Lazily load models in data generators
Fixes #701 (well, hopefully). Our BlockModelProvider is created when running other mods' data generators (thought not run), which causes issues as none of the models are considered as "existing files".
This commit is contained in:
parent
975a994581
commit
1825f67eee
|
@ -21,14 +21,12 @@
|
|||
|
||||
public class BlockModelProvider extends BlockStateProvider
|
||||
{
|
||||
private final ModelFile monitorBase;
|
||||
private final ModelFile orientable;
|
||||
private ModelFile monitorBase;
|
||||
private ModelFile orientable;
|
||||
|
||||
public BlockModelProvider( DataGenerator generator, ExistingFileHelper existingFileHelper )
|
||||
{
|
||||
super( generator, ComputerCraft.MOD_ID, existingFileHelper );
|
||||
monitorBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/monitor_base" ) );
|
||||
orientable = models().getExistingFile( new ResourceLocation( "block/orientable" ) );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
@ -41,6 +39,9 @@ public String getName()
|
|||
@Override
|
||||
protected void registerStatesAndModels()
|
||||
{
|
||||
monitorBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/monitor_base" ) );
|
||||
orientable = models().getExistingFile( new ResourceLocation( "block/orientable" ) );
|
||||
|
||||
registerMonitors( Registry.ModBlocks.MONITOR_NORMAL.get() );
|
||||
registerMonitors( Registry.ModBlocks.MONITOR_ADVANCED.get() );
|
||||
|
||||
|
|
Loading…
Reference in New Issue