Basic reformat, hit once, hope never again
This commit is contained in:
@@ -48,18 +48,24 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
this.setTileEntity( TileCraftingMonitorTile.class );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderBlockCraftingCPUMonitor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon( int direction, int metadata )
|
||||
{
|
||||
if ( direction != ForgeDirection.SOUTH.ordinal() )
|
||||
if( direction != ForgeDirection.SOUTH.ordinal() )
|
||||
{
|
||||
for ( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
||||
for( Block craftingUnitBlock : AEApi.instance().definitions().blocks().craftingUnit().maybeBlock().asSet() )
|
||||
{
|
||||
return craftingUnitBlock.getIcon( direction, metadata );
|
||||
}
|
||||
}
|
||||
|
||||
switch ( metadata )
|
||||
switch( metadata )
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
@@ -69,12 +75,6 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderBlockCraftingCPUMonitor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -31,6 +32,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
|
||||
|
||||
public class BlockCraftingStorage extends BlockCraftingUnit
|
||||
{
|
||||
public BlockCraftingStorage()
|
||||
@@ -47,54 +49,54 @@ public class BlockCraftingStorage extends BlockCraftingUnit
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
public IIcon getIcon( int direction, int metadata )
|
||||
{
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage4k";
|
||||
|
||||
if ( is.getItemDamage() == 2 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage16k";
|
||||
|
||||
if ( is.getItemDamage() == 3 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage64k";
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
switch (metadata & (~4))
|
||||
switch( metadata & ( ~4 ) )
|
||||
{
|
||||
default:
|
||||
default:
|
||||
|
||||
case 0:
|
||||
return super.getIcon( 0, 0 );
|
||||
case 1:
|
||||
return ExtraBlockTextures.BlockCraftingStorage4k.getIcon();
|
||||
case 2:
|
||||
return ExtraBlockTextures.BlockCraftingStorage16k.getIcon();
|
||||
case 3:
|
||||
return ExtraBlockTextures.BlockCraftingStorage64k.getIcon();
|
||||
case 0:
|
||||
return super.getIcon( 0, 0 );
|
||||
case 1:
|
||||
return ExtraBlockTextures.BlockCraftingStorage4k.getIcon();
|
||||
case 2:
|
||||
return ExtraBlockTextures.BlockCraftingStorage16k.getIcon();
|
||||
case 3:
|
||||
return ExtraBlockTextures.BlockCraftingStorage64k.getIcon();
|
||||
|
||||
case FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage1kFit.getIcon();
|
||||
case 1 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage4kFit.getIcon();
|
||||
case 2 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage16kFit.getIcon();
|
||||
case 3 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage64kFit.getIcon();
|
||||
case FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage1kFit.getIcon();
|
||||
case 1 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage4kFit.getIcon();
|
||||
case 2 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage16kFit.getIcon();
|
||||
case 3 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingStorage64kFit.getIcon();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getCheckedSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemStacks)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
itemStacks.add( new ItemStack( this, 1, 1 ) );
|
||||
itemStacks.add( new ItemStack( this, 1, 2 ) );
|
||||
itemStacks.add( new ItemStack( this, 1, 3 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage4k";
|
||||
|
||||
if( is.getItemDamage() == 2 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage16k";
|
||||
|
||||
if( is.getItemDamage() == 3 )
|
||||
return "tile.appliedenergistics2.BlockCraftingStorage64k";
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,18 +44,11 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockCraftingUnit extends AEBaseBlock
|
||||
{
|
||||
public static final int FLAG_FORMED = 8;
|
||||
|
||||
public BlockCraftingUnit(Class<? extends BlockCraftingUnit> childClass)
|
||||
{
|
||||
super( childClass, Material.iron );
|
||||
|
||||
this.hasSubtypes = true;
|
||||
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
|
||||
}
|
||||
|
||||
public BlockCraftingUnit()
|
||||
{
|
||||
this( BlockCraftingUnit.class );
|
||||
@@ -62,13 +56,44 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
this.setTileEntity( TileCraftingTile.class );
|
||||
}
|
||||
|
||||
public BlockCraftingUnit( Class<? extends BlockCraftingUnit> childClass )
|
||||
{
|
||||
super( childClass, Material.iron );
|
||||
|
||||
this.hasSubtypes = true;
|
||||
this.setFeature( EnumSet.of( AEFeature.CraftingCPU ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderBlockCraftingCPU.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon( int direction, int metadata )
|
||||
{
|
||||
switch( metadata )
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
return super.getIcon( 0, 0 );
|
||||
case 1:
|
||||
return ExtraBlockTextures.BlockCraftingAccelerator.getIcon();
|
||||
case FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingUnitFit.getIcon();
|
||||
case 1 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingAcceleratorFit.getIcon();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
TileCraftingTile tg = this.getTileEntity( w, x, y, z );
|
||||
if ( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
|
||||
{
|
||||
if ( Platform.isClient() )
|
||||
if( Platform.isClient() )
|
||||
return true;
|
||||
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_CRAFTING_CPU );
|
||||
@@ -79,34 +104,15 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World w, int x, int y, int z)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void getCheckedSubBlocks( Item item, CreativeTabs tabs, List<ItemStack> itemStacks )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
return this.damageDropped( meta );
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
itemStacks.add( new ItemStack( this, 1, 1 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta)
|
||||
{
|
||||
return meta & 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack is)
|
||||
{
|
||||
if ( is.getItemDamage() == 1 )
|
||||
return "tile.appliedenergistics2.BlockCraftingAccelerator";
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
|
||||
protected String getItemUnlocalizedName(ItemStack is)
|
||||
{
|
||||
return super.getUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderStateByMeta(int itemDamage)
|
||||
public void setRenderStateByMeta( int itemDamage )
|
||||
{
|
||||
IIcon front = this.getIcon( ForgeDirection.SOUTH.ordinal(), itemDamage );
|
||||
IIcon other = this.getIcon( ForgeDirection.NORTH.ordinal(), itemDamage );
|
||||
@@ -114,51 +120,47 @@ public class BlockCraftingUnit extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int direction, int metadata)
|
||||
{
|
||||
switch (metadata)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
return super.getIcon( 0, 0 );
|
||||
case 1:
|
||||
return ExtraBlockTextures.BlockCraftingAccelerator.getIcon();
|
||||
case FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingUnitFit.getIcon();
|
||||
case 1 | FLAG_FORMED:
|
||||
return ExtraBlockTextures.BlockCraftingAcceleratorFit.getIcon();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderBlockCraftingCPU.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World w, int x, int y, int z, Block a, int b)
|
||||
public void breakBlock( World w, int x, int y, int z, Block a, int b )
|
||||
{
|
||||
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||
if ( cp != null )
|
||||
if( cp != null )
|
||||
cp.breakCluster();
|
||||
|
||||
super.breakBlock( w, x, y, z, a, b );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World w, int x, int y, int z, Block junk)
|
||||
public String getUnlocalizedName( ItemStack is )
|
||||
{
|
||||
if( is.getItemDamage() == 1 )
|
||||
return "tile.appliedenergistics2.BlockCraftingAccelerator";
|
||||
|
||||
return this.getItemUnlocalizedName( is );
|
||||
}
|
||||
|
||||
protected String getItemUnlocalizedName( ItemStack is )
|
||||
{
|
||||
return super.getUnlocalizedName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange( World w, int x, int y, int z, Block junk )
|
||||
{
|
||||
TileCraftingTile cp = this.getTileEntity( w, x, y, z );
|
||||
if ( cp != null )
|
||||
if( cp != null )
|
||||
cp.updateMultiBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getCheckedSubBlocks(Item item, CreativeTabs tabs, List<ItemStack> itemStacks)
|
||||
public int damageDropped( int meta )
|
||||
{
|
||||
itemStacks.add( new ItemStack( this, 1, 0 ) );
|
||||
itemStacks.add( new ItemStack( this, 1, 1 ) );
|
||||
return meta & 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue( World w, int x, int y, int z )
|
||||
{
|
||||
int meta = w.getBlockMetadata( x, y, z );
|
||||
return this.damageDropped( meta );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -36,10 +37,14 @@ import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.crafting.TileMolecularAssembler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class BlockMolecularAssembler extends AEBaseBlock
|
||||
{
|
||||
|
||||
public BlockMolecularAssembler() {
|
||||
public static boolean booleanAlphaPass = false;
|
||||
|
||||
public BlockMolecularAssembler()
|
||||
{
|
||||
super( BlockMolecularAssembler.class, Material.iron );
|
||||
this.setFeature( EnumSet.of( AEFeature.MolecularAssembler ) );
|
||||
this.setTileEntity( TileMolecularAssembler.class );
|
||||
@@ -47,15 +52,6 @@ public class BlockMolecularAssembler extends AEBaseBlock
|
||||
this.lightOpacity = 1;
|
||||
}
|
||||
|
||||
public static boolean booleanAlphaPass = false;
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int pass)
|
||||
{
|
||||
booleanAlphaPass = pass == 1;
|
||||
return pass == 0 || pass == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass()
|
||||
{
|
||||
@@ -63,17 +59,24 @@ public class BlockMolecularAssembler extends AEBaseBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean canRenderInPass( int pass )
|
||||
{
|
||||
booleanAlphaPass = pass == 1;
|
||||
return pass == 0 || pass == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public Class<? extends BaseBlockRender> getRenderer()
|
||||
{
|
||||
return RenderBlockAssembler.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ)
|
||||
public boolean onActivated( World w, int x, int y, int z, EntityPlayer p, int side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
TileMolecularAssembler tg = this.getTileEntity( w, x, y, z );
|
||||
if ( tg != null && !p.isSneaking() )
|
||||
if( tg != null && !p.isSneaking() )
|
||||
{
|
||||
Platform.openGUI( p, tg, ForgeDirection.getOrientation( side ), GuiBridge.GUI_MAC );
|
||||
return true;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.block.crafting;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -26,27 +27,29 @@ import appeng.block.AEBaseItemBlock;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class ItemCraftingStorage extends AEBaseItemBlock
|
||||
{
|
||||
|
||||
public ItemCraftingStorage(Block id) {
|
||||
public ItemCraftingStorage( Block id )
|
||||
{
|
||||
super( id );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem(ItemStack stack)
|
||||
public ItemStack getContainerItem( ItemStack itemStack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack)
|
||||
{
|
||||
for ( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
|
||||
for( ItemStack stack : AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem( ItemStack stack )
|
||||
{
|
||||
return AEConfig.instance.isFeatureEnabled( AEFeature.enableDisassemblyCrafting );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user