Always use qualified access for fields and methods
This commit is contained in:
@@ -97,36 +97,36 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
blockRendering = new BlockRendering();
|
||||
itemRendering = new ItemRendering();
|
||||
this.blockRendering = new BlockRendering();
|
||||
this.itemRendering = new ItemRendering();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
preInitCallbacks.add( callback );
|
||||
this.preInitCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
initCallbacks.add( callback );
|
||||
this.initCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder modelRegInit( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
modelRegCallbacks.add( callback );
|
||||
this.modelRegCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
|
||||
{
|
||||
postInitCallbacks.add( callback );
|
||||
this.postInitCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
public IBlockBuilder features( AEFeature... features )
|
||||
{
|
||||
this.features.clear();
|
||||
addFeatures( features );
|
||||
this.addFeatures( features );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
customizeForClient( callback );
|
||||
this.customizeForClient( callback );
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -166,13 +166,13 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
@Override
|
||||
public IBlockBuilder useCustomItemModel()
|
||||
{
|
||||
rendering( new BlockRenderingCustomizer()
|
||||
this.rendering( new BlockRenderingCustomizer()
|
||||
{
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "inventory" );
|
||||
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, BlockDefinitionBuilder.this.registryName ), "inventory" );
|
||||
itemRendering.model( model ).variants( model );
|
||||
}
|
||||
} );
|
||||
@@ -197,31 +197,31 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
@SideOnly( Side.CLIENT )
|
||||
private void customizeForClient( BlockRenderingCustomizer callback )
|
||||
{
|
||||
callback.customize( blockRendering, itemRendering );
|
||||
callback.customize( this.blockRendering, this.itemRendering );
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@Override
|
||||
public <T extends IBlockDefinition> T build()
|
||||
{
|
||||
if( !AEConfig.instance().areFeaturesEnabled( features ) )
|
||||
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
|
||||
{
|
||||
return (T) new TileDefinition( registryName, null, null );
|
||||
return (T) new TileDefinition( this.registryName, null, null );
|
||||
}
|
||||
|
||||
// Create block and matching item, and set factory name of both
|
||||
Block block = blockSupplier.get();
|
||||
block.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + registryName );
|
||||
Block block = this.blockSupplier.get();
|
||||
block.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );
|
||||
|
||||
ItemBlock item = constructItemFromBlock( block );
|
||||
ItemBlock item = this.constructItemFromBlock( block );
|
||||
if( item != null )
|
||||
{
|
||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
item.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||
}
|
||||
|
||||
// Register the item and block with the game
|
||||
factory.addPreInit( side ->
|
||||
this.factory.addPreInit( side ->
|
||||
{
|
||||
Registration.addBlockToRegister( block );
|
||||
if( item != null )
|
||||
@@ -230,20 +230,20 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
}
|
||||
} );
|
||||
|
||||
block.setCreativeTab( creativeTab );
|
||||
block.setCreativeTab( this.creativeTab );
|
||||
|
||||
// Register all extra handlers
|
||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
||||
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( block, item ) ) );
|
||||
modelRegCallbacks.forEach( consumer -> factory.addModelReg( side -> consumer.accept( block, item ) ) );
|
||||
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( block, item ) ) );
|
||||
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( block, item ) ) );
|
||||
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( block, item ) ) );
|
||||
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( side -> consumer.accept( block, item ) ) );
|
||||
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( block, item ) ) );
|
||||
|
||||
if( tileEntityDefinition != null && block instanceof AEBaseTileBlock )
|
||||
if( this.tileEntityDefinition != null && block instanceof AEBaseTileBlock )
|
||||
{
|
||||
( (AEBaseTileBlock) block ).setTileEntity( tileEntityDefinition.getTileEntityClass() );
|
||||
if( tileEntityDefinition.getName() == null )
|
||||
( (AEBaseTileBlock) block ).setTileEntity( this.tileEntityDefinition.getTileEntityClass() );
|
||||
if( this.tileEntityDefinition.getName() == null )
|
||||
{
|
||||
tileEntityDefinition.setName( registryName );
|
||||
this.tileEntityDefinition.setName( this.registryName );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -253,52 +253,52 @@ class BlockDefinitionBuilder implements IBlockBuilder
|
||||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
|
||||
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
|
||||
this.blockRendering.apply( this.factory, block, tileBlock.getTileEntityClass() );
|
||||
}
|
||||
else
|
||||
{
|
||||
blockRendering.apply( factory, block, null );
|
||||
this.blockRendering.apply( this.factory, block, null );
|
||||
}
|
||||
|
||||
if( item != null )
|
||||
{
|
||||
itemRendering.apply( factory, item );
|
||||
this.itemRendering.apply( this.factory, item );
|
||||
}
|
||||
}
|
||||
|
||||
if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
factory.addPreInit( side ->
|
||||
this.factory.addPreInit( side ->
|
||||
{
|
||||
AEBaseTile.registerTileItem(
|
||||
tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : tileEntityDefinition.getTileEntityClass(),
|
||||
this.tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : this.tileEntityDefinition.getTileEntityClass(),
|
||||
new BlockStackSrc( block, 0, ActivityState.Enabled ) );
|
||||
} );
|
||||
|
||||
if( tileEntityDefinition != null )
|
||||
if( this.tileEntityDefinition != null )
|
||||
{
|
||||
factory.tileEntityComponent.addTileEntity( tileEntityDefinition );
|
||||
this.factory.tileEntityComponent.addTileEntity( this.tileEntityDefinition );
|
||||
}
|
||||
|
||||
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
|
||||
return (T) new TileDefinition( this.registryName, (AEBaseTileBlock) block, item );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (T) new BlockDefinition( registryName, block, item );
|
||||
return (T) new BlockDefinition( this.registryName, block, item );
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ItemBlock constructItemFromBlock( Block block )
|
||||
{
|
||||
if( disableItem )
|
||||
if( this.disableItem )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if( itemFactory != null )
|
||||
if( this.itemFactory != null )
|
||||
{
|
||||
return itemFactory.apply( block );
|
||||
return this.itemFactory.apply( block );
|
||||
}
|
||||
else if( block instanceof AEBaseBlock )
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ class BlockRendering implements IBlockRendering
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
|
||||
{
|
||||
modelCustomizer = customizer;
|
||||
this.modelCustomizer = customizer;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -99,18 +99,18 @@ class BlockRendering implements IBlockRendering
|
||||
|
||||
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
|
||||
{
|
||||
if( tesr != null )
|
||||
if( this.tesr != null )
|
||||
{
|
||||
if( tileEntityClass == null )
|
||||
{
|
||||
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
|
||||
}
|
||||
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, tesr ) );
|
||||
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, this.tesr ) );
|
||||
}
|
||||
|
||||
if( modelCustomizer != null )
|
||||
if( this.modelCustomizer != null )
|
||||
{
|
||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), modelCustomizer );
|
||||
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), this.modelCustomizer );
|
||||
}
|
||||
else if( block instanceof AEBaseTileBlock )
|
||||
{
|
||||
@@ -120,16 +120,16 @@ class BlockRendering implements IBlockRendering
|
||||
}
|
||||
|
||||
// TODO : 1.12
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( blockColor != null )
|
||||
if( this.blockColor != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new BlockColorComponent( block, blockColor ) );
|
||||
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
|
||||
}
|
||||
|
||||
if( stateMapper != null )
|
||||
if( this.stateMapper != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new StateMapperComponent( block, stateMapper ) );
|
||||
factory.addBootstrapComponent( new StateMapperComponent( block, this.stateMapper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,15 +67,15 @@ public class FeatureFactory
|
||||
this.bootstrapComponents = new ArrayList<>();
|
||||
|
||||
this.tileEntityComponent = new TileEntityComponent();
|
||||
this.bootstrapComponents.add( tileEntityComponent );
|
||||
this.bootstrapComponents.add( this.tileEntityComponent );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
modelOverrideComponent = new ModelOverrideComponent();
|
||||
bootstrapComponents.add( modelOverrideComponent );
|
||||
this.modelOverrideComponent = new ModelOverrideComponent();
|
||||
this.bootstrapComponents.add( this.modelOverrideComponent );
|
||||
|
||||
builtInModelComponent = new BuiltInModelComponent();
|
||||
bootstrapComponents.add( builtInModelComponent );
|
||||
this.builtInModelComponent = new BuiltInModelComponent();
|
||||
this.bootstrapComponents.add( this.builtInModelComponent );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ public class FeatureFactory
|
||||
|
||||
public IBlockBuilder block( String id, Supplier<Block> block )
|
||||
{
|
||||
return new BlockDefinitionBuilder( this, id, block ).features( defaultFeatures );
|
||||
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
|
||||
}
|
||||
|
||||
public IItemBuilder item( String id, Supplier<Item> item )
|
||||
{
|
||||
return new ItemDefinitionBuilder( this, id, item ).features( defaultFeatures );
|
||||
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures );
|
||||
}
|
||||
|
||||
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
|
||||
@@ -151,11 +151,11 @@ public class FeatureFactory
|
||||
@SideOnly( Side.CLIENT )
|
||||
void addBuiltInModel( String path, IModel model )
|
||||
{
|
||||
builtInModelComponent.addModel( path, model );
|
||||
this.builtInModelComponent.addModel( path, model );
|
||||
}
|
||||
|
||||
public List<IBootstrapComponent> getBootstrapComponents()
|
||||
{
|
||||
return bootstrapComponents;
|
||||
return this.bootstrapComponents;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,28 +75,28 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
this.itemSupplier = itemSupplier;
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
itemRendering = new ItemRendering();
|
||||
this.itemRendering = new ItemRendering();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDefinitionBuilder preInit( Consumer<Item> callback )
|
||||
{
|
||||
preInitCallbacks.add( callback );
|
||||
this.preInitCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDefinitionBuilder init( Consumer<Item> callback )
|
||||
{
|
||||
initCallbacks.add( callback );
|
||||
this.initCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDefinitionBuilder postInit( Consumer<Item> callback )
|
||||
{
|
||||
postInitCallbacks.add( callback );
|
||||
this.postInitCallbacks.add( callback );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
public IItemBuilder features( AEFeature... features )
|
||||
{
|
||||
this.features.clear();
|
||||
addFeatures( features );
|
||||
this.addFeatures( features );
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
customizeForClient( callback );
|
||||
this.customizeForClient( callback );
|
||||
}
|
||||
|
||||
return this;
|
||||
@@ -143,46 +143,46 @@ class ItemDefinitionBuilder implements IItemBuilder
|
||||
@SideOnly( Side.CLIENT )
|
||||
private void customizeForClient( ItemRenderingCustomizer callback )
|
||||
{
|
||||
callback.customize( itemRendering );
|
||||
callback.customize( this.itemRendering );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemDefinition build()
|
||||
{
|
||||
if( !AEConfig.instance().areFeaturesEnabled( features ) )
|
||||
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
|
||||
{
|
||||
return new ItemDefinition( registryName, null );
|
||||
return new ItemDefinition( this.registryName, null );
|
||||
}
|
||||
|
||||
Item item = itemSupplier.get();
|
||||
item.setRegistryName( AppEng.MOD_ID, registryName );
|
||||
Item item = this.itemSupplier.get();
|
||||
item.setRegistryName( AppEng.MOD_ID, this.registryName );
|
||||
|
||||
ItemDefinition definition = new ItemDefinition( registryName, item );
|
||||
ItemDefinition definition = new ItemDefinition( this.registryName, item );
|
||||
|
||||
item.setUnlocalizedName( "appliedenergistics2." + registryName );
|
||||
item.setCreativeTab( creativeTab );
|
||||
item.setUnlocalizedName( "appliedenergistics2." + this.registryName );
|
||||
item.setCreativeTab( this.creativeTab );
|
||||
|
||||
// Register all extra handlers
|
||||
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( item ) ) );
|
||||
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( item ) ) );
|
||||
modelRegCallbacks.forEach( consumer -> factory.addModelReg( side -> consumer.accept( item ) ) );
|
||||
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( item ) ) );
|
||||
this.preInitCallbacks.forEach( consumer -> this.factory.addPreInit( side -> consumer.accept( item ) ) );
|
||||
this.initCallbacks.forEach( consumer -> this.factory.addInit( side -> consumer.accept( item ) ) );
|
||||
this.modelRegCallbacks.forEach( consumer -> this.factory.addModelReg( side -> consumer.accept( item ) ) );
|
||||
this.postInitCallbacks.forEach( consumer -> this.factory.addPostInit( side -> consumer.accept( item ) ) );
|
||||
|
||||
// Register custom dispenser behavior if requested
|
||||
if( dispenserBehaviorSupplier != null )
|
||||
if( this.dispenserBehaviorSupplier != null )
|
||||
{
|
||||
factory.addPostInit( side ->
|
||||
this.factory.addPostInit( side ->
|
||||
{
|
||||
IBehaviorDispenseItem behavior = dispenserBehaviorSupplier.get();
|
||||
IBehaviorDispenseItem behavior = this.dispenserBehaviorSupplier.get();
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject( item, behavior );
|
||||
} );
|
||||
}
|
||||
|
||||
factory.addPreInit( side -> Registration.addItemToRegister( item ) );
|
||||
this.factory.addPreInit( side -> Registration.addItemToRegister( item ) );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
itemRendering.apply( factory, item );
|
||||
this.itemRendering.apply( this.factory, item );
|
||||
}
|
||||
|
||||
return definition;
|
||||
|
||||
@@ -107,7 +107,7 @@ class ItemRendering implements IItemRendering
|
||||
{
|
||||
if( this.itemMeshDefinition != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, itemMeshDefinition ) );
|
||||
factory.addBootstrapComponent( new ItemMeshDefinitionComponent( item, this.itemMeshDefinition ) );
|
||||
}
|
||||
|
||||
if( !this.itemModels.isEmpty() )
|
||||
@@ -115,7 +115,7 @@ class ItemRendering implements IItemRendering
|
||||
factory.addBootstrapComponent( new ItemModelComponent( item, this.itemModels ) );
|
||||
}
|
||||
|
||||
Set<ResourceLocation> resources = new HashSet<>( variants );
|
||||
Set<ResourceLocation> resources = new HashSet<>( this.variants );
|
||||
|
||||
// Register a default item model if neither items by meta nor an item mesh definition exist
|
||||
if( this.itemMeshDefinition == null && this.itemModels.isEmpty() )
|
||||
@@ -141,13 +141,13 @@ class ItemRendering implements IItemRendering
|
||||
}
|
||||
|
||||
// TODO : 1.12
|
||||
builtInModels.forEach( factory::addBuiltInModel );
|
||||
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
if( !resources.isEmpty() )
|
||||
{
|
||||
factory.addBootstrapComponent( new ItemVariantsComponent( item, resources ) );
|
||||
}
|
||||
else if( !this.itemModels.isEmpty() || itemMeshDefinition != null )
|
||||
else if( !this.itemModels.isEmpty() || this.itemMeshDefinition != null )
|
||||
{
|
||||
// Adding an empty variant list here will prevent Vanilla from trying to load the default item model in this
|
||||
// case
|
||||
@@ -159,9 +159,9 @@ class ItemRendering implements IItemRendering
|
||||
factory.addBootstrapComponent( new ItemVariantsComponent( item, Collections.emptyList() ) );
|
||||
}
|
||||
|
||||
if( itemColor != null )
|
||||
if( this.itemColor != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new ItemColorComponent( item, itemColor ) );
|
||||
factory.addBootstrapComponent( new ItemColorComponent( item, this.itemColor ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ class ItemRendering implements IItemRendering
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation( IBlockState state )
|
||||
{
|
||||
return new ModelResourceLocation( registryName, getPropertyString( state.getProperties() ) );
|
||||
return new ModelResourceLocation( this.registryName, this.getPropertyString( state.getProperties() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class BlockColorComponent implements InitComponent
|
||||
@Override
|
||||
public void initialize( Side side )
|
||||
{
|
||||
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( blockColor, block );
|
||||
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler( this.blockColor, this.block );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,16 +42,16 @@ public class BuiltInModelComponent implements PreInitComponent
|
||||
|
||||
public void addModel( String path, IModel model )
|
||||
{
|
||||
Preconditions.checkState( !hasInitialized );
|
||||
builtInModels.put( path, model );
|
||||
Preconditions.checkState( !this.hasInitialized );
|
||||
this.builtInModels.put( path, model );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInitialize( Side side )
|
||||
{
|
||||
hasInitialized = true;
|
||||
this.hasInitialized = true;
|
||||
|
||||
BuiltInModelLoader loader = new BuiltInModelLoader( builtInModels );
|
||||
BuiltInModelLoader loader = new BuiltInModelLoader( this.builtInModels );
|
||||
ModelLoaderRegistry.registerLoader( loader );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ public class ItemColorComponent implements InitComponent
|
||||
@Override
|
||||
public void initialize( Side side )
|
||||
{
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( itemColor, item );
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler( this.itemColor, this.item );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,6 @@ public class ItemMeshDefinitionComponent implements InitComponent
|
||||
@Override
|
||||
public void initialize( Side side )
|
||||
{
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( item, meshDefinition );
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this.item, this.meshDefinition );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ public class ItemModelComponent implements InitComponent
|
||||
{
|
||||
ItemModelMesher itemMesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
|
||||
modelsByMeta.forEach( ( meta, model ) ->
|
||||
this.modelsByMeta.forEach( ( meta, model ) ->
|
||||
{
|
||||
itemMesher.register( item, meta, model );
|
||||
itemMesher.register( this.item, meta, model );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ItemVariantsComponent implements IBootstrapComponent
|
||||
@Override
|
||||
public void preInitialize( Side side )
|
||||
{
|
||||
ResourceLocation[] resourceArr = resources.toArray( new ResourceLocation[0] );
|
||||
ModelBakery.registerItemVariants( item, resourceArr );
|
||||
ResourceLocation[] resourceArr = this.resources.toArray( new ResourceLocation[0] );
|
||||
ModelBakery.registerItemVariants( this.item, resourceArr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ public class StateMapperComponent implements ModelRegComponent
|
||||
@Override
|
||||
public void modelReg( Side side )
|
||||
{
|
||||
ModelLoader.setCustomStateMapper( block, stateMapper );
|
||||
if( stateMapper instanceof IResourceManagerReloadListener )
|
||||
ModelLoader.setCustomStateMapper( this.block, this.stateMapper );
|
||||
if( this.stateMapper instanceof IResourceManagerReloadListener )
|
||||
{
|
||||
( (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager() )
|
||||
.registerReloadListener( (IResourceManagerReloadListener) stateMapper );
|
||||
.registerReloadListener( (IResourceManagerReloadListener) this.stateMapper );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,6 @@ public class TesrComponent<T extends AEBaseTile> implements PreInitComponent
|
||||
// public void modelReg( Side side )
|
||||
public void preInitialize( Side side )
|
||||
{
|
||||
ClientRegistry.bindTileEntitySpecialRenderer( tileEntityClass, tesr );
|
||||
ClientRegistry.bindTileEntitySpecialRenderer( this.tileEntityClass, this.tesr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,16 +25,16 @@ public class TileEntityComponent implements PreInitComponent
|
||||
|
||||
public void addTileEntity( TileEntityDefinition tileEntityDefinition )
|
||||
{
|
||||
if( !tileEntityDefinitions.contains( tileEntityDefinition ) )
|
||||
if( !this.tileEntityDefinitions.contains( tileEntityDefinition ) )
|
||||
{
|
||||
tileEntityDefinitions.add( tileEntityDefinition );
|
||||
this.tileEntityDefinitions.add( tileEntityDefinition );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInitialize( Side side )
|
||||
{
|
||||
for( TileEntityDefinition tileEntityDefinition : tileEntityDefinitions )
|
||||
for( TileEntityDefinition tileEntityDefinition : this.tileEntityDefinitions )
|
||||
{
|
||||
if( !tileEntityDefinition.isRegistered() )
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ public class TileEntityDefinition
|
||||
|
||||
public Class<? extends AEBaseTile> getTileEntityClass()
|
||||
{
|
||||
return tileEntityClass;
|
||||
return this.tileEntityClass;
|
||||
}
|
||||
|
||||
public void setName( String name )
|
||||
@@ -57,16 +57,16 @@ public class TileEntityDefinition
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean isRegistered()
|
||||
{
|
||||
return isRegistered;
|
||||
return this.isRegistered;
|
||||
}
|
||||
|
||||
public void setRegistered( boolean registered )
|
||||
{
|
||||
isRegistered = registered;
|
||||
this.isRegistered = registered;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user