diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 1cff6a24..07f5ceca 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -52,7 +52,7 @@ public class TConstruct /* Proxies for sides, used for graphics processing */ @SidedProxy(clientSide = "mods.tinker.tconstruct.client.TProxyClient", serverSide = "mods.tinker.tconstruct.common.TProxyCommon") public static TProxyCommon proxy; - + public TConstruct() { if (Loader.isModLoaded("Natura")) @@ -79,7 +79,7 @@ public class TConstruct tableCasting = new LiquidCasting(); basinCasting = new LiquidCasting(); chiselDetailing = new Detailing(); - + content = new TContent(); events = new TEventHandler(); @@ -106,11 +106,11 @@ public class TConstruct VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler()); VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler()); } - + /*DimensionManager.registerProviderType(-7, TinkerWorldProvider.class, true); DimensionManager.registerDimension(-7, -7);*/ } - + @Init public void init (FMLInitializationEvent event) { @@ -129,18 +129,18 @@ public class TConstruct /*SkillRegistry.registerSkill("Wall Building", new WallBuilding()); SkillRegistry.registerSkill("Jump", new Jump());*/ } - - public static LiquidCasting getTableCasting() + + public static LiquidCasting getTableCasting () { return tableCasting; } - - public static LiquidCasting getBasinCasting() + + public static LiquidCasting getBasinCasting () { return basinCasting; } - - public static Detailing getChiselDetailing() + + public static Detailing getChiselDetailing () { return chiselDetailing; } diff --git a/mods/tinker/tconstruct/blocks/Aggregator.java b/mods/tinker/tconstruct/blocks/Aggregator.java index c82f4daf..fd66138e 100644 --- a/mods/tinker/tconstruct/blocks/Aggregator.java +++ b/mods/tinker/tconstruct/blocks/Aggregator.java @@ -126,8 +126,8 @@ public class Aggregator extends InventoryBlock { return textureNames; } - - public void updateCrystalValue(World world, int x, int y, int z) + + public void updateCrystalValue (World world, int x, int y, int z) { GlowstoneAggregator logic = (GlowstoneAggregator) world.getBlockTileEntity(x, y, z); logic.updateCrystalValue(); diff --git a/mods/tinker/tconstruct/blocks/DryingRack.java b/mods/tinker/tconstruct/blocks/DryingRack.java index c503282c..34134892 100644 --- a/mods/tinker/tconstruct/blocks/DryingRack.java +++ b/mods/tinker/tconstruct/blocks/DryingRack.java @@ -68,25 +68,25 @@ public class DryingRack extends InventoryBlock return TConstruct.instance; } - public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) + public int onBlockPlaced (World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) { if (side > 1) return side; return meta; } - - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving living, ItemStack stack) + + public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving living, ItemStack stack) { int meta = world.getBlockMetadata(x, y, z); if (meta == 0) { - int l = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int l = MathHelper.floor_double((double) (living.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int direction = l % 2; if (direction == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 2); } } - + /* Activation */ @Override public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) @@ -128,9 +128,8 @@ public class DryingRack extends InventoryBlock { AbilityHelper.spawnItemAtPlayer(player, stack); } - - public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) + public AxisAlignedBB getSelectedBoundingBoxFromPool (World world, int x, int y, int z) { int metadata = world.getBlockMetadata(x, y, z); float xMin = 0F; @@ -141,17 +140,37 @@ public class DryingRack extends InventoryBlock float zMax = 1F; switch (metadata) { - case 0: zMin = 0.375F; yMax = 0.25F; zMax = 0.625F; break; - case 1: xMin = 0.375F; yMax = 0.25F; xMax = 0.625F; break; - case 2: zMin = 0.75F; yMin = 0.75F; break; - case 3: zMax = 0.25F; yMin = 0.75F; break; - case 4: xMin = 0.75F; yMin = 0.75F; break; - case 5: xMax = 0.25F; yMin = 0.75F; break; + case 0: + zMin = 0.375F; + yMax = 0.25F; + zMax = 0.625F; + break; + case 1: + xMin = 0.375F; + yMax = 0.25F; + xMax = 0.625F; + break; + case 2: + zMin = 0.75F; + yMin = 0.75F; + break; + case 3: + zMax = 0.25F; + yMin = 0.75F; + break; + case 4: + xMin = 0.75F; + yMin = 0.75F; + break; + case 5: + xMax = 0.25F; + yMin = 0.75F; + break; } - return AxisAlignedBB.getAABBPool().getAABB((double)x + xMin, (double)y + yMin, (double)z + zMin, (double)x + xMax, (double)y + yMax, (double)z + zMax); + return AxisAlignedBB.getAABBPool().getAABB((double) x + xMin, (double) y + yMin, (double) z + zMin, (double) x + xMax, (double) y + yMax, (double) z + zMax); } - - public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) + + public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z) { int metadata = world.getBlockMetadata(x, y, z); float xMin = 0F; @@ -162,17 +181,37 @@ public class DryingRack extends InventoryBlock float zMax = 1F; switch (metadata) { - case 0: zMin = 0.375F; yMax = 0.25F; zMax = 0.625F; break; - case 1: xMin = 0.375F; yMax = 0.25F; xMax = 0.625F; break; - case 2: zMin = 0.75F; yMin = 0.75F; break; - case 3: zMax = 0.25F; yMin = 0.75F; break; - case 4: xMin = 0.75F; yMin = 0.75F; break; - case 5: xMax = 0.25F; yMin = 0.75F; break; + case 0: + zMin = 0.375F; + yMax = 0.25F; + zMax = 0.625F; + break; + case 1: + xMin = 0.375F; + yMax = 0.25F; + xMax = 0.625F; + break; + case 2: + zMin = 0.75F; + yMin = 0.75F; + break; + case 3: + zMax = 0.25F; + yMin = 0.75F; + break; + case 4: + xMin = 0.75F; + yMin = 0.75F; + break; + case 5: + xMax = 0.25F; + yMin = 0.75F; + break; } this.setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax); } - - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) + + public void addCollisionBoxesToList (World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity) { this.setBlockBoundsBasedOnState(world, x, y, z); super.addCollisionBoxesToList(world, x, y, z, aabb, list, entity); diff --git a/mods/tinker/tconstruct/blocks/EquipBlock.java b/mods/tinker/tconstruct/blocks/EquipBlock.java index 8d6ea5a8..871d8c4a 100644 --- a/mods/tinker/tconstruct/blocks/EquipBlock.java +++ b/mods/tinker/tconstruct/blocks/EquipBlock.java @@ -20,88 +20,88 @@ import cpw.mods.fml.relauncher.SideOnly; public class EquipBlock extends InventoryBlock { - public EquipBlock(int id, Material material) - { - super(id, material); - this.setHardness(0.3f); - this.setBlockBounds(0, 0, 0, 1, 0.25f, 1); - //this.setCreativeTab(ToolConstruct.materialTab); - } + public EquipBlock(int id, Material material) + { + super(id, material); + this.setHardness(0.3f); + this.setBlockBounds(0, 0, 0, 1, 0.25f, 1); + //this.setCreativeTab(ToolConstruct.materialTab); + } - @Override - public String[] getTextureNames () - { - return new String[] { "toolstation_top" }; - } - - public Icon getIcon (int side, int meta) - { - return Block.blockIron.getIcon(side, meta); - } + @Override + public String[] getTextureNames () + { + return new String[] { "toolstation_top" }; + } - @SideOnly(Side.CLIENT) - public void registerIcons (IconRegister par1IconRegister) - { - //this.blockIcon = par1iconRegister.registerIcon(Block.blockIron.getUnlocalizedName()); - } + public Icon getIcon (int side, int meta) + { + return Block.blockIron.getIcon(side, meta); + } - @Override - public boolean renderAsNormalBlock () - { - return false; - } + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister par1IconRegister) + { + //this.blockIcon = par1iconRegister.registerIcon(Block.blockIron.getUnlocalizedName()); + } - @Override - public boolean isOpaqueCube () - { - return false; - } + @Override + public boolean renderAsNormalBlock () + { + return false; + } - @Override - public int getRenderType () - { - return FrypanRender.frypanModelID; - } + @Override + public boolean isOpaqueCube () + { + return false; + } - @Override - public int idDropped (int par1, Random par2Random, int par3) - { - return 0; - } + @Override + public int getRenderType () + { + return FrypanRender.frypanModelID; + } - @Override - public TileEntity createTileEntity (World world, int metadata) - { - return new FrypanLogic(); - } + @Override + public int idDropped (int par1, Random par2Random, int par3) + { + return 0; + } - public void randomDisplayTick (World world, int x, int y, int z, Random random) - { - if (isActive(world, x, y, z)) - { - float f = (float) x + 0.5F; - float f1 = (float) y + 0.25F + (random.nextFloat() * 6F) / 16F; - float f2 = (float) z + 0.5F; - float f4 = random.nextFloat() * 0.6F - 0.3F; - world.spawnParticle("smoke", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - } - } + @Override + public TileEntity createTileEntity (World world, int metadata) + { + return new FrypanLogic(); + } - public int getLightValue (IBlockAccess world, int x, int y, int z) - { - return !isActive(world, x, y, z) ? 0 : 9; - } + public void randomDisplayTick (World world, int x, int y, int z, Random random) + { + if (isActive(world, x, y, z)) + { + float f = (float) x + 0.5F; + float f1 = (float) y + 0.25F + (random.nextFloat() * 6F) / 16F; + float f2 = (float) z + 0.5F; + float f4 = random.nextFloat() * 0.6F - 0.3F; + world.spawnParticle("smoke", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + } + } - @Override - public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) - { - return TConstruct.proxy.frypanGuiID; - } + public int getLightValue (IBlockAccess world, int x, int y, int z) + { + return !isActive(world, x, y, z) ? 0 : 9; + } - @Override - public Object getModInstance () - { - return TConstruct.instance; - } + @Override + public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) + { + return TConstruct.proxy.frypanGuiID; + } + + @Override + public Object getModInstance () + { + return TConstruct.instance; + } } diff --git a/mods/tinker/tconstruct/blocks/GlassBlock.java b/mods/tinker/tconstruct/blocks/GlassBlock.java index 115895ab..24805462 100644 --- a/mods/tinker/tconstruct/blocks/GlassBlock.java +++ b/mods/tinker/tconstruct/blocks/GlassBlock.java @@ -18,43 +18,51 @@ public class GlassBlock extends TConstructBlock super(id, Material.glass, 3f, blockTextures); } - public boolean isOpaqueCube() + public boolean isOpaqueCube () { return false; } @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { int i1 = par1IBlockAccess.getBlockId(par2, par3, par4); return i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); } @Override - public float getBlockHardness(World world, int x, int y, int z) + public float getBlockHardness (World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return 0.3F; - case 1: return 50.0F; - case 2: return 50.0F; - default: return blockHardness; + case 0: + return 0.3F; + case 1: + return 50.0F; + case 2: + return 50.0F; + default: + return blockHardness; } } - public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + public float getExplosionResistance (Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return 1.5F; - case 1: return 2000F; - case 2: return 2000F; - default: return getExplosionResistance(entity); + case 0: + return 1.5F; + case 1: + return 2000F; + case 2: + return 2000F; + default: + return getExplosionResistance(entity); } } - + @Override @SideOnly(Side.CLIENT) public void registerIcons (IconRegister iconRegister) diff --git a/mods/tinker/tconstruct/blocks/GlassPane.java b/mods/tinker/tconstruct/blocks/GlassPane.java index 1fdbc15e..fdc11c74 100644 --- a/mods/tinker/tconstruct/blocks/GlassPane.java +++ b/mods/tinker/tconstruct/blocks/GlassPane.java @@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class GlassPane extends PaneBase { static String blockTextures[] = { "glass_clear", "soulglass", "soulglass_clear" }; + public GlassPane(int id) { super(id, Material.glass, "glass/", blockTextures); diff --git a/mods/tinker/tconstruct/blocks/GlassPaneStained.java b/mods/tinker/tconstruct/blocks/GlassPaneStained.java index c83810c5..d66cd18f 100644 --- a/mods/tinker/tconstruct/blocks/GlassPaneStained.java +++ b/mods/tinker/tconstruct/blocks/GlassPaneStained.java @@ -13,8 +13,8 @@ import cpw.mods.fml.relauncher.SideOnly; public class GlassPaneStained extends PaneBase { - static String blockTextures[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", - "purple", "blue", "brown", "green", "red", "black" }; + static String blockTextures[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" }; + public GlassPaneStained(int id) { super(id, Material.glass, "glass/", assembleBlockTextures()); @@ -23,13 +23,13 @@ public class GlassPaneStained extends PaneBase this.setUnlocalizedName("tconstruct.glasspanestained"); this.setCreativeTab(TConstructRegistry.blockTab); } - + private static String[] assembleBlockTextures () { String[] textures = new String[blockTextures.length]; for (int i = 0; i < blockTextures.length; i++) { - textures[i] = "stainedglass_"+blockTextures[i]; + textures[i] = "stainedglass_" + blockTextures[i]; } return textures; } diff --git a/mods/tinker/tconstruct/blocks/GolemCoreBlock.java b/mods/tinker/tconstruct/blocks/GolemCoreBlock.java index 972c08cd..4cc8e7d6 100644 --- a/mods/tinker/tconstruct/blocks/GolemCoreBlock.java +++ b/mods/tinker/tconstruct/blocks/GolemCoreBlock.java @@ -19,97 +19,97 @@ public class GolemCoreBlock extends InventoryBlock public GolemCoreBlock(int id) { super(id, Material.rock); - this.setCreativeTab(TConstructRegistry.blockTab); + this.setCreativeTab(TConstructRegistry.blockTab); } - public boolean isOpaqueCube() + public boolean isOpaqueCube () { return false; } - public boolean renderAsNormalBlock() + public boolean renderAsNormalBlock () { return false; } - public int getRenderType() + public int getRenderType () { return GolemCoreRender.model; } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - if (!world.isRemote) - { - GolemCoreLogic logic = (GolemCoreLogic)world.getBlockTileEntity(x, y, z); - - if (!logic.isStackInSlot(0)) - { - ItemStack stack = player.getCurrentEquippedItem(); - stack = player.inventory.decrStackSize(player.inventory.currentItem, 1); - logic.setInventorySlotContents(0, stack); - } - else - { - ItemStack stack = logic.decrStackSize(0, 1); - if (stack != null) - addItemToInventory(player, world, x, y, z, stack); - } + if (!world.isRemote) + { + GolemCoreLogic logic = (GolemCoreLogic) world.getBlockTileEntity(x, y, z); - world.markBlockForUpdate(x, y, z); - } + if (!logic.isStackInSlot(0)) + { + ItemStack stack = player.getCurrentEquippedItem(); + stack = player.inventory.decrStackSize(player.inventory.currentItem, 1); + logic.setInventorySlotContents(0, stack); + } + else + { + ItemStack stack = logic.decrStackSize(0, 1); + if (stack != null) + addItemToInventory(player, world, x, y, z, stack); + } + + world.markBlockForUpdate(x, y, z); + } return true; } - - protected void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack) - { - if (!world.isRemote) - { - EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack); - world.spawnEntityInWorld(entityitem); - entityitem.onCollideWithPlayer(player); - } - } - public int damageDropped(int meta) + protected void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack) + { + if (!world.isRemote) + { + EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack); + world.spawnEntityInWorld(entityitem); + entityitem.onCollideWithPlayer(player); + } + } + + public int damageDropped (int meta) { return meta; } @Override - public Icon getIcon(int side, int meta) + public Icon getIcon (int side, int meta) { - return icons[0]; + return icons[0]; } - + @Override - public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - return true; - } + public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return true; + } - @Override - public TileEntity createTileEntity (World world, int metadata) - { - return new GolemCoreLogic(); - } + @Override + public TileEntity createTileEntity (World world, int metadata) + { + return new GolemCoreLogic(); + } - @Override - public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) - { - return null; //Not sure if gui block or not, probably not - } + @Override + public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) + { + return null; //Not sure if gui block or not, probably not + } - @Override - public Object getModInstance () - { - return TConstruct.instance; - } + @Override + public Object getModInstance () + { + return TConstruct.instance; + } - @Override - public String[] getTextureNames () - { - return new String[] { "golemcore" }; - } + @Override + public String[] getTextureNames () + { + return new String[] { "golemcore" }; + } } diff --git a/mods/tinker/tconstruct/blocks/GolemHeadBlock.java b/mods/tinker/tconstruct/blocks/GolemHeadBlock.java index f017b218..1d17fada 100644 --- a/mods/tinker/tconstruct/blocks/GolemHeadBlock.java +++ b/mods/tinker/tconstruct/blocks/GolemHeadBlock.java @@ -14,1001 +14,1001 @@ import net.minecraft.world.World; public class GolemHeadBlock extends Block { - /*public static int headSideTex = ModLoader.addOverride("/terrain.png", "/GGE/golemheadside.png"); - public static int headTopTex = ModLoader.addOverride("/terrain.png", "/GGE/golemheadtop&bottom.png"); - public static int face;*/ + /*public static int headSideTex = ModLoader.addOverride("/terrain.png", "/GGE/golemheadside.png"); + public static int headTopTex = ModLoader.addOverride("/terrain.png", "/GGE/golemheadtop&bottom.png"); + public static int face;*/ - public GolemHeadBlock(int id) - { - super(id, Material.ground); - //setTickRandomly(true); - } - - public Icon[] icons; - public String[] textureNames = new String[] { "golemhead_face", "golemhead_side", "golemhead_top"}; - - @Override - public void registerIcons(IconRegister iconRegister) + public GolemHeadBlock(int id) { - this.icons = new Icon[textureNames.length]; + super(id, Material.ground); + //setTickRandomly(true); + } + + public Icon[] icons; + public String[] textureNames = new String[] { "golemhead_face", "golemhead_side", "golemhead_top" }; + + @Override + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); } } - @Override - public void onNeighborBlockChange (World world, int x, int y, int z, int blockID) - { - if (buildGolem(world, x, y, z, world.getBlockMetadata(x, y, z))) - { - //mod_Golems.trigger("headachievement"); - } - } + @Override + public void onNeighborBlockChange (World world, int x, int y, int z, int blockID) + { + if (buildGolem(world, x, y, z, world.getBlockMetadata(x, y, z))) + { + //mod_Golems.trigger("headachievement"); + } + } - /*public int getIcon(int i, int j) - { - if (i == 1) - { - return headTopTex; - } - if (i == 0) - { - return headTopTex; - } - int k = face; - if (j == 2 && i == 2) - { - return k; - } - if (j == 3 && i == 5) - { - return k; - } - if (j == 0 && i == 3) - { - return k; - } - if (j == 1 && i == 4) - { - return k; - } - else - { - return headSideTex; - } - }*/ + /*public int getIcon(int i, int j) + { + if (i == 1) + { + return headTopTex; + } + if (i == 0) + { + return headTopTex; + } + int k = face; + if (j == 2 && i == 2) + { + return k; + } + if (j == 3 && i == 5) + { + return k; + } + if (j == 0 && i == 3) + { + return k; + } + if (j == 1 && i == 4) + { + return k; + } + else + { + return headSideTex; + } + }*/ - /*public int getBlockTextureFromSide(int i) - { - int j = face; - if (i == 1) - { - return blockIndexInTexture; - } - if (i == 0) - { - return blockIndexInTexture; - } - if (i == 3) - { - return j; - } - else - { - return blockIndexInTexture + 16; - } - }*/ + /*public int getBlockTextureFromSide(int i) + { + int j = face; + if (i == 1) + { + return blockIndexInTexture; + } + if (i == 0) + { + return blockIndexInTexture; + } + if (i == 3) + { + return j; + } + else + { + return blockIndexInTexture + 16; + } + }*/ - @Override - public void onBlockPlacedBy (World world, int i, int j, int k, EntityLiving entityliving, ItemStack par6ItemStack) - { - int l = MathHelper.floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 2.5D) & 3; - world.setBlockMetadataWithNotify(i, j, k, l, 3); - if (!buildGolem(world, i, j, k, l)) - { - for (int i1 = 0; (double) i1 < Math.random() * 5D + 3D; i1++) - { - world.spawnParticle("largesmoke", (double) i + Math.random(), (double) j + 1.2D + Math.random() / 2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - } - } - /*else - { - mod_Golems.trigger("headachievement"); - }*/ - } + @Override + public void onBlockPlacedBy (World world, int i, int j, int k, EntityLiving entityliving, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double((double) ((entityliving.rotationYaw * 4F) / 360F) + 2.5D) & 3; + world.setBlockMetadataWithNotify(i, j, k, l, 3); + if (!buildGolem(world, i, j, k, l)) + { + for (int i1 = 0; (double) i1 < Math.random() * 5D + 3D; i1++) + { + world.spawnParticle("largesmoke", (double) i + Math.random(), (double) j + 1.2D + Math.random() / 2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + } + } + /*else + { + mod_Golems.trigger("headachievement"); + }*/ + } - private boolean idIsInvalid (int i) - { - return Block.blocksList[i] != null && (!Block.blocksList[i].renderAsNormalBlock() && i != TContent.golemCore.blockID || i == 43 || i == 44 || i == Block.chest.blockID); - } + private boolean idIsInvalid (int i) + { + return Block.blocksList[i] != null && (!Block.blocksList[i].renderAsNormalBlock() && i != TContent.golemCore.blockID || i == 43 || i == 44 || i == Block.chest.blockID); + } - private boolean buildGolem (World world, int x, int y, int z, int metadata) - { - /*int pedestalHeight = 0; - for (int yPos = 1; yPos <= 3; yPos++) - { - if (world.getBlockId(x, y - yPos, z) == TContent.golemPedestal.blockID) - { - pedestalHeight = yPos; - } - } + private boolean buildGolem (World world, int x, int y, int z, int metadata) + { + /*int pedestalHeight = 0; + for (int yPos = 1; yPos <= 3; yPos++) + { + if (world.getBlockId(x, y - yPos, z) == TContent.golemPedestal.blockID) + { + pedestalHeight = yPos; + } + } - if (pedestalHeight == 0) - { - return false; - } - for (int height = pedestalHeight; height >= 0; height--) - { - if (world.getBlockId(x, y - height, z) == 0) - { - return false; - } - } + if (pedestalHeight == 0) + { + return false; + } + for (int height = pedestalHeight; height >= 0; height--) + { + if (world.getBlockId(x, y - height, z) == 0) + { + return false; + } + } - int l1 = 0; - int i2 = 0; - ItemStack itemstack = null; - GolemCoreLogic coreLogic = null; - int golemBlockIDs[][] = new int[3][3]; - int golemBlockMetas[][] = new int[3][3]; - for (int arrX = 0; arrX < 3; arrX++) - { - for (int arrY = 0; arrY < 3; arrY++) - { - golemBlockIDs[arrX][arrY] = 0; - } - } + int l1 = 0; + int i2 = 0; + ItemStack itemstack = null; + GolemCoreLogic coreLogic = null; + int golemBlockIDs[][] = new int[3][3]; + int golemBlockMetas[][] = new int[3][3]; + for (int arrX = 0; arrX < 3; arrX++) + { + for (int arrY = 0; arrY < 3; arrY++) + { + golemBlockIDs[arrX][arrY] = 0; + } + } - for (int iterX = -1; iterX <= 1; iterX++) - { - for (int iterY = 0; iterY < 3; iterY++) - { - if (iterY + (3 - pedestalHeight) >= 3 || iterY + (3 - pedestalHeight) == 0 && iterX != 0) - { - continue; - } - if (metadata == 0) - { - int bID = world.getBlockId(x - iterX, y - iterY, z); - if (idIsInvalid(bID)) - { - bID = 0; - return false; - } - if (bID == blockID) - { - i2++; - } - golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = bID; - golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = bID == blockID ? 0 : world.getBlockMetadata(x - iterX, y - iterY, z); - } - if (metadata == 1) - { - int l3 = world.getBlockId(x, y - iterY, z - iterX); - if (idIsInvalid(l3)) - { - l3 = 0; - return false; - } - if (l3 == blockID) - { - i2++; - } - golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = l3; - golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = l3 == blockID ? 0 : world.getBlockMetadata(x, y - iterY, z - iterX); - } - if (metadata == 2) - { - int i4 = world.getBlockId(x + iterX, y - iterY, z); - if (idIsInvalid(i4)) - { - i4 = 0; - return false; - } - if (i4 == blockID) - { - i2++; - } - golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = i4; - golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = i4 == blockID ? 0 : world.getBlockMetadata(x + iterX, y - iterY, z); - } - if (metadata == 3) - { - int bID = world.getBlockId(x, y - iterY, z + iterX); - if (idIsInvalid(bID)) - { - bID = 0; - return false; - } - if (bID == blockID) - { - i2++; - } - golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = bID; - golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = bID == blockID ? 0 : world.getBlockMetadata(x, y - iterY, z + iterX); - } - if (i2 > 1) - { - return false; - } - if (golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] != 0 && Block.blocksList[golemBlockIDs[iterX + 1][iterY]] != null - && !Block.blocksList[golemBlockIDs[iterX + 1][iterY]].renderAsNormalBlock() && (iterX + 1 == 0 || iterX + 1 == 2) && iterY == 2 - && golemBlockIDs[iterX + 1][iterY] != TContent.golemCore.blockID) - { - return false; - } - if (golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] == TContent.golemCore.blockID) - { - l1++; - if (metadata == 0) - { - coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x - iterX, y - iterY, z); - } - if (metadata == 1) - { - coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x, y - iterY, z - iterX); - } - if (metadata == 2) - { - coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x + iterX, y - iterY, z); - } - if (metadata == 3) - { - coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x, y - iterY, z + iterX); - } - itemstack = coreLogic.getKey(); - } - if (l1 > 1) - { - return false; - } - } - } + for (int iterX = -1; iterX <= 1; iterX++) + { + for (int iterY = 0; iterY < 3; iterY++) + { + if (iterY + (3 - pedestalHeight) >= 3 || iterY + (3 - pedestalHeight) == 0 && iterX != 0) + { + continue; + } + if (metadata == 0) + { + int bID = world.getBlockId(x - iterX, y - iterY, z); + if (idIsInvalid(bID)) + { + bID = 0; + return false; + } + if (bID == blockID) + { + i2++; + } + golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = bID; + golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = bID == blockID ? 0 : world.getBlockMetadata(x - iterX, y - iterY, z); + } + if (metadata == 1) + { + int l3 = world.getBlockId(x, y - iterY, z - iterX); + if (idIsInvalid(l3)) + { + l3 = 0; + return false; + } + if (l3 == blockID) + { + i2++; + } + golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = l3; + golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = l3 == blockID ? 0 : world.getBlockMetadata(x, y - iterY, z - iterX); + } + if (metadata == 2) + { + int i4 = world.getBlockId(x + iterX, y - iterY, z); + if (idIsInvalid(i4)) + { + i4 = 0; + return false; + } + if (i4 == blockID) + { + i2++; + } + golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = i4; + golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = i4 == blockID ? 0 : world.getBlockMetadata(x + iterX, y - iterY, z); + } + if (metadata == 3) + { + int bID = world.getBlockId(x, y - iterY, z + iterX); + if (idIsInvalid(bID)) + { + bID = 0; + return false; + } + if (bID == blockID) + { + i2++; + } + golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] = bID; + golemBlockMetas[iterX + 1][iterY + (3 - pedestalHeight)] = bID == blockID ? 0 : world.getBlockMetadata(x, y - iterY, z + iterX); + } + if (i2 > 1) + { + return false; + } + if (golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] != 0 && Block.blocksList[golemBlockIDs[iterX + 1][iterY]] != null + && !Block.blocksList[golemBlockIDs[iterX + 1][iterY]].renderAsNormalBlock() && (iterX + 1 == 0 || iterX + 1 == 2) && iterY == 2 + && golemBlockIDs[iterX + 1][iterY] != TContent.golemCore.blockID) + { + return false; + } + if (golemBlockIDs[iterX + 1][iterY + (3 - pedestalHeight)] == TContent.golemCore.blockID) + { + l1++; + if (metadata == 0) + { + coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x - iterX, y - iterY, z); + } + if (metadata == 1) + { + coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x, y - iterY, z - iterX); + } + if (metadata == 2) + { + coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x + iterX, y - iterY, z); + } + if (metadata == 3) + { + coreLogic = (GolemCoreLogic) world.getBlockTileEntity(x, y - iterY, z + iterX); + } + itemstack = coreLogic.getKey(); + } + if (l1 > 1) + { + return false; + } + } + } - boolean flag = false; - for (int j3 = 0; j3 < 3; j3++) - { - for (int k4 = 0; k4 < 3; k4++) - { - if (golemBlockIDs[k4][j3] == this.blockID) - { - flag = true; - } - } - } + boolean flag = false; + for (int j3 = 0; j3 < 3; j3++) + { + for (int k4 = 0; k4 < 3; k4++) + { + if (golemBlockIDs[k4][j3] == this.blockID) + { + flag = true; + } + } + } - if (!flag) - { - return false; - } - if (golemBlockIDs[0][2] != 0 && Block.blocksList[golemBlockIDs[0][2]].renderAsNormalBlock() || golemBlockIDs[2][2] != 0 && Block.blocksList[golemBlockIDs[2][2]].renderAsNormalBlock()) - { - return false; - } - if (l1 > 0 - && (golemBlockIDs[0][0] == TContent.golemCore.blockID || golemBlockIDs[0][1] == TContent.golemCore.blockID || golemBlockIDs[2][0] == TContent.golemCore.blockID || golemBlockIDs[2][1] == TContent.golemCore.blockID)) - { - return false; - } - TileEntity tileentity = world.getBlockTileEntity(x, y - pedestalHeight, z); - if (!(tileentity instanceof TileEntityGolemPedestal)) - { - return false; - } - TileEntityGolemPedestal tileentitygolempedestal = (TileEntityGolemPedestal) tileentity; - if (tileentitygolempedestal.subtractSoul(l1 == 1 ? 8 : 1) && world.getBlockId(x, y - pedestalHeight, z) == TContent.golemPedestal.blockID) - { - EntityGenericGolem entitygenericgolem = new EntityGenericGolem(world); - EntityPlayerSP entityplayersp = ModLoader.getMinecraftInstance().thePlayer; - double d = ((EntityPlayer) (entityplayersp)).posX - (double) (float) ((double) x + 0.5D); - double d1 = ((EntityPlayer) (entityplayersp)).posZ - (double) (float) ((double) z + 0.5D); - entitygenericgolem.setBody(golemBlockIDs, golemBlockMetas, y, pedestalHeight); - entitygenericgolem.setPositionAndRotation((double) x + 0.5D, (y - pedestalHeight) + 1, (double) z + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - if (l1 > 0) - { - entitygenericgolem.setCore(itemstack); - } - if (coreLogic != null) - { - //((GolemCoreBlock) mod_Golems.golemCore).killDisplayItem(world, coreLogic.xCoord, coreLogic.yCoord, coreLogic.zCoord); - //coreLogic.key = null; - } - if (!buildInterrupt(world, x, y, z, metadata, golemBlockIDs, golemBlockMetas, pedestalHeight, coreLogic != null, itemstack, coreLogic) && world.spawnEntityInWorld(entitygenericgolem)) - { - delBlocks(world, x, y, z, metadata, golemBlockIDs, pedestalHeight); - world.spawnParticle("hugeexplosion", (double) x + Math.random(), (double) y + 1.2D, (double) z + Math.random(), 0.0D, 0.0D, 0.0D); - return true; - } - else - { - return false; - } - } - else - { - return false; - }*/ - return false; - } + if (!flag) + { + return false; + } + if (golemBlockIDs[0][2] != 0 && Block.blocksList[golemBlockIDs[0][2]].renderAsNormalBlock() || golemBlockIDs[2][2] != 0 && Block.blocksList[golemBlockIDs[2][2]].renderAsNormalBlock()) + { + return false; + } + if (l1 > 0 + && (golemBlockIDs[0][0] == TContent.golemCore.blockID || golemBlockIDs[0][1] == TContent.golemCore.blockID || golemBlockIDs[2][0] == TContent.golemCore.blockID || golemBlockIDs[2][1] == TContent.golemCore.blockID)) + { + return false; + } + TileEntity tileentity = world.getBlockTileEntity(x, y - pedestalHeight, z); + if (!(tileentity instanceof TileEntityGolemPedestal)) + { + return false; + } + TileEntityGolemPedestal tileentitygolempedestal = (TileEntityGolemPedestal) tileentity; + if (tileentitygolempedestal.subtractSoul(l1 == 1 ? 8 : 1) && world.getBlockId(x, y - pedestalHeight, z) == TContent.golemPedestal.blockID) + { + EntityGenericGolem entitygenericgolem = new EntityGenericGolem(world); + EntityPlayerSP entityplayersp = ModLoader.getMinecraftInstance().thePlayer; + double d = ((EntityPlayer) (entityplayersp)).posX - (double) (float) ((double) x + 0.5D); + double d1 = ((EntityPlayer) (entityplayersp)).posZ - (double) (float) ((double) z + 0.5D); + entitygenericgolem.setBody(golemBlockIDs, golemBlockMetas, y, pedestalHeight); + entitygenericgolem.setPositionAndRotation((double) x + 0.5D, (y - pedestalHeight) + 1, (double) z + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + if (l1 > 0) + { + entitygenericgolem.setCore(itemstack); + } + if (coreLogic != null) + { + //((GolemCoreBlock) mod_Golems.golemCore).killDisplayItem(world, coreLogic.xCoord, coreLogic.yCoord, coreLogic.zCoord); + //coreLogic.key = null; + } + if (!buildInterrupt(world, x, y, z, metadata, golemBlockIDs, golemBlockMetas, pedestalHeight, coreLogic != null, itemstack, coreLogic) && world.spawnEntityInWorld(entitygenericgolem)) + { + delBlocks(world, x, y, z, metadata, golemBlockIDs, pedestalHeight); + world.spawnParticle("hugeexplosion", (double) x + Math.random(), (double) y + 1.2D, (double) z + Math.random(), 0.0D, 0.0D, 0.0D); + return true; + } + else + { + return false; + } + } + else + { + return false; + }*/ + return false; + } - public boolean buildInterrupt (World world, int i, int j, int k, int l, int ai[][], int ai1[][], int i1, boolean flag, ItemStack itemstack, GolemCoreLogic tileentitygolemcore) - { - /*EntityPlayerSP entityplayersp = ModLoader.getMinecraftInstance().thePlayer; - double d = ((EntityPlayer) (entityplayersp)).posX - (double) (float) ((double) i + 0.5D); - double d1 = ((EntityPlayer) (entityplayersp)).posZ - (double) (float) ((double) k + 0.5D); - int j1 = world.difficultySetting; - int k1 = 0; - for (int l1 = 0; l1 < 3; l1++) - { - for (int i2 = 0; i2 < 3; i2++) - { - if (ai[l1][i2] != 0) - { - k1++; - } - } - } + public boolean buildInterrupt (World world, int i, int j, int k, int l, int ai[][], int ai1[][], int i1, boolean flag, ItemStack itemstack, GolemCoreLogic tileentitygolemcore) + { + /*EntityPlayerSP entityplayersp = ModLoader.getMinecraftInstance().thePlayer; + double d = ((EntityPlayer) (entityplayersp)).posX - (double) (float) ((double) i + 0.5D); + double d1 = ((EntityPlayer) (entityplayersp)).posZ - (double) (float) ((double) k + 0.5D); + int j1 = world.difficultySetting; + int k1 = 0; + for (int l1 = 0; l1 < 3; l1++) + { + for (int i2 = 0; i2 < 3; i2++) + { + if (ai[l1][i2] != 0) + { + k1++; + } + } + } - boolean flag1 = ai[0][1] != 0 || ai[2][1] != 0; - if (isAll(ai, ai1, Block.tnt.blockID, -1) || i1 == 3 && ai[1][1] == Block.tnt.blockID && ai[1][2] == Block.cloth.blockID && ai1[1][2] == 5 && !flag1 && j1 >= 1) - { - EntityCreeper entitycreeper = new EntityCreeper(world); - entitycreeper.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - world.spawnEntityInWorld(entitycreeper); - delBlocks(world, i, j, k, l, ai, i1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("creeper"); - return true; - } - if (isAll(ai, ai1, Block.netherrack.blockID, -1) && i1 == 3 && j1 >= 1) - { - EntityBlaze entityblaze = new EntityBlaze(world); - entityblaze.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - world.spawnEntityInWorld(entityblaze); - delBlocks(world, i, j, k, l, ai, i1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("blaze"); - return true; - } - if (isAll(ai, ai1, Block.obsidian.blockID, -1) && i1 == 3 && countBlock(ai, ai1, Block.obsidian.blockID, -1) == 2 && j1 >= 1) - { - EntityEnderman entityenderman = new EntityEnderman(world); - entityenderman.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - world.spawnEntityInWorld(entityenderman); - delBlocks(world, i, j, k, l, ai, i1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("enderman"); - return true; - } - if (hasBlock(ai, ai1, Block.tnt.blockID, -1) && hasBlock(ai, ai1, Block.netherrack.blockID, -1)) - { - boolean flag2 = false; - Entity aentity[][] = new Entity[3][3]; - for (int j2 = 0; j2 < 3; j2++) - { - for (int l2 = 0; l2 < 3; l2++) - { - aentity[j2][l2] = null; - if (ai[j2][l2] == Block.tnt.blockID) - { - EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world); - entitytntprimed.fuse = 80; - aentity[j2][l2] = entitytntprimed; - } - } - } + boolean flag1 = ai[0][1] != 0 || ai[2][1] != 0; + if (isAll(ai, ai1, Block.tnt.blockID, -1) || i1 == 3 && ai[1][1] == Block.tnt.blockID && ai[1][2] == Block.cloth.blockID && ai1[1][2] == 5 && !flag1 && j1 >= 1) + { + EntityCreeper entitycreeper = new EntityCreeper(world); + entitycreeper.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + world.spawnEntityInWorld(entitycreeper); + delBlocks(world, i, j, k, l, ai, i1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("creeper"); + return true; + } + if (isAll(ai, ai1, Block.netherrack.blockID, -1) && i1 == 3 && j1 >= 1) + { + EntityBlaze entityblaze = new EntityBlaze(world); + entityblaze.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + world.spawnEntityInWorld(entityblaze); + delBlocks(world, i, j, k, l, ai, i1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("blaze"); + return true; + } + if (isAll(ai, ai1, Block.obsidian.blockID, -1) && i1 == 3 && countBlock(ai, ai1, Block.obsidian.blockID, -1) == 2 && j1 >= 1) + { + EntityEnderman entityenderman = new EntityEnderman(world); + entityenderman.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + world.spawnEntityInWorld(entityenderman); + delBlocks(world, i, j, k, l, ai, i1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("enderman"); + return true; + } + if (hasBlock(ai, ai1, Block.tnt.blockID, -1) && hasBlock(ai, ai1, Block.netherrack.blockID, -1)) + { + boolean flag2 = false; + Entity aentity[][] = new Entity[3][3]; + for (int j2 = 0; j2 < 3; j2++) + { + for (int l2 = 0; l2 < 3; l2++) + { + aentity[j2][l2] = null; + if (ai[j2][l2] == Block.tnt.blockID) + { + EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world); + entitytntprimed.fuse = 80; + aentity[j2][l2] = entitytntprimed; + } + } + } - replEntity(world, i, j, k, l, ai, aentity, i1); - i1 = updateBody(ai, ai1); - EntityGenericGolem entitygenericgolem = new EntityGenericGolem(world); - entitygenericgolem.setBody(ai, ai1, l, i1); - entitygenericgolem.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - if (flag) - { - entitygenericgolem.setCore(itemstack); - } - world.spawnEntityInWorld(entitygenericgolem); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("boom"); - return true; - } - if (i1 == 3 && !flag1 && ai[1][2] == Block.blockIron.blockID && ai[1][1] == Block.blockIron.blockID) - { - List list = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(i, j, k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D).expand(4D, 16D, 4D)); - Entity entity; - for (Iterator iterator = list.iterator(); iterator.hasNext(); world.addWeatherEffect(new EntityLightningBolt(world, entity.posX, entity.posY, entity.posZ))) - { - Object obj = iterator.next(); - entity = (Entity) obj; - } + replEntity(world, i, j, k, l, ai, aentity, i1); + i1 = updateBody(ai, ai1); + EntityGenericGolem entitygenericgolem = new EntityGenericGolem(world); + entitygenericgolem.setBody(ai, ai1, l, i1); + entitygenericgolem.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + if (flag) + { + entitygenericgolem.setCore(itemstack); + } + world.spawnEntityInWorld(entitygenericgolem); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("boom"); + return true; + } + if (i1 == 3 && !flag1 && ai[1][2] == Block.blockIron.blockID && ai[1][1] == Block.blockIron.blockID) + { + List list = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(i, j, k, (double) i + 1.0D, (double) j + 1.0D, (double) k + 1.0D).expand(4D, 16D, 4D)); + Entity entity; + for (Iterator iterator = list.iterator(); iterator.hasNext(); world.addWeatherEffect(new EntityLightningBolt(world, entity.posX, entity.posY, entity.posZ))) + { + Object obj = iterator.next(); + entity = (Entity) obj; + } - mod_Golems.trigger("zap"); - } - else - { - if (isAll(ai, ai1, Block.cloth.blockID, 0) && countBlock(ai, ai1, Block.cloth.blockID, 0) == 4) - { - EntitySheep entitysheep = new EntitySheep(world); - entitysheep.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - world.spawnEntityInWorld(entitysheep); - delBlocks(world, i, j, k, l, ai, i1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("sheep"); - return true; - } - if (countBlock(ai, ai1, Block.furnaceIdle.blockID, -1) >= (int) (Math.random() * 2D + 2D)) - { - ItemStack aitemstack[][] = new ItemStack[3][3]; - aitemstack[0][1] = new ItemStack(Block.lavaMoving, 1); - aitemstack[2][1] = new ItemStack(Block.lavaMoving, 1); - aitemstack[1][0] = new ItemStack(Block.lavaMoving, 1); - aitemstack[1][1] = new ItemStack(Block.lavaMoving, 1); - aitemstack[1][2] = new ItemStack(Block.lavaMoving, 1); - replBlocks(world, i, j, k, l, ai, aitemstack, i1); - mod_Golems.trigger("meltdown"); - return true; - } - if (hasBlock(ai, ai1, Block.stoneBrick.blockID, -1) && Math.random() <= 0.40000000000000002D) - { - boolean flag3 = false; - Entity aentity1[][] = new Entity[3][3]; - for (int k2 = 0; k2 < 3; k2++) - { - for (int i3 = 0; i3 < 3; i3++) - { - aentity1[k2][i3] = null; - if (ai[k2][i3] == Block.stoneBrick.blockID) - { - aentity1[k2][i3] = Math.random() <= 0.59999999999999998D ? ((Entity) (new EntitySilverfish(world))) : null; - } - } - } + mod_Golems.trigger("zap"); + } + else + { + if (isAll(ai, ai1, Block.cloth.blockID, 0) && countBlock(ai, ai1, Block.cloth.blockID, 0) == 4) + { + EntitySheep entitysheep = new EntitySheep(world); + entitysheep.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + world.spawnEntityInWorld(entitysheep); + delBlocks(world, i, j, k, l, ai, i1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("sheep"); + return true; + } + if (countBlock(ai, ai1, Block.furnaceIdle.blockID, -1) >= (int) (Math.random() * 2D + 2D)) + { + ItemStack aitemstack[][] = new ItemStack[3][3]; + aitemstack[0][1] = new ItemStack(Block.lavaMoving, 1); + aitemstack[2][1] = new ItemStack(Block.lavaMoving, 1); + aitemstack[1][0] = new ItemStack(Block.lavaMoving, 1); + aitemstack[1][1] = new ItemStack(Block.lavaMoving, 1); + aitemstack[1][2] = new ItemStack(Block.lavaMoving, 1); + replBlocks(world, i, j, k, l, ai, aitemstack, i1); + mod_Golems.trigger("meltdown"); + return true; + } + if (hasBlock(ai, ai1, Block.stoneBrick.blockID, -1) && Math.random() <= 0.40000000000000002D) + { + boolean flag3 = false; + Entity aentity1[][] = new Entity[3][3]; + for (int k2 = 0; k2 < 3; k2++) + { + for (int i3 = 0; i3 < 3; i3++) + { + aentity1[k2][i3] = null; + if (ai[k2][i3] == Block.stoneBrick.blockID) + { + aentity1[k2][i3] = Math.random() <= 0.59999999999999998D ? ((Entity) (new EntitySilverfish(world))) : null; + } + } + } - replEntity(world, i, j, k, l, ai, aentity1, i1); - i1 = updateBody(ai, ai1); - EntityGenericGolem entitygenericgolem1 = new EntityGenericGolem(world); - entitygenericgolem1.setBody(ai, ai1, l, i1); - entitygenericgolem1.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - if (flag) - { - entitygenericgolem1.setCore(itemstack); - } - world.spawnEntityInWorld(entitygenericgolem1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("silverfish"); - return true; - } - if (countBlock(ai, ai1, Block.melon.blockID, -1) == 4) - { - delBlocks(world, i, j, k, l, ai, i1); - EntityGSpawn entitygspawn = new EntityGSpawn(world); - entitygspawn.setPosition(i, j, k); - entitygspawn.skin = "http://s3.amazonaws.com/MinecraftSkins/loligator704.png"; - world.spawnEntityInWorld(entitygspawn); - mod_Golems.trigger("loligator"); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - return true; - } - if (countBlock(ai, ai1, Block.cloth.blockID, 13) == 3 && ai[1][1] == Block.cloth.blockID && ai1[1][1] == 0) - { - delBlocks(world, i, j, k, l, ai, i1); - EntityGSpawn entitygspawn1 = new EntityGSpawn(world); - entitygspawn1.setPosition(i, j, k); - entitygspawn1.skin = "http://s3.amazonaws.com/MinecraftSkins/coalheartly.png"; - world.spawnEntityInWorld(entitygspawn1); - mod_Golems.trigger("bitterman"); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - return true; - } - if (countBlock(ai, ai1, Block.cloth.blockID, 11) == 3 && ai[1][1] == Block.blockLapis.blockID) - { - delBlocks(world, i, j, k, l, ai, i1); - EntityGSpawn entitygspawn2 = new EntityGSpawn(world); - entitygspawn2.setPosition(i, j, k); - entitygspawn2.skin = "http://s3.amazonaws.com/MinecraftSkins/BILLYTG101.png"; - world.spawnEntityInWorld(entitygspawn2); - mod_Golems.trigger("yourstruly"); - return true; - } - if (countBlock(ai, ai1, Block.cloth.blockID, 12) == 2 && ai[1][1] == Block.blockGold.blockID && ai[1][2] == Block.cloth.blockID && ai1[1][2] == 0) - { - delBlocks(world, i, j, k, l, ai, i1); - EntityGSpawn entitygspawn3 = new EntityGSpawn(world); - entitygspawn3.setPosition(i, j, k); - entitygspawn3.skin = "http://s3.amazonaws.com/MinecraftSkins/Notch.png"; - world.spawnEntityInWorld(entitygspawn3); - mod_Golems.trigger("king"); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - return true; - } + replEntity(world, i, j, k, l, ai, aentity1, i1); + i1 = updateBody(ai, ai1); + EntityGenericGolem entitygenericgolem1 = new EntityGenericGolem(world); + entitygenericgolem1.setBody(ai, ai1, l, i1); + entitygenericgolem1.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + if (flag) + { + entitygenericgolem1.setCore(itemstack); + } + world.spawnEntityInWorld(entitygenericgolem1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("silverfish"); + return true; + } + if (countBlock(ai, ai1, Block.melon.blockID, -1) == 4) + { + delBlocks(world, i, j, k, l, ai, i1); + EntityGSpawn entitygspawn = new EntityGSpawn(world); + entitygspawn.setPosition(i, j, k); + entitygspawn.skin = "http://s3.amazonaws.com/MinecraftSkins/loligator704.png"; + world.spawnEntityInWorld(entitygspawn); + mod_Golems.trigger("loligator"); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + return true; + } + if (countBlock(ai, ai1, Block.cloth.blockID, 13) == 3 && ai[1][1] == Block.cloth.blockID && ai1[1][1] == 0) + { + delBlocks(world, i, j, k, l, ai, i1); + EntityGSpawn entitygspawn1 = new EntityGSpawn(world); + entitygspawn1.setPosition(i, j, k); + entitygspawn1.skin = "http://s3.amazonaws.com/MinecraftSkins/coalheartly.png"; + world.spawnEntityInWorld(entitygspawn1); + mod_Golems.trigger("bitterman"); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + return true; + } + if (countBlock(ai, ai1, Block.cloth.blockID, 11) == 3 && ai[1][1] == Block.blockLapis.blockID) + { + delBlocks(world, i, j, k, l, ai, i1); + EntityGSpawn entitygspawn2 = new EntityGSpawn(world); + entitygspawn2.setPosition(i, j, k); + entitygspawn2.skin = "http://s3.amazonaws.com/MinecraftSkins/BILLYTG101.png"; + world.spawnEntityInWorld(entitygspawn2); + mod_Golems.trigger("yourstruly"); + return true; + } + if (countBlock(ai, ai1, Block.cloth.blockID, 12) == 2 && ai[1][1] == Block.blockGold.blockID && ai[1][2] == Block.cloth.blockID && ai1[1][2] == 0) + { + delBlocks(world, i, j, k, l, ai, i1); + EntityGSpawn entitygspawn3 = new EntityGSpawn(world); + entitygspawn3.setPosition(i, j, k); + entitygspawn3.skin = "http://s3.amazonaws.com/MinecraftSkins/Notch.png"; + world.spawnEntityInWorld(entitygspawn3); + mod_Golems.trigger("king"); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + return true; + } - if (isAll(ai, ai1, Block.blockClay.blockID, -1) && i1 == 3 && countBlock(ai, ai1, Block.blockClay.blockID, -1) == 2 && j1 >= 1) - { - EntityZombie entityzombie = new EntityZombie(world); - entityzombie.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); - world.spawnEntityInWorld(entityzombie); - delBlocks(world, i, j, k, l, ai, i1); - world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); - mod_Golems.trigger("zombie"); - return true; - } - }*/ - return false; - } + if (isAll(ai, ai1, Block.blockClay.blockID, -1) && i1 == 3 && countBlock(ai, ai1, Block.blockClay.blockID, -1) == 2 && j1 >= 1) + { + EntityZombie entityzombie = new EntityZombie(world); + entityzombie.setPositionAndRotation((double) i + 0.5D, (j - i1) + 1, (double) k + 0.5D, (float) ((Math.atan2(d1, d) * 180D) / 3.1415927410125732D) - 90F, 0.0F); + world.spawnEntityInWorld(entityzombie); + delBlocks(world, i, j, k, l, ai, i1); + world.spawnParticle("hugeexplosion", (double) i + Math.random(), (double) j + 1.2D, (double) k + Math.random(), 0.0D, 0.0D, 0.0D); + mod_Golems.trigger("zombie"); + return true; + } + }*/ + return false; + } - private void delBlocks (World world, int i, int j, int k, int l, int ai[][], int i1) - { - for (int j1 = -1; j1 <= 1; j1++) - { - for (int k1 = 0; k1 < i1; k1++) - { - if (k1 == 0 && j1 != 0 || ai[j1 + 1][(k1 - i1) + 3] == 0) - { - continue; - } - if (l == 0) - { - world.setBlock(i - j1, j - k1, k, 0); - } - if (l == 1) - { - world.setBlock(i, j - k1, k - j1, 0); - } - if (l == 2) - { - world.setBlock(i + j1, j - k1, k, 0); - } - if (l == 3) - { - world.setBlock(i, j - k1, k + j1, 0); - } - } - } + private void delBlocks (World world, int i, int j, int k, int l, int ai[][], int i1) + { + for (int j1 = -1; j1 <= 1; j1++) + { + for (int k1 = 0; k1 < i1; k1++) + { + if (k1 == 0 && j1 != 0 || ai[j1 + 1][(k1 - i1) + 3] == 0) + { + continue; + } + if (l == 0) + { + world.setBlock(i - j1, j - k1, k, 0); + } + if (l == 1) + { + world.setBlock(i, j - k1, k - j1, 0); + } + if (l == 2) + { + world.setBlock(i + j1, j - k1, k, 0); + } + if (l == 3) + { + world.setBlock(i, j - k1, k + j1, 0); + } + } + } - if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) - { - if (l == 0) - { - if (ai[0][1] != 0) - { - world.setBlock(i + 1, j, k, 0); - } - if (ai[2][1] != 0) - { - world.setBlock(i - 1, j, k, 0); - } - } - if (l == 1) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k + 1, 0); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k - 1, 0); - } - } - if (l == 2) - { - if (ai[0][1] != 0) - { - world.setBlock(i - 1, j, k, 0); - } - if (ai[2][1] != 0) - { - world.setBlock(i + 1, j, k, 0); - } - } - if (l == 3) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k - 1, 0); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k + 1, 0); - } - } - } - } + if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) + { + if (l == 0) + { + if (ai[0][1] != 0) + { + world.setBlock(i + 1, j, k, 0); + } + if (ai[2][1] != 0) + { + world.setBlock(i - 1, j, k, 0); + } + } + if (l == 1) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k + 1, 0); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k - 1, 0); + } + } + if (l == 2) + { + if (ai[0][1] != 0) + { + world.setBlock(i - 1, j, k, 0); + } + if (ai[2][1] != 0) + { + world.setBlock(i + 1, j, k, 0); + } + } + if (l == 3) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k - 1, 0); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k + 1, 0); + } + } + } + } - private boolean hasBlock (int ai[][], int ai1[][], int i, int j) - { - for (int k = 0; k < 3; k++) - { - for (int l = 0; l < 3; l++) - { - if (ai[k][l] == i && (ai1[k][l] == j || j == -1)) - { - return true; - } - } - } + private boolean hasBlock (int ai[][], int ai1[][], int i, int j) + { + for (int k = 0; k < 3; k++) + { + for (int l = 0; l < 3; l++) + { + if (ai[k][l] == i && (ai1[k][l] == j || j == -1)) + { + return true; + } + } + } - return false; - } + return false; + } - private void replBlocks (World world, int i, int j, int k, int l, int ai[][], ItemStack aitemstack[][], int i1) - { - for (int j1 = -1; j1 <= 1; j1++) - { - for (int k1 = 0; k1 < i1; k1++) - { - if (aitemstack[j1 + 1][(k1 - i1) + 3] == null) - { - aitemstack[j1 + 1][(k1 - i1) + 3] = new ItemStack(0, 0, 0); - } - if (k1 == 0 && j1 != 0 || ai[j1 + 1][(k1 - i1) + 3] == 0) - { - continue; - } - if (l == 0) - { - world.setBlock(i - j1, j - k1, k, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); - } - if (l == 1) - { - world.setBlock(i, j - k1, k - j1, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); - } - if (l == 2) - { - world.setBlock(i + j1, j - k1, k, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); - } - if (l == 3) - { - world.setBlock(i, j - k1, k + j1, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); - } - } - } + private void replBlocks (World world, int i, int j, int k, int l, int ai[][], ItemStack aitemstack[][], int i1) + { + for (int j1 = -1; j1 <= 1; j1++) + { + for (int k1 = 0; k1 < i1; k1++) + { + if (aitemstack[j1 + 1][(k1 - i1) + 3] == null) + { + aitemstack[j1 + 1][(k1 - i1) + 3] = new ItemStack(0, 0, 0); + } + if (k1 == 0 && j1 != 0 || ai[j1 + 1][(k1 - i1) + 3] == 0) + { + continue; + } + if (l == 0) + { + world.setBlock(i - j1, j - k1, k, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); + } + if (l == 1) + { + world.setBlock(i, j - k1, k - j1, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); + } + if (l == 2) + { + world.setBlock(i + j1, j - k1, k, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); + } + if (l == 3) + { + world.setBlock(i, j - k1, k + j1, aitemstack[j1 + 1][(k1 - i1) + 3].itemID, aitemstack[j1 + 1][(k1 - i1) + 3].getItemDamage(), 3); + } + } + } - if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) - { - if (l == 0) - { - if (ai[0][1] != 0) - { - world.setBlock(i + 1, j, k, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); - } - if (ai[2][1] != 0) - { - world.setBlock(i - 1, j, k, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); - } - } - if (l == 1) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k + 1, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k - 1, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); - } - } - if (l == 2) - { - if (ai[0][1] != 0) - { - world.setBlock(i - 1, j, k, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); - } - if (ai[2][1] != 0) - { - world.setBlock(i + 1, j, k, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); - } - } - if (l == 3) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k - 1, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k + 1, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); - } - } - } - } + if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) + { + if (l == 0) + { + if (ai[0][1] != 0) + { + world.setBlock(i + 1, j, k, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); + } + if (ai[2][1] != 0) + { + world.setBlock(i - 1, j, k, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); + } + } + if (l == 1) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k + 1, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k - 1, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); + } + } + if (l == 2) + { + if (ai[0][1] != 0) + { + world.setBlock(i - 1, j, k, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); + } + if (ai[2][1] != 0) + { + world.setBlock(i + 1, j, k, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); + } + } + if (l == 3) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k - 1, aitemstack[0][1].itemID, aitemstack[0][1].getItemDamage(), 3); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k + 1, aitemstack[2][1].itemID, aitemstack[2][1].getItemDamage(), 3); + } + } + } + } - private void replEntity (World world, int i, int j, int k, int l, int ai[][], Entity aentity[][], int i1) - { - for (int j1 = -1; j1 <= 1; j1++) - { - for (int k1 = 0; k1 < i1; k1++) - { - if (k1 == 0 && j1 != 0) - { - continue; - } - Entity entity8 = aentity[j1 + 1][(k1 - i1) + 3]; - if (ai[j1 + 1][(k1 - i1) + 3] == 0) - { - if (entity8 != null) - { - entity8.setDead(); - } - continue; - } - if (l == 0) - { - world.setBlock(i - j1, j - k1, k, 0); - if (entity8 != null) - { - entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(entity8); - ai[j1 + 1][(k1 - i1) + 3] = 0; - } - } - if (l == 1) - { - world.setBlock(i, j - k1, k - j1, 0); - if (entity8 != null) - { - entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(entity8); - ai[j1 + 1][(k1 - i1) + 3] = 0; - } - } - if (l == 2) - { - world.setBlock(i + j1, j - k1, k, 0); - if (entity8 != null) - { - entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(entity8); - ai[j1 + 1][(k1 - i1) + 3] = 0; - } - } - if (l != 3) - { - continue; - } - world.setBlock(i, j - k1, k + j1, 0); - if (entity8 != null) - { - entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(entity8); - ai[j1 + 1][(k1 - i1) + 3] = 0; - } - } - } + private void replEntity (World world, int i, int j, int k, int l, int ai[][], Entity aentity[][], int i1) + { + for (int j1 = -1; j1 <= 1; j1++) + { + for (int k1 = 0; k1 < i1; k1++) + { + if (k1 == 0 && j1 != 0) + { + continue; + } + Entity entity8 = aentity[j1 + 1][(k1 - i1) + 3]; + if (ai[j1 + 1][(k1 - i1) + 3] == 0) + { + if (entity8 != null) + { + entity8.setDead(); + } + continue; + } + if (l == 0) + { + world.setBlock(i - j1, j - k1, k, 0); + if (entity8 != null) + { + entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(entity8); + ai[j1 + 1][(k1 - i1) + 3] = 0; + } + } + if (l == 1) + { + world.setBlock(i, j - k1, k - j1, 0); + if (entity8 != null) + { + entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(entity8); + ai[j1 + 1][(k1 - i1) + 3] = 0; + } + } + if (l == 2) + { + world.setBlock(i + j1, j - k1, k, 0); + if (entity8 != null) + { + entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(entity8); + ai[j1 + 1][(k1 - i1) + 3] = 0; + } + } + if (l != 3) + { + continue; + } + world.setBlock(i, j - k1, k + j1, 0); + if (entity8 != null) + { + entity8.setPosition(((float) i - (float) j1) + 0.5F, ((float) j - (float) k1) + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(entity8); + ai[j1 + 1][(k1 - i1) + 3] = 0; + } + } + } - if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) - { - Object obj = null; - if (l == 0) - { - if (ai[0][1] != 0) - { - world.setBlock(i + 1, j, k, 0); - Entity entity; - if ((entity = aentity[0][1]) != null) - { - entity.setPosition((float) i + 1.0F + 0.5F, (float) j + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(aentity[0][1]); - ai[2][1] = 0; - } - } - else if (aentity[0][1] != null) - { - aentity[0][1].setDead(); - } - if (ai[2][1] != 0) - { - world.setBlock(i - 1, j, k, 0); - Entity entity1; - if ((entity1 = aentity[2][1]) != null) - { - entity1.setPosition(((float) i - 1.0F) + 0.5F, (float) j + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(aentity[2][1]); - ai[2][1] = 0; - } - } - else if (aentity[2][1] != null) - { - aentity[2][1].setDead(); - } - } - if (l == 1) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k + 1, 0); - Entity entity2; - if ((entity2 = aentity[0][1]) != null) - { - entity2.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); - world.spawnEntityInWorld(aentity[0][1]); - ai[2][1] = 0; - } - } - else if (aentity[0][1] != null) - { - aentity[0][1].setDead(); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k - 1, 0); - Entity entity3; - if ((entity3 = aentity[2][1]) != null) - { - entity3.setPosition((float) i + 0.5F, (float) j + 0.5F, ((float) k - 1.0F) + 0.5F); - world.spawnEntityInWorld(aentity[2][1]); - ai[2][1] = 0; - } - } - else if (aentity[2][1] != null) - { - aentity[2][1].setDead(); - } - } - if (l == 2) - { - if (ai[0][1] != 0) - { - world.setBlock(i - 1, j, k, 0); - Entity entity4; - if ((entity4 = aentity[0][1]) != null) - { - entity4.setPosition(((float) i - 1.0F) + 0.5F, (float) j + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(aentity[0][1]); - ai[2][1] = 0; - } - } - else if (aentity[0][1] != null) - { - aentity[0][1].setDead(); - } - if (ai[2][1] != 0) - { - world.setBlock(i + 1, j, k, 0); - Entity entity5; - if ((entity5 = aentity[2][1]) != null) - { - entity5.setPosition((float) i + 1.0F + 0.5F, (float) j + 0.5F, (float) k + 0.5F); - world.spawnEntityInWorld(aentity[2][1]); - ai[2][1] = 0; - } - } - else if (aentity[2][1] != null) - { - aentity[2][1].setDead(); - } - } - if (l == 3) - { - if (ai[0][1] != 0) - { - world.setBlock(i, j, k - 1, 0); - Entity entity6; - if ((entity6 = aentity[0][1]) != null) - { - entity6.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); - world.spawnEntityInWorld(aentity[0][1]); - } - } - else if (aentity[0][1] != null) - { - aentity[0][1].setDead(); - } - if (ai[2][1] != 0) - { - world.setBlock(i, j, k + 1, 0); - Entity entity7; - if ((entity7 = aentity[2][1]) != null) - { - entity7.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); - world.spawnEntityInWorld(aentity[2][1]); - } - } - else if (aentity[2][1] != null) - { - aentity[2][1].setDead(); - } - } - } - } + if (i1 == 2 && (ai[0][1] != 0 || ai[2][1] != 0)) + { + Object obj = null; + if (l == 0) + { + if (ai[0][1] != 0) + { + world.setBlock(i + 1, j, k, 0); + Entity entity; + if ((entity = aentity[0][1]) != null) + { + entity.setPosition((float) i + 1.0F + 0.5F, (float) j + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(aentity[0][1]); + ai[2][1] = 0; + } + } + else if (aentity[0][1] != null) + { + aentity[0][1].setDead(); + } + if (ai[2][1] != 0) + { + world.setBlock(i - 1, j, k, 0); + Entity entity1; + if ((entity1 = aentity[2][1]) != null) + { + entity1.setPosition(((float) i - 1.0F) + 0.5F, (float) j + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(aentity[2][1]); + ai[2][1] = 0; + } + } + else if (aentity[2][1] != null) + { + aentity[2][1].setDead(); + } + } + if (l == 1) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k + 1, 0); + Entity entity2; + if ((entity2 = aentity[0][1]) != null) + { + entity2.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); + world.spawnEntityInWorld(aentity[0][1]); + ai[2][1] = 0; + } + } + else if (aentity[0][1] != null) + { + aentity[0][1].setDead(); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k - 1, 0); + Entity entity3; + if ((entity3 = aentity[2][1]) != null) + { + entity3.setPosition((float) i + 0.5F, (float) j + 0.5F, ((float) k - 1.0F) + 0.5F); + world.spawnEntityInWorld(aentity[2][1]); + ai[2][1] = 0; + } + } + else if (aentity[2][1] != null) + { + aentity[2][1].setDead(); + } + } + if (l == 2) + { + if (ai[0][1] != 0) + { + world.setBlock(i - 1, j, k, 0); + Entity entity4; + if ((entity4 = aentity[0][1]) != null) + { + entity4.setPosition(((float) i - 1.0F) + 0.5F, (float) j + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(aentity[0][1]); + ai[2][1] = 0; + } + } + else if (aentity[0][1] != null) + { + aentity[0][1].setDead(); + } + if (ai[2][1] != 0) + { + world.setBlock(i + 1, j, k, 0); + Entity entity5; + if ((entity5 = aentity[2][1]) != null) + { + entity5.setPosition((float) i + 1.0F + 0.5F, (float) j + 0.5F, (float) k + 0.5F); + world.spawnEntityInWorld(aentity[2][1]); + ai[2][1] = 0; + } + } + else if (aentity[2][1] != null) + { + aentity[2][1].setDead(); + } + } + if (l == 3) + { + if (ai[0][1] != 0) + { + world.setBlock(i, j, k - 1, 0); + Entity entity6; + if ((entity6 = aentity[0][1]) != null) + { + entity6.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); + world.spawnEntityInWorld(aentity[0][1]); + } + } + else if (aentity[0][1] != null) + { + aentity[0][1].setDead(); + } + if (ai[2][1] != 0) + { + world.setBlock(i, j, k + 1, 0); + Entity entity7; + if ((entity7 = aentity[2][1]) != null) + { + entity7.setPosition((float) i + 0.5F, (float) j + 0.5F, (float) k + 1.0F + 0.5F); + world.spawnEntityInWorld(aentity[2][1]); + } + } + else if (aentity[2][1] != null) + { + aentity[2][1].setDead(); + } + } + } + } - private int updateBody (int ai[][], int ai1[][]) - { - for (int i = 0; ai[1][2] == 0 && i < 3;) - { - i++; - for (int i1 = 0; i1 < 3; i1++) - { - int j2 = ai[i1][0]; - int l2 = ai[i1][1]; - ai[i1][0] = ai[i1][2]; - ai[i1][1] = j2; - ai[i1][2] = l2; - } + private int updateBody (int ai[][], int ai1[][]) + { + for (int i = 0; ai[1][2] == 0 && i < 3;) + { + i++; + for (int i1 = 0; i1 < 3; i1++) + { + int j2 = ai[i1][0]; + int l2 = ai[i1][1]; + ai[i1][0] = ai[i1][2]; + ai[i1][1] = j2; + ai[i1][2] = l2; + } - int j1 = 0; - while (j1 < 3) - { - int k2 = ai1[j1][0]; - int i3 = ai1[j1][1]; - ai1[j1][0] = ai1[j1][2]; - ai1[j1][1] = k2; - ai1[j1][2] = i3; - j1++; - } - } + int j1 = 0; + while (j1 < 3) + { + int k2 = ai1[j1][0]; + int i3 = ai1[j1][1]; + ai1[j1][0] = ai1[j1][2]; + ai1[j1][1] = k2; + ai1[j1][2] = i3; + j1++; + } + } - if (ai[1][1] == 0) - { - for (int j = 0; j < 3; j++) - { - int k1 = ai[j][0]; - ai[j][0] = ai[j][1]; - ai[j][1] = k1; - } + if (ai[1][1] == 0) + { + for (int j = 0; j < 3; j++) + { + int k1 = ai[j][0]; + ai[j][0] = ai[j][1]; + ai[j][1] = k1; + } - for (int k = 0; k < 3; k++) - { - int l1 = ai1[k][0]; - ai1[k][0] = ai1[k][1]; - ai1[k][1] = l1; - } - } - int l = 0; - for (int i2 = 0; i2 < 3; i2++) - { - if (ai[1][i2] != 0) - { - l = 3 - i2; - } - } + for (int k = 0; k < 3; k++) + { + int l1 = ai1[k][0]; + ai1[k][0] = ai1[k][1]; + ai1[k][1] = l1; + } + } + int l = 0; + for (int i2 = 0; i2 < 3; i2++) + { + if (ai[1][i2] != 0) + { + l = 3 - i2; + } + } - if (l == 1) - { - ai[0][1] = 0; - ai[2][1] = 0; - ai1[0][1] = 0; - ai1[2][1] = 0; - } - return 0; - } + if (l == 1) + { + ai[0][1] = 0; + ai[2][1] = 0; + ai1[0][1] = 0; + ai1[2][1] = 0; + } + return 0; + } - private boolean isAll (int ai[][], int ai1[][], int i, int j) - { - boolean flag = false; - for (int k = 0; k < 3; k++) - { - for (int l = 0; l < 3; l++) - { - if (ai[k][l] != i && ai[k][l] != 0 && ai[k][l] != this.blockID && (ai1[k][l] != j || j == -1)) - { - return false; - } - if (ai[k][l] == i && (ai1[k][l] == j || j == -1)) - { - flag = true; - } - } - } + private boolean isAll (int ai[][], int ai1[][], int i, int j) + { + boolean flag = false; + for (int k = 0; k < 3; k++) + { + for (int l = 0; l < 3; l++) + { + if (ai[k][l] != i && ai[k][l] != 0 && ai[k][l] != this.blockID && (ai1[k][l] != j || j == -1)) + { + return false; + } + if (ai[k][l] == i && (ai1[k][l] == j || j == -1)) + { + flag = true; + } + } + } - return flag; - } + return flag; + } - private int countBlock (int ai[][], int ai1[][], int i, int j) - { - int k = 0; - for (int l = 0; l < 3; l++) - { - for (int i1 = 0; i1 < 3; i1++) - { - if (ai[l][i1] == i && (ai1[l][i1] == j || j == -1)) - { - k++; - } - } - } + private int countBlock (int ai[][], int ai1[][], int i, int j) + { + int k = 0; + for (int l = 0; l < 3; l++) + { + for (int i1 = 0; i1 < 3; i1++) + { + if (ai[l][i1] == i && (ai1[l][i1] == j || j == -1)) + { + k++; + } + } + } - return k; - } + return k; + } } diff --git a/mods/tinker/tconstruct/blocks/GolemPedestalBlock.java b/mods/tinker/tconstruct/blocks/GolemPedestalBlock.java index 4d8af1f5..3020d936 100644 --- a/mods/tinker/tconstruct/blocks/GolemPedestalBlock.java +++ b/mods/tinker/tconstruct/blocks/GolemPedestalBlock.java @@ -59,14 +59,13 @@ public class GolemPedestalBlock extends InventoryBlock world.setBlockMetadata(i, j, k, itemstack.getItemDamage()); }*/ - public void onBlockRemoval(World world, int i, int j, int k) + public void onBlockRemoval (World world, int i, int j, int k) { Random random = new Random(); - GolemPedestalLogic tileentitygolempedestal = (GolemPedestalLogic)world.getBlockTileEntity(i, j, k); + GolemPedestalLogic tileentitygolempedestal = (GolemPedestalLogic) world.getBlockTileEntity(i, j, k); if (tileentitygolempedestal != null) { - label0: - for (int l = 0; l < tileentitygolempedestal.getSizeInventory(); l++) + label0: for (int l = 0; l < tileentitygolempedestal.getSizeInventory(); l++) { ItemStack itemstack = tileentitygolempedestal.getStackInSlot(l); if (itemstack == null) @@ -88,20 +87,19 @@ public class GolemPedestalBlock extends InventoryBlock i1 = itemstack.stackSize; } itemstack.stackSize -= i1; - EntityItem entityitem = new EntityItem(world, (float)i + f, (float)j + f1, (float)k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage())); + EntityItem entityitem = new EntityItem(world, (float) i + f, (float) j + f1, (float) k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getItemDamage())); float f3 = 0.05F; - entityitem.motionX = (float)random.nextGaussian() * f3; - entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F; - entityitem.motionZ = (float)random.nextGaussian() * f3; + entityitem.motionX = (float) random.nextGaussian() * f3; + entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) random.nextGaussian() * f3; world.spawnEntityInWorld(entityitem); - } - while (true); + } while (true); } } //super.onBlockRemoval(world, i, j, k); } - public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer) + public boolean blockActivated (World world, int i, int j, int k, EntityPlayer entityplayer) { /*ItemStack itemstack = entityplayer.getCurrentEquippedItem(); if (world.isRemote) @@ -117,31 +115,31 @@ public class GolemPedestalBlock extends InventoryBlock { return false; }*/ - return false; + return false; } - @Override - public TileEntity createTileEntity (World world, int metadata) - { + @Override + public TileEntity createTileEntity (World world, int metadata) + { return new GolemPedestalLogic(); - } + } - @Override - public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) - { - // TODO Auto-generated method stub - return null; - } + @Override + public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) + { + // TODO Auto-generated method stub + return null; + } - @Override - public Object getModInstance () - { - return null; - } + @Override + public Object getModInstance () + { + return null; + } - @Override - public String[] getTextureNames () - { - return null; - } + @Override + public String[] getTextureNames () + { + return null; + } } diff --git a/mods/tinker/tconstruct/blocks/GravelOre.java b/mods/tinker/tconstruct/blocks/GravelOre.java index 1551a21b..5d06f575 100644 --- a/mods/tinker/tconstruct/blocks/GravelOre.java +++ b/mods/tinker/tconstruct/blocks/GravelOre.java @@ -17,56 +17,55 @@ public class GravelOre extends BlockSand { public String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt" }; public Icon[] icons; - - public GravelOre(int id) - { - super(id, Material.craftedSnow); + + public GravelOre(int id) + { + super(id, Material.craftedSnow); this.setCreativeTab(TConstructRegistry.blockTab); this.setStepSound(soundGravelFootstep); - } - - public void registerIcons(IconRegister iconRegister) + } + + public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:ore_"+textureNames[i]+"_gravel"); + this.icons[i] = iconRegister.registerIcon("tinker:ore_" + textureNames[i] + "_gravel"); } } - + @Override public Icon getIcon (int side, int meta) { return icons[meta]; } + public float getBlockHardness (World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta == 5) + return 10f; + else + return 3f; + } - public float getBlockHardness (World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta == 5) - return 10f; - else - return 3f; - } - - @Override + @Override public int damageDropped (int meta) { - /*if (meta == 1) - return 0;*/ + /*if (meta == 1) + return 0;*/ return meta; } - - public int idDropped(int par1, Random par2Random, int par3) + + public int idDropped (int par1, Random par2Random, int par3) { - /*if (par1 == 1) - return Item.goldNugget.itemID;*/ + /*if (par1 == 1) + return Item.goldNugget.itemID;*/ return this.blockID; } - - @Override + + @Override public void getSubBlocks (int id, CreativeTabs tab, List list) { for (int iter = 0; iter < 6; iter++) diff --git a/mods/tinker/tconstruct/blocks/LavaTankBlock.java b/mods/tinker/tconstruct/blocks/LavaTankBlock.java index 239877a9..30d11ac8 100644 --- a/mods/tinker/tconstruct/blocks/LavaTankBlock.java +++ b/mods/tinker/tconstruct/blocks/LavaTankBlock.java @@ -52,7 +52,7 @@ public class LavaTankBlock extends BlockContainer this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); } } - + @Override public int getRenderBlockPass () { diff --git a/mods/tinker/tconstruct/blocks/LightCrystalBase.java b/mods/tinker/tconstruct/blocks/LightCrystalBase.java index c1a874b5..87c8ecf8 100644 --- a/mods/tinker/tconstruct/blocks/LightCrystalBase.java +++ b/mods/tinker/tconstruct/blocks/LightCrystalBase.java @@ -1,4 +1,3 @@ - package mods.tinker.tconstruct.blocks; import java.util.List; @@ -94,11 +93,11 @@ public class LightCrystalBase extends Block TheftValueTracker.updateCrystallinity(world.provider.dimensionId, x, z, -60); break; } - - Block block = Block.blocksList[world.getBlockId(x, y-1, z)]; + + Block block = Block.blocksList[world.getBlockId(x, y - 1, z)]; if (block == TContent.aggregator) { - ((Aggregator)block).updateCrystalValue(world, x, y-1, z); + ((Aggregator) block).updateCrystalValue(world, x, y - 1, z); } } } diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java index d21d9185..b2f7c9c2 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java @@ -10,319 +10,318 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.liquids.ILiquid; -public class LiquidMetalFlowing extends LiquidMetalBase - implements ILiquid +public class LiquidMetalFlowing extends LiquidMetalBase implements ILiquid { - boolean isOptimalFlowDirection[] = new boolean[4]; - int flowCost[] = new int[4]; + boolean isOptimalFlowDirection[] = new boolean[4]; + int flowCost[] = new int[4]; - public LiquidMetalFlowing(int id) - { - super(id, TContent.liquidMetal); - } - - /*@Override - public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + public LiquidMetalFlowing(int id) { - LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(x, y, z); - return logic.getTexturePos() + 1; + super(id, TContent.liquidMetal); + } + + /*@Override + public int getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + { + LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(x, y, z); + return logic.getTexturePos() + 1; }*/ - private void updateFlow (World world, int x, int y, int z) - { - //System.out.println("x: "+x+", y: "+y+", z: "+z); - int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); - int meta = world.getBlockMetadata(x, y, z); - world.setBlock(x, y, z, stillLiquidId(), meta, 3); - world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); - world.markBlockForUpdate(x, y, z); - ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); - } + private void updateFlow (World world, int x, int y, int z) + { + //System.out.println("x: "+x+", y: "+y+", z: "+z); + int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); + int meta = world.getBlockMetadata(x, y, z); + world.setBlock(x, y, z, stillLiquidId(), meta, 3); + world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); + world.markBlockForUpdate(x, y, z); + ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); + } - @Override - public void updateTick (World world, int x, int y, int z, Random random) - { - //System.out.println("x: "+x+", y: "+y+", z: "+z); - int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); - int flow = getFlowDecay(world, x, y, z); - byte byte0 = 1; - boolean flag = true; - if (flow > 0) - { - int i1 = -100; - i1 = getSmallestFlowDecay(world, x - 1, y, z, i1); - i1 = getSmallestFlowDecay(world, x + 1, y, z, i1); - i1 = getSmallestFlowDecay(world, x, y, z - 1, i1); - i1 = getSmallestFlowDecay(world, x, y, z + 1, i1); - int j1 = i1 + byte0; - if (j1 >= 8 || i1 < 0) - { - j1 = -1; - } - if (getFlowDecay(world, x, y + 1, z) >= 0) - { - int l1 = getFlowDecay(world, x, y + 1, z); - if (l1 >= 8) - { - j1 = l1; - } - else - { - j1 = l1 + 8; - } - } - if (j1 != flow) - { - flow = j1; - if (flow < 0) - { - world.setBlockToAir(x, y, z); - } - else - { - world.setBlockMetadataWithNotify(x, y, z, flow, 2); - world.scheduleBlockUpdate(x, y, z, blockID, tickRate()); - world.notifyBlocksOfNeighborChange(x, y, z, blockID); - } - } - else if (flag) - { - updateFlow(world, x, y, z); - } - } - else - { - updateFlow(world, x, y, z); - } - if (liquidCanDisplaceBlock(world, x, y - 1, z)) - { - if (flow >= 8) - { - world.setBlock(x, y - 1, z, blockID, flow, 3); - } - else - { - world.setBlock(x, y - 1, z, blockID, flow + 8, 3); - } - ((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setLiquidType(tex); - } - else if (flow >= 0 && (flow == 0 || blockBlocksFlow(world, x, y - 1, z))) - { - boolean aflag[] = getOptimalFlowDirections(world, x, y, z); - int k1 = flow + byte0; - if (flow >= 8) - { - k1 = 1; - } - if (k1 >= 8) - return; - if (aflag[0]) - { - flowIntoBlock(world, x - 1, y, z, k1, tex); - } - if (aflag[1]) - { - flowIntoBlock(world, x + 1, y, z, k1, tex); - } - if (aflag[2]) - { - flowIntoBlock(world, x, y, z - 1, k1, tex); - } - if (aflag[3]) - { - flowIntoBlock(world, x, y, z + 1, k1, tex); - } - } - } + @Override + public void updateTick (World world, int x, int y, int z, Random random) + { + //System.out.println("x: "+x+", y: "+y+", z: "+z); + int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); + int flow = getFlowDecay(world, x, y, z); + byte byte0 = 1; + boolean flag = true; + if (flow > 0) + { + int i1 = -100; + i1 = getSmallestFlowDecay(world, x - 1, y, z, i1); + i1 = getSmallestFlowDecay(world, x + 1, y, z, i1); + i1 = getSmallestFlowDecay(world, x, y, z - 1, i1); + i1 = getSmallestFlowDecay(world, x, y, z + 1, i1); + int j1 = i1 + byte0; + if (j1 >= 8 || i1 < 0) + { + j1 = -1; + } + if (getFlowDecay(world, x, y + 1, z) >= 0) + { + int l1 = getFlowDecay(world, x, y + 1, z); + if (l1 >= 8) + { + j1 = l1; + } + else + { + j1 = l1 + 8; + } + } + if (j1 != flow) + { + flow = j1; + if (flow < 0) + { + world.setBlockToAir(x, y, z); + } + else + { + world.setBlockMetadataWithNotify(x, y, z, flow, 2); + world.scheduleBlockUpdate(x, y, z, blockID, tickRate()); + world.notifyBlocksOfNeighborChange(x, y, z, blockID); + } + } + else if (flag) + { + updateFlow(world, x, y, z); + } + } + else + { + updateFlow(world, x, y, z); + } + if (liquidCanDisplaceBlock(world, x, y - 1, z)) + { + if (flow >= 8) + { + world.setBlock(x, y - 1, z, blockID, flow, 3); + } + else + { + world.setBlock(x, y - 1, z, blockID, flow + 8, 3); + } + ((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setLiquidType(tex); + } + else if (flow >= 0 && (flow == 0 || blockBlocksFlow(world, x, y - 1, z))) + { + boolean aflag[] = getOptimalFlowDirections(world, x, y, z); + int k1 = flow + byte0; + if (flow >= 8) + { + k1 = 1; + } + if (k1 >= 8) + return; + if (aflag[0]) + { + flowIntoBlock(world, x - 1, y, z, k1, tex); + } + if (aflag[1]) + { + flowIntoBlock(world, x + 1, y, z, k1, tex); + } + if (aflag[2]) + { + flowIntoBlock(world, x, y, z - 1, k1, tex); + } + if (aflag[3]) + { + flowIntoBlock(world, x, y, z + 1, k1, tex); + } + } + } - private void flowIntoBlock (World world, int x, int y, int z, int meta, int tex) - { - if (liquidCanDisplaceBlock(world, x, y, z)) - { - int bID = world.getBlockId(x, y, z); - if (bID > 0) - { - Block.blocksList[bID].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); - } - world.setBlock(x, y, z, blockID, meta, 3); + private void flowIntoBlock (World world, int x, int y, int z, int meta, int tex) + { + if (liquidCanDisplaceBlock(world, x, y, z)) + { + int bID = world.getBlockId(x, y, z); + if (bID > 0) + { + Block.blocksList[bID].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + } + world.setBlock(x, y, z, blockID, meta, 3); - ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); - } - } + ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); + } + } - private int calculateFlowCost (World world, int x, int y, int z, int l, int i1) - { - int j1 = 1000; - for (int k1 = 0; k1 < 4; k1++) - { - if (k1 == 0 && i1 == 1 || k1 == 1 && i1 == 0 || k1 == 2 && i1 == 3 || k1 == 3 && i1 == 2) - { - continue; - } - int posX = x; - int posY = y; - int posZ = z; - if (k1 == 0) - { - posX--; - } - if (k1 == 1) - { - posX++; - } - if (k1 == 2) - { - posZ--; - } - if (k1 == 3) - { - posZ++; - } - if (blockBlocksFlow(world, posX, posY, posZ) || world.getBlockMaterial(posX, posY, posZ) == blockMaterial && world.getBlockMetadata(posX, posY, posZ) == 0) - { - continue; - } - if (!blockBlocksFlow(world, posX, posY - 1, posZ)) - return l; - if (l >= 4) - { - continue; - } - int k2 = calculateFlowCost(world, posX, posY, posZ, l + 1, k1); - if (k2 < j1) - { - j1 = k2; - } - } + private int calculateFlowCost (World world, int x, int y, int z, int l, int i1) + { + int j1 = 1000; + for (int k1 = 0; k1 < 4; k1++) + { + if (k1 == 0 && i1 == 1 || k1 == 1 && i1 == 0 || k1 == 2 && i1 == 3 || k1 == 3 && i1 == 2) + { + continue; + } + int posX = x; + int posY = y; + int posZ = z; + if (k1 == 0) + { + posX--; + } + if (k1 == 1) + { + posX++; + } + if (k1 == 2) + { + posZ--; + } + if (k1 == 3) + { + posZ++; + } + if (blockBlocksFlow(world, posX, posY, posZ) || world.getBlockMaterial(posX, posY, posZ) == blockMaterial && world.getBlockMetadata(posX, posY, posZ) == 0) + { + continue; + } + if (!blockBlocksFlow(world, posX, posY - 1, posZ)) + return l; + if (l >= 4) + { + continue; + } + int k2 = calculateFlowCost(world, posX, posY, posZ, l + 1, k1); + if (k2 < j1) + { + j1 = k2; + } + } - return j1; - } + return j1; + } - private boolean[] getOptimalFlowDirections (World world, int x, int y, int z) - { - for (int iter = 0; iter < 4; iter++) - { - flowCost[iter] = 1000; - int posX = x; - int posY = y; - int posZ = z; - if (iter == 0) - { - posX--; - } - if (iter == 1) - { - posX++; - } - if (iter == 2) - { - posZ--; - } - if (iter == 3) - { - posZ++; - } - if (blockBlocksFlow(world, posX, posY, posZ) || world.getBlockMaterial(posX, posY, posZ) == blockMaterial && world.getBlockMetadata(posX, posY, posZ) == 0) - { - continue; - } - if (!blockBlocksFlow(world, posX, posY - 1, posZ)) - { - flowCost[iter] = 0; - } - else - { - flowCost[iter] = calculateFlowCost(world, posX, posY, posZ, 1, iter); - } - } + private boolean[] getOptimalFlowDirections (World world, int x, int y, int z) + { + for (int iter = 0; iter < 4; iter++) + { + flowCost[iter] = 1000; + int posX = x; + int posY = y; + int posZ = z; + if (iter == 0) + { + posX--; + } + if (iter == 1) + { + posX++; + } + if (iter == 2) + { + posZ--; + } + if (iter == 3) + { + posZ++; + } + if (blockBlocksFlow(world, posX, posY, posZ) || world.getBlockMaterial(posX, posY, posZ) == blockMaterial && world.getBlockMetadata(posX, posY, posZ) == 0) + { + continue; + } + if (!blockBlocksFlow(world, posX, posY - 1, posZ)) + { + flowCost[iter] = 0; + } + else + { + flowCost[iter] = calculateFlowCost(world, posX, posY, posZ, 1, iter); + } + } - int cost = flowCost[0]; - for (int k1 = 1; k1 < 4; k1++) - { - if (flowCost[k1] < cost) - { - cost = flowCost[k1]; - } - } + int cost = flowCost[0]; + for (int k1 = 1; k1 < 4; k1++) + { + if (flowCost[k1] < cost) + { + cost = flowCost[k1]; + } + } - for (int l1 = 0; l1 < 4; l1++) - { - isOptimalFlowDirection[l1] = flowCost[l1] == cost; - } + for (int l1 = 0; l1 < 4; l1++) + { + isOptimalFlowDirection[l1] = flowCost[l1] == cost; + } - return isOptimalFlowDirection; - } + return isOptimalFlowDirection; + } - private boolean blockBlocksFlow (World world, int x, int y, int z) - { - int l = world.getBlockId(x, y, z); - if (l == Block.doorWood.blockID || l == Block.doorIron.blockID || l == Block.signPost.blockID || l == Block.ladder.blockID || l == Block.reed.blockID) - return true; - if (l == 0) - return false; - Material material = Block.blocksList[l].blockMaterial; - return material.isSolid(); - } + private boolean blockBlocksFlow (World world, int x, int y, int z) + { + int l = world.getBlockId(x, y, z); + if (l == Block.doorWood.blockID || l == Block.doorIron.blockID || l == Block.signPost.blockID || l == Block.ladder.blockID || l == Block.reed.blockID) + return true; + if (l == 0) + return false; + Material material = Block.blocksList[l].blockMaterial; + return material.isSolid(); + } - protected int getSmallestFlowDecay (World world, int x, int y, int z, int l) - { - int i1 = getFlowDecay(world, x, y, z); - if (i1 < 0) - return l; - if (i1 >= 8) - { - i1 = 0; - } - return l >= 0 && i1 >= l ? l : i1; - } + protected int getSmallestFlowDecay (World world, int x, int y, int z, int l) + { + int i1 = getFlowDecay(world, x, y, z); + if (i1 < 0) + return l; + if (i1 >= 8) + { + i1 = 0; + } + return l >= 0 && i1 >= l ? l : i1; + } - private boolean liquidCanDisplaceBlock (World world, int x, int y, int z) - { - Material material = world.getBlockMaterial(x, y, z); - if (material == blockMaterial) - return false; - else - return !blockBlocksFlow(world, x, y, z); - } + private boolean liquidCanDisplaceBlock (World world, int x, int y, int z) + { + Material material = world.getBlockMaterial(x, y, z); + if (material == blockMaterial) + return false; + else + return !blockBlocksFlow(world, x, y, z); + } - @Override - public void onBlockAdded (World world, int x, int y, int z) - { - //System.out.println("x: "+x+", y: "+y+", z: "+z); - super.onBlockAdded(world, x, y, z); - if (world.getBlockId(x, y, z) == blockID) - { - world.scheduleBlockUpdate(x, y, z, blockID, tickRate()); - } - } + @Override + public void onBlockAdded (World world, int x, int y, int z) + { + //System.out.println("x: "+x+", y: "+y+", z: "+z); + super.onBlockAdded(world, x, y, z); + if (world.getBlockId(x, y, z) == blockID) + { + world.scheduleBlockUpdate(x, y, z, blockID, tickRate()); + } + } - @Override - public int stillLiquidMeta () - { - return 0; - } - - @Override - public boolean isMetaSensitive () - { - return false; - } + @Override + public int stillLiquidMeta () + { + return 0; + } - @Override - public int stillLiquidId () - { - return TContent.liquidMetalStill.blockID; - } - - @Override - public boolean hasTileEntity(int metadata) + @Override + public boolean isMetaSensitive () + { + return false; + } + + @Override + public int stillLiquidId () + { + return TContent.liquidMetalStill.blockID; + } + + @Override + public boolean hasTileEntity (int metadata) { return true; } - - @Override - public TileEntity createTileEntity(World world, int metadata) + + @Override + public TileEntity createTileEntity (World world, int metadata) { - return new LiquidTextureLogic(); + return new LiquidTextureLogic(); } } diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java index 6f32fb06..395b740e 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java @@ -13,195 +13,197 @@ import net.minecraftforge.liquids.ILiquid; public class LiquidMetalStill extends LiquidMetalBase implements ILiquid { - public LiquidMetalStill(int id) - { - super(id, TContent.liquidMetal); - //this.setCreativeTab(TConstruct.blockTab); - } + public LiquidMetalStill(int id) + { + super(id, TContent.liquidMetal); + //this.setCreativeTab(TConstruct.blockTab); + } - @Override - public int stillLiquidId () - { - return this.blockID; - } + @Override + public int stillLiquidId () + { + return this.blockID; + } - public int flowingLiquidID () - { - return TContent.liquidMetalFlowing.blockID; - } + public int flowingLiquidID () + { + return TContent.liquidMetalFlowing.blockID; + } - @Override - public boolean isMetaSensitive () - { - return false; - } + @Override + public boolean isMetaSensitive () + { + return false; + } - @Override - public int stillLiquidMeta () - { - return 0; - } + @Override + public int stillLiquidMeta () + { + return 0; + } - public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random) - { - int var6 = par5Random.nextInt(3); - int var7; - int var8; + public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random) + { + int var6 = par5Random.nextInt(3); + int var7; + int var8; - for (var7 = 0; var7 < var6; ++var7) - { - par2 += par5Random.nextInt(3) - 1; - ++par3; - par4 += par5Random.nextInt(3) - 1; - var8 = par1World.getBlockId(par2, par3, par4); + for (var7 = 0; var7 < var6; ++var7) + { + par2 += par5Random.nextInt(3) - 1; + ++par3; + par4 += par5Random.nextInt(3) - 1; + var8 = par1World.getBlockId(par2, par3, par4); - if (var8 == 0) - { - if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4)) - { - par1World.setBlock(par2, par3, par4, Block.fire.blockID); - return; - } - } - else if (Block.blocksList[var8].blockMaterial.blocksMovement()) - { - return; - } - } + if (var8 == 0) + { + if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) + || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4)) + { + par1World.setBlock(par2, par3, par4, Block.fire.blockID); + return; + } + } + else if (Block.blocksList[var8].blockMaterial.blocksMovement()) + { + return; + } + } - if (var6 == 0) - { - var7 = par2; - var8 = par4; + if (var6 == 0) + { + var7 = par2; + var8 = par4; - for (int var9 = 0; var9 < 3; ++var9) - { - par2 = var7 + par5Random.nextInt(3) - 1; - par4 = var8 + par5Random.nextInt(3) - 1; + for (int var9 = 0; var9 < 3; ++var9) + { + par2 = var7 + par5Random.nextInt(3) - 1; + par4 = var8 + par5Random.nextInt(3) - 1; - if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4)) - { - par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID); - } - } - } + if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4)) + { + par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID); + } + } + } - } + } - @Override - public boolean isBlockReplaceable (World world, int i, int j, int k) - { - return true; - } + @Override + public boolean isBlockReplaceable (World world, int i, int j, int k) + { + return true; + } - @Override - public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5) - { - this.tryToHarden(par1World, par2, par3, par4); + @Override + public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5) + { + this.tryToHarden(par1World, par2, par3, par4); - if (par1World.getBlockId(par2, par3, par4) == this.blockID) - { - this.unsetStationary(par1World, par2, par3, par4); - } - } + if (par1World.getBlockId(par2, par3, par4) == this.blockID) + { + this.unsetStationary(par1World, par2, par3, par4); + } + } - private void tryToHarden (World par1World, int par2, int par3, int par4) - { - if (par1World.getBlockId(par2, par3, par4) == this.blockID) - { - if (this.blockMaterial == Material.lava) - { - boolean var5 = false; + private void tryToHarden (World par1World, int par2, int par3, int par4) + { + if (par1World.getBlockId(par2, par3, par4) == this.blockID) + { + if (this.blockMaterial == Material.lava) + { + boolean var5 = false; - if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water) - { - var5 = true; - } + if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water) + { + var5 = true; + } - if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water) - { - var5 = true; - } + if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water) + { + var5 = true; + } - if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water) - { - var5 = true; - } + if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water) + { + var5 = true; + } - if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water) - { - var5 = true; - } + if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water) + { + var5 = true; + } - if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water) - { - var5 = true; - } + if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water) + { + var5 = true; + } - if (var5) - { - /*int var6 = par1World.getBlockMetadata(par2, par3, par4); + if (var5) + { + /*int var6 = par1World.getBlockMetadata(par2, par3, par4); - if (var6 == 0) - { - par1World.setBlock(par2, par3, par4, Block.obsidian.blockID); - } - else if (var6 <= 4) - { - par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID); - }*/ + if (var6 == 0) + { + par1World.setBlock(par2, par3, par4, Block.obsidian.blockID); + } + else if (var6 <= 4) + { + par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID); + }*/ - this.triggerLavaMixEffects(par1World, par2, par3, par4); - } - } - } - } + this.triggerLavaMixEffects(par1World, par2, par3, par4); + } + } + } + } - /** - * Creates fizzing sound and smoke. Used when lava flows over block or mixes with water. - */ - protected void triggerLavaMixEffects (World par1World, int par2, int par3, int par4) - { - par1World.playSoundEffect((double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); + /** + * Creates fizzing sound and smoke. Used when lava flows over block or mixes with water. + */ + protected void triggerLavaMixEffects (World par1World, int par2, int par3, int par4) + { + par1World.playSoundEffect((double) ((float) par2 + 0.5F), (double) ((float) par3 + 0.5F), (double) ((float) par4 + 0.5F), "random.fizz", 0.5F, + 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); - for (int var5 = 0; var5 < 8; ++var5) - { - par1World.spawnParticle("largesmoke", (double) par2 + Math.random(), (double) par3 + 1.2D, (double) par4 + Math.random(), 0.0D, 0.0D, 0.0D); - } - } + for (int var5 = 0; var5 < 8; ++var5) + { + par1World.spawnParticle("largesmoke", (double) par2 + Math.random(), (double) par3 + 1.2D, (double) par4 + Math.random(), 0.0D, 0.0D, 0.0D); + } + } - private void unsetStationary (World world, int x, int y, int z) - { - - int meta = world.getBlockMetadata(x, y, z); - int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); + private void unsetStationary (World world, int x, int y, int z) + { + + int meta = world.getBlockMetadata(x, y, z); + int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); world.setBlock(x, y, z, flowingLiquidID(), meta, 2); world.scheduleBlockUpdate(x, y, z, flowingLiquidID(), this.tickRate(world)); - ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); - } + ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); + } - public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { - return this.blockMaterial != Material.lava; - } + public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + return this.blockMaterial != Material.lava; + } - /** - * Checks to see if the block is flammable. - */ - private boolean isFlammable (World par1World, int par2, int par3, int par4) - { - return par1World.getBlockMaterial(par2, par3, par4).getCanBurn(); - } + /** + * Checks to see if the block is flammable. + */ + private boolean isFlammable (World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMaterial(par2, par3, par4).getCanBurn(); + } - @Override - public boolean hasTileEntity (int metadata) - { - return true; - } + @Override + public boolean hasTileEntity (int metadata) + { + return true; + } - @Override - public TileEntity createTileEntity (World world, int metadata) - { - return new LiquidTextureLogic(); - } + @Override + public TileEntity createTileEntity (World world, int metadata) + { + return new LiquidTextureLogic(); + } } diff --git a/mods/tinker/tconstruct/blocks/MetalOre.java b/mods/tinker/tconstruct/blocks/MetalOre.java index a9ec18d9..9292c0e1 100644 --- a/mods/tinker/tconstruct/blocks/MetalOre.java +++ b/mods/tinker/tconstruct/blocks/MetalOre.java @@ -9,22 +9,22 @@ import net.minecraft.world.World; public class MetalOre extends TConstructBlock { - public MetalOre(int id, Material material, float hardness, String[] tex) - { - super(id, material, hardness, tex); - } + public MetalOre(int id, Material material, float hardness, String[] tex) + { + super(id, material, hardness, tex); + } - public float getBlockHardness (World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta <= 2) - return 10f; - else - return 3f; - //return this.blockHardness; - } - - @Override + public float getBlockHardness (World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta <= 2) + return 10f; + else + return 3f; + //return this.blockHardness; + } + + @Override public void getSubBlocks (int id, CreativeTabs tab, List list) { for (int iter = 1; iter < 6; iter++) diff --git a/mods/tinker/tconstruct/blocks/MultiBrick.java b/mods/tinker/tconstruct/blocks/MultiBrick.java index 385f8111..760c179f 100644 --- a/mods/tinker/tconstruct/blocks/MultiBrick.java +++ b/mods/tinker/tconstruct/blocks/MultiBrick.java @@ -23,49 +23,79 @@ public class MultiBrick extends TConstructBlock } @Override - public float getBlockHardness(World world, int x, int y, int z) + public float getBlockHardness (World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return Block.obsidian.getBlockHardness(world, x, y, z); - case 1: return Block.sandStone.getBlockHardness(world, x, y, z); - case 2: return Block.netherrack.getBlockHardness(world, x, y, z); - case 3: return Block.stone.getBlockHardness(world, x, y, z); - case 4: return Block.blockIron.getBlockHardness(world, x, y, z); - case 5: return Block.blockGold.getBlockHardness(world, x, y, z); - case 6: return Block.blockLapis.getBlockHardness(world, x, y, z); - case 7: return Block.blockDiamond.getBlockHardness(world, x, y, z); - case 8: return Block.blockRedstone.getBlockHardness(world, x, y, z); - case 9: return 1.0F; - case 10: return 1.5F; - case 11: return 1.5F; - case 12: return Block.whiteStone.getBlockHardness(world, x, y, z); - case 13: return Block.obsidian.getBlockHardness(world, x, y, z); - default: return blockHardness; + case 0: + return Block.obsidian.getBlockHardness(world, x, y, z); + case 1: + return Block.sandStone.getBlockHardness(world, x, y, z); + case 2: + return Block.netherrack.getBlockHardness(world, x, y, z); + case 3: + return Block.stone.getBlockHardness(world, x, y, z); + case 4: + return Block.blockIron.getBlockHardness(world, x, y, z); + case 5: + return Block.blockGold.getBlockHardness(world, x, y, z); + case 6: + return Block.blockLapis.getBlockHardness(world, x, y, z); + case 7: + return Block.blockDiamond.getBlockHardness(world, x, y, z); + case 8: + return Block.blockRedstone.getBlockHardness(world, x, y, z); + case 9: + return 1.0F; + case 10: + return 1.5F; + case 11: + return 1.5F; + case 12: + return Block.whiteStone.getBlockHardness(world, x, y, z); + case 13: + return Block.obsidian.getBlockHardness(world, x, y, z); + default: + return blockHardness; } } - public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + public float getExplosionResistance (Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return Block.obsidian.getExplosionResistance(entity); - case 1: return Block.sandStone.getExplosionResistance(entity); - case 2: return Block.netherrack.getExplosionResistance(entity); - case 3: return Block.stone.getExplosionResistance(entity); - case 4: return Block.blockIron.getExplosionResistance(entity); - case 5: return Block.blockGold.getExplosionResistance(entity); - case 6: return Block.blockLapis.getExplosionResistance(entity); - case 7: return Block.blockDiamond.getExplosionResistance(entity); - case 8: return Block.blockRedstone.getExplosionResistance(entity); - case 9: return 1.0F; - case 10: return 1.5F; - case 11: return 1.5F; - case 12: return Block.whiteStone.getExplosionResistance(entity); - case 13: return Block.obsidian.getExplosionResistance(entity); - default: return getExplosionResistance(entity); + case 0: + return Block.obsidian.getExplosionResistance(entity); + case 1: + return Block.sandStone.getExplosionResistance(entity); + case 2: + return Block.netherrack.getExplosionResistance(entity); + case 3: + return Block.stone.getExplosionResistance(entity); + case 4: + return Block.blockIron.getExplosionResistance(entity); + case 5: + return Block.blockGold.getExplosionResistance(entity); + case 6: + return Block.blockLapis.getExplosionResistance(entity); + case 7: + return Block.blockDiamond.getExplosionResistance(entity); + case 8: + return Block.blockRedstone.getExplosionResistance(entity); + case 9: + return 1.0F; + case 10: + return 1.5F; + case 11: + return 1.5F; + case 12: + return Block.whiteStone.getExplosionResistance(entity); + case 13: + return Block.obsidian.getExplosionResistance(entity); + default: + return getExplosionResistance(entity); } } @@ -89,27 +119,27 @@ public class MultiBrick extends TConstructBlock return AxisAlignedBB.getBoundingBox(x, y, z, (double) x + 1.0D, (double) y + 0.625D, (double) z + 1.0D); return super.getCollisionBoundingBoxFromPool(world, x, y, z); } - + /*@Override public int getRenderType () { return BrickRender.model; }*/ - + @Override - public boolean isBlockNormalCube(World world, int x, int y, int z) + public boolean isBlockNormalCube (World world, int x, int y, int z) { return world.getBlockMetadata(x, y, z) != 8; } - + @Override - public boolean canProvidePower() + public boolean canProvidePower () { return true; } - + @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) + public int isProvidingWeakPower (IBlockAccess world, int x, int y, int z, int side) { if (world.getBlockMetadata(x, y, z) == 8) return 4; diff --git a/mods/tinker/tconstruct/blocks/MultiBrickFancy.java b/mods/tinker/tconstruct/blocks/MultiBrickFancy.java index 40e5c7e4..1026295b 100644 --- a/mods/tinker/tconstruct/blocks/MultiBrickFancy.java +++ b/mods/tinker/tconstruct/blocks/MultiBrickFancy.java @@ -14,8 +14,9 @@ import cpw.mods.fml.relauncher.SideOnly; public class MultiBrickFancy extends TConstructBlock { - static String blockTextures[] = { "fancybrick_obsidian", "fancybrick_sandstone", "fancybrick_netherrack", "fancybrick_stone_refined", "fancybrick_iron", "fancybrick_gold", "fancybrick_lapis", "fancybrick_diamond", "fancybrick_redstone", - "fancybrick_bone", "fancybrick_slime", "fancybrick_blueslime", "fancybrick_endstone", "fancybrick_obsidian_ingot", "fancybrick_stone", "road_stone" }; + static String blockTextures[] = { "fancybrick_obsidian", "fancybrick_sandstone", "fancybrick_netherrack", "fancybrick_stone_refined", "fancybrick_iron", "fancybrick_gold", "fancybrick_lapis", + "fancybrick_diamond", "fancybrick_redstone", "fancybrick_bone", "fancybrick_slime", "fancybrick_blueslime", "fancybrick_endstone", "fancybrick_obsidian_ingot", "fancybrick_stone", + "road_stone" }; public MultiBrickFancy(int id) { @@ -23,55 +24,83 @@ public class MultiBrickFancy extends TConstructBlock } @Override - public float getBlockHardness(World world, int x, int y, int z) + public float getBlockHardness (World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return Block.obsidian.getBlockHardness(world, x, y, z); - case 1: return Block.sandStone.getBlockHardness(world, x, y, z); - case 2: return Block.netherrack.getBlockHardness(world, x, y, z); - case 4: return Block.blockIron.getBlockHardness(world, x, y, z); - case 5: return Block.blockGold.getBlockHardness(world, x, y, z); - case 6: return Block.blockLapis.getBlockHardness(world, x, y, z); - case 7: return Block.blockDiamond.getBlockHardness(world, x, y, z); - case 8: return Block.blockRedstone.getBlockHardness(world, x, y, z); - case 9: return 1.0F; - case 10: return 1.5F; - case 11: return 1.5F; - case 12: return Block.whiteStone.getBlockHardness(world, x, y, z); - case 13: return Block.obsidian.getBlockHardness(world, x, y, z); - case 3: + case 0: + return Block.obsidian.getBlockHardness(world, x, y, z); + case 1: + return Block.sandStone.getBlockHardness(world, x, y, z); + case 2: + return Block.netherrack.getBlockHardness(world, x, y, z); + case 4: + return Block.blockIron.getBlockHardness(world, x, y, z); + case 5: + return Block.blockGold.getBlockHardness(world, x, y, z); + case 6: + return Block.blockLapis.getBlockHardness(world, x, y, z); + case 7: + return Block.blockDiamond.getBlockHardness(world, x, y, z); + case 8: + return Block.blockRedstone.getBlockHardness(world, x, y, z); + case 9: + return 1.0F; + case 10: + return 1.5F; + case 11: + return 1.5F; + case 12: + return Block.whiteStone.getBlockHardness(world, x, y, z); + case 13: + return Block.obsidian.getBlockHardness(world, x, y, z); + case 3: case 14: case 15: return Block.stone.getBlockHardness(world, x, y, z); - default: return blockHardness; + default: + return blockHardness; } } - public float getExplosionResistance(Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) + public float getExplosionResistance (Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return Block.obsidian.getExplosionResistance(entity); - case 1: return Block.sandStone.getExplosionResistance(entity); - case 2: return Block.netherrack.getExplosionResistance(entity); - case 4: return Block.blockIron.getExplosionResistance(entity); - case 5: return Block.blockGold.getExplosionResistance(entity); - case 6: return Block.blockLapis.getExplosionResistance(entity); - case 7: return Block.blockDiamond.getExplosionResistance(entity); - case 8: return Block.blockRedstone.getExplosionResistance(entity); - case 9: return 1.0F; - case 10: return 1.5F; - case 11: return 1.5F; - case 12: return Block.whiteStone.getExplosionResistance(entity); - case 13: return Block.obsidian.getExplosionResistance(entity); - case 3: + case 0: + return Block.obsidian.getExplosionResistance(entity); + case 1: + return Block.sandStone.getExplosionResistance(entity); + case 2: + return Block.netherrack.getExplosionResistance(entity); + case 4: + return Block.blockIron.getExplosionResistance(entity); + case 5: + return Block.blockGold.getExplosionResistance(entity); + case 6: + return Block.blockLapis.getExplosionResistance(entity); + case 7: + return Block.blockDiamond.getExplosionResistance(entity); + case 8: + return Block.blockRedstone.getExplosionResistance(entity); + case 9: + return 1.0F; + case 10: + return 1.5F; + case 11: + return 1.5F; + case 12: + return Block.whiteStone.getExplosionResistance(entity); + case 13: + return Block.obsidian.getExplosionResistance(entity); + case 3: case 14: case 15: return Block.stone.getExplosionResistance(entity); - default: return getExplosionResistance(entity); + default: + return getExplosionResistance(entity); } } @@ -95,27 +124,27 @@ public class MultiBrickFancy extends TConstructBlock return AxisAlignedBB.getBoundingBox(x, y, z, (double) x + 1.0D, (double) y + 0.625D, (double) z + 1.0D); return super.getCollisionBoundingBoxFromPool(world, x, y, z); } - + /*@Override public int getRenderType () { return BrickRender.model; }*/ - + @Override - public boolean isBlockNormalCube(World world, int x, int y, int z) + public boolean isBlockNormalCube (World world, int x, int y, int z) { return world.getBlockMetadata(x, y, z) != 8; } - + @Override - public boolean canProvidePower() + public boolean canProvidePower () { return false; } - + @Override - public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) + public int isProvidingWeakPower (IBlockAccess world, int x, int y, int z, int side) { if (world.getBlockMetadata(x, y, z) == 8) return 4; diff --git a/mods/tinker/tconstruct/blocks/OreberryBush.java b/mods/tinker/tconstruct/blocks/OreberryBush.java index dae91d32..623f7db9 100644 --- a/mods/tinker/tconstruct/blocks/OreberryBush.java +++ b/mods/tinker/tconstruct/blocks/OreberryBush.java @@ -29,321 +29,321 @@ import cpw.mods.fml.relauncher.SideOnly; public class OreberryBush extends BlockLeavesBase implements IPlantable { - Random random; - public Icon[] fastIcons; - public Icon[] fancyIcons; - public String[] textureNames; - public String[] oreTypes; - public int itemMeat; - private int subitems; + Random random; + public Icon[] fastIcons; + public Icon[] fancyIcons; + public String[] textureNames; + public String[] oreTypes; + public int itemMeat; + private int subitems; - public OreberryBush(int id, String[] textureNames, int meta, int sub, String[] oreTypes) - { - super(id, Material.leaves, false); - this.textureNames = textureNames; - this.itemMeat = meta; - this.subitems = sub; - this.oreTypes = oreTypes; - this.setTickRandomly(true); - random = new Random(); - this.setHardness(0.3F); - this.setStepSound(Block.soundMetalFootstep); - this.setCreativeTab(TConstructRegistry.blockTab); - } + public OreberryBush(int id, String[] textureNames, int meta, int sub, String[] oreTypes) + { + super(id, Material.leaves, false); + this.textureNames = textureNames; + this.itemMeat = meta; + this.subitems = sub; + this.oreTypes = oreTypes; + this.setTickRandomly(true); + random = new Random(); + this.setHardness(0.3F); + this.setStepSound(Block.soundMetalFootstep); + this.setCreativeTab(TConstructRegistry.blockTab); + } - /* Berries show up at meta 12-15 */ + /* Berries show up at meta 12-15 */ - @SideOnly(Side.CLIENT) - @Override - public void registerIcons (IconRegister iconRegister) - { - this.fastIcons = new Icon[textureNames.length]; - this.fancyIcons = new Icon[textureNames.length]; + @SideOnly(Side.CLIENT) + @Override + public void registerIcons (IconRegister iconRegister) + { + this.fastIcons = new Icon[textureNames.length]; + this.fancyIcons = new Icon[textureNames.length]; - for (int i = 0; i < this.fastIcons.length; i++) - { - if (textureNames[i] != "") - { - this.fastIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fast"); - this.fancyIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fancy"); - } - } - } + for (int i = 0; i < this.fastIcons.length; i++) + { + if (textureNames[i] != "") + { + this.fastIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fast"); + this.fancyIcons[i] = iconRegister.registerIcon("tinker:crops/" + textureNames[i] + "_fancy"); + } + } + } - @Override - public Icon getIcon (int side, int metadata) - { - if (graphicsLevel) - { - if (metadata < 12) - { - return fancyIcons[metadata % 4]; - } - else - { - return fancyIcons[metadata % 4 + 4]; - } - } - else - { - if (metadata < 12) - { - return fastIcons[metadata % 4]; - } - else - { - return fastIcons[metadata % 4 + 4]; - } - } - } + @Override + public Icon getIcon (int side, int metadata) + { + if (graphicsLevel) + { + if (metadata < 12) + { + return fancyIcons[metadata % 4]; + } + else + { + return fancyIcons[metadata % 4 + 4]; + } + } + else + { + if (metadata < 12) + { + return fastIcons[metadata % 4]; + } + else + { + return fastIcons[metadata % 4 + 4]; + } + } + } - /* Bushes are stored by size then type */ - @Override - public int damageDropped (int metadata) - { - return metadata % 4; - } + /* Bushes are stored by size then type */ + @Override + public int damageDropped (int metadata) + { + return metadata % 4; + } - /* The following methods define a berry bush's size depending on metadata */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) - { - int l = world.getBlockMetadata(x, y, z); - if (l < 4) - { - return AxisAlignedBB.getBoundingBox((double) x + 0.25D, y, (double) z + 0.25D, (double) x + 0.75D, (double) y + 0.5D, (double) z + 0.75D); - } - else if (l < 8) - { - return AxisAlignedBB.getBoundingBox((double) x + 0.125D, y, (double) z + 0.125D, (double) x + 0.875D, (double) y + 0.75D, (double) z + 0.875D); - } - else - { - return AxisAlignedBB.getBoundingBox(x + 0.0625, y, z + 0.0625, (double) x + 0.9375D, (double) y + 0.9375D, (double) z + 0.9375D); - } - } + /* The following methods define a berry bush's size depending on metadata */ + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) + { + int l = world.getBlockMetadata(x, y, z); + if (l < 4) + { + return AxisAlignedBB.getBoundingBox((double) x + 0.25D, y, (double) z + 0.25D, (double) x + 0.75D, (double) y + 0.5D, (double) z + 0.75D); + } + else if (l < 8) + { + return AxisAlignedBB.getBoundingBox((double) x + 0.125D, y, (double) z + 0.125D, (double) x + 0.875D, (double) y + 0.75D, (double) z + 0.875D); + } + else + { + return AxisAlignedBB.getBoundingBox(x + 0.0625, y, z + 0.0625, (double) x + 0.9375D, (double) y + 0.9375D, (double) z + 0.9375D); + } + } - public AxisAlignedBB getSelectedBoundingBoxFromPool (World world, int x, int y, int z) - { - int l = world.getBlockMetadata(x, y, z); - if (l < 4) - { - return AxisAlignedBB.getBoundingBox((double) x + 0.25D, y, (double) z + 0.25D, (double) x + 0.75D, (double) y + 0.5D, (double) z + 0.75D); - } - else if (l < 8) - { - return AxisAlignedBB.getBoundingBox((double) x + 0.125D, y, (double) z + 0.125D, (double) x + 0.875D, (double) y + 0.75D, (double) z + 0.875D); - } - else - { - return AxisAlignedBB.getBoundingBox(x, y, z, (double) x + 1.0D, (double) y + 1.0D, (double) z + 1.0D); - } - } + public AxisAlignedBB getSelectedBoundingBoxFromPool (World world, int x, int y, int z) + { + int l = world.getBlockMetadata(x, y, z); + if (l < 4) + { + return AxisAlignedBB.getBoundingBox((double) x + 0.25D, y, (double) z + 0.25D, (double) x + 0.75D, (double) y + 0.5D, (double) z + 0.75D); + } + else if (l < 8) + { + return AxisAlignedBB.getBoundingBox((double) x + 0.125D, y, (double) z + 0.125D, (double) x + 0.875D, (double) y + 0.75D, (double) z + 0.875D); + } + else + { + return AxisAlignedBB.getBoundingBox(x, y, z, (double) x + 1.0D, (double) y + 1.0D, (double) z + 1.0D); + } + } - @Override - public void setBlockBoundsBasedOnState (IBlockAccess iblockaccess, int x, int y, int z) - { - int md = iblockaccess.getBlockMetadata(x, y, z); + @Override + public void setBlockBoundsBasedOnState (IBlockAccess iblockaccess, int x, int y, int z) + { + int md = iblockaccess.getBlockMetadata(x, y, z); - float minX; - float minY = 0F; - float minZ; - float maxX; - float maxY; - float maxZ; + float minX; + float minY = 0F; + float minZ; + float maxX; + float maxY; + float maxZ; - if (md < 4) - { - minX = minZ = 0.25F; - maxX = maxZ = 0.75F; - maxY = 0.5F; - } - else + if (md < 4) + { + minX = minZ = 0.25F; + maxX = maxZ = 0.75F; + maxY = 0.5F; + } + else - if (md < 8) - { - minX = minZ = 0.125F; - maxX = maxZ = 0.875F; - maxY = 0.75F; - } + if (md < 8) + { + minX = minZ = 0.125F; + maxX = maxZ = 0.875F; + maxY = 0.75F; + } - else - { - minX = minZ = 0.0F; - maxX = maxZ = 1.0F; - maxY = 1.0F; - } - setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); - } + else + { + minX = minZ = 0.0F; + maxX = maxZ = 1.0F; + maxY = 1.0F; + } + setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ); + } - /* Left-click harvests berries */ - @Override - public void onBlockClicked (World world, int x, int y, int z, EntityPlayer player) - { - if (!world.isRemote) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta >= 12) - { - world.setBlock(x, y, z, blockID, meta - 4, 3); - AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat)); - } - } - } + /* Left-click harvests berries */ + @Override + public void onBlockClicked (World world, int x, int y, int z, EntityPlayer player) + { + if (!world.isRemote) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta >= 12) + { + world.setBlock(x, y, z, blockID, meta - 4, 3); + AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat)); + } + } + } - /* Right-click harvests berries */ - @Override - public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - /*if (world.isRemote) - return false;*/ + /* Right-click harvests berries */ + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + /*if (world.isRemote) + return false;*/ - int meta = world.getBlockMetadata(x, y, z); - if (meta >= 12) - { - if (world.isRemote) - return true; + int meta = world.getBlockMetadata(x, y, z); + if (meta >= 12) + { + if (world.isRemote) + return true; - world.setBlock(x, y, z, blockID, meta - 4, 3); - AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat)); - return true; - } + world.setBlock(x, y, z, blockID, meta - 4, 3); + AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.oreBerries, 1, meta % 4 + itemMeat)); + return true; + } - return false; - } + return false; + } - /* Render logic */ + /* Render logic */ - @Override - public boolean isOpaqueCube () - { - return false; - } + @Override + public boolean isOpaqueCube () + { + return false; + } - public void setGraphicsLevel (boolean flag) - { - graphicsLevel = flag; - } + public void setGraphicsLevel (boolean flag) + { + graphicsLevel = flag; + } - @Override - public boolean renderAsNormalBlock () - { - return false; - } + @Override + public boolean renderAsNormalBlock () + { + return false; + } - public int getRenderType () - { - return OreberryRender.model; - } + public int getRenderType () + { + return OreberryRender.model; + } - public boolean shouldSideBeRendered (IBlockAccess iblockaccess, int x, int y, int z, int meta) - { - if (meta > 7 || graphicsLevel) - { - return super.shouldSideBeRendered(iblockaccess, x, y, z, meta); - } - else - { - return true; - } - } + public boolean shouldSideBeRendered (IBlockAccess iblockaccess, int x, int y, int z, int meta) + { + if (meta > 7 || graphicsLevel) + { + return super.shouldSideBeRendered(iblockaccess, x, y, z, meta); + } + else + { + return true; + } + } - /* Bush growth */ + /* Bush growth */ - @Override - public void updateTick (World world, int x, int y, int z, Random random1) - { - if (world.isRemote) - { - return; - } + @Override + public void updateTick (World world, int x, int y, int z, Random random1) + { + if (world.isRemote) + { + return; + } - if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8) - { - if (world.getFullBlockLightValue(x, y, z) < 10) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta < 12) - { - world.setBlock(x, y, z, blockID, meta + 4, 3); - } - } - /*else if (meta < 8) - { - world.setBlock(x, y, z, blockID, meta + 4, 3); - }*/ - } - } + if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8) + { + if (world.getFullBlockLightValue(x, y, z) < 10) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta < 12) + { + world.setBlock(x, y, z, blockID, meta + 4, 3); + } + } + /*else if (meta < 8) + { + world.setBlock(x, y, z, blockID, meta + 4, 3); + }*/ + } + } - public boolean canSustainPlant (World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) - { - if (plant instanceof OreberryBush) - return (world.getBlockMetadata(x, y, z) > 7); - return super.canSustainPlant(world, x, y, z, direction, plant); - } + public boolean canSustainPlant (World world, int x, int y, int z, ForgeDirection direction, IPlantable plant) + { + if (plant instanceof OreberryBush) + return (world.getBlockMetadata(x, y, z) > 7); + return super.canSustainPlant(world, x, y, z, direction, plant); + } - public boolean canPlaceBlockAt (World world, int x, int y, int z) - { - if (world.getFullBlockLightValue(x, y, z) < 13) - return super.canPlaceBlockAt(world, x, y, z); - return false; - } + public boolean canPlaceBlockAt (World world, int x, int y, int z) + { + if (world.getFullBlockLightValue(x, y, z) < 13) + return super.canPlaceBlockAt(world, x, y, z); + return false; + } - /* Resistance to fire */ + /* Resistance to fire */ - @Override - public int getFlammability (IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) - { - return 0; - } + @Override + public int getFlammability (IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) + { + return 0; + } - @Override - public boolean isFlammable (IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) - { - return false; - } + @Override + public boolean isFlammable (IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) + { + return false; + } - @Override - public int getFireSpreadSpeed (World world, int x, int y, int z, int metadata, ForgeDirection face) - { - return 0; - } + @Override + public int getFireSpreadSpeed (World world, int x, int y, int z, int metadata, ForgeDirection face) + { + return 0; + } - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @SideOnly(Side.CLIENT) - @Override - public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int var4 = 8; var4 < 8 + subitems; ++var4) - { - par3List.add(new ItemStack(par1, 1, var4)); - } - } + /** + * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) + */ + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (int var4 = 8; var4 < 8 + subitems; ++var4) + { + par3List.add(new ItemStack(par1, 1, var4)); + } + } - @Override - public EnumPlantType getPlantType (World world, int x, int y, int z) - { - return EnumPlantType.Cave; - } + @Override + public EnumPlantType getPlantType (World world, int x, int y, int z) + { + return EnumPlantType.Cave; + } - @Override - public int getPlantID (World world, int x, int y, int z) - { - return this.blockID; - } + @Override + public int getPlantID (World world, int x, int y, int z) + { + return this.blockID; + } - @Override - public int getPlantMetadata (World world, int x, int y, int z) - { - return world.getBlockMetadata(x, y, z) - 4; - } + @Override + public int getPlantMetadata (World world, int x, int y, int z) + { + return world.getBlockMetadata(x, y, z) - 4; + } - @Override - public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) - { - if (!(entity instanceof EntityItem)) - entity.attackEntityFrom(DamageSource.cactus, 1); - } + @Override + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) + { + if (!(entity instanceof EntityItem)) + entity.attackEntityFrom(DamageSource.cactus, 1); + } } diff --git a/mods/tinker/tconstruct/blocks/OreberryBushEssence.java b/mods/tinker/tconstruct/blocks/OreberryBushEssence.java index 22de8a53..2c5c8b71 100644 --- a/mods/tinker/tconstruct/blocks/OreberryBushEssence.java +++ b/mods/tinker/tconstruct/blocks/OreberryBushEssence.java @@ -29,43 +29,43 @@ import cpw.mods.fml.relauncher.SideOnly; public class OreberryBushEssence extends OreberryBush implements IPlantable { - public OreberryBushEssence(int id, String[] textureNames, int meta, int sub, String[] oreTypes) - { - super(id, textureNames, meta, sub, oreTypes); - } + public OreberryBushEssence(int id, String[] textureNames, int meta, int sub, String[] oreTypes) + { + super(id, textureNames, meta, sub, oreTypes); + } - /* Bush growth */ + /* Bush growth */ - @Override - public void updateTick (World world, int x, int y, int z, Random random1) - { - if (world.isRemote) - { - return; - } + @Override + public void updateTick (World world, int x, int y, int z, Random random1) + { + if (world.isRemote) + { + return; + } - if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8) - { - int meta = world.getBlockMetadata(x, y, z); - if (world.getFullBlockLightValue(x, y, z) < 10 || meta % 4 == 1) - { - if (meta < 12) - { - world.setBlock(x, y, z, blockID, meta + 4, 3); - } - } - /*else if (meta < 8) - { - world.setBlock(x, y, z, blockID, meta + 4, 3); - }*/ - } - } + if (random1.nextInt(20) == 0)// && world.getBlockLightValue(x, y, z) <= 8) + { + int meta = world.getBlockMetadata(x, y, z); + if (world.getFullBlockLightValue(x, y, z) < 10 || meta % 4 == 1) + { + if (meta < 12) + { + world.setBlock(x, y, z, blockID, meta + 4, 3); + } + } + /*else if (meta < 8) + { + world.setBlock(x, y, z, blockID, meta + 4, 3); + }*/ + } + } - public boolean canPlaceBlockAt (World world, int x, int y, int z) - { - return true; - /*if (world.getFullBlockLightValue(x, y, z) < 13) - return super.canPlaceBlockAt(world, x, y, z); - return false;*/ - } + public boolean canPlaceBlockAt (World world, int x, int y, int z) + { + return true; + /*if (world.getFullBlockLightValue(x, y, z) < 13) + return super.canPlaceBlockAt(world, x, y, z); + return false;*/ + } } diff --git a/mods/tinker/tconstruct/blocks/PaneBase.java b/mods/tinker/tconstruct/blocks/PaneBase.java index 2b59f7ed..427631e2 100644 --- a/mods/tinker/tconstruct/blocks/PaneBase.java +++ b/mods/tinker/tconstruct/blocks/PaneBase.java @@ -24,6 +24,7 @@ public class PaneBase extends Block public String folder; public Icon[] icons; public Icon[] sideIcons; + public PaneBase(int id, Material material, String folder, String[] blockTextures) { super(id, material); @@ -41,53 +42,53 @@ public class PaneBase extends Block { return sideIcons[meta]; } - + @Override @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) + public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; this.sideIcons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]); - this.sideIcons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]+"_side"); + this.icons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i]); + this.sideIcons[i] = iconRegister.registerIcon("tinker:" + folder + textureNames[i] + "_side"); } } - + @Override @SideOnly(Side.CLIENT) public Icon getIcon (int side, int meta) { return icons[meta]; } - + @Override - public void getSubBlocks(int id, CreativeTabs tab, List list) + public void getSubBlocks (int id, CreativeTabs tab, List list) { for (int iter = 0; iter < textureNames.length; iter++) { list.add(new ItemStack(id, 1, iter)); } } - - public boolean isOpaqueCube() + + public boolean isOpaqueCube () { return false; } - public boolean renderAsNormalBlock() + public boolean renderAsNormalBlock () { return false; } - public int getRenderType() + public int getRenderType () { return PaneRender.model; } - public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) + public boolean shouldSideBeRendered (IBlockAccess iblockaccess, int i, int j, int k, int l) { int bID = iblockaccess.getBlockId(i, j, k); if (Block.blocksList[bID] instanceof PaneBase || Block.blocksList[bID] instanceof BlockPane) @@ -101,7 +102,7 @@ public class PaneBase extends Block } @Override - public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List arraylist, Entity entity) + public void addCollisionBoxesToList (World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List arraylist, Entity entity) { boolean south = canConnectTo(world.getBlockId(x, y, z - 1)); boolean north = canConnectTo(world.getBlockId(x, y, z + 1)); @@ -139,12 +140,12 @@ public class PaneBase extends Block } } - public void setBlockBoundsForItemRender() + public void setBlockBoundsForItemRender () { setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } - public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) + public void setBlockBoundsBasedOnState (IBlockAccess iblockaccess, int i, int j, int k) { float f = 0.4375F; float f1 = 0.5625F; diff --git a/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java b/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java index d188aa00..949e179a 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java +++ b/mods/tinker/tconstruct/blocks/RedstoneBallRepeater.java @@ -20,11 +20,11 @@ import cpw.mods.fml.relauncher.SideOnly; public class RedstoneBallRepeater extends BlockRedstoneLogic { /** The offsets for the two torches in redstone repeater blocks. */ - public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; + public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D }; /** The states in which the redstone repeater blocks can be. */ - public static final int[] repeaterState = new int[] {1, 2, 3, 4}; - + public static final int[] repeaterState = new int[] { 1, 2, 3, 4 }; + @SideOnly(Side.CLIENT) public static Icon field_94413_c; @SideOnly(Side.CLIENT) @@ -43,7 +43,7 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic /** * Called upon block activation (right click on the block.) */ - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + public boolean onBlockActivated (World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { int i1 = par1World.getBlockMetadata(par2, par3, par4); int j1 = (i1 & 12) >> 2; @@ -52,17 +52,17 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic return true; } - public int func_94481_j_(int par1) + public int func_94481_j_ (int par1) { return repeaterState[(par1 & 12) >> 2] * 2; } - public BlockRedstoneLogic func_94485_e() + public BlockRedstoneLogic func_94485_e () { return Block.redstoneRepeaterActive; } - public BlockRedstoneLogic func_94484_i() + public BlockRedstoneLogic func_94484_i () { return Block.redstoneRepeaterIdle; } @@ -70,13 +70,12 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic /** * Returns the ID of the items to drop on destruction. */ - public int idDropped(int par1, Random par2Random, int par3) + public int idDropped (int par1, Random par2Random, int par3) { return this.blockID; } @SideOnly(Side.CLIENT) - /** * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) */ @@ -84,26 +83,25 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic { return Item.redstoneRepeater.itemID; }*/ - /** * The type of render function that is called for this block */ - public int getRenderType() + public int getRenderType () { return BallRepeaterRender.model; } - public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + public boolean func_94476_e (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return this.func_94482_f(par1IBlockAccess, par2, par3, par4, par5) > 0; } - public boolean func_94477_d(int par1) + public boolean func_94477_d (int par1) { return isRedstoneRepeaterBlockID(par1); } - - public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) + + public static boolean isPowerProviderOrWire (IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) { int i1 = par0IBlockAccess.getBlockId(par1, par2, par3); @@ -127,19 +125,18 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic } @SideOnly(Side.CLIENT) - /** * A randomly called display update to be able to add particles or other items for display */ - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + public void randomDisplayTick (World par1World, int par2, int par3, int par4, Random par5Random) { if (this.isRepeaterPowered) { int l = par1World.getBlockMetadata(par2, par3, par4); int i1 = getDirection(l); - double d0 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; - double d1 = (double)((float)par3 + 0.4F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; - double d2 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; + double d0 = (double) ((float) par2 + 0.5F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; + double d1 = (double) ((float) par3 + 0.4F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; + double d2 = (double) ((float) par4 + 0.5F) + (double) (par5Random.nextFloat() - 0.5F) * 0.2D; double d3 = 0.0D; double d4 = 0.0D; @@ -147,17 +144,17 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic { switch (i1) { - case 0: - d4 = -0.3125D; - break; - case 1: - d3 = 0.3125D; - break; - case 2: - d4 = 0.3125D; - break; - case 3: - d3 = -0.3125D; + case 0: + d4 = -0.3125D; + break; + case 1: + d3 = 0.3125D; + break; + case 2: + d4 = 0.3125D; + break; + case 3: + d3 = -0.3125D; } } else @@ -166,26 +163,25 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic switch (i1) { - case 0: - d4 = repeaterTorchOffset[j1]; - break; - case 1: - d3 = -repeaterTorchOffset[j1]; - break; - case 2: - d4 = -repeaterTorchOffset[j1]; - break; - case 3: - d3 = repeaterTorchOffset[j1]; + case 0: + d4 = repeaterTorchOffset[j1]; + break; + case 1: + d3 = -repeaterTorchOffset[j1]; + break; + case 2: + d4 = -repeaterTorchOffset[j1]; + break; + case 3: + d3 = repeaterTorchOffset[j1]; } } par1World.spawnParticle("reddust", d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); } } - - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; } @@ -193,19 +189,19 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ - public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) + public void breakBlock (World par1World, int par2, int par3, int par4, int par5, int par6) { super.breakBlock(par1World, par2, par3, par4, par5, par6); this.func_94483_i_(par1World, par2, par3, par4); } @Override - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + public int colorMultiplier (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return 8388608; } - - public void registerIcons(IconRegister par1IconRegister) + + public void registerIcons (IconRegister par1IconRegister) { this.field_94413_c = par1IconRegister.registerIcon("tinker:repeaterDust_cross"); this.field_94410_cO = par1IconRegister.registerIcon("tinker:repeaterDust_line"); @@ -213,10 +209,11 @@ public class RedstoneBallRepeater extends BlockRedstoneLogic this.field_94412_cQ = par1IconRegister.registerIcon("tinker:repeaterDust_line_overlay"); this.blockIcon = this.field_94413_c; } - + @SideOnly(Side.CLIENT) - public static Icon func_94409_b(String par0Str) + public static Icon func_94409_b (String par0Str) { - return par0Str == "repeaterDust_cross" ? field_94413_c : (par0Str == "repeaterDust_line" ? field_94410_cO : (par0Str == "repeaterDust_cross_overlay" ? field_94411_cP : (par0Str == "repeaterDust_line_overlay" ? field_94412_cQ : null))); + return par0Str == "repeaterDust_cross" ? field_94413_c : (par0Str == "repeaterDust_line" ? field_94410_cO : (par0Str == "repeaterDust_cross_overlay" ? field_94411_cP + : (par0Str == "repeaterDust_line_overlay" ? field_94412_cQ : null))); } } diff --git a/mods/tinker/tconstruct/blocks/RedstoneMachine.java b/mods/tinker/tconstruct/blocks/RedstoneMachine.java index d9729c80..eafbd4b1 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneMachine.java +++ b/mods/tinker/tconstruct/blocks/RedstoneMachine.java @@ -52,9 +52,10 @@ public class RedstoneMachine extends InventoryBlock public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) { int meta = world.getBlockMetadata(x, y, z); - switch(meta) + switch (meta) { - case 0: return TConstruct.proxy.drawbridgeGui; + case 0: + return TConstruct.proxy.drawbridgeGui; } return null; } @@ -70,9 +71,8 @@ public class RedstoneMachine extends InventoryBlock @Override public String[] getTextureNames () { - String[] textureNames = { "drawbridge_top", "drawbridge_side", "drawbridge_bottom", "drawbridge_top_face", "drawbridge_side_face", "drawbridge_bottom_face", - "firestarter_top", "firestarter_side", "firestarter_bottom" - }; + String[] textureNames = { "drawbridge_top", "drawbridge_side", "drawbridge_bottom", "drawbridge_top_face", "drawbridge_side_face", "drawbridge_bottom_face", "firestarter_top", + "firestarter_side", "firestarter_bottom" }; return textureNames; } @@ -100,7 +100,7 @@ public class RedstoneMachine extends InventoryBlock } if (meta == 1) { - return icons[getTextureIndex(side)+6]; + return icons[getTextureIndex(side) + 6]; } return icons[0]; } @@ -154,13 +154,13 @@ public class RedstoneMachine extends InventoryBlock return 1; } - + public int getRenderType () { return MachineRender.model; } - - public boolean isFireSource(World world, int x, int y, int z, int metadata, ForgeDirection side) + + public boolean isFireSource (World world, int x, int y, int z, int metadata, ForgeDirection side) { if (metadata == 1) return side == UP; diff --git a/mods/tinker/tconstruct/blocks/SearedBlock.java b/mods/tinker/tconstruct/blocks/SearedBlock.java index f1871ec6..49dec7d3 100644 --- a/mods/tinker/tconstruct/blocks/SearedBlock.java +++ b/mods/tinker/tconstruct/blocks/SearedBlock.java @@ -23,118 +23,83 @@ import net.minecraft.world.World; public class SearedBlock extends InventoryBlock { - - public SearedBlock(int id) - { - super(id, Material.rock); - this.setCreativeTab(TConstructRegistry.blockTab); - setHardness(12); - setStepSound(soundMetalFootstep); - } - @Override - public TileEntity createTileEntity (World world, int metadata) - { - switch (metadata) - { - case 0: - return new CastingTableLogic(); - case 1: - return new FaucetLogic(); + public SearedBlock(int id) + { + super(id, Material.rock); + this.setCreativeTab(TConstructRegistry.blockTab); + setHardness(12); + setStepSound(soundMetalFootstep); + } + + @Override + public TileEntity createTileEntity (World world, int metadata) + { + switch (metadata) + { + case 0: + return new CastingTableLogic(); + case 1: + return new FaucetLogic(); case 2: return new CastingBasinLogic(); - default: - return null; - } - } - + default: + return null; + } + } + @Override public int getRenderBlockPass () { return 1; } - @Override - public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) - { - return null; - } + @Override + public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) + { + return null; + } - @Override - public Object getModInstance () - { - return TConstruct.instance; - } + @Override + public Object getModInstance () + { + return TConstruct.instance; + } - /* Activation */ - @Override - public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) - { - int md = world.getBlockMetadata(x, y, z); - if (md == 0) - { - return activateCastingTable(world, x, y, z, player); - } - if (md == 2) + /* Activation */ + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) + { + int md = world.getBlockMetadata(x, y, z); + if (md == 0) + { + return activateCastingTable(world, x, y, z, player); + } + if (md == 2) { return activateCastingBasin(world, x, y, z, player); } - else if (md == 1) - { - if (player.isSneaking()) - return false; + else if (md == 1) + { + if (player.isSneaking()) + return false; - FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); - logic.setActive(true); - return true; - } - else - return super.onBlockActivated(world, x, y, z, player, side, clickX, clickY, clickZ); - } + FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); + logic.setActive(true); + return true; + } + else + return super.onBlockActivated(world, x, y, z, player, side, clickX, clickY, clickZ); + } - boolean activateCastingTable (World world, int x, int y, int z, EntityPlayer player) - { - if (!world.isRemote) - { - CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z); - if (logic.liquid != null) - return true; - - if (!logic.isStackInSlot(0) && !logic.isStackInSlot(1)) - { - ItemStack stack = player.getCurrentEquippedItem(); - stack = player.inventory.decrStackSize(player.inventory.currentItem, 1); - logic.setInventorySlotContents(0, stack); - } - else - { - if (logic.isStackInSlot(1)) - { - ItemStack stack = logic.decrStackSize(1, 1); - if (stack != null) - addItemToInventory(player, world, x, y, z, stack); - } - else if (logic.isStackInSlot(0)) - { - ItemStack stack = logic.decrStackSize(0, 1); - if (stack != null) - addItemToInventory(player, world, x, y, z, stack); - } - } - - world.markBlockForUpdate(x, y, z); - } - return true; - } - - boolean activateCastingBasin (World world, int x, int y, int z, EntityPlayer player) + boolean activateCastingTable (World world, int x, int y, int z, EntityPlayer player) { if (!world.isRemote) { - CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z); + CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z); if (logic.liquid != null) return true; - + if (!logic.isStackInSlot(0) && !logic.isStackInSlot(1)) { ItemStack stack = player.getCurrentEquippedItem(); @@ -162,184 +127,213 @@ public class SearedBlock extends InventoryBlock return true; } - public void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack) - { - AbilityHelper.spawnItemAtPlayer(player, stack); - /*if (!world.isRemote) - { - EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack); - world.spawnEntityInWorld(entityitem); - entityitem.onCollideWithPlayer(player); - }*/ - } + boolean activateCastingBasin (World world, int x, int y, int z, EntityPlayer player) + { + if (!world.isRemote) + { + CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z); + if (logic.liquid != null) + return true; - /* Rendering */ - @Override - public int getRenderType () - { - return SearedRender.searedModel; - } + if (!logic.isStackInSlot(0) && !logic.isStackInSlot(1)) + { + ItemStack stack = player.getCurrentEquippedItem(); + stack = player.inventory.decrStackSize(player.inventory.currentItem, 1); + logic.setInventorySlotContents(0, stack); + } + else + { + if (logic.isStackInSlot(1)) + { + ItemStack stack = logic.decrStackSize(1, 1); + if (stack != null) + addItemToInventory(player, world, x, y, z, stack); + } + else if (logic.isStackInSlot(0)) + { + ItemStack stack = logic.decrStackSize(0, 1); + if (stack != null) + addItemToInventory(player, world, x, y, z, stack); + } + } - @Override - public String[] getTextureNames() - { - String[] textureNames = { - "castingtable_top", - "castingtable_side", - "castingtable_bottom", - "faucet", - "blockcast_top", - "blockcast_side", - "blockcast_bottom"}; - - return textureNames; - } + world.markBlockForUpdate(x, y, z); + } + return true; + } - @Override - public Icon getIcon (int side, int meta) - { - if (meta == 0) - return icons[getTextureIndex(side)]; - else if (meta == 2) - return icons[getTextureIndex(side)+4]; - else - return icons[3]; - } + public void addItemToInventory (EntityPlayer player, World world, int x, int y, int z, ItemStack stack) + { + AbilityHelper.spawnItemAtPlayer(player, stack); + /*if (!world.isRemote) + { + EntityItem entityitem = new EntityItem(world, (double) x + 0.5D, (double) y + 0.9325D, (double) z + 0.5D, stack); + world.spawnEntityInWorld(entityitem); + entityitem.onCollideWithPlayer(player); + }*/ + } - public int getTextureIndex (int side) - { - if (side == 0) - return 2; - if (side == 1) - return 0; + /* Rendering */ + @Override + public int getRenderType () + { + return SearedRender.searedModel; + } - return 1; - } + @Override + public String[] getTextureNames () + { + String[] textureNames = { "castingtable_top", "castingtable_side", "castingtable_bottom", "faucet", "blockcast_top", "blockcast_side", "blockcast_bottom" }; - @Override - public boolean renderAsNormalBlock () - { - return false; - } + return textureNames; + } - @Override - public boolean isOpaqueCube () - { - return false; - } + @Override + public Icon getIcon (int side, int meta) + { + if (meta == 0) + return icons[getTextureIndex(side)]; + else if (meta == 2) + return icons[getTextureIndex(side) + 4]; + else + return icons[3]; + } - @Override - public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - return true; - } + public int getTextureIndex (int side) + { + if (side == 0) + return 2; + if (side == 1) + return 0; - @Override - public void getSubBlocks (int id, CreativeTabs tab, List list) - { - for (int iter = 0; iter < 3; iter++) - { - list.add(new ItemStack(id, 1, iter)); - } - } + return 1; + } - @Override - public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta != 1) - { - this.setBlockBounds(0, 0, 0, 1, 1, 1); - } - else - { - FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); - float xMin = 0.25F; - float xMax = 0.75F; - float zMin = 0.25F; - float zMax = 0.75F; + @Override + public boolean renderAsNormalBlock () + { + return false; + } - switch (logic.getRenderDirection()) - { - case 2: - zMin = 0.625F; - zMax = 1.0F; - break; - case 3: - zMax = 0.375F; - zMin = 0F; - break; - case 4: - xMin = 0.625F; - xMax = 1.0F; - break; - case 5: - xMax = 0.375F; - xMin = 0F; - break; - } + @Override + public boolean isOpaqueCube () + { + return false; + } - this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax); - } - } + @Override + public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return true; + } - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta != 1) - { - return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1, z + 1); - } - else - { - FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); - if (logic != null) - { - float xMin = 0.25F; - float xMax = 0.75F; - float zMin = 0.25F; - float zMax = 0.75F; + @Override + public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < 3; iter++) + { + list.add(new ItemStack(id, 1, iter)); + } + } - switch (logic.getRenderDirection()) - { - case 2: - zMin = 0.625F; - zMax = 1.0F; - break; - case 3: - zMax = 0.375F; - zMin = 0F; - break; - case 4: - xMin = 0.625F; - xMax = 1.0F; - break; - case 5: - xMax = 0.375F; - xMin = 0F; - break; - } + @Override + public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta != 1) + { + this.setBlockBounds(0, 0, 0, 1, 1, 1); + } + else + { + FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); + float xMin = 0.25F; + float xMax = 0.75F; + float zMin = 0.25F; + float zMax = 0.75F; - return AxisAlignedBB.getAABBPool().getAABB((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, (double) ((float) z + zMax)); - } - } + switch (logic.getRenderDirection()) + { + case 2: + zMin = 0.625F; + zMax = 1.0F; + break; + case 3: + zMax = 0.375F; + zMin = 0F; + break; + case 4: + xMin = 0.625F; + xMax = 1.0F; + break; + case 5: + xMax = 0.375F; + xMin = 0F; + break; + } - return super.getCollisionBoundingBoxFromPool(world, x, y, z); - } - - /* Redstone */ - public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) + this.setBlockBounds(xMin, 0.25F, zMin, xMax, 0.625F, zMax); + } + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta != 1) + { + return AxisAlignedBB.getAABBPool().getAABB(x, y, z, x + 1, y + 1, z + 1); + } + else + { + FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); + if (logic != null) + { + float xMin = 0.25F; + float xMax = 0.75F; + float zMin = 0.25F; + float zMax = 0.75F; + + switch (logic.getRenderDirection()) + { + case 2: + zMin = 0.625F; + zMax = 1.0F; + break; + case 3: + zMax = 0.375F; + zMin = 0F; + break; + case 4: + xMin = 0.625F; + xMax = 1.0F; + break; + case 5: + xMax = 0.375F; + xMin = 0F; + break; + } + + return AxisAlignedBB.getAABBPool().getAABB((double) ((float) x + xMin), (double) y + 0.25, (double) ((float) z + zMin), (double) ((float) x + xMax), (double) y + 0.625, + (double) ((float) z + zMax)); + } + } + + return super.getCollisionBoundingBoxFromPool(world, x, y, z); + } + + /* Redstone */ + public boolean canConnectRedstone (IBlockAccess world, int x, int y, int z, int side) { return world.getBlockMetadata(x, y, z) == 1; } - - public void onNeighborBlockChange(World world, int x, int y, int z, int neighborBlockID) + + public void onNeighborBlockChange (World world, int x, int y, int z, int neighborBlockID) { - if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 1) - { - FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); + if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 1) + { + FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); logic.setActive(true); - } + } } } diff --git a/mods/tinker/tconstruct/blocks/SmelteryBlock.java b/mods/tinker/tconstruct/blocks/SmelteryBlock.java index 17d1e0d4..cdc33669 100644 --- a/mods/tinker/tconstruct/blocks/SmelteryBlock.java +++ b/mods/tinker/tconstruct/blocks/SmelteryBlock.java @@ -25,114 +25,99 @@ import net.minecraft.world.World; public class SmelteryBlock extends InventoryBlock { - Random rand; + Random rand; - public SmelteryBlock(int id) - { - super(id, Material.rock); - setHardness(12F); - setStepSound(soundMetalFootstep); - rand = new Random(); - this.setCreativeTab(TConstructRegistry.blockTab); - this.setUnlocalizedName("tconstruct.Smeltery"); - } - - /* Rendering */ + public SmelteryBlock(int id) + { + super(id, Material.rock); + setHardness(12F); + setStepSound(soundMetalFootstep); + rand = new Random(); + this.setCreativeTab(TConstructRegistry.blockTab); + this.setUnlocalizedName("tconstruct.Smeltery"); + } - @Override - public int getRenderType () - { - return SmelteryRender.smelteryModel; - } - - @Override - public String[] getTextureNames() - { - String[] textureNames = { - "smeltery_side", - "smeltery_inactive", - "smeltery_active", - "drain_side", - "drain_out", - "drain_basin", - "searedbrick", - "searedstone", - "searedcobble", - "searedpaver", - "searedbrickcracked", - "searedroad", - "searedbrickfancy", - "searedbricksquare", - "searedcreeper" - }; - - return textureNames; - } + /* Rendering */ - public Icon getIcon (int side, int meta) - { - if (meta < 2) - { - int sideTex = side == 3 ? 1 : 0; - return icons[sideTex + meta*3]; - } - else if (meta == 2) - { - return icons[6]; - } - else if (meta == 11) - { - if (side == 0 || side == 1) - return icons[9]; - } - - return icons[3 + meta]; - } + @Override + public int getRenderType () + { + return SmelteryRender.smelteryModel; + } - public Icon getBlockTexture (IBlockAccess world, int x, int y, int z, int side) - { - TileEntity logic = world.getBlockTileEntity(x, y, z); - short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0; - int meta = world.getBlockMetadata(x, y, z); - if (meta == 0) //Smeltery - { - if (side == direction) - { - if (isActive(world, x, y, z)) - { - return icons[2]; - } - else - { - return icons[1]; - } - } - else - { - return icons[0]; - } - } - if (meta == 1) //Drain - { - if (side == direction) - return icons[5]; - else if (side / 2 == direction / 2) - return icons[4]; - else - return icons[3]; - } - else if (meta == 2) - { - return icons[6]; - } + @Override + public String[] getTextureNames () + { + String[] textureNames = { "smeltery_side", "smeltery_inactive", "smeltery_active", "drain_side", "drain_out", "drain_basin", "searedbrick", "searedstone", "searedcobble", "searedpaver", + "searedbrickcracked", "searedroad", "searedbrickfancy", "searedbricksquare", "searedcreeper" }; + + return textureNames; + } + + public Icon getIcon (int side, int meta) + { + if (meta < 2) + { + int sideTex = side == 3 ? 1 : 0; + return icons[sideTex + meta * 3]; + } + else if (meta == 2) + { + return icons[6]; + } else if (meta == 11) { if (side == 0 || side == 1) return icons[9]; } - return icons[3 + meta]; - - } + + return icons[3 + meta]; + } + + public Icon getBlockTexture (IBlockAccess world, int x, int y, int z, int side) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + short direction = (logic instanceof IFacingLogic) ? ((IFacingLogic) logic).getRenderDirection() : 0; + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0) //Smeltery + { + if (side == direction) + { + if (isActive(world, x, y, z)) + { + return icons[2]; + } + else + { + return icons[1]; + } + } + else + { + return icons[0]; + } + } + if (meta == 1) //Drain + { + if (side == direction) + return icons[5]; + else if (side / 2 == direction / 2) + return icons[4]; + else + return icons[3]; + } + else if (meta == 2) + { + return icons[6]; + } + else if (meta == 11) + { + if (side == 0 || side == 1) + return icons[9]; + } + return icons[3 + meta]; + + } /*@Override public int getRenderBlockPass() @@ -140,151 +125,154 @@ public class SmelteryBlock extends InventoryBlock return 1; }*/ - public int damageDropped (int meta) - { - return meta; - } + public int damageDropped (int meta) + { + return meta; + } - public int quantityDropped (Random random) - { - return 1; - } + public int quantityDropped (Random random) + { + return 1; + } - @Override - public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) - { - return TConstruct.proxy.smelteryGuiID; - } + @Override + public Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer) + { + return TConstruct.proxy.smelteryGuiID; + } - public void randomDisplayTick (World world, int x, int y, int z, Random random) - { - if (isActive(world, x, y, z)) - { - TileEntity logic = world.getBlockTileEntity(x, y, z); - byte face = 0; - if (logic instanceof IFacingLogic) - face = ((IFacingLogic) logic).getRenderDirection(); - float f = (float) x + 0.5F; - float f1 = (float) y + 0.5F + (random.nextFloat() * 6F) / 16F; - float f2 = (float) z + 0.5F; - float f3 = 0.52F; - float f4 = random.nextFloat() * 0.6F - 0.3F; - switch (face) - { - case 4: - world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - break; + public void randomDisplayTick (World world, int x, int y, int z, Random random) + { + if (isActive(world, x, y, z)) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + byte face = 0; + if (logic instanceof IFacingLogic) + face = ((IFacingLogic) logic).getRenderDirection(); + float f = (float) x + 0.5F; + float f1 = (float) y + 0.5F + (random.nextFloat() * 6F) / 16F; + float f2 = (float) z + 0.5F; + float f3 = 0.52F; + float f4 = random.nextFloat() * 0.6F - 0.3F; + switch (face) + { + case 4: + world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + break; - case 5: - world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); - break; + case 5: + world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + break; - case 2: - world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); - break; + case 2: + world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + break; - case 3: - world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); - break; - } - } - } + case 3: + world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + break; + } + } + } - public int getLightValue (IBlockAccess world, int x, int y, int z) - { - return !isActive(world, x, y, z) ? 0 : 9; - } + public int getLightValue (IBlockAccess world, int x, int y, int z) + { + return !isActive(world, x, y, z) ? 0 : 9; + } - //@Override - /*public void getSubBlocks (int id, CreativeTabs tab, List list) - { - for (int iter = 0; iter < 9; iter++) - { - list.add(new ItemStack(id, 1, iter)); - } - }*/ + //@Override + /*public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < 9; iter++) + { + list.add(new ItemStack(id, 1, iter)); + } + }*/ - @Override - public Object getModInstance () - { - return TConstruct.instance; - } - - @Override - public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) - { - if (player.isSneaking() || world.getBlockMetadata(x, y, z) != 0) - return false; - - Integer integer = getGui(world, x, y, z, player); - if (integer == null || integer == -1) - { - return false; - } - else - { - player.openGui(getModInstance(), integer, world, x, y, z); - return true; - } - } + @Override + public Object getModInstance () + { + return TConstruct.instance; + } - @Override - public TileEntity createTileEntity (World world, int metadata) - { - switch (metadata) - { - case 0: return new SmelteryLogic(); - case 1: return new SmelteryDrainLogic(); - case 3: return null; //Furnace - } - return new MultiServantLogic(); - } + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) + { + if (player.isSneaking() || world.getBlockMetadata(x, y, z) != 0) + return false; - @Override - public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack) - { - super.onBlockPlacedBy(world, x, y, z, entityliving, stack); - if (world.getBlockMetadata(x, y, z) == 0) - onBlockPlacedElsewhere(world, x, y, z, entityliving); - } + Integer integer = getGui(world, x, y, z, player); + if (integer == null || integer == -1) + { + return false; + } + else + { + player.openGui(getModInstance(), integer, world, x, y, z); + return true; + } + } - public void onBlockPlacedElsewhere (World world, int x, int y, int z, EntityLiving entityliving) - { - SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z); - logic.checkValidPlacement(); - } + @Override + public TileEntity createTileEntity (World world, int metadata) + { + switch (metadata) + { + case 0: + return new SmelteryLogic(); + case 1: + return new SmelteryDrainLogic(); + case 3: + return null; //Furnace + } + return new MultiServantLogic(); + } - @Override - public void breakBlock (World world, int x, int y, int z, int par5, int par6) //Don't drop inventory - { - world.removeBlockTileEntity(x, y, z); - } - - @Override - public void getSubBlocks (int id, CreativeTabs tab, List list) - { - for (int iter = 0; iter < 12; iter++) - { - if (iter != 3) - list.add(new ItemStack(id, 1, iter)); - } - } - - /* Updating */ - public void onNeighborBlockChange(World world, int x, int y, int z, int nBlockID) - { - TileEntity logic = world.getBlockTileEntity(x, y, z); - if (logic instanceof IServantLogic) - { - ((IServantLogic) logic).notifyMasterOfChange(); - } - else if (logic instanceof IMasterLogic) - { - ((IMasterLogic) logic).notifyChange(x, y, z); - } - } + @Override + public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack) + { + super.onBlockPlacedBy(world, x, y, z, entityliving, stack); + if (world.getBlockMetadata(x, y, z) == 0) + onBlockPlacedElsewhere(world, x, y, z, entityliving); + } + + public void onBlockPlacedElsewhere (World world, int x, int y, int z, EntityLiving entityliving) + { + SmelteryLogic logic = (SmelteryLogic) world.getBlockTileEntity(x, y, z); + logic.checkValidPlacement(); + } + + @Override + public void breakBlock (World world, int x, int y, int z, int par5, int par6) //Don't drop inventory + { + world.removeBlockTileEntity(x, y, z); + } + + @Override + public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < 12; iter++) + { + if (iter != 3) + list.add(new ItemStack(id, 1, iter)); + } + } + + /* Updating */ + public void onNeighborBlockChange (World world, int x, int y, int z, int nBlockID) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + if (logic instanceof IServantLogic) + { + ((IServantLogic) logic).notifyMasterOfChange(); + } + else if (logic instanceof IMasterLogic) + { + ((IMasterLogic) logic).notifyChange(x, y, z); + } + } } diff --git a/mods/tinker/tconstruct/blocks/SoilBlock.java b/mods/tinker/tconstruct/blocks/SoilBlock.java index b1cfe34d..6aa1ecf6 100644 --- a/mods/tinker/tconstruct/blocks/SoilBlock.java +++ b/mods/tinker/tconstruct/blocks/SoilBlock.java @@ -38,7 +38,7 @@ public class SoilBlock extends TConstructBlock } } } - + /*public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); diff --git a/mods/tinker/tconstruct/blocks/SpeedBlock.java b/mods/tinker/tconstruct/blocks/SpeedBlock.java index fd9f88d7..e21551a1 100644 --- a/mods/tinker/tconstruct/blocks/SpeedBlock.java +++ b/mods/tinker/tconstruct/blocks/SpeedBlock.java @@ -28,7 +28,7 @@ public class SpeedBlock extends TConstructBlock int metadata = world.getBlockMetadata(x, y, z); if (metadata == 1 || metadata == 4) boost = 2.7D; - + double mX = Math.abs(entity.motionX); double mZ = Math.abs(entity.motionZ); if (mX < 0.5D) diff --git a/mods/tinker/tconstruct/blocks/StoneTorch.java b/mods/tinker/tconstruct/blocks/StoneTorch.java index 30c8a8e7..e0c6fd61 100644 --- a/mods/tinker/tconstruct/blocks/StoneTorch.java +++ b/mods/tinker/tconstruct/blocks/StoneTorch.java @@ -31,7 +31,7 @@ public class StoneTorch extends Block * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int par2, int par3, int par4) { return null; } @@ -40,7 +40,7 @@ public class StoneTorch extends Block * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ - public boolean isOpaqueCube() + public boolean isOpaqueCube () { return false; } @@ -48,7 +48,7 @@ public class StoneTorch extends Block /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ - public boolean renderAsNormalBlock() + public boolean renderAsNormalBlock () { return false; } @@ -56,7 +56,7 @@ public class StoneTorch extends Block /** * The type of render function that is called for this block */ - public int getRenderType() + public int getRenderType () { return 2; } @@ -64,7 +64,7 @@ public class StoneTorch extends Block /** * Gets if we can place a torch on a block. */ - private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) + private boolean canPlaceTorchOn (World par1World, int par2, int par3, int par4) { if (par1World.doesBlockHaveSolidTopSurface(par2, par3, par4)) { @@ -80,42 +80,44 @@ public class StoneTorch extends Block /** * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { - return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) || - par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) || - par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) || - par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) || - canPlaceTorchOn(par1World, par2, par3 - 1, par4); + return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) || par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) + || par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) || par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) + || canPlaceTorchOn(par1World, par2, par3 - 1, par4); } /** * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata */ - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) + public int onBlockPlaced (World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { int j1 = par9; - + if (par5 == 0) { if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { j1 = 5; } - else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) { + else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) + { j1 = 4; } - else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) { + else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) + { j1 = 3; } - else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) { + else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) + { j1 = 2; } - else if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) { + else if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) + { j1 = 1; } } - + if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { j1 = 5; @@ -143,7 +145,7 @@ public class StoneTorch extends Block return j1; } - + @SideOnly(Side.CLIENT) public void registerIcons (IconRegister par1IconRegister) { @@ -154,12 +156,12 @@ public class StoneTorch extends Block * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) + public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5) { this.func_94397_d(par1World, par2, par3, par4, par5); } - protected boolean func_94397_d(World par1World, int par2, int par3, int par4, int par5) + protected boolean func_94397_d (World par1World, int par2, int par3, int par4, int par5) { if (this.dropTorchIfCantStay(par1World, par2, par3, par4)) { @@ -212,7 +214,7 @@ public class StoneTorch extends Block * Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns * True if it can stay and False if it drops. Args: world, x, y, z */ - protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4) + protected boolean dropTorchIfCantStay (World par1World, int par2, int par3, int par4) { if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { @@ -234,7 +236,7 @@ public class StoneTorch extends Block * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, * x, y, z, startVec, endVec */ - public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) + public MovingObjectPosition collisionRayTrace (World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { int l = par1World.getBlockMetadata(par2, par3, par4) & 7; float f = 0.15F; @@ -265,16 +267,15 @@ public class StoneTorch extends Block } @SideOnly(Side.CLIENT) - /** * A randomly called display update to be able to add particles or other items for display */ - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + public void randomDisplayTick (World par1World, int par2, int par3, int par4, Random par5Random) { int meta = par1World.getBlockMetadata(par2, par3, par4); - double d0 = (double)((float)par2 + 0.5F); - double d1 = (double)((float)par3 + 0.7F); - double d2 = (double)((float)par4 + 0.5F); + double d0 = (double) ((float) par2 + 0.5F); + double d1 = (double) ((float) par3 + 0.7F); + double d2 = (double) ((float) par4 + 0.5F); double d3 = 0.2199999988079071D; double d4 = 0.27000001072883606D; diff --git a/mods/tinker/tconstruct/blocks/TConstructBlock.java b/mods/tinker/tconstruct/blocks/TConstructBlock.java index f1a52607..f72ec0f6 100644 --- a/mods/tinker/tconstruct/blocks/TConstructBlock.java +++ b/mods/tinker/tconstruct/blocks/TConstructBlock.java @@ -15,47 +15,48 @@ import net.minecraft.util.Icon; public class TConstructBlock extends Block { - public String[] textureNames; - public Icon[] icons; - public TConstructBlock(int id, Material material, float hardness, String[] tex) - { - super(id, material); - setHardness(hardness); - this.setCreativeTab(TConstructRegistry.blockTab); - textureNames = tex; - } + public String[] textureNames; + public Icon[] icons; - @Override - public int damageDropped (int meta) - { - return meta; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) + public TConstructBlock(int id, Material material, float hardness, String[] tex) { - this.icons = new Icon[textureNames.length]; + super(id, material); + setHardness(hardness); + this.setCreativeTab(TConstructRegistry.blockTab); + textureNames = tex; + } + + @Override + public int damageDropped (int meta) + { + return meta; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); } } - - @Override - @SideOnly(Side.CLIENT) - public Icon getIcon (int side, int meta) - { - return icons[meta]; - } - @Override - public void getSubBlocks (int id, CreativeTabs tab, List list) - { - for (int iter = 0; iter < icons.length; iter++) - { - list.add(new ItemStack(id, 1, iter)); - } - } + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (int side, int meta) + { + return icons[meta]; + } + + @Override + public void getSubBlocks (int id, CreativeTabs tab, List list) + { + for (int iter = 0; iter < icons.length; iter++) + { + list.add(new ItemStack(id, 1, iter)); + } + } } diff --git a/mods/tinker/tconstruct/blocks/TMetalBlock.java b/mods/tinker/tconstruct/blocks/TMetalBlock.java index 0b7c73ee..66dd8a74 100644 --- a/mods/tinker/tconstruct/blocks/TMetalBlock.java +++ b/mods/tinker/tconstruct/blocks/TMetalBlock.java @@ -10,16 +10,17 @@ import net.minecraft.world.World; public class TMetalBlock extends TConstructBlock { - + static String[] metalTypes = new String[] { "compressed_cobalt", "compressed_ardite", "compressed_manyullyn", "compressed_copper", "compressed_bronze", "compressed_tin", "compressed_aluminum", "compressed_alubrass", "compressed_alumite", "compressed_steel" }; + public TMetalBlock(int id, Material material, float hardness) { super(id, material, hardness, metalTypes); this.setStepSound(Block.soundMetalFootstep); } - public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) + public boolean isBeaconBase (World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { return true; } diff --git a/mods/tinker/tconstruct/blocks/ToolForgeBlock.java b/mods/tinker/tconstruct/blocks/ToolForgeBlock.java index b1633a0b..7201beee 100644 --- a/mods/tinker/tconstruct/blocks/ToolForgeBlock.java +++ b/mods/tinker/tconstruct/blocks/ToolForgeBlock.java @@ -63,12 +63,17 @@ public class ToolForgeBlock extends InventoryBlock { switch (meta) { - case 0: return Block.blockIron.getIcon(side, 0); - case 1: return Block.blockGold.getIcon(side, 0); - case 2: return Block.blockDiamond.getIcon(side, 0); - case 3: return Block.blockEmerald.getIcon(side, 0); - default: return TContent.metalBlock.getIcon(side, meta - 4); - } + case 0: + return Block.blockIron.getIcon(side, 0); + case 1: + return Block.blockGold.getIcon(side, 0); + case 2: + return Block.blockDiamond.getIcon(side, 0); + case 3: + return Block.blockEmerald.getIcon(side, 0); + default: + return TContent.metalBlock.getIcon(side, meta - 4); + } } return this.icons[meta]; diff --git a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java index 1f984821..db8a79c1 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingBasinLogic.java @@ -85,7 +85,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT return ret; } - + public int updateCapacity (int capacity) { int ret = TConstruct.ingotLiquidValue; @@ -113,7 +113,7 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT if (recipe == null) return 0; this.capacity = updateCapacity(recipe.castingMetal.amount); - + if (inventory[1] == null) { LiquidStack copyLiquid = resource.copy(); @@ -192,13 +192,16 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT } @Override - public LiquidStack drain (int maxDrain, boolean doDrain) - { - if (liquid == null || liquid.itemID <= 0 || castingDelay > 0) return null; - if (liquid.amount <= 0) return null; + public LiquidStack drain (int maxDrain, boolean doDrain) + { + if (liquid == null || liquid.itemID <= 0 || castingDelay > 0) + return null; + if (liquid.amount <= 0) + return null; int used = maxDrain; - if (liquid.amount < used) used = liquid.amount; + if (liquid.amount < used) + used = liquid.amount; if (doDrain) { @@ -208,13 +211,14 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT LiquidStack drained = new LiquidStack(liquid.itemID, used, liquid.itemMeta); // Reset liquid if emptied - if (liquid.amount <= 0) liquid = null; + if (liquid.amount <= 0) + liquid = null; if (doDrain) LiquidEvent.fireEvent(new LiquidEvent.LiquidDrainingEvent(drained, this.worldObj, this.xCoord, this.yCoord, this.zCoord, this)); return drained; - } + } @Override public int getTankPressure () @@ -239,16 +243,16 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT } @Override - public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) - { - return drain(0, maxDrain, doDrain); - } + public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) + { + return drain(0, maxDrain, doDrain); + } - @Override - public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) - { - return drain(maxDrain, doDrain); - } + @Override + public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) + { + return drain(maxDrain, doDrain); + } @Override public ILiquidTank[] getTanks (ForgeDirection direction) @@ -365,29 +369,29 @@ public class CastingBasinLogic extends InventoryLogic implements ILiquidTank, IT } @Override - public int[] getAccessibleSlotsFromSide (int side) - { - return new int[] { 0, 1 }; - } + public int[] getAccessibleSlotsFromSide (int side) + { + return new int[] { 0, 1 }; + } - @Override - public boolean canInsertItem (int slot, ItemStack itemstack, int side) - { - if (liquid != null) - return false; - - if (slot == 0) - return true; - - return false; - } + @Override + public boolean canInsertItem (int slot, ItemStack itemstack, int side) + { + if (liquid != null) + return false; - @Override - public boolean canExtractItem (int slot, ItemStack itemstack, int side) - { - if (slot == 1) - return true; - - return false; - } + if (slot == 0) + return true; + + return false; + } + + @Override + public boolean canExtractItem (int slot, ItemStack itemstack, int side) + { + if (slot == 1) + return true; + + return false; + } } diff --git a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java index 2394c13e..c214bffd 100644 --- a/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/CastingTableLogic.java @@ -91,7 +91,7 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT ret = TConstruct.tableCasting.getCastingAmount(this.liquid, inv); } - System.out.println("Ret: "+ret); + System.out.println("Ret: " + ret); return ret; } diff --git a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java index 3ca21d77..6fc0cb8e 100644 --- a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java @@ -111,19 +111,18 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc protected String getDefaultName () { return "tinker.drawbridge"; - } + } @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) + public void setInventorySlotContents (int slot, ItemStack itemstack) { super.setInventorySlotContents(slot, itemstack); if (slot == 1) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - @Override - public ItemStack decrStackSize(int slot, int quantity) + public ItemStack decrStackSize (int slot, int quantity) { ItemStack stack = super.decrStackSize(slot, quantity); if (slot == 1) @@ -175,7 +174,7 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { //tryExtend(worldObj, xPos, yPos, zPos, direction); worldObj.setBlock(xPos, yPos, zPos, inventory[0].itemID, inventory[0].getItemDamage(), 3); - worldObj.playSoundEffect((double)xPos + 0.5D, (double)yPos + 0.5D, (double)zPos + 0.5D, "tile.piston.out", 0.25F, worldObj.rand.nextFloat() * 0.25F + 0.6F); + worldObj.playSoundEffect((double) xPos + 0.5D, (double) yPos + 0.5D, (double) zPos + 0.5D, "tile.piston.out", 0.25F, worldObj.rand.nextFloat() * 0.25F + 0.6F); inventory[0].stackSize--; } else @@ -190,7 +189,8 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc working = false; } } - else //Retraction + else + //Retraction { if ((inventory[0] == null || inventory[0].stackSize < inventory[0].getMaxStackSize()) && extension > 0) { @@ -219,14 +219,14 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc xPos += extension; break; } - + Block block = Block.blocksList[worldObj.getBlockId(xPos, yPos, zPos)]; if (block != null) { int meta = worldObj.getBlockMetadata(xPos, yPos, zPos); if (inventory[0] != null && validBlock(block) && validMetadata(block.blockID, meta)) { - worldObj.playSoundEffect((double)xPos + 0.5D, (double)yPos + 0.5D, (double)zPos + 0.5D, "tile.piston.in", 0.25F, worldObj.rand.nextFloat() * 0.15F + 0.6F); + worldObj.playSoundEffect((double) xPos + 0.5D, (double) yPos + 0.5D, (double) zPos + 0.5D, "tile.piston.in", 0.25F, worldObj.rand.nextFloat() * 0.15F + 0.6F); worldObj.setBlock(xPos, yPos, zPos, 0); inventory[0].stackSize++; } @@ -245,8 +245,8 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc } } } - - boolean validBlock(Block block) + + boolean validBlock (Block block) { int type = TConstructRegistry.interchangableBlockMapping[block.blockID]; if (type != 0) @@ -285,8 +285,8 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc } return false; } - - private boolean tryExtend(World par1World, int x, int y, int z, int side) + + private boolean tryExtend (World par1World, int x, int y, int z, int side) { int posX = x + Facing.offsetsXForSide[side]; int posY = y + Facing.offsetsYForSide[side]; @@ -384,8 +384,8 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc return true; } } - - private static boolean canPushBlock(int par0, World par1World, int par2, int par3, int par4, boolean par5) + + private static boolean canPushBlock (int par0, World par1World, int par2, int par3, int par4, boolean par5) { if (par0 == Block.obsidian.blockID) { diff --git a/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java b/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java index d1ff3fa3..cf270adc 100644 --- a/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/DryingRackLogic.java @@ -52,16 +52,16 @@ public class DryingRackLogic extends InventoryLogic } } } - + @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) + public void setInventorySlotContents (int slot, ItemStack itemstack) { super.setInventorySlotContents(slot, itemstack); updateDryingTime(); } - + @Override - public ItemStack decrStackSize(int slot, int quantity) + public ItemStack decrStackSize (int slot, int quantity) { ItemStack stack = super.decrStackSize(slot, quantity); maxTime = 0; @@ -69,7 +69,6 @@ public class DryingRackLogic extends InventoryLogic return stack; } - public void updateDryingTime () { currentTime = 0; diff --git a/mods/tinker/tconstruct/blocks/logic/EquipLogic.java b/mods/tinker/tconstruct/blocks/logic/EquipLogic.java index b65ea0d1..5e94a5bb 100644 --- a/mods/tinker/tconstruct/blocks/logic/EquipLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/EquipLogic.java @@ -9,31 +9,31 @@ import net.minecraft.item.ItemStack; * 2-9: Food */ -public abstract class EquipLogic extends InventoryLogic +public abstract class EquipLogic extends InventoryLogic { - - public EquipLogic(int invSize) - { - super(invSize); - } - public void setEquipmentItem(ItemStack stack) - { - inventory[0] = stack.copy(); - } - - public boolean hasEquipmentItem() - { - return inventory[0] != null; - } - - public ItemStack getEquipmentItem() - { - return inventory[0]; - } - - /*@Override - public ItemStack getStackInSlot(int slot) + public EquipLogic(int invSize) + { + super(invSize); + } + + public void setEquipmentItem (ItemStack stack) + { + inventory[0] = stack.copy(); + } + + public boolean hasEquipmentItem () + { + return inventory[0] != null; + } + + public ItemStack getEquipmentItem () + { + return inventory[0]; + } + + /*@Override + public ItemStack getStackInSlot(int slot) { return inventory[slot +1]; } @@ -42,9 +42,9 @@ public abstract class EquipLogic extends InventoryLogic { return inventory[slot +1] != null; } - + @Override - public int getSizeInventory() + public int getSizeInventory() { return inventory.length - 1; }*/ diff --git a/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java b/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java index c0e8bcf7..98a439ca 100644 --- a/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/FaucetLogic.java @@ -17,212 +17,212 @@ import net.minecraftforge.liquids.LiquidStack; public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogic, ITankContainer { - byte direction; - boolean active; - public LiquidStack liquid; + byte direction; + boolean active; + public LiquidStack liquid; - public boolean activateFaucet () - { - if (liquid == null && active) - { - int x = xCoord, z = zCoord; - switch (getRenderDirection()) - { - case 2: - z++; - break; - case 3: - z--; - break; - case 4: - x++; - break; - case 5: - x--; - break; - } + public boolean activateFaucet () + { + if (liquid == null && active) + { + int x = xCoord, z = zCoord; + switch (getRenderDirection()) + { + case 2: + z++; + break; + case 3: + z--; + break; + case 4: + x++; + break; + case 5: + x--; + break; + } - TileEntity drainte = worldObj.getBlockTileEntity(x, yCoord, z); - TileEntity tankte = worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord); + TileEntity drainte = worldObj.getBlockTileEntity(x, yCoord, z); + TileEntity tankte = worldObj.getBlockTileEntity(xCoord, yCoord - 1, zCoord); - if (drainte != null && drainte instanceof ITankContainer && tankte != null && tankte instanceof ITankContainer) - { - LiquidStack templiquid = ((ITankContainer) drainte).drain(getForgeDirection(), TConstruct.ingotLiquidValue, false); - if (templiquid != null) - { - int drained = ((ITankContainer) tankte).fill(ForgeDirection.UP, templiquid, false); - if (drained > 0) - { - liquid = ((ITankContainer) drainte).drain(getForgeDirection(), drained, true); - ((ITankContainer) tankte).fill(ForgeDirection.UP, liquid, true); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - return true; - } - else - { - return false; - } - - } - /*if (liquid != null) - { - int drained = ((ITankContainer) tankte).fill(ForgeDirection.UP, liquid, true); - if (drained != liquid.amount) - { - liquid.amount -= drained; - ((ITankContainer) drainte).fill(getForgeDirection(), liquid, true); - } - if (drained > 0) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - return true; - } - else - { - liquid = null; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - return false; - } - } - else - { - ((ITankContainer) drainte).fill(getForgeDirection(), liquid, true); - }*/ - } - } - return false; - } + if (drainte != null && drainte instanceof ITankContainer && tankte != null && tankte instanceof ITankContainer) + { + LiquidStack templiquid = ((ITankContainer) drainte).drain(getForgeDirection(), TConstruct.ingotLiquidValue, false); + if (templiquid != null) + { + int drained = ((ITankContainer) tankte).fill(ForgeDirection.UP, templiquid, false); + if (drained > 0) + { + liquid = ((ITankContainer) drainte).drain(getForgeDirection(), drained, true); + ((ITankContainer) tankte).fill(ForgeDirection.UP, liquid, true); + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return true; + } + else + { + return false; + } - @Override - public void updateEntity () - { - if (liquid != null) - { - liquid.amount -= TConstruct.liquidUpdateAmount; - if (liquid.amount <= 0) - { - liquid = null; - if (!activateFaucet()) - { - active = false; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - } - } + } + /*if (liquid != null) + { + int drained = ((ITankContainer) tankte).fill(ForgeDirection.UP, liquid, true); + if (drained != liquid.amount) + { + liquid.amount -= drained; + ((ITankContainer) drainte).fill(getForgeDirection(), liquid, true); + } + if (drained > 0) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return true; + } + else + { + liquid = null; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + return false; + } + } + else + { + ((ITankContainer) drainte).fill(getForgeDirection(), liquid, true); + }*/ + } + } + return false; + } - @Override - public byte getRenderDirection () - { - return direction; - } + @Override + public void updateEntity () + { + if (liquid != null) + { + liquid.amount -= TConstruct.liquidUpdateAmount; + if (liquid.amount <= 0) + { + liquid = null; + if (!activateFaucet()) + { + active = false; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + } + + @Override + public byte getRenderDirection () + { + return direction; + } + + @Override + public ForgeDirection getForgeDirection () + { + return ForgeDirection.VALID_DIRECTIONS[direction]; + } - @Override - public ForgeDirection getForgeDirection () - { - return ForgeDirection.VALID_DIRECTIONS[direction]; - } - @Override public void setDirection (int side) { //direction = (byte) side; } - @Override - public void setDirection (float yaw, float pitch, EntityLiving player) - { - int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; - switch (facing) - { - case 0: - direction = 2; - break; + @Override + public void setDirection (float yaw, float pitch, EntityLiving player) + { + int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; + switch (facing) + { + case 0: + direction = 2; + break; - case 1: - direction = 5; - break; + case 1: + direction = 5; + break; - case 2: - direction = 3; - break; + case 2: + direction = 3; + break; - case 3: - direction = 4; - break; - } - } + case 3: + direction = 4; + break; + } + } - @Override - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - readCustomNBT(tags); - } + @Override + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } - public void readCustomNBT (NBTTagCompound tags) - { - direction = tags.getByte("Direction"); - if (tags.getBoolean("hasLiquid")) - this.liquid = new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta")); - else - this.liquid = null; - } + public void readCustomNBT (NBTTagCompound tags) + { + direction = tags.getByte("Direction"); + if (tags.getBoolean("hasLiquid")) + this.liquid = new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta")); + else + this.liquid = null; + } - @Override - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - writeCustomNBT(tags); - } + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } - public void writeCustomNBT (NBTTagCompound tags) - { - tags.setByte("Direction", direction); - tags.setBoolean("hasLiquid", liquid != null); - if (liquid != null) - { - tags.setInteger("itemID", liquid.itemID); - tags.setInteger("amount", liquid.amount); - tags.setInteger("itemMeta", liquid.itemMeta); - } - } + public void writeCustomNBT (NBTTagCompound tags) + { + tags.setByte("Direction", direction); + tags.setBoolean("hasLiquid", liquid != null); + if (liquid != null) + { + tags.setInteger("itemID", liquid.itemID); + tags.setInteger("amount", liquid.amount); + tags.setInteger("itemMeta", liquid.itemMeta); + } + } - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeCustomNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readCustomNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } - @Override - public boolean getActive () - { - return active; - } + @Override + public boolean getActive () + { + return active; + } - @Override - public void setActive (boolean flag) - { - if (!active) - { - active = true; - activateFaucet(); - } - else - { - active = false; - } - } + @Override + public void setActive (boolean flag) + { + if (!active) + { + active = true; + activateFaucet(); + } + else + { + active = false; + } + } @Override public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) diff --git a/mods/tinker/tconstruct/blocks/logic/FrypanLogic.java b/mods/tinker/tconstruct/blocks/logic/FrypanLogic.java index 78d7a8be..f739ce5d 100644 --- a/mods/tinker/tconstruct/blocks/logic/FrypanLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/FrypanLogic.java @@ -24,279 +24,278 @@ import cpw.mods.fml.common.registry.GameRegistry; * 2-9: Food */ -public class FrypanLogic extends EquipLogic - implements IActiveLogic +public class FrypanLogic extends EquipLogic implements IActiveLogic { - boolean active; - public int fuel; - public int fuelGague; - public int progress; + boolean active; + public int fuel; + public int fuelGague; + public int progress; - public FrypanLogic() - { - super(10); - active = false; - } + public FrypanLogic() + { + super(10); + active = false; + } - @Override - public String getDefaultName () - { - return "crafters.frypan"; - } + @Override + public String getDefaultName () + { + return "crafters.frypan"; + } - @Override - public boolean getActive () - { - return active; - } + @Override + public boolean getActive () + { + return active; + } - @Override - public void setActive (boolean flag) - { - active = flag; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } + @Override + public void setActive (boolean flag) + { + active = flag; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } - /* Fuel gauge */ - public int gaugeProgressScaled (int scale) - { - return (progress * scale) / 1000; - } + /* Fuel gauge */ + public int gaugeProgressScaled (int scale) + { + return (progress * scale) / 1000; + } - public int gaugeFuelScaled (int scale) - { - if (fuelGague == 0) - { - fuelGague = fuel; - if (fuelGague == 0) - { - fuelGague = 1000; - } - } - return (fuel * scale) / fuelGague; - } + public int gaugeFuelScaled (int scale) + { + if (fuelGague == 0) + { + fuelGague = fuel; + if (fuelGague == 0) + { + fuelGague = 1000; + } + } + return (fuel * scale) / fuelGague; + } - /* Item cooking */ - public void updateEntity () - { - boolean burning = isBurning(); - boolean updateInventory = false; - if (fuel <= 0 && canCook()) - { - fuel = fuelGague = (int) (getItemBurnTime(inventory[1]) * 2.5); - if (fuel > 0) - { - if (inventory[1].getItem().hasContainerItem()) //Fuel slot - { - inventory[1] = new ItemStack(inventory[1].getItem().getContainerItem()); - } - else - { - inventory[1].stackSize--; - } - if (inventory[1].stackSize <= 0) - { - inventory[1] = null; - } - updateInventory = true; - } - } - if (isBurning() && canCook()) - { - progress++; - if (progress >= 1000) - { - progress = 0; - cookItems(); - updateInventory = true; - } - } - else - { - progress = 0; - } - if (fuel > 0) - { - fuel--; - } - if (burning != isBurning()) - { - setActive(isBurning()); - updateInventory = true; - } - if (updateInventory) - { - onInventoryChanged(); - } - } + /* Item cooking */ + public void updateEntity () + { + boolean burning = isBurning(); + boolean updateInventory = false; + if (fuel <= 0 && canCook()) + { + fuel = fuelGague = (int) (getItemBurnTime(inventory[1]) * 2.5); + if (fuel > 0) + { + if (inventory[1].getItem().hasContainerItem()) //Fuel slot + { + inventory[1] = new ItemStack(inventory[1].getItem().getContainerItem()); + } + else + { + inventory[1].stackSize--; + } + if (inventory[1].stackSize <= 0) + { + inventory[1] = null; + } + updateInventory = true; + } + } + if (isBurning() && canCook()) + { + progress++; + if (progress >= 1000) + { + progress = 0; + cookItems(); + updateInventory = true; + } + } + else + { + progress = 0; + } + if (fuel > 0) + { + fuel--; + } + if (burning != isBurning()) + { + setActive(isBurning()); + updateInventory = true; + } + if (updateInventory) + { + onInventoryChanged(); + } + } - public void cookItems () - { - if (!canCook()) - return; + public void cookItems () + { + if (!canCook()) + return; - for (int id = 2; id < 10; id++) //Check every slot - { - if (canCook()) - { - ItemStack result = getResultFor(inventory[id]); - if (result != null) - { - int ids = 2; - boolean placed = false; - while (ids < 10 && !placed) //Try to merge stacks first - { - if (inventory[ids] != null && inventory[ids].isItemEqual(result) && inventory[ids].stackSize < inventory[ids].getMaxStackSize()) - { - if (inventory[ids].stackSize + result.stackSize <= inventory[ids].getMaxStackSize()) - { - inventory[ids].stackSize += result.stackSize; - placed = true; - } - else - { - int decrement = inventory[ids].getMaxStackSize() - inventory[ids].stackSize; - inventory[ids].stackSize = inventory[ids].getMaxStackSize(); - result.stackSize -= decrement; - } - } - ids++; - } + for (int id = 2; id < 10; id++) //Check every slot + { + if (canCook()) + { + ItemStack result = getResultFor(inventory[id]); + if (result != null) + { + int ids = 2; + boolean placed = false; + while (ids < 10 && !placed) //Try to merge stacks first + { + if (inventory[ids] != null && inventory[ids].isItemEqual(result) && inventory[ids].stackSize < inventory[ids].getMaxStackSize()) + { + if (inventory[ids].stackSize + result.stackSize <= inventory[ids].getMaxStackSize()) + { + inventory[ids].stackSize += result.stackSize; + placed = true; + } + else + { + int decrement = inventory[ids].getMaxStackSize() - inventory[ids].stackSize; + inventory[ids].stackSize = inventory[ids].getMaxStackSize(); + result.stackSize -= decrement; + } + } + ids++; + } - ids = 2; - while (!placed && ids < 10) //Place remaining in slot - { - if (inventory[ids] == null) - { - inventory[ids] = result; - placed = true; - } - ids++; - } - - if (placed) - decrStackSize(id, 1); - } - } - } - } + ids = 2; + while (!placed && ids < 10) //Place remaining in slot + { + if (inventory[ids] == null) + { + inventory[ids] = result; + placed = true; + } + ids++; + } - public boolean canCook () - { - for (int id = 2; id < 10; id++) - { - if (inventory[id] == null) //Nothing here! - continue; + if (placed) + decrStackSize(id, 1); + } + } + } + } - ItemStack result = getResultFor(inventory[id]); - if (result == null) //Doesn't cook into anything - continue; + public boolean canCook () + { + for (int id = 2; id < 10; id++) + { + if (inventory[id] == null) //Nothing here! + continue; - for (int slotid = 2; slotid < 10; slotid++) - { - if (inventory[slotid] == null) - return true; + ItemStack result = getResultFor(inventory[id]); + if (result == null) //Doesn't cook into anything + continue; - else if (inventory[slotid].isItemEqual(result) && inventory[slotid].stackSize + result.stackSize <= inventory[slotid].getMaxStackSize()) - return true; - } - } - return false; - } + for (int slotid = 2; slotid < 10; slotid++) + { + if (inventory[slotid] == null) + return true; - public boolean isBurning () - { - return fuel > 0; - } + else if (inventory[slotid].isItemEqual(result) && inventory[slotid].stackSize + result.stackSize <= inventory[slotid].getMaxStackSize()) + return true; + } + } + return false; + } - public ItemStack getResultFor (ItemStack stack) - { - ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack); - if (result != null && result.getItem() instanceof ItemFood) //Only valid for food - return result.copy(); + public boolean isBurning () + { + return fuel > 0; + } - return null; - } + public ItemStack getResultFor (ItemStack stack) + { + ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack); + if (result != null && result.getItem() instanceof ItemFood) //Only valid for food + return result.copy(); - public static int getItemBurnTime (ItemStack stack) - { - if (stack == null) - { - return 0; - } - else - { - int itemID = stack.getItem().itemID; - Item item = stack.getItem(); + return null; + } - if (stack.getItem() instanceof ItemBlock && Block.blocksList[itemID] != null) - { - Block block = Block.blocksList[itemID]; + public static int getItemBurnTime (ItemStack stack) + { + if (stack == null) + { + return 0; + } + else + { + int itemID = stack.getItem().itemID; + Item item = stack.getItem(); - if (block == Block.woodSingleSlab) - { - return 150; - } - - if (block == Block.wood) - { - return 2400; - } + if (stack.getItem() instanceof ItemBlock && Block.blocksList[itemID] != null) + { + Block block = Block.blocksList[itemID]; - if (block.blockMaterial == Material.wood) - { - return 300; - } - } - if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) - return 200; - if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) - return 200; - if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) - return 200; - if (itemID == Item.stick.itemID) - return 100; - if (itemID == Item.coal.itemID) - return 800; - if (itemID == Item.bucketLava.itemID) - return 20000; - if (itemID == Block.sapling.blockID) - return 100; - if (itemID == Item.blazeRod.itemID) - return 2400; - return GameRegistry.getFuelValue(stack); - } - } + if (block == Block.woodSingleSlab) + { + return 150; + } - /* NBT */ - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - active = tags.getBoolean("Active"); - fuel = tags.getInteger("Fuel"); - fuelGague = tags.getInteger("FuelGague"); - } + if (block == Block.wood) + { + return 2400; + } - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - tags.setBoolean("Active", active); - tags.setInteger("Fuel", fuel); - tags.setInteger("FuelGague", fuelGague); - } + if (block.blockMaterial == Material.wood) + { + return 300; + } + } + if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) + return 200; + if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) + return 200; + if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) + return 200; + if (itemID == Item.stick.itemID) + return 100; + if (itemID == Item.coal.itemID) + return 800; + if (itemID == Item.bucketLava.itemID) + return 20000; + if (itemID == Block.sapling.blockID) + return 100; + if (itemID == Item.blazeRod.itemID) + return 2400; + return GameRegistry.getFuelValue(stack); + } + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return new FrypanContainer(inventoryplayer, this); - } - - /*@Override - public boolean canDropInventorySlot(int slot) - { - if (slot == 0) - return false; - else - return true; - }*/ + /* NBT */ + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + active = tags.getBoolean("Active"); + fuel = tags.getInteger("Fuel"); + fuelGague = tags.getInteger("FuelGague"); + } + + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + tags.setBoolean("Active", active); + tags.setInteger("Fuel", fuel); + tags.setInteger("FuelGague", fuelGague); + } + + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + return new FrypanContainer(inventoryplayer, this); + } + + /*@Override + public boolean canDropInventorySlot(int slot) + { + if (slot == 0) + return false; + else + return true; + }*/ } diff --git a/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java b/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java index 821f1d22..25b8e617 100644 --- a/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/GolemCoreLogic.java @@ -12,102 +12,106 @@ import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.world.World; -public class GolemCoreLogic extends InventoryLogic - implements IInventory +public class GolemCoreLogic extends InventoryLogic implements IInventory { public GolemCoreLogic() { - super(1); - } - - public ItemStack getKey() - { - return inventory[0]; + super(1); } - public void setKey(ItemStack itemstack) + public ItemStack getKey () + { + return inventory[0]; + } + + public void setKey (ItemStack itemstack) { inventory[0] = itemstack; onInventoryChanged(); } - public void clear() + public void clear () { - inventory[0] = null; + inventory[0] = null; } - public int getSizeInventory() + public int getSizeInventory () { return 1; } - public ItemStack getStackInSlot(int slot) + public ItemStack getStackInSlot (int slot) { return inventory[0]; } - public int getInventoryStackLimit() + public int getInventoryStackLimit () { return 1; } - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return true; } - public void openChest() {} - public void closeChest() {} + public void openChest () + { + } - public boolean isUseableByPlayer(EntityPlayer entityplayer) + public void closeChest () + { + } + + public boolean isUseableByPlayer (EntityPlayer entityplayer) { return true; } - @Override - public ItemStack getStackInSlotOnClosing (int i) - { - return null; - } + @Override + public ItemStack getStackInSlotOnClosing (int i) + { + return null; + } - @Override - public boolean isInvNameLocalized () - { - return false; - } + @Override + public boolean isInvNameLocalized () + { + return false; + } - @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) - { - return true; - } + @Override + public boolean isStackValidForSlot (int i, ItemStack itemstack) + { + return true; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return null; - } + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + return null; + } - @Override - protected String getDefaultName () - { - return "golems.core"; - } - - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeToNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + @Override + protected String getDefaultName () + { + return "golems.core"; + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readFromNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readFromNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java b/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java index e018718f..669b96b3 100644 --- a/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/GolemPedestalLogic.java @@ -10,8 +10,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.src.ModLoader; import net.minecraft.tileentity.TileEntity; -public class GolemPedestalLogic extends TileEntity - implements IInventory +public class GolemPedestalLogic extends TileEntity implements IInventory { public ItemStack supply; public static int cost[] = null; @@ -175,12 +174,12 @@ public class GolemPedestalLogic extends TileEntity } } - public int getSizeInventory() + public int getSizeInventory () { return 9; } - public ItemStack getStackInSlot(int i) + public ItemStack getStackInSlot (int i) { if (supply != null && supply.getItem() == null) { @@ -189,7 +188,7 @@ public class GolemPedestalLogic extends TileEntity return supply; } - public boolean subtractSoul(int i) + public boolean subtractSoul (int i) { System.out.println("SUBTRACT WHY"); if (supply == null || supply.itemID >= 512 || cost[supply.itemID] == 0) @@ -201,26 +200,29 @@ public class GolemPedestalLogic extends TileEntity int j = cost[supply.itemID]; int k = souls[supply.itemID]; int l = (supply.stackSize / j) * k; - System.out.println((new StringBuilder()).append("Subtracting amt").append(i).append(" s").append(k).append(" c").append(j).append(" ss").append(supply.stackSize).append(" id").append(supply.itemID).append(" sa").append(l).append(" calc").append(Math.ceil((double)i / (double)k)).toString()); + System.out.println((new StringBuilder()).append("Subtracting amt").append(i).append(" s").append(k).append(" c").append(j).append(" ss").append(supply.stackSize).append(" id") + .append(supply.itemID).append(" sa").append(l).append(" calc").append(Math.ceil((double) i / (double) k)).toString()); if (l < i) { worldObj.playSoundAtEntity(ModLoader.getMinecraftInstance().thePlayer, "mob.blaze.death", 1.0F, 0.5F); ModLoader.getMinecraftInstance().thePlayer.addChatMessage("I need more souls..."); return false; } - supply.stackSize -= Math.ceil((double)i / (double)k) * (double)j; + supply.stackSize -= Math.ceil((double) i / (double) k) * (double) j; if (supply.stackSize == 0) { supply = null; } else if (supply.stackSize < 0) { - throw new UnsupportedOperationException((new StringBuilder()).append("If you are getting this error then your golems mod has derped, \nplease contact billythegoat101 on the minecraftforums with the error code: LERN YO MATHS [i").append(supply.itemID).append(",ss").append(supply.stackSize).append(",a").append(i).append("]").toString()); + throw new UnsupportedOperationException((new StringBuilder()) + .append("If you are getting this error then your golems mod has derped, \nplease contact billythegoat101 on the minecraftforums with the error code: LERN YO MATHS [i") + .append(supply.itemID).append(",ss").append(supply.stackSize).append(",a").append(i).append("]").toString()); } return true; } - public ItemStack decrStackSize(int i, int j) + public ItemStack decrStackSize (int i, int j) { if (supply != null && supply.getItem() == null) { @@ -249,7 +251,7 @@ public class GolemPedestalLogic extends TileEntity } } - public void setInventorySlotContents(int i, ItemStack itemstack) + public void setInventorySlotContents (int i, ItemStack itemstack) { supply = itemstack; if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) @@ -263,7 +265,7 @@ public class GolemPedestalLogic extends TileEntity onInventoryChanged(); } - public void writeToNBT(NBTTagCompound nbttagcompound) + public void writeToNBT (NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); if (supply == null) @@ -274,21 +276,21 @@ public class GolemPedestalLogic extends TileEntity if (supply != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte)0); + nbttagcompound1.setByte("Slot", (byte) 0); supply.writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } nbttagcompound.setTag("Items", nbttaglist); } - public void readFromNBT(NBTTagCompound nbttagcompound) + public void readFromNBT (NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); supply = new ItemStack(0, 0, 0); NBTTagList nbttaglist = nbttagcompound.getTagList("Items"); for (int i = 0; i < nbttaglist.tagCount(); i++) { - NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i); + NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i); int j = nbttagcompound1.getByte("Slot") & 0xff; if (j >= 0 && j < 1) { @@ -302,57 +304,57 @@ public class GolemPedestalLogic extends TileEntity } } - public String getInvName() + public String getInvName () { return "golempedestalinv"; } - public int getInventoryStackLimit() + public int getInventoryStackLimit () { return 64; } - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return true; } - public void openChest() + public void openChest () { } - public void closeChest() + public void closeChest () { } - public void clear() + public void clear () { supply = null; } - public boolean isUseableByPlayer(EntityPlayer entityplayer) + public boolean isUseableByPlayer (EntityPlayer entityplayer) { return true; } - @Override - public ItemStack getStackInSlotOnClosing (int i) - { - // TODO Auto-generated method stub - return null; - } + @Override + public ItemStack getStackInSlotOnClosing (int i) + { + // TODO Auto-generated method stub + return null; + } - @Override - public boolean isInvNameLocalized () - { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isInvNameLocalized () + { + // TODO Auto-generated method stub + return false; + } - @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) - { - // TODO Auto-generated method stub - return false; - } + @Override + public boolean isStackValidForSlot (int i, ItemStack itemstack) + { + // TODO Auto-generated method stub + return false; + } } diff --git a/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java b/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java index 7c7f7bb8..9260770c 100644 --- a/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/LavaTankLogic.java @@ -14,177 +14,177 @@ import net.minecraftforge.liquids.LiquidTank; public class LavaTankLogic extends MultiServantLogic implements ITankContainer { - public LiquidTank tank; - public int renderOffset; - //public LiquidStack renderLiquid; - //public int counter; - //public int updateAmount; + public LiquidTank tank; + public int renderOffset; - public LavaTankLogic() - { - tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * 4); - } + //public LiquidStack renderLiquid; + //public int counter; + //public int updateAmount; - @Override - public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) - { - return fill(0, resource, doFill); - } + public LavaTankLogic() + { + tank = new LiquidTank(LiquidContainerRegistry.BUCKET_VOLUME * 4); + } - @Override - public int fill (int tankIndex, LiquidStack resource, boolean doFill) - { - /*if (resource != null && resource.amount > 20 && counter == 0) - { - if (tank.getLiquid() == null) - { - renderLiquid = new LiquidStack(resource.itemID, 0, resource.itemMeta); - } - else - { - renderLiquid = tank.getLiquid(); - } - counter = 24; - updateAmount = resource.amount / 24; - System.out.println("renderLiquid: "+renderLiquid.amount); - }*/ - //renderLiquid = tank.getLiquid(); - int amount = tank.fill(resource, doFill); - if (amount > 0 && doFill) - { - renderOffset = resource.amount; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } + @Override + public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) + { + return fill(0, resource, doFill); + } - //System.out.println("tankLiquid: "+tank.getLiquid().amount); - return amount; - } + @Override + public int fill (int tankIndex, LiquidStack resource, boolean doFill) + { + /*if (resource != null && resource.amount > 20 && counter == 0) + { + if (tank.getLiquid() == null) + { + renderLiquid = new LiquidStack(resource.itemID, 0, resource.itemMeta); + } + else + { + renderLiquid = tank.getLiquid(); + } + counter = 24; + updateAmount = resource.amount / 24; + System.out.println("renderLiquid: "+renderLiquid.amount); + }*/ + //renderLiquid = tank.getLiquid(); + int amount = tank.fill(resource, doFill); + if (amount > 0 && doFill) + { + renderOffset = resource.amount; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } - @Override - public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) - { - return drain(0, maxDrain, doDrain); - } + //System.out.println("tankLiquid: "+tank.getLiquid().amount); + return amount; + } - @Override - public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) - { - /*if (maxDrain > 20 && counter == 0) - { - renderLiquid = tank.getLiquid(); - counter = 24; - updateAmount = -(maxDrain / 24); - }*/ + @Override + public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) + { + return drain(0, maxDrain, doDrain); + } - - LiquidStack amount = tank.drain(maxDrain, doDrain); - if (amount != null && doDrain) - { - renderOffset = -maxDrain; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - return amount; - } + @Override + public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) + { + /*if (maxDrain > 20 && counter == 0) + { + renderLiquid = tank.getLiquid(); + counter = 24; + updateAmount = -(maxDrain / 24); + }*/ - @Override - public ILiquidTank[] getTanks (ForgeDirection direction) - { - return new ILiquidTank[] { tank }; - } + LiquidStack amount = tank.drain(maxDrain, doDrain); + if (amount != null && doDrain) + { + renderOffset = -maxDrain; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + return amount; + } - @Override - public ILiquidTank getTank (ForgeDirection direction, LiquidStack type) - { - return tank; - } + @Override + public ILiquidTank[] getTanks (ForgeDirection direction) + { + return new ILiquidTank[] { tank }; + } - public float getLiquidAmountScaled () - { - return (float) (tank.getLiquid().amount - renderOffset) / (float) (tank.getCapacity() * 1.01F); - } + @Override + public ILiquidTank getTank (ForgeDirection direction, LiquidStack type) + { + return tank; + } - public boolean containsLiquid () - { - return tank.getLiquid() != null; - } + public float getLiquidAmountScaled () + { + return (float) (tank.getLiquid().amount - renderOffset) / (float) (tank.getCapacity() * 1.01F); + } - public int getBrightness () - { - if (containsLiquid()) - { - int id = tank.getLiquid().itemID; - if (id < 4096) - { - return Block.lightValue[id]; - } - } - return 0; - } + public boolean containsLiquid () + { + return tank.getLiquid() != null; + } - @Override - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - readCustomNBT(tags); - } + public int getBrightness () + { + if (containsLiquid()) + { + int id = tank.getLiquid().itemID; + if (id < 4096) + { + return Block.lightValue[id]; + } + } + return 0; + } - @Override - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - writeCustomNBT(tags); - } + @Override + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } - public void readCustomNBT (NBTTagCompound tags) - { - if (tags.getBoolean("hasLiquid")) - tank.setLiquid(new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta"))); - else - tank.setLiquid(null); - //renderLiquid = tank.getLiquid(); - } + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } - public void writeCustomNBT (NBTTagCompound tags) - { - LiquidStack liquid = tank.getLiquid(); - tags.setBoolean("hasLiquid", liquid != null); - if (liquid != null) - { - tags.setInteger("itemID", liquid.itemID); - tags.setInteger("amount", liquid.amount); - tags.setInteger("itemMeta", liquid.itemMeta); - } - } + public void readCustomNBT (NBTTagCompound tags) + { + if (tags.getBoolean("hasLiquid")) + tank.setLiquid(new LiquidStack(tags.getInteger("itemID"), tags.getInteger("amount"), tags.getInteger("itemMeta"))); + else + tank.setLiquid(null); + //renderLiquid = tank.getLiquid(); + } - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeCustomNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + public void writeCustomNBT (NBTTagCompound tags) + { + LiquidStack liquid = tank.getLiquid(); + tags.setBoolean("hasLiquid", liquid != null); + if (liquid != null) + { + tags.setInteger("itemID", liquid.itemID); + tags.setInteger("amount", liquid.amount); + tags.setInteger("itemMeta", liquid.itemMeta); + } + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readCustomNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } - /* Updating */ - public boolean canUpdate () - { - return true; - } + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } - @Override - public void updateEntity () - { - if (renderOffset > 0) - { - renderOffset -= 6; - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } - } + /* Updating */ + public boolean canUpdate () + { + return true; + } + + @Override + public void updateEntity () + { + if (renderOffset > 0) + { + renderOffset -= 6; + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } + } } diff --git a/mods/tinker/tconstruct/blocks/logic/LiquidTextureLogic.java b/mods/tinker/tconstruct/blocks/logic/LiquidTextureLogic.java index a61771f7..24ad8348 100644 --- a/mods/tinker/tconstruct/blocks/logic/LiquidTextureLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/LiquidTextureLogic.java @@ -8,58 +8,58 @@ import net.minecraft.tileentity.TileEntity; public class LiquidTextureLogic extends TileEntity { - int texturePos; + int texturePos; - public boolean canUpdate() + public boolean canUpdate () { return false; } - - public void setLiquidType (int tex) - { - texturePos = tex; - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } - public int getLiquidType () - { - return texturePos; - } + public void setLiquidType (int tex) + { + texturePos = tex; + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - readCustomNBT(tags); - } - - public void readCustomNBT(NBTTagCompound tags) - { - texturePos = tags.getInteger("Texture"); - } + public int getLiquidType () + { + return texturePos; + } - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - writeCustomNBT(tags); - } - - public void writeCustomNBT (NBTTagCompound tags) - { - tags.setInteger("Texture", texturePos); - } + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeCustomNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + public void readCustomNBT (NBTTagCompound tags) + { + texturePos = tags.getInteger("Texture"); + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readCustomNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } + + public void writeCustomNBT (NBTTagCompound tags) + { + tags.setInteger("Texture", texturePos); + } + + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java b/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java index 7174b087..88e875b7 100644 --- a/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/MultiServantLogic.java @@ -11,139 +11,138 @@ import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.liquids.LiquidStack; -public class MultiServantLogic extends TileEntity - implements IServantLogic +public class MultiServantLogic extends TileEntity implements IServantLogic { - boolean hasMaster; - CoordTuple master; - short masterID; - byte masterMeat; //Typo, it stays! - - public boolean canUpdate() + boolean hasMaster; + CoordTuple master; + short masterID; + byte masterMeat; //Typo, it stays! + + public boolean canUpdate () { return false; } - public boolean hasValidMaster () - { - if (!hasMaster) - return false; - - if (worldObj.getBlockId(master.x, master.y, master.z) == masterID && worldObj.getBlockMetadata(master.x, master.y, master.z) == masterMeat) - return true; - else - { - hasMaster = false; - master = null; - return false; - } - } + public boolean hasValidMaster () + { + if (!hasMaster) + return false; - public CoordTuple getMasterPosition () - { - return master; - } - - public void overrideMaster(int x, int y, int z) - { - hasMaster = true; - master = new CoordTuple(x, y, z); - masterID = (short) worldObj.getBlockId(x, y, z); - masterMeat = (byte) worldObj.getBlockMetadata(x, y, z); - } - - public void removeMaster() - { - hasMaster = false; - master = null; - masterID = 0; - masterMeat = 0; - } - - public boolean verifyMaster(int x, int y, int z) - { - if (master.equalCoords(x, y, z) && worldObj.getBlockId(x, y, z) == masterID && worldObj.getBlockMetadata(x, y, z) == masterMeat) - return true; - else - return false; - } - - public boolean setMaster(int x, int y, int z) - { - if (!hasMaster || worldObj.getBlockId(master.x, master.y, master.z) != masterID || (worldObj.getBlockMetadata(master.x, master.y, master.z) != masterMeat)) - { - overrideMaster(x, y, z); - return true; - } - else - { - return false; - } - } - - public void notifyMasterOfChange() - { - if (hasValidMaster()) - { - IMasterLogic logic = (IMasterLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - logic.notifyChange(xCoord, yCoord, zCoord); - } - } + if (worldObj.getBlockId(master.x, master.y, master.z) == masterID && worldObj.getBlockMetadata(master.x, master.y, master.z) == masterMeat) + return true; + else + { + hasMaster = false; + master = null; + return false; + } + } - public void readCustomNBT (NBTTagCompound tags) - { - hasMaster = tags.getBoolean("HasMaster"); - if (hasMaster) - { - int xCenter = tags.getInteger("xCenter"); - int yCenter = tags.getInteger("yCenter"); - int zCenter = tags.getInteger("zCenter"); - master = new CoordTuple(xCenter, yCenter, zCenter); - masterID = tags.getShort("MasterID"); - masterMeat = tags.getByte("masterMeat"); - } - } + public CoordTuple getMasterPosition () + { + return master; + } - public void writeCustomNBT (NBTTagCompound tags) - { - tags.setBoolean("HasMaster", hasMaster); - if (hasMaster) - { - tags.setInteger("xCenter", master.x); - tags.setInteger("yCenter", master.y); - tags.setInteger("zCenter", master.z); - tags.setShort("MasterID", masterID); - tags.setByte("masterMeat", masterMeat); - } - } - - @Override - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - readCustomNBT(tags); - } + public void overrideMaster (int x, int y, int z) + { + hasMaster = true; + master = new CoordTuple(x, y, z); + masterID = (short) worldObj.getBlockId(x, y, z); + masterMeat = (byte) worldObj.getBlockMetadata(x, y, z); + } - @Override - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - writeCustomNBT(tags); - } + public void removeMaster () + { + hasMaster = false; + master = null; + masterID = 0; + masterMeat = 0; + } - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeCustomNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + public boolean verifyMaster (int x, int y, int z) + { + if (master.equalCoords(x, y, z) && worldObj.getBlockId(x, y, z) == masterID && worldObj.getBlockMetadata(x, y, z) == masterMeat) + return true; + else + return false; + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readCustomNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + public boolean setMaster (int x, int y, int z) + { + if (!hasMaster || worldObj.getBlockId(master.x, master.y, master.z) != masterID || (worldObj.getBlockMetadata(master.x, master.y, master.z) != masterMeat)) + { + overrideMaster(x, y, z); + return true; + } + else + { + return false; + } + } + + public void notifyMasterOfChange () + { + if (hasValidMaster()) + { + IMasterLogic logic = (IMasterLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + logic.notifyChange(xCoord, yCoord, zCoord); + } + } + + public void readCustomNBT (NBTTagCompound tags) + { + hasMaster = tags.getBoolean("HasMaster"); + if (hasMaster) + { + int xCenter = tags.getInteger("xCenter"); + int yCenter = tags.getInteger("yCenter"); + int zCenter = tags.getInteger("zCenter"); + master = new CoordTuple(xCenter, yCenter, zCenter); + masterID = tags.getShort("MasterID"); + masterMeat = tags.getByte("masterMeat"); + } + } + + public void writeCustomNBT (NBTTagCompound tags) + { + tags.setBoolean("HasMaster", hasMaster); + if (hasMaster) + { + tags.setInteger("xCenter", master.x); + tags.setInteger("yCenter", master.y); + tags.setInteger("zCenter", master.z); + tags.setShort("MasterID", masterID); + tags.setByte("masterMeat", masterMeat); + } + } + + @Override + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } + + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } + + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/PartCrafterLogic.java b/mods/tinker/tconstruct/blocks/logic/PartCrafterLogic.java index b1aa5274..4b78550a 100644 --- a/mods/tinker/tconstruct/blocks/logic/PartCrafterLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/PartCrafterLogic.java @@ -13,155 +13,154 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -public class PartCrafterLogic extends InventoryLogic - implements ISidedInventory +public class PartCrafterLogic extends InventoryLogic implements ISidedInventory { - boolean craftedTop; - boolean craftedBottom; + boolean craftedTop; + boolean craftedBottom; - public PartCrafterLogic() - { - super(10); - craftedTop = false; - craftedBottom = false; - } + public PartCrafterLogic() + { + super(10); + craftedTop = false; + craftedBottom = false; + } - @Override - public String getDefaultName () - { - return "toolstation.parts"; - } + @Override + public String getDefaultName () + { + return "toolstation.parts"; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - for (int xPos = x-1; xPos <= x+1; xPos++) - { - for (int zPos = z-1; zPos <= z+1; zPos++) - { - TileEntity tile = world.getBlockTileEntity(xPos, y, zPos); - if (tile != null && tile instanceof PatternChestLogic) - return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic)tile); - } - } - return new PartCrafterContainer(inventoryplayer, this); - } + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + for (int xPos = x - 1; xPos <= x + 1; xPos++) + { + for (int zPos = z - 1; zPos <= z + 1; zPos++) + { + TileEntity tile = world.getBlockTileEntity(xPos, y, zPos); + if (tile != null && tile instanceof PatternChestLogic) + return new PartCrafterChestContainer(inventoryplayer, this, (PatternChestLogic) tile); + } + } + return new PartCrafterContainer(inventoryplayer, this); + } - //Called when emptying a slot, not when another item is placed in it - public ItemStack decrStackSize (int slotID, int quantity) - { - ItemStack returnStack = super.decrStackSize(slotID, quantity); - tryBuildPart(slotID); - return returnStack; - } - - public void tryBuildPart(int slotID) - { - if (slotID == 4 || slotID == 5) - { - if (!craftedTop && inventory[0] != null) - { - int value = PatternBuilder.instance.getPartValue(inventory[2]); - IPattern item = (IPattern)inventory[0].getItem(); - int cost = item != null ? item.getPatternCost(inventory[0]) : 0; - if (value > 0 && cost > 0) - { - int decrease = cost / value; - if (cost % value != 0) - decrease++; - super.decrStackSize(2, decrease); //Call super to avoid crafting again - } - } - - if (inventory[4] != null || inventory[5] != null) - craftedTop = true; - else - craftedTop = false; - } + //Called when emptying a slot, not when another item is placed in it + public ItemStack decrStackSize (int slotID, int quantity) + { + ItemStack returnStack = super.decrStackSize(slotID, quantity); + tryBuildPart(slotID); + return returnStack; + } - if (!craftedTop) - buildTopPart(); - - if (slotID == 6 || slotID == 7) - { - if (!craftedBottom && inventory[1] != null) - { - int value = PatternBuilder.instance.getPartValue(inventory[3]); - IPattern item = (IPattern)inventory[1].getItem(); - int cost = item != null ? item.getPatternCost(inventory[1]) : 0; - if (value > 0 && cost > 0) - { - int decrease = cost / value; - if (cost % value != 0) - decrease++; - super.decrStackSize(3, decrease); //Call super to avoid crafting again - } - } - - if (inventory[6] != null || inventory[7] != null) - craftedBottom = true; - else - craftedBottom = false; - } + public void tryBuildPart (int slotID) + { + if (slotID == 4 || slotID == 5) + { + if (!craftedTop && inventory[0] != null) + { + int value = PatternBuilder.instance.getPartValue(inventory[2]); + IPattern item = (IPattern) inventory[0].getItem(); + int cost = item != null ? item.getPatternCost(inventory[0]) : 0; + if (value > 0 && cost > 0) + { + int decrease = cost / value; + if (cost % value != 0) + decrease++; + super.decrStackSize(2, decrease); //Call super to avoid crafting again + } + } - if (!craftedBottom) - buildBottomPart(); - } + if (inventory[4] != null || inventory[5] != null) + craftedTop = true; + else + craftedTop = false; + } - //Called when a slot has something placed into it. - public void setInventorySlotContents (int slot, ItemStack itemstack) - { - super.setInventorySlotContents(slot, itemstack); - if ((slot == 0 || slot == 2) && !craftedTop) - buildTopPart(); - if ((slot == 1 || slot == 3) && !craftedBottom) - buildBottomPart(); - } + if (!craftedTop) + buildTopPart(); - void buildTopPart () - { - ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[2], inventory[0], inventory[1]); - if (parts != null) - { - inventory[4] = parts[0]; - inventory[5] = parts[1]; - } - else - { - inventory[4] = inventory[5] = null; - } - } + if (slotID == 6 || slotID == 7) + { + if (!craftedBottom && inventory[1] != null) + { + int value = PatternBuilder.instance.getPartValue(inventory[3]); + IPattern item = (IPattern) inventory[1].getItem(); + int cost = item != null ? item.getPatternCost(inventory[1]) : 0; + if (value > 0 && cost > 0) + { + int decrease = cost / value; + if (cost % value != 0) + decrease++; + super.decrStackSize(3, decrease); //Call super to avoid crafting again + } + } - void buildBottomPart () - { - ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[3], inventory[1], inventory[0]); - if (parts != null) - { - inventory[6] = parts[0]; - inventory[7] = parts[1]; - } - else - { - inventory[6] = inventory[7] = null; - } - } + if (inventory[6] != null || inventory[7] != null) + craftedBottom = true; + else + craftedBottom = false; + } - /* NBT */ - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - craftedTop = tags.getBoolean("CraftedTop"); - craftedBottom = tags.getBoolean("CraftedBottom"); - } + if (!craftedBottom) + buildBottomPart(); + } - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - tags.setBoolean("CraftedTop", craftedTop); - tags.setBoolean("CraftedBottom", craftedBottom); - } - - @Override + //Called when a slot has something placed into it. + public void setInventorySlotContents (int slot, ItemStack itemstack) + { + super.setInventorySlotContents(slot, itemstack); + if ((slot == 0 || slot == 2) && !craftedTop) + buildTopPart(); + if ((slot == 1 || slot == 3) && !craftedBottom) + buildBottomPart(); + } + + void buildTopPart () + { + ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[2], inventory[0], inventory[1]); + if (parts != null) + { + inventory[4] = parts[0]; + inventory[5] = parts[1]; + } + else + { + inventory[4] = inventory[5] = null; + } + } + + void buildBottomPart () + { + ItemStack[] parts = PatternBuilder.instance.getToolPart(inventory[3], inventory[1], inventory[0]); + if (parts != null) + { + inventory[6] = parts[0]; + inventory[7] = parts[1]; + } + else + { + inventory[6] = inventory[7] = null; + } + } + + /* NBT */ + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + craftedTop = tags.getBoolean("CraftedTop"); + craftedBottom = tags.getBoolean("CraftedBottom"); + } + + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + tags.setBoolean("CraftedTop", craftedTop); + tags.setBoolean("CraftedBottom", craftedBottom); + } + + @Override public int[] getAccessibleSlotsFromSide (int side) { return new int[0]; diff --git a/mods/tinker/tconstruct/blocks/logic/PatternChestLogic.java b/mods/tinker/tconstruct/blocks/logic/PatternChestLogic.java index 26c0a3ca..c147af1a 100644 --- a/mods/tinker/tconstruct/blocks/logic/PatternChestLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/PatternChestLogic.java @@ -8,25 +8,25 @@ import net.minecraft.world.World; public class PatternChestLogic extends InventoryLogic { - public PatternChestLogic() - { - super(30); - } - - public boolean canUpdate() + public PatternChestLogic() + { + super(30); + } + + public boolean canUpdate () { return false; } - @Override - public String getDefaultName () - { - return "toolstation.patternholder"; - } + @Override + public String getDefaultName () + { + return "toolstation.patternholder"; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return new PatternChestContainer(inventoryplayer, this); - } + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + return new PatternChestContainer(inventoryplayer, this); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java b/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java index 0825849d..37a53b76 100644 --- a/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/RedwireLogic.java @@ -9,65 +9,65 @@ import net.minecraft.tileentity.TileEntity; public class RedwireLogic extends TileEntity { - byte facesUsed; - byte type; - byte distanceTravelled; - byte maxDistance; - - public void readCustomNBT (NBTTagCompound tags) - { - /*hasMaster = tags.getBoolean("HasMaster"); - if (hasMaster) - { - int xCenter = tags.getInteger("xCenter"); - int yCenter = tags.getInteger("yCenter"); - int zCenter = tags.getInteger("zCenter"); - master = new CoordTuple(xCenter, yCenter, zCenter); - masterID = tags.getShort("MasterID"); - masterMeat = tags.getByte("masterMeat"); - }*/ - } + byte facesUsed; + byte type; + byte distanceTravelled; + byte maxDistance; - public void writeCustomNBT (NBTTagCompound tags) - { - /*tags.setBoolean("HasMaster", hasMaster); - if (hasMaster) - { - tags.setInteger("xCenter", master.x); - tags.setInteger("yCenter", master.y); - tags.setInteger("zCenter", master.z); - tags.setShort("MasterID", masterID); - tags.setByte("masterMeat", masterMeat); - }*/ - } - - @Override - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - readCustomNBT(tags); - } + public void readCustomNBT (NBTTagCompound tags) + { + /*hasMaster = tags.getBoolean("HasMaster"); + if (hasMaster) + { + int xCenter = tags.getInteger("xCenter"); + int yCenter = tags.getInteger("yCenter"); + int zCenter = tags.getInteger("zCenter"); + master = new CoordTuple(xCenter, yCenter, zCenter); + masterID = tags.getShort("MasterID"); + masterMeat = tags.getByte("masterMeat"); + }*/ + } - @Override - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - writeCustomNBT(tags); - } + public void writeCustomNBT (NBTTagCompound tags) + { + /*tags.setBoolean("HasMaster", hasMaster); + if (hasMaster) + { + tags.setInteger("xCenter", master.x); + tags.setInteger("yCenter", master.y); + tags.setInteger("zCenter", master.z); + tags.setShort("MasterID", masterID); + tags.setByte("masterMeat", masterMeat); + }*/ + } - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeCustomNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + @Override + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readCustomNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } + + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java b/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java index 4fadbf75..76b98e94 100644 --- a/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/SmelteryDrainLogic.java @@ -12,189 +12,188 @@ import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.LiquidStack; -public class SmelteryDrainLogic extends MultiServantLogic - implements ITankContainer, IFacingLogic +public class SmelteryDrainLogic extends MultiServantLogic implements ITankContainer, IFacingLogic { - byte direction; + byte direction; - public boolean canUpdate () - { - return false; - } + public boolean canUpdate () + { + return false; + } - /*@Override - public LiquidStack getLiquid () - { - return null; - } + /*@Override + public LiquidStack getLiquid () + { + return null; + } - @Override - public int getCapacity () - { - if (!hasMaster) - return 0; + @Override + public int getCapacity () + { + if (!hasMaster) + return 0; - SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - return smeltery.getCapacity(); - }*/ + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return smeltery.getCapacity(); + }*/ - /*@Override - public int fill (LiquidStack resource, boolean doFill) - { - - }*/ + /*@Override + public int fill (LiquidStack resource, boolean doFill) + { + + }*/ - /*@Override - public LiquidStack drain (int maxDrain, boolean doDrain) - { - - }*/ + /*@Override + public LiquidStack drain (int maxDrain, boolean doDrain) + { + + }*/ - @Override - public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) - { - //if (from == ForgeDirection.OPPOSITES[getRenderDirection()]) - return fill(0, resource, doFill); - //return 0; - } + @Override + public int fill (ForgeDirection from, LiquidStack resource, boolean doFill) + { + //if (from == ForgeDirection.OPPOSITES[getRenderDirection()]) + return fill(0, resource, doFill); + //return 0; + } - @Override - public int fill (int tankIndex, LiquidStack resource, boolean doFill) - { - if (hasMaster && resource != null) - { - if (doFill) - { - SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - return smeltery.fill(resource, doFill); - } - else - { - return resource.amount; - } - } - else - { - return 0; - } - } + @Override + public int fill (int tankIndex, LiquidStack resource, boolean doFill) + { + if (hasMaster && resource != null) + { + if (doFill) + { + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return smeltery.fill(resource, doFill); + } + else + { + return resource.amount; + } + } + else + { + return 0; + } + } - @Override - public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) - { - return drain(0, maxDrain, doDrain); - } + @Override + public LiquidStack drain (ForgeDirection from, int maxDrain, boolean doDrain) + { + return drain(0, maxDrain, doDrain); + } - @Override - public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) - { - if (hasValidMaster()) - { - SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - return smeltery.drain(maxDrain, doDrain); - } - else - { - return null; - } - } + @Override + public LiquidStack drain (int tankIndex, int maxDrain, boolean doDrain) + { + if (hasValidMaster()) + { + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return smeltery.drain(maxDrain, doDrain); + } + else + { + return null; + } + } - @Override - public ILiquidTank[] getTanks (ForgeDirection direction) - { - if (hasValidMaster()) - { - SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - return new ILiquidTank[] { smeltery }; - } - return null; - } + @Override + public ILiquidTank[] getTanks (ForgeDirection direction) + { + if (hasValidMaster()) + { + SmelteryLogic smeltery = (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + return new ILiquidTank[] { smeltery }; + } + return null; + } - @Override - public ILiquidTank getTank (ForgeDirection direction, LiquidStack type) - { - if (hasValidMaster()) - { - return (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); - } - return null; - } + @Override + public ILiquidTank getTank (ForgeDirection direction, LiquidStack type) + { + if (hasValidMaster()) + { + return (SmelteryLogic) worldObj.getBlockTileEntity(master.x, master.y, master.z); + } + return null; + } - @Override - public byte getRenderDirection () - { - return direction; - } - - @Override - public ForgeDirection getForgeDirection() - { - return ForgeDirection.VALID_DIRECTIONS[direction]; - } + @Override + public byte getRenderDirection () + { + return direction; + } + + @Override + public ForgeDirection getForgeDirection () + { + return ForgeDirection.VALID_DIRECTIONS[direction]; + } @Override public void setDirection (int side) { - + } - @Override - public void setDirection (float yaw, float pitch, EntityLiving player) - { - if (pitch > 45) - direction = 1; - else if (pitch < -45) - direction = 0; - else - { - int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; - switch (facing) - { - case 0: - direction = 2; - break; + @Override + public void setDirection (float yaw, float pitch, EntityLiving player) + { + if (pitch > 45) + direction = 1; + else if (pitch < -45) + direction = 0; + else + { + int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3; + switch (facing) + { + case 0: + direction = 2; + break; - case 1: - direction = 5; - break; + case 1: + direction = 5; + break; - case 2: - direction = 3; - break; + case 2: + direction = 3; + break; - case 3: - direction = 4; - break; - } - } - } - - public void readFromNBT (NBTTagCompound tags) - { - super.readFromNBT(tags); - direction = tags.getByte("Direction"); - } + case 3: + direction = 4; + break; + } + } + } - @Override - public void writeToNBT (NBTTagCompound tags) - { - super.writeToNBT(tags); - tags.setByte("Direction", direction); - } + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + direction = tags.getByte("Direction"); + } - /* Packets */ - @Override - public Packet getDescriptionPacket () - { - NBTTagCompound tag = new NBTTagCompound(); - writeToNBT(tag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); - } + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + tags.setByte("Direction", direction); + } - @Override - public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) - { - readFromNBT(packet.customParam1); - worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - } + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeToNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readFromNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java b/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java index 17898e73..bda8e701 100644 --- a/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/SmelteryLogic.java @@ -191,11 +191,11 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { return ForgeDirection.VALID_DIRECTIONS[direction]; } - + @Override public void setDirection (int side) { - + } @Override diff --git a/mods/tinker/tconstruct/blocks/logic/StencilTableLogic.java b/mods/tinker/tconstruct/blocks/logic/StencilTableLogic.java index e797f3b6..3a7df5af 100644 --- a/mods/tinker/tconstruct/blocks/logic/StencilTableLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/StencilTableLogic.java @@ -9,73 +9,72 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -public class StencilTableLogic extends InventoryLogic - implements ISidedInventory +public class StencilTableLogic extends InventoryLogic implements ISidedInventory { - public StencilTableLogic() - { - super(2); - } - - public boolean canUpdate() + public StencilTableLogic() + { + super(2); + } + + public boolean canUpdate () { return false; } - @Override - public String getDefaultName () - { - return "toolstation.PatternShaper"; - } + @Override + public String getDefaultName () + { + return "toolstation.PatternShaper"; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return new PatternShaperContainer(inventoryplayer, this); - } - - /*@Override - public void onInventoryChanged() + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) { - if (inventory[0] == null) - inventory[1] = null; - super.onInventoryChanged(); + return new PatternShaperContainer(inventoryplayer, this); + } + + /*@Override + public void onInventoryChanged() + { + if (inventory[0] == null) + inventory[1] = null; + super.onInventoryChanged(); }*/ - - @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) + + @Override + public void setInventorySlotContents (int slot, ItemStack itemstack) { - super.setInventorySlotContents(slot, itemstack); - if (slot == 0 && itemstack != null && itemstack.getItem() instanceof mods.tinker.tconstruct.items.Pattern) - { - if (itemstack.getItemDamage() == 0) - setInventorySlotContents(1, new ItemStack(TContent.woodPattern, 1, 1)); - else if (itemstack.getItemDamage() == 1) - setInventorySlotContents(1, new ItemStack(TContent.metalPattern, 1, 0)); - } + super.setInventorySlotContents(slot, itemstack); + if (slot == 0 && itemstack != null && itemstack.getItem() instanceof mods.tinker.tconstruct.items.Pattern) + { + if (itemstack.getItemDamage() == 0) + setInventorySlotContents(1, new ItemStack(TContent.woodPattern, 1, 1)); + else if (itemstack.getItemDamage() == 1) + setInventorySlotContents(1, new ItemStack(TContent.metalPattern, 1, 0)); + } } - - @Override - public ItemStack decrStackSize(int slot, int quantity) + + @Override + public ItemStack decrStackSize (int slot, int quantity) { - if (slot == 1) - { - super.decrStackSize(0, 1); - if (inventory[0] == null) - return super.decrStackSize(slot, quantity); - else - return inventory[1].copy(); - } - else - { - ItemStack ret = super.decrStackSize(slot, quantity); - if (inventory[0] == null) - super.decrStackSize(1, 1); - return ret; - } + if (slot == 1) + { + super.decrStackSize(0, 1); + if (inventory[0] == null) + return super.decrStackSize(slot, quantity); + else + return inventory[1].copy(); + } + else + { + ItemStack ret = super.decrStackSize(slot, quantity); + if (inventory[0] == null) + super.decrStackSize(1, 1); + return ret; + } } - - public void altDecrStackSize(int slot, int quantity) + + public void altDecrStackSize (int slot, int quantity) { if (inventory[slot] != null) { @@ -93,17 +92,17 @@ public class StencilTableLogic extends InventoryLogic return; } } - - @Override - public boolean canDropInventorySlot(int slot) - { - if (slot == 0) - return true; - else - return false; - } - - @Override + + @Override + public boolean canDropInventorySlot (int slot) + { + if (slot == 0) + return true; + else + return false; + } + + @Override public int[] getAccessibleSlotsFromSide (int side) { return new int[0]; diff --git a/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java b/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java index d6ad67a1..d1001ef8 100644 --- a/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/ToolForgeLogic.java @@ -13,44 +13,42 @@ import net.minecraft.world.World; /* Simple class for storing items in the block */ -public class ToolForgeLogic extends ToolStationLogic - implements ISidedInventory +public class ToolForgeLogic extends ToolStationLogic implements ISidedInventory { - ItemStack previousTool; - String toolName; + ItemStack previousTool; + String toolName; - public ToolForgeLogic() - { - super(6); - toolName = ""; - } - + public ToolForgeLogic() + { + super(6); + toolName = ""; + } - @Override - public String getDefaultName () - { - return "toolforge.crafting"; - } + @Override + public String getDefaultName () + { + return "toolforge.crafting"; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return new ToolForgeContainer(inventoryplayer, this); - } + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + return new ToolForgeContainer(inventoryplayer, this); + } - public void buildTool (String name) - { - toolName = name; - ItemStack tool = ToolBuilder.instance.buildTool(inventory[1], inventory[2], inventory[3], inventory[4], name); - if (inventory[0] == null) - inventory[0] = tool; - else - { - NBTTagCompound tags = inventory[0].getTagCompound(); - if (!tags.getCompoundTag("InfiTool").hasKey("Built")) - { - inventory[0] = tool; - } - } - } + public void buildTool (String name) + { + toolName = name; + ItemStack tool = ToolBuilder.instance.buildTool(inventory[1], inventory[2], inventory[3], inventory[4], name); + if (inventory[0] == null) + inventory[0] = tool; + else + { + NBTTagCompound tags = inventory[0].getTagCompound(); + if (!tags.getCompoundTag("InfiTool").hasKey("Built")) + { + inventory[0] = tool; + } + } + } } diff --git a/mods/tinker/tconstruct/blocks/logic/ToolStationLogic.java b/mods/tinker/tconstruct/blocks/logic/ToolStationLogic.java index 75ce61f4..dbc123e7 100644 --- a/mods/tinker/tconstruct/blocks/logic/ToolStationLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/ToolStationLogic.java @@ -13,87 +13,86 @@ import net.minecraft.world.World; /* Simple class for storing items in the block */ -public class ToolStationLogic extends InventoryLogic - implements ISidedInventory +public class ToolStationLogic extends InventoryLogic implements ISidedInventory { - public ItemStack previousTool; - public String toolName; + public ItemStack previousTool; + public String toolName; - public ToolStationLogic() - { - super(4); - toolName = ""; - } + public ToolStationLogic() + { + super(4); + toolName = ""; + } public ToolStationLogic(int slots) { super(slots); toolName = ""; } - - public boolean canDropInventorySlot(int slot) + + public boolean canDropInventorySlot (int slot) { - if (slot == 0) - return false; + if (slot == 0) + return false; return true; } - @Override - public ItemStack getStackInSlotOnClosing (int var1) - { - return null; - } + @Override + public ItemStack getStackInSlotOnClosing (int var1) + { + return null; + } - @Override - public String getDefaultName () - { - return "toolstation.crafting"; - } + @Override + public String getDefaultName () + { + return "toolstation.crafting"; + } - @Override - public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) - { - return new ToolStationContainer(inventoryplayer, this); - } + @Override + public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) + { + return new ToolStationContainer(inventoryplayer, this); + } - public void onInventoryChanged () - { - buildTool(toolName); - if (this.worldObj != null) - { - this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); - this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord, this); - } - } + public void onInventoryChanged () + { + buildTool(toolName); + if (this.worldObj != null) + { + this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); + this.worldObj.updateTileEntityChunkAndDoNothing(this.xCoord, this.yCoord, this.zCoord, this); + } + } - public void buildTool (String name) - { - toolName = name; - ItemStack tool = ToolBuilder.instance.buildTool(inventory[1], inventory[2], inventory[3], name); - if (inventory[0] == null) - inventory[0] = tool; - else - { - NBTTagCompound tags = inventory[0].getTagCompound(); - if (!tags.getCompoundTag("InfiTool").hasKey("Built")) - { - inventory[0] = tool; - } - } - } - - public void setToolname (String name) - { - toolName = name; - buildTool (name); - } - - public boolean canUpdate() + public void buildTool (String name) + { + toolName = name; + ItemStack tool = ToolBuilder.instance.buildTool(inventory[1], inventory[2], inventory[3], name); + if (inventory[0] == null) + inventory[0] = tool; + else + { + NBTTagCompound tags = inventory[0].getTagCompound(); + if (!tags.getCompoundTag("InfiTool").hasKey("Built")) + { + inventory[0] = tool; + } + } + } + + public void setToolname (String name) + { + toolName = name; + buildTool(name); + } + + public boolean canUpdate () { return false; } - @Override + @Override public int[] getAccessibleSlotsFromSide (int side) { return new int[0]; diff --git a/mods/tinker/tconstruct/blocks/traps/BarricadeBlock.java b/mods/tinker/tconstruct/blocks/traps/BarricadeBlock.java index 2838ba72..d9592fa0 100644 --- a/mods/tinker/tconstruct/blocks/traps/BarricadeBlock.java +++ b/mods/tinker/tconstruct/blocks/traps/BarricadeBlock.java @@ -13,80 +13,80 @@ import net.minecraft.world.World; public class BarricadeBlock extends Block { - public BarricadeBlock(int blockID)//, String name, int texture) - { - super(blockID, Material.wood); - setHardness(4.0F); + public BarricadeBlock(int blockID)//, String name, int texture) + { + super(blockID, Material.wood); + setHardness(4.0F); this.setCreativeTab(TConstructRegistry.blockTab); - //setUnlocalizedName("barricade" + name); - //GameRegistry.addName(this, name + " Barricade"); - } - - public Icon getIcon(int side, int meta) + //setUnlocalizedName("barricade" + name); + //GameRegistry.addName(this, name + " Barricade"); + } + + public Icon getIcon (int side, int meta) { return Block.wood.getIcon(2, meta % 4); } - public boolean renderAsNormalBlock () - { - return false; - } + public boolean renderAsNormalBlock () + { + return false; + } - public boolean isOpaqueCube () - { - return false; - } + public boolean isOpaqueCube () + { + return false; + } - public int getRenderType () - { - return BarricadeRender.model; - } + public int getRenderType () + { + return BarricadeRender.model; + } - public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int x, int y, int z) - { - return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1); - } + public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int x, int y, int z) + { + return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1); + } - public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int x, int y, int z) - { - setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } + public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int x, int y, int z) + { + setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } - public void harvestBlock (World world, EntityPlayer player, int x, int y, int z, int meta) - { - if (meta % 4 > 0) - { - world.setBlock(x, y, z, this.blockID, meta - 1, 3); - dropBlockAsItem_do(world, x, y, z, new ItemStack(this)); - } - else - { - dropBlockAsItem_do(world, x, y, z, new ItemStack(this)); - } - } + public void harvestBlock (World world, EntityPlayer player, int x, int y, int z, int meta) + { + if (meta % 4 > 0) + { + world.setBlock(x, y, z, this.blockID, meta - 1, 3); + dropBlockAsItem_do(world, x, y, z, new ItemStack(this)); + } + else + { + dropBlockAsItem_do(world, x, y, z, new ItemStack(this)); + } + } - @Override - public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - ItemStack stack = player.getCurrentEquippedItem(); - if ((stack != null) && (stack.itemID == this.blockID) && (!player.isSneaking())) - { - int meta = world.getBlockMetadata(x, y, z); - if (meta % 4 != 3) - { - world.setBlock(x, y, z, this.blockID, meta + 1, 3); - Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player, stack); - Block.blocksList[this.blockID].onPostBlockPlaced(world, x, y, z, meta); + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + ItemStack stack = player.getCurrentEquippedItem(); + if ((stack != null) && (stack.itemID == this.blockID) && (!player.isSneaking())) + { + int meta = world.getBlockMetadata(x, y, z); + if (meta % 4 != 3) + { + world.setBlock(x, y, z, this.blockID, meta + 1, 3); + Block.blocksList[this.blockID].onBlockPlacedBy(world, x, y, z, player, stack); + Block.blocksList[this.blockID].onPostBlockPlaced(world, x, y, z, meta); - Block var9 = Block.blocksList[this.blockID]; - world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, var9.stepSound.getStepSound(), (var9.stepSound.getVolume() + 1.0F) / 2.0F, var9.stepSound.getPitch() * 0.8F); - player.swingItem(); - if (!player.capabilities.isCreativeMode) - stack.stackSize -= 1; - - return true; - } - } - return false; - } + Block var9 = Block.blocksList[this.blockID]; + world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, var9.stepSound.getStepSound(), (var9.stepSound.getVolume() + 1.0F) / 2.0F, var9.stepSound.getPitch() * 0.8F); + player.swingItem(); + if (!player.capabilities.isCreativeMode) + stack.stackSize -= 1; + + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/mods/tinker/tconstruct/blocks/traps/Landmine.java b/mods/tinker/tconstruct/blocks/traps/Landmine.java index afc84c8a..041c9433 100644 --- a/mods/tinker/tconstruct/blocks/traps/Landmine.java +++ b/mods/tinker/tconstruct/blocks/traps/Landmine.java @@ -32,31 +32,31 @@ public class Landmine extends Block float var5 = 0.0625F; this.setBlockBounds(var5, 0.0F, var5, 1.0F - var5, 0.03125F, 1.0F - var5); } - - public Icon getBlockTexture(IBlockAccess world, int x, int y, int z, int side) + + public Icon getBlockTexture (IBlockAccess world, int x, int y, int z, int side) { - Block block = Block.blocksList[world.getBlockId(x, y-1, z)]; - if (block != null) - { - return block.getBlockTexture(world, x, y-1, z, side); - } + Block block = Block.blocksList[world.getBlockId(x, y - 1, z)]; + if (block != null) + { + return block.getBlockTexture(world, x, y - 1, z, side); + } return Block.sponge.getIcon(side, world.getBlockMetadata(x, y, z)); } - - public Icon getIcon(int side, int meta) + + public Icon getIcon (int side, int meta) { return Block.sponge.getIcon(1, meta); } - - public void registerIcons(IconRegister par1IconRegister) + + public void registerIcons (IconRegister par1IconRegister) { - + } /** * How many world ticks before ticking */ - public int tickRate() + public int tickRate () { return 20; } @@ -65,7 +65,7 @@ public class Landmine extends Block * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + public AxisAlignedBB getCollisionBoundingBoxFromPool (World par1World, int par2, int par3, int par4) { return null; } @@ -74,7 +74,7 @@ public class Landmine extends Block * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ - public boolean isOpaqueCube() + public boolean isOpaqueCube () { return false; } @@ -82,12 +82,12 @@ public class Landmine extends Block /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ - public boolean renderAsNormalBlock() + public boolean renderAsNormalBlock () { return false; } - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + public boolean getBlocksMovement (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return true; } @@ -95,7 +95,7 @@ public class Landmine extends Block /** * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z */ - public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)); } @@ -104,7 +104,7 @@ public class Landmine extends Block * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are * their own) Args: x, y, z, neighbor blockID */ - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) + public void onNeighborBlockChange (World par1World, int par2, int par3, int par4, int par5) { boolean var6 = false; @@ -123,7 +123,7 @@ public class Landmine extends Block /** * Ticks the block if it's been scheduled */ - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random) { if (!par1World.isRemote) { @@ -137,7 +137,7 @@ public class Landmine extends Block /** * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity */ - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + public void onEntityCollidedWithBlock (World par1World, int par2, int par3, int par4, Entity par5Entity) { if (!par1World.isRemote) { @@ -151,7 +151,7 @@ public class Landmine extends Block /** * Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa. */ - private void setStateIfMobInteractsWithPlate(World world, int posX, int posY, int posZ) + private void setStateIfMobInteractsWithPlate (World world, int posX, int posY, int posZ) { boolean var5 = world.getBlockMetadata(posX, posY, posZ) == 1; boolean var6 = false; @@ -160,17 +160,26 @@ public class Landmine extends Block if (this.triggerMobType == EnumMobType.everything) { - var8 = world.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7))); + var8 = world.getEntitiesWithinAABBExcludingEntity( + (Entity) null, + AxisAlignedBB.getAABBPool().getAABB((double) ((float) posX + var7), (double) posY, (double) ((float) posZ + var7), (double) ((float) (posX + 1) - var7), (double) posY + 0.25D, + (double) ((float) (posZ + 1) - var7))); } if (this.triggerMobType == EnumMobType.mobs) { - var8 = world.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7))); + var8 = world.getEntitiesWithinAABB( + EntityLiving.class, + AxisAlignedBB.getAABBPool().getAABB((double) ((float) posX + var7), (double) posY, (double) ((float) posZ + var7), (double) ((float) (posX + 1) - var7), (double) posY + 0.25D, + (double) ((float) (posZ + 1) - var7))); } if (this.triggerMobType == EnumMobType.players) { - var8 = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)posX + var7), (double)posY, (double)((float)posZ + var7), (double)((float)(posX + 1) - var7), (double)posY + 0.25D, (double)((float)(posZ + 1) - var7))); + var8 = world.getEntitiesWithinAABB( + EntityPlayer.class, + AxisAlignedBB.getAABBPool().getAABB((double) ((float) posX + var7), (double) posY, (double) ((float) posZ + var7), (double) ((float) (posX + 1) - var7), (double) posY + 0.25D, + (double) ((float) (posZ + 1) - var7))); } if (!var8.isEmpty()) @@ -179,7 +188,7 @@ public class Landmine extends Block while (var9.hasNext()) { - Entity var10 = (Entity)var9.next(); + Entity var10 = (Entity) var9.next(); if (!var10.doesEntityNotTriggerPressurePlate()) { @@ -191,8 +200,8 @@ public class Landmine extends Block if (var6 && !var5) { - world.setBlock(posX, posY, posZ, 0); - world.createExplosion((Entity)null, posX, posY, posZ, 2.0F, true); + world.setBlock(posX, posY, posZ, 0); + world.createExplosion((Entity) null, posX, posY, posZ, 2.0F, true); /*par1World.setBlockMetadataWithNotify(posX, posY, posZ, 1); par1World.notifyBlocksOfNeighborChange(posX, posY, posZ, this.blockID); par1World.notifyBlocksOfNeighborChange(posX, posY - 1, posZ, this.blockID); @@ -218,7 +227,7 @@ public class Landmine extends Block /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ - public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) + public void breakBlock (World par1World, int par2, int par3, int par4, int par5, int par6) { if (par6 > 0) { @@ -232,7 +241,7 @@ public class Landmine extends Block /** * Updates the blocks bounds based on its current state. Args: world, x, y, z */ - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { boolean var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) == 1; float var6 = 0.0625F; @@ -250,7 +259,7 @@ public class Landmine extends Block /** * Sets the block's bounds for rendering it as an item */ - public void setBlockBoundsForItemRender() + public void setBlockBoundsForItemRender () { float var1 = 0.5F; float var2 = 0.125F; @@ -262,7 +271,7 @@ public class Landmine extends Block * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility * and stop pistons */ - public int getMobilityFlag() + public int getMobilityFlag () { return 1; } diff --git a/mods/tinker/tconstruct/blocks/traps/Punji.java b/mods/tinker/tconstruct/blocks/traps/Punji.java index 60b889cc..031e91b4 100644 --- a/mods/tinker/tconstruct/blocks/traps/Punji.java +++ b/mods/tinker/tconstruct/blocks/traps/Punji.java @@ -8,13 +8,13 @@ import net.minecraft.world.World; public class Punji extends Block { - public Punji(int id) - { - super(id, Material.circuits); - } - - @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) + public Punji(int id) + { + super(id, Material.circuits); + } + + @Override + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) { entity.fallDistance *= 2.0F; } diff --git a/mods/tinker/tconstruct/client/ChiselRotator.java b/mods/tinker/tconstruct/client/ChiselRotator.java index 4bd82146..db2eac44 100644 --- a/mods/tinker/tconstruct/client/ChiselRotator.java +++ b/mods/tinker/tconstruct/client/ChiselRotator.java @@ -54,15 +54,15 @@ public class ChiselRotator implements IItemRenderer for (int x = 1; x < stack.getItem().getRenderPasses(stack.getItemDamage()); x++) { int i1 = Item.itemsList[stack.itemID].getColorFromItemStack(stack, x); - float f10 = (float)(i1 >> 16 & 255) / 255.0F; - float f11 = (float)(i1 >> 8 & 255) / 255.0F; - float f12 = (float)(i1 & 255) / 255.0F; + float f10 = (float) (i1 >> 16 & 255) / 255.0F; + float f11 = (float) (i1 >> 8 & 255) / 255.0F; + float f12 = (float) (i1 & 255) / 255.0F; GL11.glColor4f(f3 * f10, f3 * f11, f3 * f12, 1.0F); this.renderItem(stack, living, x); } } - - void renderItem(ItemStack stack, EntityLiving living, int pass) + + void renderItem (ItemStack stack, EntityLiving living, int pass) { GL11.glPushMatrix(); diff --git a/mods/tinker/tconstruct/client/CustomBowRenderer.java b/mods/tinker/tconstruct/client/CustomBowRenderer.java index 83540960..2755681b 100644 --- a/mods/tinker/tconstruct/client/CustomBowRenderer.java +++ b/mods/tinker/tconstruct/client/CustomBowRenderer.java @@ -38,7 +38,7 @@ public class CustomBowRenderer implements IItemRenderer { EntityLiving living = (EntityLiving) data[1]; ItemRenderer renderer = RenderManager.instance.itemRenderer; - for (int i = 0; i < item.getItem().getRenderPasses(item.getItemDamage())+1; i++) + for (int i = 0; i < item.getItem().getRenderPasses(item.getItemDamage()) + 1; i++) renderItem(living, item, i, type); } @@ -55,9 +55,9 @@ public class CustomBowRenderer implements IItemRenderer Icon icon = living.getItemIcon(stack, renderPass); if (living instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)living; + EntityPlayer player = (EntityPlayer) living; if (player.getItemInUse() != null) - icon = stack.getItem().getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount()); + icon = stack.getItem().getIcon(stack, renderPass, player, player.getItemInUse(), player.getItemInUseCount()); } if (icon == null) @@ -85,11 +85,11 @@ public class CustomBowRenderer implements IItemRenderer GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.75F); GL11.glTranslatef(-0.6F, -0.25F, 1.0F); //GL11.glRotatef(-90.0F, 0F, 1.0F, -1.0F); - + //GL11.glRotatef(90.0F, 0F, 1.0F, 1.0F); //GL11.glRotatef(90.0F, 1.0F, 0F, 1.0F); //GL11.glRotatef(90.0F, 0F, 1.0F, 0.5F); - + //GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); //GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); GL11.glScalef(1.75F, 1.75F, 1.75F); diff --git a/mods/tinker/tconstruct/client/CustomFont.java b/mods/tinker/tconstruct/client/CustomFont.java index 67783559..84355732 100644 --- a/mods/tinker/tconstruct/client/CustomFont.java +++ b/mods/tinker/tconstruct/client/CustomFont.java @@ -25,249 +25,249 @@ import org.lwjgl.opengl.GL11; */ public class CustomFont { - private int texID; - private int[] xPos; - private int[] yPos; - private int startChar; - private int endChar; - private FontMetrics metrics; + private int texID; + private int[] xPos; + private int[] yPos; + private int startChar; + private int endChar; + private FontMetrics metrics; - /** - * Instantiates the font, filling in default start - * and end character parameters. - * - * 'new CustomFont(ModLoader.getMinecraftInstance(), - * "Arial", 12); - * - * @param mc The Minecraft instance for the font to be bound to. - * @param fontName The name of the font to be drawn. - * @param size The size of the font to be drawn. - */ - public CustomFont(Minecraft mc, Object font, int size) - { - this(mc, font, size, 0, 4000); - } + /** + * Instantiates the font, filling in default start + * and end character parameters. + * + * 'new CustomFont(ModLoader.getMinecraftInstance(), + * "Arial", 12); + * + * @param mc The Minecraft instance for the font to be bound to. + * @param fontName The name of the font to be drawn. + * @param size The size of the font to be drawn. + */ + public CustomFont(Minecraft mc, Object font, int size) + { + this(mc, font, size, 0, 4000); + } - /** - * Instantiates the font, pre-rendering a sprite - * font image by using a true type font on a - * bitmap. Then allocating that bitmap to the - * Minecraft rendering engine for later use. - * - * 'new CustomFont(ModLoader.getMinecraftInstance(), - * "Arial", 12, 32, 126);' - * - * @param mc The Minecraft instance for the font to be bound to. - * @param fontName The name of the font to be drawn. - * @param size The size of the font to be drawn. - * @param startChar The starting ASCII character id to be drawable. (Default 32) - * @param endChar The ending ASCII character id to be drawable. (Default 126) - */ - public CustomFont(Minecraft mc, Object font, int size, int startChar, int endChar) - { - this.startChar = startChar; - this.endChar = endChar; - xPos = new int[endChar - startChar]; - yPos = new int[endChar - startChar]; + /** + * Instantiates the font, pre-rendering a sprite + * font image by using a true type font on a + * bitmap. Then allocating that bitmap to the + * Minecraft rendering engine for later use. + * + * 'new CustomFont(ModLoader.getMinecraftInstance(), + * "Arial", 12, 32, 126);' + * + * @param mc The Minecraft instance for the font to be bound to. + * @param fontName The name of the font to be drawn. + * @param size The size of the font to be drawn. + * @param startChar The starting ASCII character id to be drawable. (Default 32) + * @param endChar The ending ASCII character id to be drawable. (Default 126) + */ + public CustomFont(Minecraft mc, Object font, int size, int startChar, int endChar) + { + this.startChar = startChar; + this.endChar = endChar; + xPos = new int[endChar - startChar]; + yPos = new int[endChar - startChar]; - // Create a bitmap and fill it with a transparent color as well - // as obtain a Graphics instance which can be drawn on. - // NOTE: It is CRUICIAL that the size of the image is 256x256, if - // it is not the Minecraft engine will not draw it properly. - BufferedImage img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); - Graphics g = img.getGraphics(); - try - { - if (font instanceof String) - { - String fontName = (String) font; - if (fontName.contains("/")) - g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName)).deriveFont((float) size)); - else - g.setFont(new Font(fontName, 0, size)); - } - else if (font instanceof InputStream) - { - g.setFont(Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size)); - } - else if (font instanceof File) - { - g.setFont(Font.createFont(Font.TRUETYPE_FONT, (File) font).deriveFont((float) size)); - } - } - catch (Exception e) - { - e.printStackTrace(); - } + // Create a bitmap and fill it with a transparent color as well + // as obtain a Graphics instance which can be drawn on. + // NOTE: It is CRUICIAL that the size of the image is 256x256, if + // it is not the Minecraft engine will not draw it properly. + BufferedImage img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB); + Graphics g = img.getGraphics(); + try + { + if (font instanceof String) + { + String fontName = (String) font; + if (fontName.contains("/")) + g.setFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName)).deriveFont((float) size)); + else + g.setFont(new Font(fontName, 0, size)); + } + else if (font instanceof InputStream) + { + g.setFont(Font.createFont(Font.TRUETYPE_FONT, (InputStream) font).deriveFont((float) size)); + } + else if (font instanceof File) + { + g.setFont(Font.createFont(Font.TRUETYPE_FONT, (File) font).deriveFont((float) size)); + } + } + catch (Exception e) + { + e.printStackTrace(); + } - g.setColor(new Color(255, 255, 255, 0)); - g.fillRect(0, 0, 256, 256); - g.setColor(Color.white); - metrics = g.getFontMetrics(); + g.setColor(new Color(255, 255, 255, 0)); + g.fillRect(0, 0, 256, 256); + g.setColor(Color.white); + metrics = g.getFontMetrics(); - // Draw the specified range of characters onto - // the new bitmap, spacing according to the font - // widths. Also allocating positions of characters - // on the bitmap to two arrays which will be used - // later when drawing. - int x = 2; - int y = 2; - for (int i = startChar; i < endChar; i++) - { - g.drawString("" + ((char) i), x, y + g.getFontMetrics().getAscent()); - xPos[i - startChar] = x; - yPos[i - startChar] = y - metrics.getMaxDescent(); - x += metrics.stringWidth("" + (char) i) + 2; - if (x >= 250 - metrics.getMaxAdvance()) - { - x = 2; - y += metrics.getMaxAscent() + metrics.getMaxDescent() + size / 2; - } - } + // Draw the specified range of characters onto + // the new bitmap, spacing according to the font + // widths. Also allocating positions of characters + // on the bitmap to two arrays which will be used + // later when drawing. + int x = 2; + int y = 2; + for (int i = startChar; i < endChar; i++) + { + g.drawString("" + ((char) i), x, y + g.getFontMetrics().getAscent()); + xPos[i - startChar] = x; + yPos[i - startChar] = y - metrics.getMaxDescent(); + x += metrics.stringWidth("" + (char) i) + 2; + if (x >= 250 - metrics.getMaxAdvance()) + { + x = 2; + y += metrics.getMaxAscent() + metrics.getMaxDescent() + size / 2; + } + } - // Render the finished bitmap into the Minecraft - // graphics engine. - texID = mc.renderEngine.allocateAndSetupTexture(img); - } + // Render the finished bitmap into the Minecraft + // graphics engine. + texID = mc.renderEngine.allocateAndSetupTexture(img); + } - /** - * Draws a given string with an automatically - * calculated shadow below it. - * @param gui The gui/subclass to be drawn on - * @param text The string to be drawn - * @param x The x position to start drawing - * @param y The y position to start drawing - * @param color The color of the non-shadowed text (Hex) - */ - public void drawStringS (Gui gui, String text, int x, int y, int color) - { - int l = color & 0xff000000; - int shade = (color & 0xfcfcfc) >> 2; - shade += l; - drawString(gui, text, x + 1, y + 1, shade); - drawString(gui, text, x, y, color); - } + /** + * Draws a given string with an automatically + * calculated shadow below it. + * @param gui The gui/subclass to be drawn on + * @param text The string to be drawn + * @param x The x position to start drawing + * @param y The y position to start drawing + * @param color The color of the non-shadowed text (Hex) + */ + public void drawStringS (Gui gui, String text, int x, int y, int color) + { + int l = color & 0xff000000; + int shade = (color & 0xfcfcfc) >> 2; + shade += l; + drawString(gui, text, x + 1, y + 1, shade); + drawString(gui, text, x, y, color); + } - /** - * Draws a given string onto a gui/subclass. - * @param gui The gui/subclass to be drawn on - * @param text The string to be drawn - * @param x The x position to start drawing - * @param y The y position to start drawing - * @param color The color of the non-shadowed text (Hex) - */ - public void drawString (Gui gui, String text, int x, int y, int color) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(3553 /*GL_TEXTURE_2D*/); - GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, texID); - float red = (float) (color >> 16 & 0xff) / 255F; - float green = (float) (color >> 8 & 0xff) / 255F; - float blue = (float) (color & 0xff) / 255F; - float alpha = (float) (color >> 24 & 0xff) / 255F; - GL11.glColor4f(red, green, blue, alpha); - int startX = x; - for (int i = 0; i < text.length(); i++) - { - char c = text.charAt(i); - if (c == '\\') - { - char type = text.charAt(i + 1); - if (type == 'n') - { - y += metrics.getAscent() + 2; - x = startX; - } - i++; - continue; - } - drawChar(gui, c, x, y); - x += metrics.getStringBounds("" + c, null).getWidth(); - } - } + /** + * Draws a given string onto a gui/subclass. + * @param gui The gui/subclass to be drawn on + * @param text The string to be drawn + * @param x The x position to start drawing + * @param y The y position to start drawing + * @param color The color of the non-shadowed text (Hex) + */ + public void drawString (Gui gui, String text, int x, int y, int color) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(3553 /*GL_TEXTURE_2D*/); + GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, texID); + float red = (float) (color >> 16 & 0xff) / 255F; + float green = (float) (color >> 8 & 0xff) / 255F; + float blue = (float) (color & 0xff) / 255F; + float alpha = (float) (color >> 24 & 0xff) / 255F; + GL11.glColor4f(red, green, blue, alpha); + int startX = x; + for (int i = 0; i < text.length(); i++) + { + char c = text.charAt(i); + if (c == '\\') + { + char type = text.charAt(i + 1); + if (type == 'n') + { + y += metrics.getAscent() + 2; + x = startX; + } + i++; + continue; + } + drawChar(gui, c, x, y); + x += metrics.getStringBounds("" + c, null).getWidth(); + } + } - /** - * Returns the created FontMetrics - * which is used to retrive various - * information about the True Type Font - * @return FontMetrics of the created font. - */ - public FontMetrics getMetrics () - { - return metrics; - } + /** + * Returns the created FontMetrics + * which is used to retrive various + * information about the True Type Font + * @return FontMetrics of the created font. + */ + public FontMetrics getMetrics () + { + return metrics; + } - /** - * Gets the drawing width of a given - * string of string. - * @param text The string to be measured - * @return The width of the given string. - */ - public int getStringWidth (String text) - { - return (int) getBounds(text).getWidth(); - } + /** + * Gets the drawing width of a given + * string of string. + * @param text The string to be measured + * @return The width of the given string. + */ + public int getStringWidth (String text) + { + return (int) getBounds(text).getWidth(); + } - /** - * Gets the drawing height of a given - * string of string. - * @param text The string to be measured - * @return The height of the given string. - */ - public int getStringHeight (String text) - { - return (int) getBounds(text).getHeight(); - } + /** + * Gets the drawing height of a given + * string of string. + * @param text The string to be measured + * @return The height of the given string. + */ + public int getStringHeight (String text) + { + return (int) getBounds(text).getHeight(); + } - /** - * A method that returns a Rectangle that - * contains the width and height demensions - * of the given string. - * @param text The string to be measured - * @return Rectangle containing width and height that - * the text will consume when drawn. - */ - private Rectangle getBounds (String text) - { - int w = 0; - int h = 0; - int tw = 0; - for (int i = 0; i < text.length(); i++) - { - char c = text.charAt(i); - if (c == '\\') - { - char type = text.charAt(i + 1); + /** + * A method that returns a Rectangle that + * contains the width and height demensions + * of the given string. + * @param text The string to be measured + * @return Rectangle containing width and height that + * the text will consume when drawn. + */ + private Rectangle getBounds (String text) + { + int w = 0; + int h = 0; + int tw = 0; + for (int i = 0; i < text.length(); i++) + { + char c = text.charAt(i); + if (c == '\\') + { + char type = text.charAt(i + 1); - if (type == 'n') - { - h += metrics.getAscent() + 2; - if (tw > w) - w = tw; - tw = 0; - } - i++; - continue; - } - tw += metrics.stringWidth("" + c); - } - if (tw > w) - w = tw; - h += metrics.getAscent(); - return new Rectangle(0, 0, w, h); - } + if (type == 'n') + { + h += metrics.getAscent() + 2; + if (tw > w) + w = tw; + tw = 0; + } + i++; + continue; + } + tw += metrics.stringWidth("" + c); + } + if (tw > w) + w = tw; + h += metrics.getAscent(); + return new Rectangle(0, 0, w, h); + } - /** - * Private drawing method used within other - * drawing methods. - */ - private void drawChar (Gui gui, char c, int x, int y) - { - Rectangle2D bounds = metrics.getStringBounds("" + c, null); - drawTexturedModalRect(x, y, xPos[(byte) c - startChar], yPos[(byte) c - startChar], (int) bounds.getWidth(), (int) bounds.getHeight() + metrics.getMaxDescent()); - } + /** + * Private drawing method used within other + * drawing methods. + */ + private void drawChar (Gui gui, char c, int x, int y) + { + Rectangle2D bounds = metrics.getStringBounds("" + c, null); + drawTexturedModalRect(x, y, xPos[(byte) c - startChar], yPos[(byte) c - startChar], (int) bounds.getWidth(), (int) bounds.getHeight() + metrics.getMaxDescent()); + } - public void drawTexturedModalRect(int x, int y, int u, int v, int width, int height) + public void drawTexturedModalRect (int x, int y, int u, int v, int width, int height) { float offsetWidth = 0.00390625F; float offsetHeight = 0.00390625F; diff --git a/mods/tinker/tconstruct/client/RenderItemCopy.java b/mods/tinker/tconstruct/client/RenderItemCopy.java index b5bef8e3..6b5068de 100644 --- a/mods/tinker/tconstruct/client/RenderItemCopy.java +++ b/mods/tinker/tconstruct/client/RenderItemCopy.java @@ -46,7 +46,7 @@ public class RenderItemCopy extends Render /** * Renders the item */ - public void doRenderItem(EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) + public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) { this.random.setSeed(187L); ItemStack itemstack = par1EntityItem.getEntityItem(); @@ -54,11 +54,11 @@ public class RenderItemCopy extends Render if (itemstack.getItem() != null) { GL11.glPushMatrix(); - float f2 = shouldBob() ? MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; - float f3 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI); + float f2 = shouldBob() ? MathHelper.sin(((float) par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; + float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI); byte b0 = getMiniBlockCount(itemstack); - GL11.glTranslatef((float)par2, (float)par4 + f2, (float)par6); + GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); int i; float f4; @@ -141,9 +141,9 @@ public class RenderItemCopy extends Render if (this.renderWithColor) { i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k); - f5 = (float)(i >> 16 & 255) / 255.0F; - f4 = (float)(i >> 8 & 255) / 255.0F; - f6 = (float)(i & 255) / 255.0F; + f5 = (float) (i >> 16 & 255) / 255.0F; + f4 = (float) (i >> 8 & 255) / 255.0F; + f6 = (float) (i & 255) / 255.0F; GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8); } @@ -179,9 +179,9 @@ public class RenderItemCopy extends Render if (this.renderWithColor) { int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); - f8 = (float)(l >> 16 & 255) / 255.0F; - float f9 = (float)(l >> 8 & 255) / 255.0F; - f5 = (float)(l & 255) / 255.0F; + f8 = (float) (l >> 16 & 255) / 255.0F; + float f9 = (float) (l >> 8 & 255) / 255.0F; + f5 = (float) (l & 255) / 255.0F; f4 = 1.0F; this.renderDroppedItem(par1EntityItem, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4); } @@ -200,7 +200,7 @@ public class RenderItemCopy extends Render /** * Renders a dropped item */ - private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) + private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) { Tessellator tessellator = Tessellator.instance; @@ -228,7 +228,7 @@ public class RenderItemCopy extends Render } else { - GL11.glRotatef((((float)par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL11.glRotatef((((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); } float f12 = 0.0625F; @@ -237,7 +237,7 @@ public class RenderItemCopy extends Render int j = itemstack.stackSize; byte b0 = getMiniItemCount(itemstack); - GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float)b0 / 2.0F)); + GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F)); for (int k = 0; k < b0; ++k) { @@ -279,14 +279,14 @@ public class RenderItemCopy extends Render GL11.glPushMatrix(); float f14 = 0.125F; GL11.glScalef(f14, f14, f14); - float f15 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; + float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; GL11.glTranslatef(f15, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(f14, f14, f14); - f15 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; + f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); @@ -322,10 +322,10 @@ public class RenderItemCopy extends Render GL11.glColor4f(par5, par6, par7, 1.0F); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - tessellator.addVertexWithUV((double)(0.0F - f9), (double)(0.0F - f10), 0.0D, (double)f4, (double)f7); - tessellator.addVertexWithUV((double)(f8 - f9), (double)(0.0F - f10), 0.0D, (double)f5, (double)f7); - tessellator.addVertexWithUV((double)(f8 - f9), (double)(1.0F - f10), 0.0D, (double)f5, (double)f6); - tessellator.addVertexWithUV((double)(0.0F - f9), (double)(1.0F - f10), 0.0D, (double)f4, (double)f6); + tessellator.addVertexWithUV((double) (0.0F - f9), (double) (0.0F - f10), 0.0D, (double) f4, (double) f7); + tessellator.addVertexWithUV((double) (f8 - f9), (double) (0.0F - f10), 0.0D, (double) f5, (double) f7); + tessellator.addVertexWithUV((double) (f8 - f9), (double) (1.0F - f10), 0.0D, (double) f5, (double) f6); + tessellator.addVertexWithUV((double) (0.0F - f9), (double) (1.0F - f10), 0.0D, (double) f4, (double) f6); tessellator.draw(); GL11.glPopMatrix(); } @@ -335,7 +335,7 @@ public class RenderItemCopy extends Render /** * Renders the item's icon or block into the UI at the specified position. */ - public void renderItemIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { int k = par3ItemStack.itemID; int l = par3ItemStack.getItemDamage(); @@ -349,16 +349,16 @@ public class RenderItemCopy extends Render { par2RenderEngine.bindTexture("/terrain.png"); GL11.glPushMatrix(); - GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel); + GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); GL11.glTranslatef(1.0F, 0.5F, 1.0F); GL11.glScalef(1.0F, 1.0F, -1.0F); GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); int i1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - f2 = (float)(i1 >> 16 & 255) / 255.0F; - f = (float)(i1 >> 8 & 255) / 255.0F; - f1 = (float)(i1 & 255) / 255.0F; + f2 = (float) (i1 >> 16 & 255) / 255.0F; + f = (float) (i1 >> 8 & 255) / 255.0F; + f1 = (float) (i1 & 255) / 255.0F; if (this.renderWithColor) { @@ -384,9 +384,9 @@ public class RenderItemCopy extends Render { Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1); int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); - f = (float)(k1 >> 16 & 255) / 255.0F; - f1 = (float)(k1 >> 8 & 255) / 255.0F; - float f3 = (float)(k1 & 255) / 255.0F; + f = (float) (k1 >> 16 & 255) / 255.0F; + f1 = (float) (k1 >> 8 & 255) / 255.0F; + float f3 = (float) (k1 & 255) / 255.0F; if (this.renderWithColor) { @@ -417,9 +417,9 @@ public class RenderItemCopy extends Render } j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); - float f4 = (float)(j1 >> 16 & 255) / 255.0F; - f2 = (float)(j1 >> 8 & 255) / 255.0F; - f = (float)(j1 & 255) / 255.0F; + float f4 = (float) (j1 >> 16 & 255) / 255.0F; + f2 = (float) (j1 >> 8 & 255) / 255.0F; + f = (float) (j1 & 255) / 255.0F; if (this.renderWithColor) { @@ -437,11 +437,11 @@ public class RenderItemCopy extends Render /** * Render the item's icon or block into the GUI, including the glint effect. */ - public void renderItemAndEffectIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemAndEffectIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { if (par3ItemStack != null) { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, renderWithColor, zLevel, (float)par4, (float)par5)) + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5)) { this.renderItemIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5); } @@ -466,7 +466,7 @@ public class RenderItemCopy extends Render } } - private void renderGlint(int par1, int par2, int par3, int par4, int par5) + private void renderGlint (int par1, int par2, int par3, int par4, int par5) { for (int j1 = 0; j1 < 2; ++j1) { @@ -482,7 +482,7 @@ public class RenderItemCopy extends Render float f = 0.00390625F; float f1 = 0.00390625F; - float f2 = (float)(Minecraft.getSystemTime() % (long)(3000 + j1 * 1873)) / (3000.0F + (float)(j1 * 1873)) * 256.0F; + float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F; float f3 = 0.0F; Tessellator tessellator = Tessellator.instance; float f4 = 4.0F; @@ -493,10 +493,11 @@ public class RenderItemCopy extends Render } tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + par5), (double)this.zLevel, (double)((f2 + (float)par5 * f4) * f), (double)((f3 + (float)par5) * f1)); - tessellator.addVertexWithUV((double)(par2 + par4), (double)(par3 + par5), (double)this.zLevel, (double)((f2 + (float)par4 + (float)par5 * f4) * f), (double)((f3 + (float)par5) * f1)); - tessellator.addVertexWithUV((double)(par2 + par4), (double)(par3 + 0), (double)this.zLevel, (double)((f2 + (float)par4) * f), (double)((f3 + 0.0F) * f1)); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)this.zLevel, (double)((f2 + 0.0F) * f), (double)((f3 + 0.0F) * f1)); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); + tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), + (double) ((f3 + (float) par5) * f1)); + tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1)); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); tessellator.draw(); } } @@ -505,12 +506,12 @@ public class RenderItemCopy extends Render * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the * specified position. */ - public void renderItemOverlayIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) + public void renderItemOverlayIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { - this.renderItemOverlayIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String)null); + this.renderItemOverlayIntoGUI(par1SmallFontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null); } - public void renderItemOverlayIntoGUI(SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str) + public void renderItemOverlayIntoGUI (SmallFontRenderer par1SmallFontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str) { if (par3ItemStack != null) { @@ -526,8 +527,8 @@ public class RenderItemCopy extends Render if (par3ItemStack.isItemDamaged()) { - int k = (int)Math.round(13.0D - (double)par3ItemStack.getItemDamageForDisplay() * 13.0D / (double)par3ItemStack.getMaxDamage()); - int l = (int)Math.round(255.0D - (double)par3ItemStack.getItemDamageForDisplay() * 255.0D / (double)par3ItemStack.getMaxDamage()); + int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage()); + int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage()); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_TEXTURE_2D); @@ -549,25 +550,25 @@ public class RenderItemCopy extends Render * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: * tessellator, x, y, width, height, color */ - private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) + private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) { par1Tessellator.startDrawingQuads(); par1Tessellator.setColorOpaque_I(par6); - par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + 0), 0.0D); - par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + par5), 0.0D); - par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + par5), 0.0D); - par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + 0), 0.0D); + par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D); + par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D); + par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D); + par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D); par1Tessellator.draw(); } - public void renderIcon(int par1, int par2, Icon par3Icon, int par4, int par5) + public void renderIcon (int par1, int par2, Icon par3Icon, int par4, int par5) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); - tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); - tessellator.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMaxV()); + tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV()); + tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMaxU(), (double) par3Icon.getMinV()); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.getMinU(), (double) par3Icon.getMinV()); tessellator.draw(); } @@ -577,16 +578,16 @@ public class RenderItemCopy extends Render * (Render 1 ) ret = 2; - if (stack.stackSize > 5 ) ret = 3; - if (stack.stackSize > 20) ret = 4; - if (stack.stackSize > 40) ret = 5; + if (stack.stackSize > 1) + ret = 2; + if (stack.stackSize > 5) + ret = 3; + if (stack.stackSize > 20) + ret = 4; + if (stack.stackSize > 40) + ret = 5; return ret; } @@ -616,12 +621,15 @@ public class RenderItemCopy extends Render * @param stack * @return */ - public byte getMiniItemCount(ItemStack stack) + public byte getMiniItemCount (ItemStack stack) { byte ret = 1; - if (stack.stackSize > 1) ret = 2; - if (stack.stackSize > 15) ret = 3; - if (stack.stackSize > 31) ret = 4; + if (stack.stackSize > 1) + ret = 2; + if (stack.stackSize > 15) + ret = 3; + if (stack.stackSize > 31) + ret = 4; return ret; } } diff --git a/mods/tinker/tconstruct/client/SuperSoakerRender.java b/mods/tinker/tconstruct/client/SuperSoakerRender.java index 9f11247e..46cc436a 100644 --- a/mods/tinker/tconstruct/client/SuperSoakerRender.java +++ b/mods/tinker/tconstruct/client/SuperSoakerRender.java @@ -9,35 +9,35 @@ import net.minecraftforge.client.IItemRenderer; public class SuperSoakerRender implements IItemRenderer { - @Override - public boolean handleRenderType (ItemStack item, ItemRenderType type) - { - return type != ItemRenderType.INVENTORY; - } + @Override + public boolean handleRenderType (ItemStack item, ItemRenderType type) + { + return type != ItemRenderType.INVENTORY; + } - @Override - public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper) - { - return true; - } + @Override + public boolean shouldUseRenderHelper (ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } - @Override - public void renderItem (ItemRenderType type, ItemStack item, Object... data) - { - if (type == ItemRenderType.EQUIPPED) - renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]); - if (type == ItemRenderType.ENTITY) - renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]); - } + @Override + public void renderItem (ItemRenderType type, ItemStack item, Object... data) + { + if (type == ItemRenderType.EQUIPPED) + renderEquippedItem(item, (RenderBlocks) data[0], (EntityLiving) data[1]); + if (type == ItemRenderType.ENTITY) + renderEntityItem(item, (RenderBlocks) data[0], (EntityItem) data[1]); + } - void renderEquippedItem (ItemStack item, RenderBlocks renderBlocks, EntityLiving entityLiving) - { - - } + void renderEquippedItem (ItemStack item, RenderBlocks renderBlocks, EntityLiving entityLiving) + { - void renderEntityItem (ItemStack item, RenderBlocks renderBlocks, EntityItem entityItem) - { - - } + } + + void renderEntityItem (ItemStack item, RenderBlocks renderBlocks, EntityItem entityItem) + { + + } } diff --git a/mods/tinker/tconstruct/client/TClientEvents.java b/mods/tinker/tconstruct/client/TClientEvents.java index b79a637e..c1885c47 100644 --- a/mods/tinker/tconstruct/client/TClientEvents.java +++ b/mods/tinker/tconstruct/client/TClientEvents.java @@ -22,63 +22,63 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TClientEvents { - Minecraft mc = Minecraft.getMinecraft(); - - /*@ForgeSubscribe - public void interact (PlayerInteractEvent event) - { - if (event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote) - { - System.out.println("Fired"); - List skills = TProxyClient.skillList; - if (skills.size() > 0) - { - Skill walls = TConstruct.playerTracker.getPlayerStats(event.entityPlayer.username).skillList.get(0); - walls.rightClickActivate(event.entityPlayer, event.entityPlayer.worldObj); - } - } - }*/ - - /* Sounds */ - @ForgeSubscribe - public void onSound (SoundLoadEvent event) - { - try - { - event.manager.soundPoolSounds.addSound("sounds/frypan_hit.ogg", TConstruct.class.getResource("/sounds/frypan_hit.ogg")); - event.manager.soundPoolSounds.addSound("sounds/little_saw.ogg", TConstruct.class.getResource("/sounds/little_saw.ogg")); - event.manager.soundPoolSounds.addSound("sounds/launcher_clank.ogg", TConstruct.class.getResource("/sounds/launcher_clank.ogg")); - System.out.println("[TConstruct] Successfully loaded sounds."); - } - catch (Exception e) - { - System.err.println("[TConstruct] Failed to register one or more sounds"); - } - } + Minecraft mc = Minecraft.getMinecraft(); - /* Liquids */ - @ForgeSubscribe - public void postStitch (TextureStitchEvent.Post event) - { - for (int i = 0; i < TContent.liquidIcons.length; i++) - { - TContent.liquidIcons[i].setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); - LiquidStack canon = TContent.liquidIcons[i].canonical(); - if (canon != null) - canon.setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); - } - } - - /* HUD */ - @ForgeSubscribe - public void renderHealthbar (RenderGameOverlayEvent.Post event) - { - ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + /*@ForgeSubscribe + public void interact (PlayerInteractEvent event) + { + if (event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote) + { + System.out.println("Fired"); + List skills = TProxyClient.skillList; + if (skills.size() > 0) + { + Skill walls = TConstruct.playerTracker.getPlayerStats(event.entityPlayer.username).skillList.get(0); + walls.rightClickActivate(event.entityPlayer, event.entityPlayer.worldObj); + } + } + }*/ + + /* Sounds */ + @ForgeSubscribe + public void onSound (SoundLoadEvent event) + { + try + { + event.manager.soundPoolSounds.addSound("sounds/frypan_hit.ogg", TConstruct.class.getResource("/sounds/frypan_hit.ogg")); + event.manager.soundPoolSounds.addSound("sounds/little_saw.ogg", TConstruct.class.getResource("/sounds/little_saw.ogg")); + event.manager.soundPoolSounds.addSound("sounds/launcher_clank.ogg", TConstruct.class.getResource("/sounds/launcher_clank.ogg")); + System.out.println("[TConstruct] Successfully loaded sounds."); + } + catch (Exception e) + { + System.err.println("[TConstruct] Failed to register one or more sounds"); + } + } + + /* Liquids */ + @ForgeSubscribe + public void postStitch (TextureStitchEvent.Post event) + { + for (int i = 0; i < TContent.liquidIcons.length; i++) + { + TContent.liquidIcons[i].setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); + LiquidStack canon = TContent.liquidIcons[i].canonical(); + if (canon != null) + canon.setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); + } + } + + /* HUD */ + @ForgeSubscribe + public void renderHealthbar (RenderGameOverlayEvent.Post event) + { + ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int scaledWidth = scaledresolution.getScaledWidth(); int scaledHeight = scaledresolution.getScaledHeight(); int xBasePos = scaledWidth / 2 - 91; int yBasePos = scaledHeight - 39; - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(mc.thePlayer.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(mc.thePlayer.username); PotionEffect potion = mc.thePlayer.getActivePotionEffect(Potion.wither); if (potion != null) @@ -86,91 +86,92 @@ public class TClientEvents potion = mc.thePlayer.getActivePotionEffect(Potion.poison); if (potion != null) return; - - if (event.type == RenderGameOverlayEvent.ElementType.HEALTH) - { - this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/newhearts.png"); - - int hp = mc.thePlayer.getHealth(); - for (int iter = 0; iter < hp / 20; iter++) - { - int renderHearts = (hp - 20*(iter+1)) / 2; - if (renderHearts > 10) - renderHearts = 10; - for (int i = 0; i < renderHearts; i++) - { - this.drawTexturedModalRect(xBasePos + 8*i, yBasePos, 0 + 18*iter, 0, 8, 8); - } - if (hp % 2 == 1 && renderHearts < 10) - { - this.drawTexturedModalRect(xBasePos + 8*renderHearts, yBasePos, 9 + 18*iter, 0, 8, 8); - } - } - this.mc.renderEngine.bindTexture("/gui/icons.png"); - } - - /*if (event.type == RenderGameOverlayEvent.ElementType.HOTBAR) - { - if (stats.skillList == null) - return; - - int amount = 0; - GL11.glScalef(1/16f, 1/16f, 1/16f); - for (Skill skill : stats.skillList) - { - if (!skill.getActive()) - GL11.glColor4f(0.5f, 0.5f, 0.5f, 1.0F); - this.mc.renderEngine.bindTexture(skill.getTextureFile(scaledresolution.getScaleFactor())); - this.drawTexturedModalRect((2+amount*18)*16, 32, 0, 0, 256, 256); - amount++; - } - GL11.glScalef(16f, 16f, 16f); - }*/ - } + if (event.type == RenderGameOverlayEvent.ElementType.HEALTH) + { + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/newhearts.png"); - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) + int hp = mc.thePlayer.getHealth(); + for (int iter = 0; iter < hp / 20; iter++) + { + int renderHearts = (hp - 20 * (iter + 1)) / 2; + if (renderHearts > 10) + renderHearts = 10; + for (int i = 0; i < renderHearts; i++) + { + this.drawTexturedModalRect(xBasePos + 8 * i, yBasePos, 0 + 18 * iter, 0, 8, 8); + } + if (hp % 2 == 1 && renderHearts < 10) + { + this.drawTexturedModalRect(xBasePos + 8 * renderHearts, yBasePos, 9 + 18 * iter, 0, 8, 8); + } + } + + this.mc.renderEngine.bindTexture("/gui/icons.png"); + } + + /*if (event.type == RenderGameOverlayEvent.ElementType.HOTBAR) + { + if (stats.skillList == null) + return; + + int amount = 0; + GL11.glScalef(1/16f, 1/16f, 1/16f); + for (Skill skill : stats.skillList) + { + if (!skill.getActive()) + GL11.glColor4f(0.5f, 0.5f, 0.5f, 1.0F); + this.mc.renderEngine.bindTexture(skill.getTextureFile(scaledresolution.getScaleFactor())); + this.drawTexturedModalRect((2+amount*18)*16, 32, 0, 0, 256, 256); + amount++; + } + GL11.glScalef(16f, 16f, 16f); + }*/ + } + + public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1)); - tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1)); - tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1)); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1)); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + par6) * f1)); + tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + par6) * f1)); + tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + 0) * f1)); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + 0) * f1)); tessellator.draw(); } - double zLevel = 0; - /* Armor */ - ModelBiped model = new ModelBiped(5f); - WingModel wings = new WingModel(); + double zLevel = 0; - /*static - { - model.bipedHead.showModel = false; - }*/ + /* Armor */ + ModelBiped model = new ModelBiped(5f); + WingModel wings = new WingModel(); - private float interpolateRotation (float par1, float par2, float par3) - { - float f3; + /*static + { + model.bipedHead.showModel = false; + }*/ - for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F) - { - ; - } + private float interpolateRotation (float par1, float par2, float par3) + { + float f3; - while (f3 >= 180.0F) - { - f3 -= 360.0F; - } + for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F) + { + ; + } - return par1 + par3 * f3; - } + while (f3 >= 180.0F) + { + f3 -= 360.0F; + } - protected float handleRotationFloat (EntityLiving par1EntityLiving, float par2) - { - return (float) par1EntityLiving.ticksExisted + par2; - } + return par1 + par3 * f3; + } + + protected float handleRotationFloat (EntityLiving par1EntityLiving, float par2) + { + return (float) par1EntityLiving.ticksExisted + par2; + } } diff --git a/mods/tinker/tconstruct/client/TClientTickHandler.java b/mods/tinker/tconstruct/client/TClientTickHandler.java index ef86736b..9629bfac 100644 --- a/mods/tinker/tconstruct/client/TClientTickHandler.java +++ b/mods/tinker/tconstruct/client/TClientTickHandler.java @@ -23,7 +23,7 @@ public class TClientTickHandler implements ITickHandler { TContent.oreBerry.setGraphicsLevel(Block.leaves.graphicsLevel); TContent.oreBerrySecond.setGraphicsLevel(Block.leaves.graphicsLevel); - + /*player = mc.thePlayer; if (player == null || player.capabilities.isCreativeMode) return; @@ -59,16 +59,16 @@ public class TClientTickHandler implements ITickHandler //return EnumSet.of(TickType.PLAYER); } - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) + public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int par5, int par6) { float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + par6) * f1)); - tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + par6) * f1)); - tessellator.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * f), (double)((float)(par4 + 0) * f1)); - tessellator.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * f), (double)((float)(par4 + 0) * f1)); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + par6) * f1)); + tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + par6) * f1)); + tessellator.addVertexWithUV((double) (par1 + par5), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + par5) * f), (double) ((float) (par4 + 0) * f1)); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + 0) * f1)); tessellator.draw(); } @@ -76,7 +76,7 @@ public class TClientTickHandler implements ITickHandler public void tickStart (EnumSet type, Object... tickData) { // TODO Auto-generated method stub - + } @Override diff --git a/mods/tinker/tconstruct/client/TControls.java b/mods/tinker/tconstruct/client/TControls.java index c52e5fed..77b668db 100644 --- a/mods/tinker/tconstruct/client/TControls.java +++ b/mods/tinker/tconstruct/client/TControls.java @@ -19,187 +19,187 @@ import cpw.mods.fml.common.network.PacketDispatcher; public class TControls extends TKeyHandler { - //static KeyBinding grabKey = new KeyBinding("key.grab", 29); - //static KeyBinding stiltsKey = new KeyBinding("key.stilts", 46); - public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24); - /*public static KeyBinding skillOne = new KeyBinding("key.skill.one", 44); - public static KeyBinding skillTwo = new KeyBinding("key.skill.two", 45); - public static KeyBinding skillThree = new KeyBinding("key.skill.three", 46); - public static KeyBinding skillFour = new KeyBinding("key.skill.four", 47); - public static KeyBinding skillFive = new KeyBinding("key.skill.five", 48);*/ - static KeyBinding jumpKey; - static KeyBinding invKey; - static Minecraft mc; + //static KeyBinding grabKey = new KeyBinding("key.grab", 29); + //static KeyBinding stiltsKey = new KeyBinding("key.stilts", 46); + public static KeyBinding armorKey = new KeyBinding("key.tarmor", 24); + /*public static KeyBinding skillOne = new KeyBinding("key.skill.one", 44); + public static KeyBinding skillTwo = new KeyBinding("key.skill.two", 45); + public static KeyBinding skillThree = new KeyBinding("key.skill.three", 46); + public static KeyBinding skillFour = new KeyBinding("key.skill.four", 47); + public static KeyBinding skillFive = new KeyBinding("key.skill.five", 48);*/ + static KeyBinding jumpKey; + static KeyBinding invKey; + static Minecraft mc; - boolean jumping; - boolean doubleJump = true; - boolean climbing = false; - boolean onGround = false; - boolean onStilts = false; - - int currentTab = 1; + boolean jumping; + boolean doubleJump = true; + boolean climbing = false; + boolean onGround = false; + boolean onStilts = false; - //boolean onStilts = false; + int currentTab = 1; - public TControls() - { - super(new KeyBinding[] { armorKey/*, skillOne, skillTwo, skillThree, skillFour, skillFive*/ }, new boolean[] { false/*, false, false, false, false, false*/ }, getVanillaKeyBindings(), new boolean[] { - false, false }); - //System.out.println("Controls registered");Natura - } + //boolean onStilts = false; - private static KeyBinding[] getVanillaKeyBindings () - { - mc = Minecraft.getMinecraft(); - jumpKey = mc.gameSettings.keyBindJump; - invKey = mc.gameSettings.keyBindInventory; - return new KeyBinding[] { jumpKey, invKey }; - } + public TControls() + { + super(new KeyBinding[] { armorKey /*, skillOne, skillTwo, skillThree, skillFour, skillFive*/}, new boolean[] { false /*, false, false, false, false, false*/}, getVanillaKeyBindings(), + new boolean[] { false, false }); + //System.out.println("Controls registered");Natura + } - @Override - public String getLabel () - { - return null; - } + private static KeyBinding[] getVanillaKeyBindings () + { + mc = Minecraft.getMinecraft(); + jumpKey = mc.gameSettings.keyBindJump; + invKey = mc.gameSettings.keyBindInventory; + return new KeyBinding[] { jumpKey, invKey }; + } - @Override - public void keyDown (EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat) - { - if (tickEnd && mc.theWorld != null) - { - if (kb == armorKey && mc.currentScreen == null) //Extended Armor - { - openArmorGui();//mc.thePlayer.username); - } - if (kb == invKey && mc.currentScreen != null && mc.currentScreen.getClass() == GuiInventory.class)// && !mc.playerController.isInCreativeMode()) - { - TProxyClient.addTabsToInventory((GuiContainer) mc.currentScreen); - } - /*if (kb == skillOne) - { - sendSkillkey(mc.thePlayer, (byte) 0);//, mc.thePlayer.dimension, mc.thePlayer.entityId); - } - if (kb == skillTwo) - { - sendSkillkey(mc.thePlayer, (byte) 1);//, mc.thePlayer.dimension, mc.thePlayer.entityId); - } - if (kb == skillThree) - { - sendSkillkey(mc.thePlayer, (byte) 2);//, mc.thePlayer.dimension, mc.thePlayer.entityId); - } - if (kb == skillFour) - { - sendSkillkey(mc.thePlayer, (byte) 3);//, mc.thePlayer.dimension, mc.thePlayer.entityId); - } - if (kb == skillFive) - { - sendSkillkey(mc.thePlayer, (byte) 4);//, mc.thePlayer.dimension, mc.thePlayer.entityId); - }*/ - /*if (kb == jumpKey) //Double jump - { - if (jumping && !doubleJump) - { - //if (player == null) - //player = mc.thePlayer; + @Override + public String getLabel () + { + return null; + } - mc.thePlayer.motionY = 0.42D; - mc.thePlayer.fallDistance = 0; + @Override + public void keyDown (EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat) + { + if (tickEnd && mc.theWorld != null) + { + if (kb == armorKey && mc.currentScreen == null) //Extended Armor + { + openArmorGui();//mc.thePlayer.username); + } + if (kb == invKey && mc.currentScreen != null && mc.currentScreen.getClass() == GuiInventory.class)// && !mc.playerController.isInCreativeMode()) + { + TProxyClient.addTabsToInventory((GuiContainer) mc.currentScreen); + } + /*if (kb == skillOne) + { + sendSkillkey(mc.thePlayer, (byte) 0);//, mc.thePlayer.dimension, mc.thePlayer.entityId); + } + if (kb == skillTwo) + { + sendSkillkey(mc.thePlayer, (byte) 1);//, mc.thePlayer.dimension, mc.thePlayer.entityId); + } + if (kb == skillThree) + { + sendSkillkey(mc.thePlayer, (byte) 2);//, mc.thePlayer.dimension, mc.thePlayer.entityId); + } + if (kb == skillFour) + { + sendSkillkey(mc.thePlayer, (byte) 3);//, mc.thePlayer.dimension, mc.thePlayer.entityId); + } + if (kb == skillFive) + { + sendSkillkey(mc.thePlayer, (byte) 4);//, mc.thePlayer.dimension, mc.thePlayer.entityId); + }*/ + /*if (kb == jumpKey) //Double jump + { + if (jumping && !doubleJump) + { + //if (player == null) + //player = mc.thePlayer; - if (mc.thePlayer.isPotionActive(Potion.jump)) - { - mc.thePlayer.motionY += (double) ((float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); - } + mc.thePlayer.motionY = 0.42D; + mc.thePlayer.fallDistance = 0; - doubleJump = true; - resetFallDamage(mc.thePlayer.username); - } + if (mc.thePlayer.isPotionActive(Potion.jump)) + { + mc.thePlayer.motionY += (double) ((float) (mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } - if (!jumping) - jumping = mc.thePlayer.isAirBorne; - }*/ - } - /*else if (kb == stiltsKey) //Stilts - { - float size = 1.8F; - if (!onStilts) - size = 0.8F; - TConstruct.playerTracker.updateSize(mc.thePlayer.username, size); - onStilts = !onStilts; - //updateServer(mc.thePlayer.username, (byte) 11); - if (onStilts) - { - onStilts = false; - } - else - { - onStilts = true; - } - }*/ - } + doubleJump = true; + resetFallDamage(mc.thePlayer.username); + } - @Override - public void keyUp (EnumSet types, KeyBinding kb, boolean tickEnd) - { - //landOnGround(); - } + if (!jumping) + jumping = mc.thePlayer.isAirBorne; + }*/ + } + /*else if (kb == stiltsKey) //Stilts + { + float size = 1.8F; + if (!onStilts) + size = 0.8F; + TConstruct.playerTracker.updateSize(mc.thePlayer.username, size); + onStilts = !onStilts; + //updateServer(mc.thePlayer.username, (byte) 11); + if (onStilts) + { + onStilts = false; + } + else + { + onStilts = true; + } + }*/ + } - @Override - public EnumSet ticks () - { - return EnumSet.of(TickType.CLIENT); - } + @Override + public void keyUp (EnumSet types, KeyBinding kb, boolean tickEnd) + { + //landOnGround(); + } - public void landOnGround () - { - doubleJump = false; - jumping = false; - } + @Override + public EnumSet ticks () + { + return EnumSet.of(TickType.CLIENT); + } - public void resetControls () - { - doubleJump = false; - jumping = false; - climbing = false; - onGround = false; - onStilts = false; - } + public void landOnGround () + { + doubleJump = false; + jumping = false; + } - void resetFallDamage (String name) - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(8); - DataOutputStream outputStream = new DataOutputStream(bos); - try - { - outputStream.writeByte(10); - outputStream.writeUTF(name); - } - catch (Exception ex) - { - ex.printStackTrace(); - } + public void resetControls () + { + doubleJump = false; + jumping = false; + climbing = false; + onGround = false; + onStilts = false; + } - updateServer(bos); - } + void resetFallDamage (String name) + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(8); + DataOutputStream outputStream = new DataOutputStream(bos); + try + { + outputStream.writeByte(10); + outputStream.writeUTF(name); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - void updateSize (String name, float size) - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(8); - DataOutputStream outputStream = new DataOutputStream(bos); - try - { - outputStream.writeByte(11); - outputStream.writeUTF(name); - outputStream.writeFloat(size); - } - catch (Exception ex) - { - ex.printStackTrace(); - } + updateServer(bos); + } - updateServer(bos); - } - - public static void openInventoryGui () + void updateSize (String name, float size) + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(8); + DataOutputStream outputStream = new DataOutputStream(bos); + try + { + outputStream.writeByte(11); + outputStream.writeUTF(name); + outputStream.writeFloat(size); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + + updateServer(bos); + } + + public static void openInventoryGui () { ByteArrayOutputStream bos = new ByteArrayOutputStream(8); DataOutputStream outputStream = new DataOutputStream(bos); @@ -216,24 +216,24 @@ public class TControls extends TKeyHandler updateServer(bos); } - public static void openArmorGui () - { - ByteArrayOutputStream bos = new ByteArrayOutputStream(8); - DataOutputStream outputStream = new DataOutputStream(bos); - try - { - outputStream.writeByte(3); + public static void openArmorGui () + { + ByteArrayOutputStream bos = new ByteArrayOutputStream(8); + DataOutputStream outputStream = new DataOutputStream(bos); + try + { + outputStream.writeByte(3); outputStream.writeByte(1); - } - catch (Exception ex) - { - ex.printStackTrace(); - } + } + catch (Exception ex) + { + ex.printStackTrace(); + } - updateServer(bos); - } - - public static void openKnapsackGui () + updateServer(bos); + } + + public static void openKnapsackGui () { ByteArrayOutputStream bos = new ByteArrayOutputStream(8); DataOutputStream outputStream = new DataOutputStream(bos); @@ -250,49 +250,49 @@ public class TControls extends TKeyHandler updateServer(bos); } - /*public void activateSkill (EntityPlayer player, int slot) - { - if (TProxyClient.skillList.size() > slot) - { - Skill skill = TProxyClient.skillList.get(slot); - if (skill != null) - { - skill.activate(player, player.worldObj); - } - } - }*/ + /*public void activateSkill (EntityPlayer player, int slot) + { + if (TProxyClient.skillList.size() > slot) + { + Skill skill = TProxyClient.skillList.get(slot); + if (skill != null) + { + skill.activate(player, player.worldObj); + } + } + }*/ - public void sendSkillkey (EntityPlayer player, byte key) - { - TConstruct.playerTracker.activateSkill(player, key); + public void sendSkillkey (EntityPlayer player, byte key) + { + TConstruct.playerTracker.activateSkill(player, key); - System.out.println(MinecraftServer.getServer()); - if (MinecraftServer.getServer().isDedicatedServer()) - { - System.out.println("Send"); - ByteArrayOutputStream bos = new ByteArrayOutputStream(8); - DataOutputStream outputStream = new DataOutputStream(bos); - try - { - outputStream.writeByte(4); - outputStream.writeByte(key); - } - catch (Exception ex) - { - ex.printStackTrace(); - } + System.out.println(MinecraftServer.getServer()); + if (MinecraftServer.getServer().isDedicatedServer()) + { + System.out.println("Send"); + ByteArrayOutputStream bos = new ByteArrayOutputStream(8); + DataOutputStream outputStream = new DataOutputStream(bos); + try + { + outputStream.writeByte(4); + outputStream.writeByte(key); + } + catch (Exception ex) + { + ex.printStackTrace(); + } - updateServer(bos); - } - } + updateServer(bos); + } + } - static void updateServer (ByteArrayOutputStream bos) - { - Packet250CustomPayload packet = new Packet250CustomPayload(); - packet.channel = "TConstruct"; - packet.data = bos.toByteArray(); - packet.length = bos.size(); + static void updateServer (ByteArrayOutputStream bos) + { + Packet250CustomPayload packet = new Packet250CustomPayload(); + packet.channel = "TConstruct"; + packet.data = bos.toByteArray(); + packet.length = bos.size(); - PacketDispatcher.sendPacketToServer(packet); - } + PacketDispatcher.sendPacketToServer(packet); + } } diff --git a/mods/tinker/tconstruct/client/TKeyHandler.java b/mods/tinker/tconstruct/client/TKeyHandler.java index 56d8eac6..f8ed1d10 100644 --- a/mods/tinker/tconstruct/client/TKeyHandler.java +++ b/mods/tinker/tconstruct/client/TKeyHandler.java @@ -36,7 +36,6 @@ public abstract class TKeyHandler implements ITickHandler this.keyDown = new boolean[keyBindings.length + vanillaKeys.length]; } - /** * Register the keys into the system. You will do your own keyboard management elsewhere. No events will fire * if you use this method @@ -49,7 +48,7 @@ public abstract class TKeyHandler implements ITickHandler this.isDummy = true; } - public KeyBinding[] getKeyBindings() + public KeyBinding[] getKeyBindings () { return this.keyBindings; } @@ -58,7 +57,7 @@ public abstract class TKeyHandler implements ITickHandler * Not to be overridden - KeyBindings are tickhandlers under the covers */ @Override - public final void tickStart(EnumSet type, Object... tickData) + public final void tickStart (EnumSet type, Object... tickData) { keyTick(type, false); } @@ -67,12 +66,12 @@ public abstract class TKeyHandler implements ITickHandler * Not to be overridden - KeyBindings are tickhandlers under the covers */ @Override - public final void tickEnd(EnumSet type, Object... tickData) + public final void tickEnd (EnumSet type, Object... tickData) { keyTick(type, true); } - public void keyTick(EnumSet type, boolean tickEnd) + public void keyTick (EnumSet type, boolean tickEnd) { for (int i = 0; i < keyBindings.length; i++) { @@ -83,7 +82,7 @@ public abstract class TKeyHandler implements ITickHandler { if (state) { - keyDown(type, keyBinding, tickEnd, state!=keyDown[i]); + keyDown(type, keyBinding, tickEnd, state != keyDown[i]); } else { @@ -100,11 +99,11 @@ public abstract class TKeyHandler implements ITickHandler KeyBinding keyBinding = vKeyBindings[i]; int keyCode = keyBinding.keyCode; boolean state = (keyCode < 0 ? Mouse.isButtonDown(keyCode + 100) : Keyboard.isKeyDown(keyCode)); - if (state != keyDown[i+keyBindings.length] || (state && vRepeatings[i])) + if (state != keyDown[i + keyBindings.length] || (state && vRepeatings[i])) { if (state) { - keyDown(type, keyBinding, tickEnd, state!=keyDown[i+keyBindings.length]); + keyDown(type, keyBinding, tickEnd, state != keyDown[i + keyBindings.length]); } else { @@ -112,7 +111,7 @@ public abstract class TKeyHandler implements ITickHandler } if (tickEnd) { - keyDown[i+keyBindings.length] = state; + keyDown[i + keyBindings.length] = state; } } } @@ -128,7 +127,8 @@ public abstract class TKeyHandler implements ITickHandler * @param tickEnd was it an end or start tick which fired the key * @param isRepeat is it a repeat key event */ - public abstract void keyDown(EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat); + public abstract void keyDown (EnumSet types, KeyBinding kb, boolean tickEnd, boolean isRepeat); + /** * Fired once when the key changes state from down to up * @@ -137,8 +137,7 @@ public abstract class TKeyHandler implements ITickHandler * @param types the type(s) of tick that fired when this key was first down * @param tickEnd was it an end or start tick which fired the key */ - public abstract void keyUp(EnumSet types, KeyBinding kb, boolean tickEnd); - + public abstract void keyUp (EnumSet types, KeyBinding kb, boolean tickEnd); /** * This is the list of ticks for which the key binding should trigger. The only @@ -146,5 +145,5 @@ public abstract class TKeyHandler implements ITickHandler * * @see cpw.mods.fml.common.ITickHandler#ticks() */ - public abstract EnumSet ticks(); + public abstract EnumSet ticks (); } diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index 2ee59429..083d122f 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -164,7 +164,7 @@ public class TProxyClient extends TProxyCommon tessellator.draw(); GL11.glTranslatef(0.5F, 0.5F, 0.5F); } - + public static void renderInvBlockFace (RenderBlocks renderblocks, Block block, int meta) { Tessellator tessellator = Tessellator.instance; @@ -297,7 +297,7 @@ public class TProxyClient extends TProxyCommon RenderingRegistry.registerEntityRenderingHandler(LaunchedPotion.class, new LaunchedItemRender(Item.potion, 16384)); RenderingRegistry.registerEntityRenderingHandler(ArrowEntity.class, new ArrowRender()); //RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo! - + MinecraftForgeClient.registerItemRenderer(TContent.shortbow.itemID, new CustomBowRenderer()); addRenderMappings(); @@ -558,14 +558,15 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.registerManualSmeltery("searedstone", new ItemStack(TContent.smeltery, 1, 4), new ItemStack(TContent.liquidMetalStill, 1, 14), null); } + public static Map> pageClasses = new HashMap>(); - - public static void registerManualPage(String type, Class clazz) + + public static void registerManualPage (String type, Class clazz) { pageClasses.put(type, clazz); } - - public static Class getPageClass(String type) + + public static Class getPageClass (String type) { return pageClasses.get(type); } @@ -712,7 +713,7 @@ public class TProxyClient extends TProxyCommon { TConstructClientRegistry.addMaterialRenderMapping(partIter, "tinker", partTypes[partIter], true); } - + /*for (int iter = 0; iter < modPartTypes.length; iter++) { TConstructClientRegistry.addMaterialRenderMapping(31 + iter, "tinker", modPartTypes[iter], true); @@ -725,13 +726,13 @@ public class TProxyClient extends TProxyCommon TConstructClientRegistry.addEffectRenderMapping(tool, i, "tinker", effectTypes[i], true); } } - + String[] bowstringTypes = { "string", "magicfabric" }; for (int bowIter = 0; bowIter < bowstringTypes.length; bowIter++) { TConstructClientRegistry.addAlternateMaterialRenderMapping(TContent.shortbow, bowIter, "tinker", bowstringTypes[bowIter], true); } - + String[] fletching = { "feather", "leaf", "slime", "blueslime" }; for (int arrowIter = 0; arrowIter < fletching.length; arrowIter++) { diff --git a/mods/tinker/tconstruct/client/armor/WingModel.java b/mods/tinker/tconstruct/client/armor/WingModel.java index 12eeb09f..6043ba85 100644 --- a/mods/tinker/tconstruct/client/armor/WingModel.java +++ b/mods/tinker/tconstruct/client/armor/WingModel.java @@ -7,117 +7,117 @@ import net.minecraft.entity.Entity; public class WingModel extends ModelBase { - ModelRenderer WingBaseRight; - ModelRenderer WingEdgeRight; - ModelRenderer WingInsetRight; - ModelRenderer WingCenterRight; - ModelRenderer WingFlangeRight; - ModelRenderer WingAuxRight; - ModelRenderer WingBaseLeft; - ModelRenderer WingEdgeLeft; - ModelRenderer WingInsetLeft; - ModelRenderer WingCenterLeft; - ModelRenderer WingFlangeLeft; - ModelRenderer WingAuxLeft; + ModelRenderer WingBaseRight; + ModelRenderer WingEdgeRight; + ModelRenderer WingInsetRight; + ModelRenderer WingCenterRight; + ModelRenderer WingFlangeRight; + ModelRenderer WingAuxRight; + ModelRenderer WingBaseLeft; + ModelRenderer WingEdgeLeft; + ModelRenderer WingInsetLeft; + ModelRenderer WingCenterLeft; + ModelRenderer WingFlangeLeft; + ModelRenderer WingAuxLeft; - public WingModel() - { - textureWidth = 64; - textureHeight = 64; + public WingModel() + { + textureWidth = 64; + textureHeight = 64; - //Right Wing - WingBaseRight = new ModelRenderer(this, 0, 41); - WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10); - WingBaseRight.setRotationPoint(-1F, 1F, 0F); - setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F); + //Right Wing + WingBaseRight = new ModelRenderer(this, 0, 41); + WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseRight.setRotationPoint(-1F, 1F, 0F); + setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F); - WingEdgeRight = new ModelRenderer(this, 0, 53); //Texture position - WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size - WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position - setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians + WingEdgeRight = new ModelRenderer(this, 0, 53); //Texture position + WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size + WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position + setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians - WingInsetRight = new ModelRenderer(this, 6, 53); - WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2); - WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F); - setRotation(WingInsetRight, 0.3490659F, 0F, 0F); + WingInsetRight = new ModelRenderer(this, 6, 53); + WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetRight, 0.3490659F, 0F, 0F); - WingCenterRight = new ModelRenderer(this, 12, 53); - WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2); - WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F); - setRotation(WingCenterRight, 0.1745329F, 0F, 0F); + WingCenterRight = new ModelRenderer(this, 12, 53); + WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterRight, 0.1745329F, 0F, 0F); - WingFlangeRight = new ModelRenderer(this, 18, 53); - WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2); - WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F); - setRotation(WingFlangeRight, 0F, 0F, 0F); + WingFlangeRight = new ModelRenderer(this, 18, 53); + WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeRight, 0F, 0F, 0F); - WingAuxRight = new ModelRenderer(this, 24, 53); - WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2); - WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F); - setRotation(WingAuxRight, -0.1745329F, 0F, 0F); + WingAuxRight = new ModelRenderer(this, 24, 53); + WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxRight, -0.1745329F, 0F, 0F); - WingBaseRight.addChild(WingEdgeRight); - WingBaseRight.addChild(WingInsetRight); - WingBaseRight.addChild(WingCenterRight); - WingBaseRight.addChild(WingFlangeRight); - WingBaseRight.addChild(WingAuxRight); + WingBaseRight.addChild(WingEdgeRight); + WingBaseRight.addChild(WingInsetRight); + WingBaseRight.addChild(WingCenterRight); + WingBaseRight.addChild(WingFlangeRight); + WingBaseRight.addChild(WingAuxRight); - //Left Wing - WingBaseLeft = new ModelRenderer(this, 42, 41); - WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10); - WingBaseLeft.setRotationPoint(1F, 1F, 0F); - setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F); + //Left Wing + WingBaseLeft = new ModelRenderer(this, 42, 41); + WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseLeft.setRotationPoint(1F, 1F, 0F); + setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F); - WingEdgeLeft = new ModelRenderer(this, 58, 53); - WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2); - WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F); - setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F); + WingEdgeLeft = new ModelRenderer(this, 58, 53); + WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2); + WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F); + setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F); - WingInsetLeft = new ModelRenderer(this, 52, 53); - WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2); - WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F); - setRotation(WingInsetLeft, 0.3490659F, 0F, 0F); + WingInsetLeft = new ModelRenderer(this, 52, 53); + WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetLeft, 0.3490659F, 0F, 0F); - WingCenterLeft = new ModelRenderer(this, 46, 53); - WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2); - WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F); - setRotation(WingCenterLeft, 0.1745329F, 0F, 0F); + WingCenterLeft = new ModelRenderer(this, 46, 53); + WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterLeft, 0.1745329F, 0F, 0F); - WingFlangeLeft = new ModelRenderer(this, 40, 53); - WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2); - WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F); - setRotation(WingFlangeLeft, 0F, 0F, 0F); + WingFlangeLeft = new ModelRenderer(this, 40, 53); + WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeLeft, 0F, 0F, 0F); - WingAuxLeft = new ModelRenderer(this, 34, 53); - WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2); - WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F); - setRotation(WingAuxLeft, -0.1745329F, 0F, 0F); + WingAuxLeft = new ModelRenderer(this, 34, 53); + WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxLeft, -0.1745329F, 0F, 0F); - WingBaseLeft.addChild(WingEdgeLeft); - WingBaseLeft.addChild(WingInsetLeft); - WingBaseLeft.addChild(WingCenterLeft); - WingBaseLeft.addChild(WingFlangeLeft); - WingBaseLeft.addChild(WingAuxLeft); - } + WingBaseLeft.addChild(WingEdgeLeft); + WingBaseLeft.addChild(WingInsetLeft); + WingBaseLeft.addChild(WingCenterLeft); + WingBaseLeft.addChild(WingFlangeLeft); + WingBaseLeft.addChild(WingAuxLeft); + } - public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - WingBaseRight.render(f5); - WingBaseLeft.render(f5); - } + public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + WingBaseRight.render(f5); + WingBaseLeft.render(f5); + } - private void setRotation (ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } + private void setRotation (ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } - public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/mods/tinker/tconstruct/client/block/BallRepeaterRender.java b/mods/tinker/tconstruct/client/block/BallRepeaterRender.java index e1d857ce..a328d34a 100644 --- a/mods/tinker/tconstruct/client/block/BallRepeaterRender.java +++ b/mods/tinker/tconstruct/client/block/BallRepeaterRender.java @@ -12,6 +12,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class BallRepeaterRender implements ISimpleBlockRenderingHandler { public static int model = RenderingRegistry.getNextAvailableRenderId(); + @Override public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) { @@ -35,8 +36,8 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler { return model; } - - public boolean renderRedstoneBallRepeater(Block par1Block, int par2, int par3, int par4, IBlockAccess world) + + public boolean renderRedstoneBallRepeater (Block par1Block, int par2, int par3, int par4, IBlockAccess world) { Tessellator tessellator = Tessellator.instance; int l = world.getBlockMetadata(par2, par3, par4); @@ -46,7 +47,7 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler Icon icon3 = RedstoneBallRepeater.func_94409_b("repeaterDust_line_overlay"); tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(world, par2, par3, par4)); float f = 1.0F; - float f1 = (float)l / 15.0F; + float f1 = (float) l / 15.0F; float f2 = f1 * 0.6F + 0.4F; if (l == 0) @@ -68,10 +69,14 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler } tessellator.setColorOpaque_F(f2, f3, f4); - boolean flag = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3, par4, 1) || !world.isBlockNormalCube(par2 - 1, par3, par4) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3 - 1, par4, -1); - boolean flag1 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3, par4, 3) || !world.isBlockNormalCube(par2 + 1, par3, par4) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3 - 1, par4, -1); - boolean flag2 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 - 1, 2) || !world.isBlockNormalCube(par2, par3, par4 - 1) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 - 1, -1); - boolean flag3 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 + 1, 0) || !world.isBlockNormalCube(par2, par3, par4 + 1) && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 + 1, -1); + boolean flag = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3, par4, 1) || !world.isBlockNormalCube(par2 - 1, par3, par4) + && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 - 1, par3 - 1, par4, -1); + boolean flag1 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3, par4, 3) || !world.isBlockNormalCube(par2 + 1, par3, par4) + && RedstoneBallRepeater.isPowerProviderOrWire(world, par2 + 1, par3 - 1, par4, -1); + boolean flag2 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 - 1, 2) || !world.isBlockNormalCube(par2, par3, par4 - 1) + && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 - 1, -1); + boolean flag3 = RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3, par4 + 1, 0) || !world.isBlockNormalCube(par2, par3, par4 + 1) + && RedstoneBallRepeater.isPowerProviderOrWire(world, par2, par3 - 1, par4 + 1, -1); if (!world.isBlockNormalCube(par2, par3 + 1, par4)) { @@ -96,10 +101,10 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler } } - float f5 = (float)(par2 + 0); - float f6 = (float)(par2 + 1); - float f7 = (float)(par4 + 0); - float f8 = (float)(par4 + 1); + float f5 = (float) (par2 + 0); + float f6 = (float) (par2 + 1); + float f7 = (float) (par4 + 0); + float f8 = (float) (par4 + 1); int i1 = 0; if ((flag || flag1) && !flag2 && !flag3) @@ -159,39 +164,39 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler i2 -= 5; } - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon.getInterpolatedU((double)l1), (double)icon.getInterpolatedV((double)i2)); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon.getInterpolatedU((double)l1), (double)icon.getInterpolatedV((double)k1)); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon.getInterpolatedU((double)j1), (double)icon.getInterpolatedV((double)k1)); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon.getInterpolatedU((double)j1), (double)icon.getInterpolatedV((double)i2)); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon.getInterpolatedU((double) l1), (double) icon.getInterpolatedV((double) i2)); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon.getInterpolatedU((double) l1), (double) icon.getInterpolatedV((double) k1)); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon.getInterpolatedU((double) j1), (double) icon.getInterpolatedV((double) k1)); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon.getInterpolatedU((double) j1), (double) icon.getInterpolatedV((double) i2)); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon2.getInterpolatedU((double)l1), (double)icon2.getInterpolatedV((double)i2)); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon2.getInterpolatedU((double)l1), (double)icon2.getInterpolatedV((double)k1)); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon2.getInterpolatedU((double)j1), (double)icon2.getInterpolatedV((double)k1)); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon2.getInterpolatedU((double)j1), (double)icon2.getInterpolatedV((double)i2)); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon2.getInterpolatedU((double) l1), (double) icon2.getInterpolatedV((double) i2)); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon2.getInterpolatedU((double) l1), (double) icon2.getInterpolatedV((double) k1)); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon2.getInterpolatedU((double) j1), (double) icon2.getInterpolatedV((double) k1)); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon2.getInterpolatedU((double) j1), (double) icon2.getInterpolatedV((double) i2)); } else if (i1 == 1) { - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon1.getMaxU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon1.getMaxU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon1.getMinU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon1.getMinU(), (double)icon1.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMaxU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMinU(), (double) icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon3.getMaxU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon3.getMaxU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon3.getMinU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon3.getMinU(), (double)icon3.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMaxU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMinU(), (double) icon3.getMaxV()); } else { - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon1.getMaxU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon1.getMinU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon1.getMinU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon1.getMaxU(), (double)icon1.getMinV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon1.getMinU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon1.getMaxU(), (double) icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f8, (double)icon3.getMaxU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)f6, (double)par3 + 0.015625D, (double)f7, (double)icon3.getMinU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f7, (double)icon3.getMinU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)f5, (double)par3 + 0.015625D, (double)f8, (double)icon3.getMaxU(), (double)icon3.getMinV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) f6, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f7, (double) icon3.getMinU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) f5, (double) par3 + 0.015625D, (double) f8, (double) icon3.getMaxU(), (double) icon3.getMinV()); } if (!world.isBlockNormalCube(par2, par3 + 1, par4)) @@ -199,57 +204,57 @@ public class BallRepeaterRender implements ISimpleBlockRenderingHandler if (world.isBlockNormalCube(par2 - 1, par3, par4) && world.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)icon1.getMaxU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)icon1.getMinU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)icon1.getMinU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)icon1.getMaxU(), (double)icon1.getMaxV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon1.getMaxU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon1.getMinU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon1.getMinU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon1.getMaxU(), (double) icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)icon3.getMaxU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)icon3.getMinU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)icon3.getMinU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)icon3.getMaxU(), (double)icon3.getMaxV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon3.getMaxU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon3.getMinU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon3.getMinU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) par2 + 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon3.getMaxU(), (double) icon3.getMaxV()); } if (world.isBlockNormalCube(par2 + 1, par3, par4) && world.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)icon1.getMinU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)icon1.getMaxU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)icon1.getMaxU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)icon1.getMinU(), (double)icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon1.getMinU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon1.getMaxU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon1.getMaxU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon1.getMinU(), (double) icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)icon3.getMinU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)icon3.getMaxU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)icon3.getMaxU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)icon3.getMinU(), (double)icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 1), (double) icon3.getMinU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1), (double) icon3.getMaxU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 0), (double) icon3.getMaxU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1) - 0.015625D, (double) (par3 + 0), (double) (par4 + 0), (double) icon3.getMinU(), (double) icon3.getMinV()); } if (world.isBlockNormalCube(par2, par3, par4 - 1) && world.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)icon1.getMinU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)icon1.getMaxU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)icon1.getMaxU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)icon1.getMinU(), (double)icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon1.getMinU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon1.getMinU(), (double) icon1.getMinV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)icon3.getMinU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)icon3.getMaxU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)icon3.getMaxU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)icon3.getMinU(), (double)icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon3.getMinU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) par4 + 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) par4 + 0.015625D, (double) icon3.getMinU(), (double) icon3.getMinV()); } if (world.isBlockNormalCube(par2, par3, par4 + 1) && world.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) { tessellator.setColorOpaque_F(f * f2, f * f3, f * f4); - tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)icon1.getMaxU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)icon1.getMinU(), (double)icon1.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)icon1.getMinU(), (double)icon1.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)icon1.getMaxU(), (double)icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon1.getMinU(), (double) icon1.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon1.getMinU(), (double) icon1.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon1.getMaxU(), (double) icon1.getMaxV()); tessellator.setColorOpaque_F(f, f, f); - tessellator.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)icon3.getMaxU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)icon3.getMinU(), (double)icon3.getMinV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)icon3.getMinU(), (double)icon3.getMaxV()); - tessellator.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)icon3.getMaxU(), (double)icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 1), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon3.getMinU(), (double) icon3.getMinV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) (par4 + 1) - 0.015625D, (double) icon3.getMinU(), (double) icon3.getMaxV()); + tessellator.addVertexWithUV((double) (par2 + 0), (double) ((float) (par3 + 1) + 0.021875F), (double) (par4 + 1) - 0.015625D, (double) icon3.getMaxU(), (double) icon3.getMaxV()); } } diff --git a/mods/tinker/tconstruct/client/block/BarricadeRender.java b/mods/tinker/tconstruct/client/block/BarricadeRender.java index b96a155e..5207e364 100644 --- a/mods/tinker/tconstruct/client/block/BarricadeRender.java +++ b/mods/tinker/tconstruct/client/block/BarricadeRender.java @@ -12,93 +12,93 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class BarricadeRender implements ISimpleBlockRenderingHandler { - public static int model; + public static int model; - public BarricadeRender() - { - model = RenderingRegistry.getNextAvailableRenderId(); - } + public BarricadeRender() + { + model = RenderingRegistry.getNextAvailableRenderId(); + } - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block barricade, int modelId, RenderBlocks renderer) - { - if (modelId == model) - { - int meta = world.getBlockMetadata(x, y, z); - Tessellator tessellator = Tessellator.instance; + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block barricade, int modelId, RenderBlocks renderer) + { + if (modelId == model) + { + int meta = world.getBlockMetadata(x, y, z); + Tessellator tessellator = Tessellator.instance; - if ((meta < 4) || (meta == 10) || (meta == 11)) - { - renderInnerEast(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if ((meta < 4) || (meta == 10) || (meta == 11)) + { + renderInnerEast(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if (((meta < 4) && (meta > 0)) || (meta == 11)) - { - renderOuterEast(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if (((meta < 4) && (meta > 0)) || (meta == 11)) + { + renderOuterEast(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if ((meta == 2) || (meta == 3) || ((meta >= 8) && (meta <= 11))) - { - renderInnerWest(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if ((meta == 2) || (meta == 3) || ((meta >= 8) && (meta <= 11))) + { + renderInnerWest(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if ((meta == 3) || ((meta >= 9) && (meta <= 11))) - { - renderOuterWest(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if ((meta == 3) || ((meta >= 9) && (meta <= 11))) + { + renderOuterWest(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if (((meta >= 4) && (meta <= 7)) || (meta >= 14)) - { - renderInnerSouth(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if (((meta >= 4) && (meta <= 7)) || (meta >= 14)) + { + renderInnerSouth(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if (((meta >= 5) && (meta <= 7)) || (meta == 15)) - { - renderOuterSouth(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if (((meta >= 5) && (meta <= 7)) || (meta == 15)) + { + renderOuterSouth(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if ((meta == 6) || (meta == 7) || (meta >= 12)) - { - renderInnerNorth(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if ((meta == 6) || (meta == 7) || (meta >= 12)) + { + renderInnerNorth(renderer, world, x, y, z, (Block) barricade, tessellator); + } - if ((meta == 7) || (meta >= 13)) - { - renderOuterNorth(renderer, world, x, y, z, (Block)barricade, tessellator); - } + if ((meta == 7) || (meta >= 13)) + { + renderOuterNorth(renderer, world, x, y, z, (Block) barricade, tessellator); + } - return true; - } - return false; - } + return true; + } + return false; + } - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (modelID == model) - { - block.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - block.setBlockBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } - } + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (modelID == model) + { + block.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + block.setBlockBounds(0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + } + } - @Override - public boolean shouldRender3DInInventory() - { - return true; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } - @Override - public int getRenderId() - { - return model; - } + @Override + public int getRenderId () + { + return model; + } - private static void renderInnerWest(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(renderblocks.blockAccess, x, y, z)); + private static void renderInnerWest (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(renderblocks.blockAccess, x, y, z)); float f3 = 1.0F; if (Block.lightValue[barricade.blockID] > 0) @@ -114,23 +114,22 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler icon = renderblocks.overrideBlockTexture; } - double d0 = (double)icon.getMinU(); - double d1 = (double)icon.getMinV(); - double d2 = (double)icon.getMaxU(); - double d3 = (double)icon.getMaxV(); + double d0 = (double) icon.getMinU(); + double d1 = (double) icon.getMinV(); + double d2 = (double) icon.getMaxU(); + double d3 = (double) icon.getMaxV(); Vec3[] vec1 = new Vec3[8]; float minSize = 0.0625F; float maxSize = 0.0625F; float height = 0.625F; - vec1[0] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-minSize), 0.0D, (double)(-maxSize)); - vec1[1] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)minSize, 0.0D, (double)(-maxSize)); - vec1[2] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)minSize, 0.0D, (double)maxSize); - vec1[3] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-minSize), 0.0D, (double)maxSize); - vec1[4] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-minSize), (double)height, (double)(-maxSize)); - vec1[5] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)minSize, (double)height, (double)(-maxSize)); - vec1[6] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)minSize, (double)height, (double)maxSize); - vec1[7] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-minSize), (double)height, (double)maxSize); - + vec1[0] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) (-minSize), 0.0D, (double) (-maxSize)); + vec1[1] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) minSize, 0.0D, (double) (-maxSize)); + vec1[2] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) minSize, 0.0D, (double) maxSize); + vec1[3] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) (-minSize), 0.0D, (double) maxSize); + vec1[4] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) (-minSize), (double) height, (double) (-maxSize)); + vec1[5] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) minSize, (double) height, (double) (-maxSize)); + vec1[6] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) minSize, (double) height, (double) maxSize); + vec1[7] = renderblocks.blockAccess.getWorldVec3Pool().getVecFromPool((double) (-minSize), (double) height, (double) maxSize); int l = renderblocks.blockAccess.getBlockMetadata(x, y, z); int i1 = l & 7; @@ -141,28 +140,28 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler if (flag) { vec1[j1].zCoord -= 0.0625D; - vec1[j1].rotateAroundX(((float)Math.PI * 2F / 9F)); + vec1[j1].rotateAroundX(((float) Math.PI * 2F / 9F)); } else { vec1[j1].zCoord += 0.0625D; - vec1[j1].rotateAroundX(-((float)Math.PI * 2F / 9F)); + vec1[j1].rotateAroundX(-((float) Math.PI * 2F / 9F)); } if (i1 == 0 || i1 == 7) { - vec1[j1].rotateAroundZ((float)Math.PI); + vec1[j1].rotateAroundZ((float) Math.PI); } if (i1 == 6 || i1 == 0) { - vec1[j1].rotateAroundY(((float)Math.PI / 2F)); + vec1[j1].rotateAroundY(((float) Math.PI / 2F)); } if (i1 > 0 && i1 < 5) { vec1[j1].yCoord -= 0.375D; - vec1[j1].rotateAroundX(((float)Math.PI / 2F)); + vec1[j1].rotateAroundX(((float) Math.PI / 2F)); if (i1 == 4) { @@ -171,34 +170,34 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler if (i1 == 3) { - vec1[j1].rotateAroundY((float)Math.PI); + vec1[j1].rotateAroundY((float) Math.PI); } if (i1 == 2) { - vec1[j1].rotateAroundY(((float)Math.PI / 2F)); + vec1[j1].rotateAroundY(((float) Math.PI / 2F)); } if (i1 == 1) { - vec1[j1].rotateAroundY(-((float)Math.PI / 2F)); + vec1[j1].rotateAroundY(-((float) Math.PI / 2F)); } - vec1[j1].xCoord += (double)x + 0.5D; - vec1[j1].yCoord += (double)((float)y + 0.5F); - vec1[j1].zCoord += (double)z + 0.5D; + vec1[j1].xCoord += (double) x + 0.5D; + vec1[j1].yCoord += (double) ((float) y + 0.5F); + vec1[j1].zCoord += (double) z + 0.5D; } else if (i1 != 0 && i1 != 7) { - vec1[j1].xCoord += (double)x + 0.5D; - vec1[j1].yCoord += (double)((float)y + 0.125F); - vec1[j1].zCoord += (double)z + 0.5D; + vec1[j1].xCoord += (double) x + 0.5D; + vec1[j1].yCoord += (double) ((float) y + 0.125F); + vec1[j1].zCoord += (double) z + 0.5D; } else { - vec1[j1].xCoord += (double)x + 0.5D; - vec1[j1].yCoord += (double)((float)y + 0.875F); - vec1[j1].zCoord += (double)z + 0.5D; + vec1[j1].xCoord += (double) x + 0.5D; + vec1[j1].yCoord += (double) ((float) y + 0.875F); + vec1[j1].zCoord += (double) z + 0.5D; } } @@ -211,17 +210,17 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler { if (k1 == 0) { - d0 = (double)icon.getInterpolatedU(7.0D); - d1 = (double)icon.getInterpolatedV(6.0D); - d2 = (double)icon.getInterpolatedU(9.0D); - d3 = (double)icon.getInterpolatedV(8.0D); + d0 = (double) icon.getInterpolatedU(7.0D); + d1 = (double) icon.getInterpolatedV(6.0D); + d2 = (double) icon.getInterpolatedU(9.0D); + d3 = (double) icon.getInterpolatedV(8.0D); } else if (k1 == 2) { - d0 = (double)icon.getInterpolatedU(7.0D); - d1 = (double)icon.getInterpolatedV(6.0D); - d2 = (double)icon.getInterpolatedU(9.0D); - d3 = (double)icon.getMaxV(); + d0 = (double) icon.getInterpolatedU(7.0D); + d1 = (double) icon.getInterpolatedV(6.0D); + d2 = (double) icon.getInterpolatedU(9.0D); + d3 = (double) icon.getMaxV(); } if (k1 == 0) @@ -273,47 +272,47 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(vec33.xCoord, vec33.yCoord, vec33.zCoord, d0, d1); } - /*tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; + /*tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double)icon.getMinU(); double tex2 = (double)icon.getMinV(); double tex3 = (double)icon.getMaxU(); double tex4 = (double)icon.getMaxV(); - Vec3[] vec1 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec1[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec1[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec1[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec1[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec1[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec1[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec1[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec1[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - for (int var25 = 0; var25 < 8; var25++) - { - vec1[var25].zCoord -= 0.0625D; - vec1[var25].rotateAroundX(-0.7853982F); - vec1[var25].yCoord -= 0.5D; - vec1[var25].rotateAroundX(1.570796F); + Vec3[] vec1 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec1[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec1[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec1[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec1[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec1[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec1[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec1[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec1[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + for (int var25 = 0; var25 < 8; var25++) + { + vec1[var25].zCoord -= 0.0625D; + vec1[var25].rotateAroundX(-0.7853982F); + vec1[var25].yCoord -= 0.5D; + vec1[var25].rotateAroundX(1.570796F); - vec1[var25].xCoord += x + 0.625D; - vec1[var25].yCoord += y; - vec1[var25].zCoord += z + 0.5D; - } + vec1[var25].xCoord += x + 0.625D; + vec1[var25].yCoord += y; + vec1[var25].zCoord += z + 0.5D; + } - Vec3 vec1a = null; - Vec3 vec1b = null; - Vec3 vec1c = null; - Vec3 vec1d = null; + Vec3 vec1a = null; + Vec3 vec1b = null; + Vec3 vec1c = null; + Vec3 vec1d = null; - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) { tex1 = (double)icon.getInterpolatedU(7.0D); tex2 = (double)icon.getInterpolatedV(6.0D); @@ -328,809 +327,809 @@ public class BarricadeRender implements ISimpleBlockRenderingHandler tex4 = (double)icon.getMaxV(); } - if (iter == 0) - { - vec1a = vec1[0]; - vec1b = vec1[1]; - vec1c = vec1[2]; - vec1d = vec1[3]; - } - else if (iter == 1) - { - vec1a = vec1[7]; - vec1b = vec1[6]; - vec1c = vec1[5]; - vec1d = vec1[4]; - } - else if (iter == 2) - { - vec1a = vec1[1]; - vec1b = vec1[0]; - vec1c = vec1[4]; - vec1d = vec1[5]; - } - else if (iter == 3) - { - vec1a = vec1[2]; - vec1b = vec1[1]; - vec1c = vec1[5]; - vec1d = vec1[6]; - } - else if (iter == 4) - { - vec1a = vec1[3]; - vec1b = vec1[2]; - vec1c = vec1[6]; - vec1d = vec1[7]; - } - else if (iter == 5) - { - vec1a = vec1[0]; - vec1b = vec1[3]; - vec1c = vec1[7]; - vec1d = vec1[4]; - } + if (iter == 0) + { + vec1a = vec1[0]; + vec1b = vec1[1]; + vec1c = vec1[2]; + vec1d = vec1[3]; + } + else if (iter == 1) + { + vec1a = vec1[7]; + vec1b = vec1[6]; + vec1c = vec1[5]; + vec1d = vec1[4]; + } + else if (iter == 2) + { + vec1a = vec1[1]; + vec1b = vec1[0]; + vec1c = vec1[4]; + vec1d = vec1[5]; + } + else if (iter == 3) + { + vec1a = vec1[2]; + vec1b = vec1[1]; + vec1c = vec1[5]; + vec1d = vec1[6]; + } + else if (iter == 4) + { + vec1a = vec1[3]; + vec1b = vec1[2]; + vec1c = vec1[6]; + vec1d = vec1[7]; + } + else if (iter == 5) + { + vec1a = vec1[0]; + vec1b = vec1[3]; + vec1c = vec1[7]; + vec1d = vec1[4]; + } - tessellator.addVertexWithUV(vec1a.xCoord, vec1a.yCoord, vec1a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec1b.xCoord, vec1b.yCoord, vec1b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec1c.xCoord, vec1c.yCoord, vec1c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec1d.xCoord, vec1d.yCoord, vec1d.zCoord, tex1, tex3); - }*/ - } + tessellator.addVertexWithUV(vec1a.xCoord, vec1a.yCoord, vec1a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec1b.xCoord, vec1b.yCoord, vec1b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec1c.xCoord, vec1c.yCoord, vec1c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec1d.xCoord, vec1d.yCoord, vec1d.zCoord, tex1, tex3); + }*/ + } - private static void renderOuterWest(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; + private static void renderOuterWest (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec2 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec2 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; - vec2[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec2[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec2[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec2[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec2[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec2[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec2[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec2[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + vec2[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec2[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec2[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec2[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec2[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec2[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec2[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec2[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - for (int var25 = 0; var25 < 8; var25++) - { - vec2[var25].zCoord -= 0.0625D; - vec2[var25].rotateAroundX(-0.7853982F); - vec2[var25].yCoord -= 0.5D; - vec2[var25].rotateAroundX(1.570796F); + for (int var25 = 0; var25 < 8; var25++) + { + vec2[var25].zCoord -= 0.0625D; + vec2[var25].rotateAroundX(-0.7853982F); + vec2[var25].yCoord -= 0.5D; + vec2[var25].rotateAroundX(1.570796F); - vec2[var25].xCoord += x + 0.125D; - vec2[var25].yCoord += y; - vec2[var25].zCoord += z + 0.5D; - } - Vec3 vec2a = null; - Vec3 vec2b = null; - Vec3 vec2c = null; - Vec3 vec2d = null; + vec2[var25].xCoord += x + 0.125D; + vec2[var25].yCoord += y; + vec2[var25].zCoord += z + 0.5D; + } + Vec3 vec2a = null; + Vec3 vec2b = null; + Vec3 vec2c = null; + Vec3 vec2d = null; - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); } - if (iter == 0) - { - vec2a = vec2[0]; - vec2b = vec2[1]; - vec2c = vec2[2]; - vec2d = vec2[3]; - } - else if (iter == 1) - { - vec2a = vec2[7]; - vec2b = vec2[6]; - vec2c = vec2[5]; - vec2d = vec2[4]; - } - else if (iter == 2) - { - vec2a = vec2[1]; - vec2b = vec2[0]; - vec2c = vec2[4]; - vec2d = vec2[5]; - } - else if (iter == 3) - { - vec2a = vec2[2]; - vec2b = vec2[1]; - vec2c = vec2[5]; - vec2d = vec2[6]; - } - else if (iter == 4) - { - vec2a = vec2[3]; - vec2b = vec2[2]; - vec2c = vec2[6]; - vec2d = vec2[7]; - } - else if (iter == 5) - { - vec2a = vec2[0]; - vec2b = vec2[3]; - vec2c = vec2[7]; - vec2d = vec2[4]; - } - - tessellator.addVertexWithUV(vec2a.xCoord, vec2a.yCoord, vec2a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec2b.xCoord, vec2b.yCoord, vec2b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec2c.xCoord, vec2c.yCoord, vec2c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec2d.xCoord, vec2d.yCoord, vec2d.zCoord, tex1, tex3); - } - } - - private static void renderInnerEast(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; - - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec3 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec3[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec3[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec3[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec3[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec3[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec3[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec3[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec3[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - - for (int var25 = 0; var25 < 8; var25++) - { - vec3[var25].zCoord -= 0.0625D; - vec3[var25].rotateAroundX(-0.7853982F); - vec3[var25].yCoord -= 0.0625D; - vec3[var25].rotateAroundX(6.283186F); - - vec3[var25].xCoord += x + 0.375D; - vec3[var25].yCoord += y; - vec3[var25].zCoord += z; - } - - Vec3 vec3a = null; - Vec3 vec3b = null; - Vec3 vec3c = null; - Vec3 Vec3 = null; - - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + vec2a = vec2[0]; + vec2b = vec2[1]; + vec2c = vec2[2]; + vec2d = vec2[3]; + } + else if (iter == 1) + { + vec2a = vec2[7]; + vec2b = vec2[6]; + vec2c = vec2[5]; + vec2d = vec2[4]; } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + vec2a = vec2[1]; + vec2b = vec2[0]; + vec2c = vec2[4]; + vec2d = vec2[5]; + } + else if (iter == 3) + { + vec2a = vec2[2]; + vec2b = vec2[1]; + vec2c = vec2[5]; + vec2d = vec2[6]; + } + else if (iter == 4) + { + vec2a = vec2[3]; + vec2b = vec2[2]; + vec2c = vec2[6]; + vec2d = vec2[7]; + } + else if (iter == 5) + { + vec2a = vec2[0]; + vec2b = vec2[3]; + vec2c = vec2[7]; + vec2d = vec2[4]; } - if (iter == 0) - { - vec3a = vec3[0]; - vec3b = vec3[1]; - vec3c = vec3[2]; - Vec3 = vec3[3]; - } - else if (iter == 1) - { - vec3a = vec3[7]; - vec3b = vec3[6]; - vec3c = vec3[5]; - Vec3 = vec3[4]; - } - else if (iter == 2) - { - vec3a = vec3[1]; - vec3b = vec3[0]; - vec3c = vec3[4]; - Vec3 = vec3[5]; - } - else if (iter == 3) - { - vec3a = vec3[2]; - vec3b = vec3[1]; - vec3c = vec3[5]; - Vec3 = vec3[6]; - } - else if (iter == 4) - { - vec3a = vec3[2]; - vec3b = vec3[1]; - vec3c = vec3[5]; - Vec3 = vec3[6]; - } - else if (iter == 5) - { - vec3a = vec3[0]; - vec3b = vec3[3]; - vec3c = vec3[7]; - Vec3 = vec3[4]; - } + tessellator.addVertexWithUV(vec2a.xCoord, vec2a.yCoord, vec2a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec2b.xCoord, vec2b.yCoord, vec2b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec2c.xCoord, vec2c.yCoord, vec2c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec2d.xCoord, vec2d.yCoord, vec2d.zCoord, tex1, tex3); + } + } - tessellator.addVertexWithUV(vec3a.xCoord, vec3a.yCoord, vec3a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec3b.xCoord, vec3b.yCoord, vec3b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec3c.xCoord, vec3c.yCoord, vec3c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(Vec3.xCoord, Vec3.yCoord, Vec3.zCoord, tex1, tex3); - } - } + private static void renderInnerEast (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; - private static void renderOuterEast(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec3 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec3[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec3[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec3[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec3[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec3[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec3[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec3[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec3[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec4 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; + for (int var25 = 0; var25 < 8; var25++) + { + vec3[var25].zCoord -= 0.0625D; + vec3[var25].rotateAroundX(-0.7853982F); + vec3[var25].yCoord -= 0.0625D; + vec3[var25].rotateAroundX(6.283186F); - vec4[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec4[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec4[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec4[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec4[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec4[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec4[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec4[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + vec3[var25].xCoord += x + 0.375D; + vec3[var25].yCoord += y; + vec3[var25].zCoord += z; + } - for (int var25 = 0; var25 < 8; var25++) - { - vec4[var25].zCoord -= 0.0625D; - vec4[var25].rotateAroundX(-0.7853982F); - vec4[var25].yCoord -= 0.0625D; - vec4[var25].rotateAroundX(6.283186F); + Vec3 vec3a = null; + Vec3 vec3b = null; + Vec3 vec3c = null; + Vec3 Vec3 = null; - vec4[var25].xCoord += x + 0.875D; - vec4[var25].yCoord += y; - vec4[var25].zCoord += z; - } - - Vec3 vec4a = null; - Vec3 vec4b = null; - Vec3 vec4c = null; - Vec3 vec4d = null; - - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); } - if (iter == 0) - { - vec4a = vec4[0]; - vec4b = vec4[1]; - vec4c = vec4[2]; - vec4d = vec4[3]; - } - else if (iter == 1) - { - vec4a = vec4[7]; - vec4b = vec4[6]; - vec4c = vec4[5]; - vec4d = vec4[4]; - } - else if (iter == 2) - { - vec4a = vec4[1]; - vec4b = vec4[0]; - vec4c = vec4[4]; - vec4d = vec4[5]; - } - else if (iter == 3) - { - vec4a = vec4[2]; - vec4b = vec4[1]; - vec4c = vec4[5]; - vec4d = vec4[6]; - } - else if (iter == 4) - { - vec4a = vec4[2]; - vec4b = vec4[1]; - vec4c = vec4[5]; - vec4d = vec4[6]; - } - else if (iter == 5) - { - vec4a = vec4[0]; - vec4b = vec4[3]; - vec4c = vec4[7]; - vec4d = vec4[4]; - } - - tessellator.addVertexWithUV(vec4a.xCoord, vec4a.yCoord, vec4a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec4b.xCoord, vec4b.yCoord, vec4b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec4c.xCoord, vec4c.yCoord, vec4c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec4d.xCoord, vec4d.yCoord, vec4d.zCoord, tex1, tex3); - } - } - - private static void renderInnerNorth(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; - - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec1 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec1[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec1[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec1[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec1[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec1[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec1[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec1[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec1[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - - for (int var25 = 0; var25 < 8; var25++) - { - vec1[var25].zCoord -= 0.4375D; - vec1[var25].rotateAroundX(-0.7853982F); - vec1[var25].yCoord -= 0.5D; - vec1[var25].rotateAroundY(1.570796F); - - vec1[var25].xCoord += x + 0.375D; - vec1[var25].yCoord += y + 0.1875D; - vec1[var25].zCoord += z + 0.625D; - } - - Vec3 vec1a = null; - Vec3 vec1b = null; - Vec3 vec1c = null; - Vec3 vec1d = null; - - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + vec3a = vec3[0]; + vec3b = vec3[1]; + vec3c = vec3[2]; + Vec3 = vec3[3]; + } + else if (iter == 1) + { + vec3a = vec3[7]; + vec3b = vec3[6]; + vec3c = vec3[5]; + Vec3 = vec3[4]; } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + vec3a = vec3[1]; + vec3b = vec3[0]; + vec3c = vec3[4]; + Vec3 = vec3[5]; + } + else if (iter == 3) + { + vec3a = vec3[2]; + vec3b = vec3[1]; + vec3c = vec3[5]; + Vec3 = vec3[6]; + } + else if (iter == 4) + { + vec3a = vec3[2]; + vec3b = vec3[1]; + vec3c = vec3[5]; + Vec3 = vec3[6]; + } + else if (iter == 5) + { + vec3a = vec3[0]; + vec3b = vec3[3]; + vec3c = vec3[7]; + Vec3 = vec3[4]; } - if (iter == 0) - { - vec1a = vec1[0]; - vec1b = vec1[1]; - vec1c = vec1[2]; - vec1d = vec1[3]; - } - else if (iter == 1) - { - vec1a = vec1[7]; - vec1b = vec1[6]; - vec1c = vec1[5]; - vec1d = vec1[4]; - } - else if (iter == 2) - { - vec1a = vec1[1]; - vec1b = vec1[0]; - vec1c = vec1[4]; - vec1d = vec1[5]; - } - else if (iter == 3) - { - vec1a = vec1[2]; - vec1b = vec1[1]; - vec1c = vec1[5]; - vec1d = vec1[6]; - } - else if (iter == 4) - { - vec1a = vec1[3]; - vec1b = vec1[2]; - vec1c = vec1[6]; - vec1d = vec1[7]; - } - else if (iter == 5) - { - vec1a = vec1[0]; - vec1b = vec1[3]; - vec1c = vec1[7]; - vec1d = vec1[4]; - } + tessellator.addVertexWithUV(vec3a.xCoord, vec3a.yCoord, vec3a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec3b.xCoord, vec3b.yCoord, vec3b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec3c.xCoord, vec3c.yCoord, vec3c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(Vec3.xCoord, Vec3.yCoord, Vec3.zCoord, tex1, tex3); + } + } - tessellator.addVertexWithUV(vec1a.xCoord, vec1a.yCoord, vec1a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec1b.xCoord, vec1b.yCoord, vec1b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec1c.xCoord, vec1c.yCoord, vec1c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec1d.xCoord, vec1d.yCoord, vec1d.zCoord, tex1, tex3); - } - } + private static void renderOuterEast (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; - private static void renderOuterNorth(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec4 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec2 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec2[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec2[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec2[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec2[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec2[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec2[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec2[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec2[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + vec4[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec4[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec4[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec4[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec4[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec4[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec4[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec4[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - for (int var25 = 0; var25 < 8; var25++) - { - vec2[var25].zCoord -= 0.4375D; - vec2[var25].rotateAroundX(-0.7853982F); - vec2[var25].yCoord -= 0.5D; - vec2[var25].rotateAroundY(1.570796F); + for (int var25 = 0; var25 < 8; var25++) + { + vec4[var25].zCoord -= 0.0625D; + vec4[var25].rotateAroundX(-0.7853982F); + vec4[var25].yCoord -= 0.0625D; + vec4[var25].rotateAroundX(6.283186F); - vec2[var25].xCoord += x + 0.375D; - vec2[var25].yCoord += y + 0.1875D; - vec2[var25].zCoord += z + 0.125D; - } + vec4[var25].xCoord += x + 0.875D; + vec4[var25].yCoord += y; + vec4[var25].zCoord += z; + } - Vec3 vec2a = null; - Vec3 vec2b = null; - Vec3 vec2c = null; - Vec3 vec2d = null; + Vec3 vec4a = null; + Vec3 vec4b = null; + Vec3 vec4c = null; + Vec3 vec4d = null; - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); } - if (iter == 0) - { - vec2a = vec2[0]; - vec2b = vec2[1]; - vec2c = vec2[2]; - vec2d = vec2[3]; - } - else if (iter == 1) - { - vec2a = vec2[7]; - vec2b = vec2[6]; - vec2c = vec2[5]; - vec2d = vec2[4]; - } - else if (iter == 2) - { - vec2a = vec2[1]; - vec2b = vec2[0]; - vec2c = vec2[4]; - vec2d = vec2[5]; - } - else if (iter == 3) - { - vec2a = vec2[2]; - vec2b = vec2[1]; - vec2c = vec2[5]; - vec2d = vec2[6]; - } - else if (iter == 4) - { - vec2a = vec2[3]; - vec2b = vec2[2]; - vec2c = vec2[6]; - vec2d = vec2[7]; - } - else if (iter == 5) - { - vec2a = vec2[0]; - vec2b = vec2[3]; - vec2c = vec2[7]; - vec2d = vec2[4]; - } - - tessellator.addVertexWithUV(vec2a.xCoord, vec2a.yCoord, vec2a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec2b.xCoord, vec2b.yCoord, vec2b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec2c.xCoord, vec2c.yCoord, vec2c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec2d.xCoord, vec2d.yCoord, vec2d.zCoord, tex1, tex3); - } - } - - private static void renderInnerSouth(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; - - tessellator.setColorOpaque_F(color, color, color); - - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec3 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec3[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec3[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec3[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec3[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec3[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec3[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec3[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec3[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - - for (int var25 = 0; var25 < 8; var25++) - { - vec3[var25].zCoord -= 0.4375D; - vec3[var25].rotateAroundX(-0.7853982F); - vec3[var25].yCoord -= 0.5D; - vec3[var25].rotateAroundY(4.712389F); - - vec3[var25].xCoord += x + 0.625D; - vec3[var25].yCoord += y + 0.1875D; - vec3[var25].zCoord += z + 0.375D; - } - Vec3 vec3a = null; - Vec3 vec3b = null; - Vec3 vec3c = null; - Vec3 Vec3 = null; - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + vec4a = vec4[0]; + vec4b = vec4[1]; + vec4c = vec4[2]; + vec4d = vec4[3]; + } + else if (iter == 1) + { + vec4a = vec4[7]; + vec4b = vec4[6]; + vec4c = vec4[5]; + vec4d = vec4[4]; } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + vec4a = vec4[1]; + vec4b = vec4[0]; + vec4c = vec4[4]; + vec4d = vec4[5]; + } + else if (iter == 3) + { + vec4a = vec4[2]; + vec4b = vec4[1]; + vec4c = vec4[5]; + vec4d = vec4[6]; + } + else if (iter == 4) + { + vec4a = vec4[2]; + vec4b = vec4[1]; + vec4c = vec4[5]; + vec4d = vec4[6]; + } + else if (iter == 5) + { + vec4a = vec4[0]; + vec4b = vec4[3]; + vec4c = vec4[7]; + vec4d = vec4[4]; } - if (iter == 0) - { - vec3a = vec3[0]; - vec3b = vec3[1]; - vec3c = vec3[2]; - Vec3 = vec3[3]; - } - else if (iter == 1) - { - vec3a = vec3[7]; - vec3b = vec3[6]; - vec3c = vec3[5]; - Vec3 = vec3[4]; - } - else if (iter == 2) - { - vec3a = vec3[1]; - vec3b = vec3[0]; - vec3c = vec3[4]; - Vec3 = vec3[5]; - } - else if (iter == 3) - { - vec3a = vec3[2]; - vec3b = vec3[1]; - vec3c = vec3[5]; - Vec3 = vec3[6]; - } - else if (iter == 4) - { - vec3a = vec3[2]; - vec3b = vec3[1]; - vec3c = vec3[5]; - Vec3 = vec3[6]; - } - else if (iter == 5) - { - vec3a = vec3[0]; - vec3b = vec3[3]; - vec3c = vec3[7]; - Vec3 = vec3[4]; - } + tessellator.addVertexWithUV(vec4a.xCoord, vec4a.yCoord, vec4a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec4b.xCoord, vec4b.yCoord, vec4b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec4c.xCoord, vec4c.yCoord, vec4c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec4d.xCoord, vec4d.yCoord, vec4d.zCoord, tex1, tex3); + } + } - tessellator.addVertexWithUV(vec3a.xCoord, vec3a.yCoord, vec3a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec3b.xCoord, vec3b.yCoord, vec3b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec3c.xCoord, vec3c.yCoord, vec3c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(Vec3.xCoord, Vec3.yCoord, Vec3.zCoord, tex1, tex3); - } - } + private static void renderInnerNorth (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; - private static void renderOuterSouth(RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) - { - tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); - float color = 1.0F; + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec1 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec1[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec1[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec1[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec1[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec1[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec1[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec1[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec1[7] = Vec3.createVectorHelper(-minSize, height, maxSize); - tessellator.setColorOpaque_F(color, color, color); - Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); - double tex1 = (double)icon.getMinU(); - double tex2 = (double)icon.getMinV(); - double tex3 = (double)icon.getMaxU(); - double tex4 = (double)icon.getMaxV(); - Vec3[] vec4 = new Vec3[8]; - float minSize = 0.125F; - float maxSize = 0.125F; - float height = 1.416F; - vec4[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); - vec4[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); - vec4[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); - vec4[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); - vec4[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); - vec4[5] = Vec3.createVectorHelper(minSize, height, -maxSize); - vec4[6] = Vec3.createVectorHelper(minSize, height, maxSize); - vec4[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + for (int var25 = 0; var25 < 8; var25++) + { + vec1[var25].zCoord -= 0.4375D; + vec1[var25].rotateAroundX(-0.7853982F); + vec1[var25].yCoord -= 0.5D; + vec1[var25].rotateAroundY(1.570796F); - for (int var25 = 0; var25 < 8; var25++) - { - vec4[var25].zCoord -= 0.4375D; - vec4[var25].rotateAroundX(-0.7853982F); - vec4[var25].yCoord -= 0.5D; - vec4[var25].rotateAroundY(4.712389F); + vec1[var25].xCoord += x + 0.375D; + vec1[var25].yCoord += y + 0.1875D; + vec1[var25].zCoord += z + 0.625D; + } - vec4[var25].xCoord += x + 0.625D; - vec4[var25].yCoord += y + 0.1875D; - vec4[var25].zCoord += z + 0.875D; - } + Vec3 vec1a = null; + Vec3 vec1b = null; + Vec3 vec1c = null; + Vec3 vec1d = null; - Vec3 vec4a = null; - Vec3 vec4b = null; - Vec3 vec4c = null; - Vec3 vec4d = null; - - for (int iter = 0; iter < 6; iter++) - { - if (iter == 0) + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getInterpolatedV(8.0D); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); } else if (iter == 2) { - tex1 = (double)icon.getInterpolatedU(7.0D); - tex2 = (double)icon.getInterpolatedV(6.0D); - tex3 = (double)icon.getInterpolatedU(9.0D); - tex4 = (double)icon.getMaxV(); + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); } - if (iter == 0) - { - vec4a = vec4[0]; - vec4b = vec4[1]; - vec4c = vec4[2]; - vec4d = vec4[3]; - } - else if (iter == 1) - { - vec4a = vec4[7]; - vec4b = vec4[6]; - vec4c = vec4[5]; - vec4d = vec4[4]; - } - else if (iter == 2) - { - vec4a = vec4[1]; - vec4b = vec4[0]; - vec4c = vec4[4]; - vec4d = vec4[5]; - } - else if (iter == 3) - { - vec4a = vec4[2]; - vec4b = vec4[1]; - vec4c = vec4[5]; - vec4d = vec4[6]; - } - else if (iter == 4) - { - vec4a = vec4[2]; - vec4b = vec4[1]; - vec4c = vec4[5]; - vec4d = vec4[6]; - } - else if (iter == 5) - { - vec4a = vec4[0]; - vec4b = vec4[3]; - vec4c = vec4[7]; - vec4d = vec4[4]; - } + if (iter == 0) + { + vec1a = vec1[0]; + vec1b = vec1[1]; + vec1c = vec1[2]; + vec1d = vec1[3]; + } + else if (iter == 1) + { + vec1a = vec1[7]; + vec1b = vec1[6]; + vec1c = vec1[5]; + vec1d = vec1[4]; + } + else if (iter == 2) + { + vec1a = vec1[1]; + vec1b = vec1[0]; + vec1c = vec1[4]; + vec1d = vec1[5]; + } + else if (iter == 3) + { + vec1a = vec1[2]; + vec1b = vec1[1]; + vec1c = vec1[5]; + vec1d = vec1[6]; + } + else if (iter == 4) + { + vec1a = vec1[3]; + vec1b = vec1[2]; + vec1c = vec1[6]; + vec1d = vec1[7]; + } + else if (iter == 5) + { + vec1a = vec1[0]; + vec1b = vec1[3]; + vec1c = vec1[7]; + vec1d = vec1[4]; + } - tessellator.addVertexWithUV(vec4a.xCoord, vec4a.yCoord, vec4a.zCoord, tex1, tex4); - tessellator.addVertexWithUV(vec4b.xCoord, vec4b.yCoord, vec4b.zCoord, tex2, tex4); - tessellator.addVertexWithUV(vec4c.xCoord, vec4c.yCoord, vec4c.zCoord, tex2, tex3); - tessellator.addVertexWithUV(vec4d.xCoord, vec4d.yCoord, vec4d.zCoord, tex1, tex3); - } - } + tessellator.addVertexWithUV(vec1a.xCoord, vec1a.yCoord, vec1a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec1b.xCoord, vec1b.yCoord, vec1b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec1c.xCoord, vec1c.yCoord, vec1c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec1d.xCoord, vec1d.yCoord, vec1d.zCoord, tex1, tex3); + } + } + + private static void renderOuterNorth (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; + + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec2 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec2[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec2[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec2[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec2[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec2[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec2[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec2[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec2[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + + for (int var25 = 0; var25 < 8; var25++) + { + vec2[var25].zCoord -= 0.4375D; + vec2[var25].rotateAroundX(-0.7853982F); + vec2[var25].yCoord -= 0.5D; + vec2[var25].rotateAroundY(1.570796F); + + vec2[var25].xCoord += x + 0.375D; + vec2[var25].yCoord += y + 0.1875D; + vec2[var25].zCoord += z + 0.125D; + } + + Vec3 vec2a = null; + Vec3 vec2b = null; + Vec3 vec2c = null; + Vec3 vec2d = null; + + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); + } + else if (iter == 2) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); + } + + if (iter == 0) + { + vec2a = vec2[0]; + vec2b = vec2[1]; + vec2c = vec2[2]; + vec2d = vec2[3]; + } + else if (iter == 1) + { + vec2a = vec2[7]; + vec2b = vec2[6]; + vec2c = vec2[5]; + vec2d = vec2[4]; + } + else if (iter == 2) + { + vec2a = vec2[1]; + vec2b = vec2[0]; + vec2c = vec2[4]; + vec2d = vec2[5]; + } + else if (iter == 3) + { + vec2a = vec2[2]; + vec2b = vec2[1]; + vec2c = vec2[5]; + vec2d = vec2[6]; + } + else if (iter == 4) + { + vec2a = vec2[3]; + vec2b = vec2[2]; + vec2c = vec2[6]; + vec2d = vec2[7]; + } + else if (iter == 5) + { + vec2a = vec2[0]; + vec2b = vec2[3]; + vec2c = vec2[7]; + vec2d = vec2[4]; + } + + tessellator.addVertexWithUV(vec2a.xCoord, vec2a.yCoord, vec2a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec2b.xCoord, vec2b.yCoord, vec2b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec2c.xCoord, vec2c.yCoord, vec2c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec2d.xCoord, vec2d.yCoord, vec2d.zCoord, tex1, tex3); + } + } + + private static void renderInnerSouth (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; + + tessellator.setColorOpaque_F(color, color, color); + + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec3 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec3[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec3[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec3[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec3[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec3[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec3[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec3[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec3[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + + for (int var25 = 0; var25 < 8; var25++) + { + vec3[var25].zCoord -= 0.4375D; + vec3[var25].rotateAroundX(-0.7853982F); + vec3[var25].yCoord -= 0.5D; + vec3[var25].rotateAroundY(4.712389F); + + vec3[var25].xCoord += x + 0.625D; + vec3[var25].yCoord += y + 0.1875D; + vec3[var25].zCoord += z + 0.375D; + } + Vec3 vec3a = null; + Vec3 vec3b = null; + Vec3 vec3c = null; + Vec3 Vec3 = null; + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); + } + else if (iter == 2) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); + } + + if (iter == 0) + { + vec3a = vec3[0]; + vec3b = vec3[1]; + vec3c = vec3[2]; + Vec3 = vec3[3]; + } + else if (iter == 1) + { + vec3a = vec3[7]; + vec3b = vec3[6]; + vec3c = vec3[5]; + Vec3 = vec3[4]; + } + else if (iter == 2) + { + vec3a = vec3[1]; + vec3b = vec3[0]; + vec3c = vec3[4]; + Vec3 = vec3[5]; + } + else if (iter == 3) + { + vec3a = vec3[2]; + vec3b = vec3[1]; + vec3c = vec3[5]; + Vec3 = vec3[6]; + } + else if (iter == 4) + { + vec3a = vec3[2]; + vec3b = vec3[1]; + vec3c = vec3[5]; + Vec3 = vec3[6]; + } + else if (iter == 5) + { + vec3a = vec3[0]; + vec3b = vec3[3]; + vec3c = vec3[7]; + Vec3 = vec3[4]; + } + + tessellator.addVertexWithUV(vec3a.xCoord, vec3a.yCoord, vec3a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec3b.xCoord, vec3b.yCoord, vec3b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec3c.xCoord, vec3c.yCoord, vec3c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(Vec3.xCoord, Vec3.yCoord, Vec3.zCoord, tex1, tex3); + } + } + + private static void renderOuterSouth (RenderBlocks renderblocks, IBlockAccess iblockaccess, int x, int y, int z, Block barricade, Tessellator tessellator) + { + tessellator.setBrightness(barricade.getMixedBrightnessForBlock(iblockaccess, x, y, z)); + float color = 1.0F; + + tessellator.setColorOpaque_F(color, color, color); + Icon icon = renderblocks.getBlockIconFromSide(barricade, 0); + double tex1 = (double) icon.getMinU(); + double tex2 = (double) icon.getMinV(); + double tex3 = (double) icon.getMaxU(); + double tex4 = (double) icon.getMaxV(); + Vec3[] vec4 = new Vec3[8]; + float minSize = 0.125F; + float maxSize = 0.125F; + float height = 1.416F; + vec4[0] = Vec3.createVectorHelper(-minSize, 0.0D, -maxSize); + vec4[1] = Vec3.createVectorHelper(minSize, 0.0D, -maxSize); + vec4[2] = Vec3.createVectorHelper(minSize, 0.0D, maxSize); + vec4[3] = Vec3.createVectorHelper(-minSize, 0.0D, maxSize); + vec4[4] = Vec3.createVectorHelper(-minSize, height, -maxSize); + vec4[5] = Vec3.createVectorHelper(minSize, height, -maxSize); + vec4[6] = Vec3.createVectorHelper(minSize, height, maxSize); + vec4[7] = Vec3.createVectorHelper(-minSize, height, maxSize); + + for (int var25 = 0; var25 < 8; var25++) + { + vec4[var25].zCoord -= 0.4375D; + vec4[var25].rotateAroundX(-0.7853982F); + vec4[var25].yCoord -= 0.5D; + vec4[var25].rotateAroundY(4.712389F); + + vec4[var25].xCoord += x + 0.625D; + vec4[var25].yCoord += y + 0.1875D; + vec4[var25].zCoord += z + 0.875D; + } + + Vec3 vec4a = null; + Vec3 vec4b = null; + Vec3 vec4c = null; + Vec3 vec4d = null; + + for (int iter = 0; iter < 6; iter++) + { + if (iter == 0) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getInterpolatedV(8.0D); + } + else if (iter == 2) + { + tex1 = (double) icon.getInterpolatedU(7.0D); + tex2 = (double) icon.getInterpolatedV(6.0D); + tex3 = (double) icon.getInterpolatedU(9.0D); + tex4 = (double) icon.getMaxV(); + } + + if (iter == 0) + { + vec4a = vec4[0]; + vec4b = vec4[1]; + vec4c = vec4[2]; + vec4d = vec4[3]; + } + else if (iter == 1) + { + vec4a = vec4[7]; + vec4b = vec4[6]; + vec4c = vec4[5]; + vec4d = vec4[4]; + } + else if (iter == 2) + { + vec4a = vec4[1]; + vec4b = vec4[0]; + vec4c = vec4[4]; + vec4d = vec4[5]; + } + else if (iter == 3) + { + vec4a = vec4[2]; + vec4b = vec4[1]; + vec4c = vec4[5]; + vec4d = vec4[6]; + } + else if (iter == 4) + { + vec4a = vec4[2]; + vec4b = vec4[1]; + vec4c = vec4[5]; + vec4d = vec4[6]; + } + else if (iter == 5) + { + vec4a = vec4[0]; + vec4b = vec4[3]; + vec4c = vec4[7]; + vec4d = vec4[4]; + } + + tessellator.addVertexWithUV(vec4a.xCoord, vec4a.yCoord, vec4a.zCoord, tex1, tex4); + tessellator.addVertexWithUV(vec4b.xCoord, vec4b.yCoord, vec4b.zCoord, tex2, tex4); + tessellator.addVertexWithUV(vec4c.xCoord, vec4c.yCoord, vec4c.zCoord, tex2, tex3); + tessellator.addVertexWithUV(vec4d.xCoord, vec4d.yCoord, vec4d.zCoord, tex1, tex3); + } + } } diff --git a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java index 9718c6f5..80e2957f 100644 --- a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java +++ b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java @@ -11,32 +11,31 @@ import net.minecraft.world.IBlockAccess; public class BlockSkinRenderHelper { - public static boolean renderMetadataBlock (Block block, int metadata, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) - { - int var5 = block.colorMultiplier(world, x, y, z); - float var6 = (float) (var5 >> 16 & 255) / 255.0F; - float var7 = (float) (var5 >> 8 & 255) / 255.0F; - float var8 = (float) (var5 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) - { - float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; - float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; - float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; - var6 = var9; - var7 = var10; - var8 = var11; - } - - return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[block.blockID] == 0 ? - renderMetadataBlockWithAmbientOcclusion(block, metadata, x, y, z, var6, var7, var8, renderer, world) - : renderMetadataBlockWithColorMultiplier(block, metadata, x, y, z, var6, var7, var8, renderer, world); - } - - static boolean renderMetadataBlockWithAmbientOcclusion(Block block, int metadata, int xPos, int yPos, int zPos, - float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) + public static boolean renderMetadataBlock (Block block, int metadata, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) { - render.enableAO = true; + int var5 = block.colorMultiplier(world, x, y, z); + float var6 = (float) (var5 >> 16 & 255) / 255.0F; + float var7 = (float) (var5 >> 8 & 255) / 255.0F; + float var8 = (float) (var5 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[block.blockID] == 0 ? renderMetadataBlockWithAmbientOcclusion(block, metadata, x, y, z, var6, var7, var8, renderer, world) + : renderMetadataBlockWithColorMultiplier(block, metadata, x, y, z, var6, var7, var8, renderer, world); + } + + static boolean renderMetadataBlockWithAmbientOcclusion (Block block, int metadata, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, + IBlockAccess world) + { + render.enableAO = true; boolean flag = false; float f3 = 0.0F; float f4 = 0.0F; @@ -174,7 +173,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(0, metadata)); + render.renderFaceYNeg(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(0, metadata)); flag = true; } @@ -278,7 +277,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(1, metadata)); + render.renderFaceYPos(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(1, metadata)); flag = true; } @@ -396,7 +395,7 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(2, metadata); - render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, icon); + render.renderFaceZNeg(block, (double) xPos, (double) yPos, (double) zPos, icon); flag = true; } @@ -513,7 +512,7 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(3, metadata); - render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, icon); + render.renderFaceZPos(block, (double) xPos, (double) yPos, (double) zPos, icon); flag = true; } @@ -630,7 +629,7 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(4, metadata); - render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, icon); + render.renderFaceXNeg(block, (double) xPos, (double) yPos, (double) zPos, icon); flag = true; } @@ -747,7 +746,7 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(5, metadata); - render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, icon); + render.renderFaceXPos(block, (double) xPos, (double) yPos, (double) zPos, icon); flag = true; } @@ -755,10 +754,11 @@ public class BlockSkinRenderHelper render.enableAO = false; return flag; } - - static boolean renderMetadataBlockWithColorMultiplier(Block block, int metadata, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) + + static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, + IBlockAccess world) { - render.enableAO = false; + render.enableAO = false; Tessellator tessellator = Tessellator.instance; boolean flag = false; float f3 = 0.5F; @@ -797,7 +797,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); - render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(0, metadata)); + render.renderFaceYNeg(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(0, metadata)); flag = true; } @@ -805,7 +805,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); - render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(1, metadata)); + render.renderFaceYPos(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(1, metadata)); flag = true; } @@ -815,7 +815,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(2, metadata)); + render.renderFaceZNeg(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(2, metadata)); flag = true; } @@ -824,7 +824,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(3, metadata)); + render.renderFaceZPos(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(3, metadata)); flag = true; } @@ -833,7 +833,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(4, metadata)); + render.renderFaceXNeg(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(4, metadata)); flag = true; } @@ -842,42 +842,40 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(5, metadata)); + render.renderFaceXPos(block, (double) xPos, (double) yPos, (double) zPos, block.getIcon(5, metadata)); flag = true; } return flag; } - - public static boolean renderFakeBlock (Icon texture, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) - { - Block block = Block.stone; - int var5 = block.colorMultiplier(world, x, y, z); - float var6 = (float) (var5 >> 16 & 255) / 255.0F; - float var7 = (float) (var5 >> 8 & 255) / 255.0F; - float var8 = (float) (var5 & 255) / 255.0F; - if (EntityRenderer.anaglyphEnable) - { - float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; - float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; - float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; - var6 = var9; - var7 = var10; - var8 = var11; - } - - return Minecraft.isAmbientOcclusionEnabled() ? - renderFakeBlockWithAmbientOcclusion(texture, x, y, z, var6, var7, var8, renderer, world) - : renderFakeBlockWithColorMultiplier(texture, x, y, z, var6, var7, var8, renderer, world); - } - - static boolean renderFakeBlockWithAmbientOcclusion(Icon texture, int xPos, int yPos, int zPos, - float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) + public static boolean renderFakeBlock (Icon texture, int x, int y, int z, RenderBlocks renderer, IBlockAccess world) { - Block block = Block.stone; - render.enableAO = true; + Block block = Block.stone; + int var5 = block.colorMultiplier(world, x, y, z); + float var6 = (float) (var5 >> 16 & 255) / 255.0F; + float var7 = (float) (var5 >> 8 & 255) / 255.0F; + float var8 = (float) (var5 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; + var6 = var9; + var7 = var10; + var8 = var11; + } + + return Minecraft.isAmbientOcclusionEnabled() ? renderFakeBlockWithAmbientOcclusion(texture, x, y, z, var6, var7, var8, renderer, world) : renderFakeBlockWithColorMultiplier(texture, x, y, z, + var6, var7, var8, renderer, world); + } + + static boolean renderFakeBlockWithAmbientOcclusion (Icon texture, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) + { + Block block = Block.stone; + render.enableAO = true; boolean flag = false; float f3 = 0.0F; float f4 = 0.0F; @@ -1015,7 +1013,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceYNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1119,7 +1117,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceYPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1234,7 +1232,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceZNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1350,7 +1348,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceZPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1466,7 +1464,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceXNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1582,7 +1580,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceXPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1590,11 +1588,11 @@ public class BlockSkinRenderHelper render.enableAO = false; return flag; } - - static boolean renderFakeBlockWithColorMultiplier(Icon texture, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) + + static boolean renderFakeBlockWithColorMultiplier (Icon texture, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) { - Block block = Block.stone; - render.enableAO = false; + Block block = Block.stone; + render.enableAO = false; Tessellator tessellator = Tessellator.instance; boolean flag = false; float f3 = 0.5F; @@ -1633,7 +1631,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); - render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceYNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1641,7 +1639,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); - render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceYPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1651,7 +1649,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceZNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1660,7 +1658,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceZPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1669,7 +1667,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceXNeg(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } @@ -1678,7 +1676,7 @@ public class BlockSkinRenderHelper { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, texture); + render.renderFaceXPos(block, (double) xPos, (double) yPos, (double) zPos, texture); flag = true; } diff --git a/mods/tinker/tconstruct/client/block/BreakingFX.java b/mods/tinker/tconstruct/client/block/BreakingFX.java index 85f6c801..7bacb583 100644 --- a/mods/tinker/tconstruct/client/block/BreakingFX.java +++ b/mods/tinker/tconstruct/client/block/BreakingFX.java @@ -13,7 +13,7 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class BreakingFX extends EntityFX { - public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, RenderEngine par9RenderEngine) + public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, RenderEngine par9RenderEngine) { super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); this.setParticleIcon(par9RenderEngine, par8Item.getIconFromDamage(0)); @@ -33,35 +33,35 @@ public class BreakingFX extends EntityFX this.motionZ += par12; } - public int getFXLayer() + public int getFXLayer () { return 2; } - public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + public void renderParticle (Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { - float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f6 = ((float) this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; float f7 = f6 + 0.015609375F; - float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f8 = ((float) this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; float f9 = f8 + 0.015609375F; float f10 = 0.1F * this.particleScale; if (this.particleIcon != null) { - f6 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); - f7 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); - f8 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); - f9 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + f6 = this.particleIcon.getInterpolatedU((double) (this.particleTextureJitterX / 4.0F * 16.0F)); + f7 = this.particleIcon.getInterpolatedU((double) ((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f8 = this.particleIcon.getInterpolatedV((double) (this.particleTextureJitterY / 4.0F * 16.0F)); + f9 = this.particleIcon.getInterpolatedV((double) ((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); } - float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); - float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); - float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); + float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); + float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); float f14 = 1.0F; par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue); - par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f6, (double)f9); - par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f6, (double)f8); - par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f7, (double)f8); - par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f7, (double)f9); + par1Tessellator.addVertexWithUV((double) (f11 - par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 - par5 * f10 - par7 * f10), (double) f6, (double) f9); + par1Tessellator.addVertexWithUV((double) (f11 - par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 - par5 * f10 + par7 * f10), (double) f6, (double) f8); + par1Tessellator.addVertexWithUV((double) (f11 + par3 * f10 + par6 * f10), (double) (f12 + par4 * f10), (double) (f13 + par5 * f10 + par7 * f10), (double) f7, (double) f8); + par1Tessellator.addVertexWithUV((double) (f11 + par3 * f10 - par6 * f10), (double) (f12 - par4 * f10), (double) (f13 + par5 * f10 - par7 * f10), (double) f7, (double) f9); } } diff --git a/mods/tinker/tconstruct/client/block/BrickRender.java b/mods/tinker/tconstruct/client/block/BrickRender.java index e5e12569..18a5daea 100644 --- a/mods/tinker/tconstruct/client/block/BrickRender.java +++ b/mods/tinker/tconstruct/client/block/BrickRender.java @@ -9,35 +9,36 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class BrickRender implements ISimpleBlockRenderingHandler { - public static int model = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + public static int model = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } + } - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - int meta = world.getBlockMetadata(x, y, z); - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.5F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F); - BlockSkinRenderHelper.renderFakeBlock(block.getIcon(0, meta), x-1, y, z, renderer, world); + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + int meta = world.getBlockMetadata(x, y, z); + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.5F, 0.5F, 0.5F, 1.0F, 1.0F, 1.0F); + BlockSkinRenderHelper.renderFakeBlock(block.getIcon(0, meta), x - 1, y, z, renderer, world); //renderer.renderStandardBlock(block, x-1, y, z); - return true; - } + return true; + } - @Override - public boolean shouldRender3DInInventory () - { - return true; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } - @Override - public int getRenderId () - { - return model; - } + @Override + public int getRenderId () + { + return model; + } } diff --git a/mods/tinker/tconstruct/client/block/CastingBasinSpecialRender.java b/mods/tinker/tconstruct/client/block/CastingBasinSpecialRender.java index 128c27f4..d2f26487 100644 --- a/mods/tinker/tconstruct/client/block/CastingBasinSpecialRender.java +++ b/mods/tinker/tconstruct/client/block/CastingBasinSpecialRender.java @@ -19,50 +19,50 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class CastingBasinSpecialRender extends TileEntitySpecialRenderer { - @Override - public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) - { - this.render((CastingBasinLogic) logic, var2, var4, var6, var8); - } + @Override + public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) + { + this.render((CastingBasinLogic) logic, var2, var4, var6, var8); + } - public void render (CastingBasinLogic logic, double posX, double posY, double posZ, float var8) - { - GL11.glPushMatrix(); - float var10 = (float) (posX - 0.5F); - float var11 = (float) (posY - 0.5F); - float var12 = (float) (posZ - 0.5F); - GL11.glTranslatef(var10, var11, var12); + public void render (CastingBasinLogic logic, double posX, double posY, double posZ, float var8) + { + GL11.glPushMatrix(); + float var10 = (float) (posX - 0.5F); + float var11 = (float) (posY - 0.5F); + float var12 = (float) (posZ - 0.5F); + GL11.glTranslatef(var10, var11, var12); - ItemStack stack = logic.getStackInSlot(0); - if (stack != null) - renderItem(logic, stack); - - stack = logic.getStackInSlot(1); + ItemStack stack = logic.getStackInSlot(0); if (stack != null) renderItem(logic, stack); - - GL11.glPopMatrix(); - } - - void renderItem(CastingBasinLogic logic, ItemStack stack) - { - FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(1F, 0.675F, 1.0F); - //GL11.glRotatef(90F, 1, 0F, 0F); - GL11.glScalef(1.75F, 1.75F, 1.75F); - if (stack.getItem() instanceof ItemBlock) - { - GL11.glScalef(1.6F, 1.6F, 1.6F); - GL11.glTranslatef(0F, 0.045F, 0.0f); - } - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; + stack = logic.getStackInSlot(1); + if (stack != null) + renderItem(logic, stack); - GL11.glPopMatrix(); - } + GL11.glPopMatrix(); + } + + void renderItem (CastingBasinLogic logic, ItemStack stack) + { + FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); + entityitem.getEntityItem().stackSize = 1; + entityitem.hoverStart = 0.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(1F, 0.675F, 1.0F); + //GL11.glRotatef(90F, 1, 0F, 0F); + GL11.glScalef(1.75F, 1.75F, 1.75F); + if (stack.getItem() instanceof ItemBlock) + { + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0F, 0.045F, 0.0f); + } + + RenderItem.renderInFrame = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderItem.renderInFrame = false; + + GL11.glPopMatrix(); + } } diff --git a/mods/tinker/tconstruct/client/block/CastingTableSpecialRenderer.java b/mods/tinker/tconstruct/client/block/CastingTableSpecialRenderer.java index 27f90e64..96b30804 100644 --- a/mods/tinker/tconstruct/client/block/CastingTableSpecialRenderer.java +++ b/mods/tinker/tconstruct/client/block/CastingTableSpecialRenderer.java @@ -19,56 +19,56 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer { - @Override - public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) - { - //System.out.println("Render!!!"); - this.render((CastingTableLogic) logic, var2, var4, var6, var8); - } + @Override + public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) + { + //System.out.println("Render!!!"); + this.render((CastingTableLogic) logic, var2, var4, var6, var8); + } - public void render (CastingTableLogic logic, double posX, double posY, double posZ, float var8) - { - GL11.glPushMatrix(); - float var10 = (float) (posX - 0.5F); - float var11 = (float) (posY - 0.5F); - float var12 = (float) (posZ - 0.5F); - GL11.glTranslatef(var10, var11, var12); - this.func_82402_b(logic); - GL11.glPopMatrix(); - } + public void render (CastingTableLogic logic, double posX, double posY, double posZ, float var8) + { + GL11.glPushMatrix(); + float var10 = (float) (posX - 0.5F); + float var11 = (float) (posY - 0.5F); + float var12 = (float) (posZ - 0.5F); + GL11.glTranslatef(var10, var11, var12); + this.func_82402_b(logic); + GL11.glPopMatrix(); + } - private void func_82402_b (CastingTableLogic logic) - { - ItemStack stack = logic.getStackInSlot(0); + private void func_82402_b (CastingTableLogic logic) + { + ItemStack stack = logic.getStackInSlot(0); - if (stack != null) - renderItem(logic, stack); - - stack = logic.getStackInSlot(1); - - if (stack != null) - renderItem(logic, stack); - } - - void renderItem(CastingTableLogic logic, ItemStack stack) - { - FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(1F, 1.565F, 0.55F); - GL11.glRotatef(90F, 1, 0F, 0F); - GL11.glScalef(2F, 2F, 2F); - if (stack.getItem() instanceof ItemBlock) - { - GL11.glRotatef(90F, -1, 0F, 0F); - GL11.glTranslatef(0F, -0.1F, 0.2275F); - } + if (stack != null) + renderItem(logic, stack); - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; + stack = logic.getStackInSlot(1); - GL11.glPopMatrix(); - } + if (stack != null) + renderItem(logic, stack); + } + + void renderItem (CastingTableLogic logic, ItemStack stack) + { + FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); + entityitem.getEntityItem().stackSize = 1; + entityitem.hoverStart = 0.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(1F, 1.565F, 0.55F); + GL11.glRotatef(90F, 1, 0F, 0F); + GL11.glScalef(2F, 2F, 2F); + if (stack.getItem() instanceof ItemBlock) + { + GL11.glRotatef(90F, -1, 0F, 0F); + GL11.glTranslatef(0F, -0.1F, 0.2275F); + } + + RenderItem.renderInFrame = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderItem.renderInFrame = false; + + GL11.glPopMatrix(); + } } diff --git a/mods/tinker/tconstruct/client/block/FluidRender.java b/mods/tinker/tconstruct/client/block/FluidRender.java index f9745a38..19db26ad 100644 --- a/mods/tinker/tconstruct/client/block/FluidRender.java +++ b/mods/tinker/tconstruct/client/block/FluidRender.java @@ -14,426 +14,427 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class FluidRender implements ISimpleBlockRenderingHandler { - public static int fluidModel = RenderingRegistry.getNextAvailableRenderId(); + public static int fluidModel = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } + } - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - return renderFluids(renderer, world, block, x, y, z); - } + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + return renderFluids(renderer, world, block, x, y, z); + } - @Override - public boolean shouldRender3DInInventory () - { - return false; - } + @Override + public boolean shouldRender3DInInventory () + { + return false; + } - @Override - public int getRenderId () - { - return fluidModel; - } + @Override + public int getRenderId () + { + return fluidModel; + } - public boolean renderFluids (RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z) - { - Tessellator tessellator = Tessellator.instance; - int l = block.colorMultiplier(world, x, y, z); - float f = (float) (l >> 16 & 255) / 255.0F; - float f1 = (float) (l >> 8 & 255) / 255.0F; - float f2 = (float) (l & 255) / 255.0F; - boolean flag = block.shouldSideBeRendered(world, x, y + 1, z, 1); - boolean flag1 = block.shouldSideBeRendered(world, x, y - 1, z, 0); - boolean[] aboolean = new boolean[] { block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), block.shouldSideBeRendered(world, x + 1, y, z, 5) }; + public boolean renderFluids (RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z) + { + Tessellator tessellator = Tessellator.instance; + int l = block.colorMultiplier(world, x, y, z); + float f = (float) (l >> 16 & 255) / 255.0F; + float f1 = (float) (l >> 8 & 255) / 255.0F; + float f2 = (float) (l & 255) / 255.0F; + boolean flag = block.shouldSideBeRendered(world, x, y + 1, z, 1); + boolean flag1 = block.shouldSideBeRendered(world, x, y - 1, z, 0); + boolean[] aboolean = new boolean[] { block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), + block.shouldSideBeRendered(world, x + 1, y, z, 5) }; - if (!flag && !flag1 && !aboolean[0] && !aboolean[1] && !aboolean[2] && !aboolean[3]) - { - return false; - } - else - { - boolean flag2 = false; - float f3 = 0.5F; - float f4 = 1.0F; - float f5 = 0.8F; - float f6 = 0.6F; - double d0 = 0.0D; - double d1 = 1.0D; - Material material = block.blockMaterial; - int i1 = world.getBlockMetadata(x, y, z); - double d2 = (double) renderer.getFluidHeight(x, y, z, material); - double d3 = (double) renderer.getFluidHeight(x, y, z + 1, material); - double d4 = (double) renderer.getFluidHeight(x + 1, y, z + 1, material); - double d5 = (double) renderer.getFluidHeight(x + 1, y, z, material); - double d6 = 0.0010000000474974513D; - float f7; + if (!flag && !flag1 && !aboolean[0] && !aboolean[1] && !aboolean[2] && !aboolean[3]) + { + return false; + } + else + { + boolean flag2 = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + double d0 = 0.0D; + double d1 = 1.0D; + Material material = block.blockMaterial; + int i1 = world.getBlockMetadata(x, y, z); + double d2 = (double) renderer.getFluidHeight(x, y, z, material); + double d3 = (double) renderer.getFluidHeight(x, y, z + 1, material); + double d4 = (double) renderer.getFluidHeight(x + 1, y, z + 1, material); + double d5 = (double) renderer.getFluidHeight(x + 1, y, z, material); + double d6 = 0.0010000000474974513D; + float f7; - if (renderer.renderAllFaces || flag) - { - flag2 = true; - Icon icon = block.getBlockTexture(world, x, y, z, 1);//renderer.func_94165_a(block, 1, i1); - float f8 = (float) LiquidMetalBase.getFlowDirection(world, x, y, z, material); + if (renderer.renderAllFaces || flag) + { + flag2 = true; + Icon icon = block.getBlockTexture(world, x, y, z, 1);//renderer.func_94165_a(block, 1, i1); + float f8 = (float) LiquidMetalBase.getFlowDirection(world, x, y, z, material); - if (f8 > -999.0F) - { - icon = block.getBlockTexture(world, x, y, z, 2);//renderer.func_94165_a(block, 2, i1); - } + if (f8 > -999.0F) + { + icon = block.getBlockTexture(world, x, y, z, 2);//renderer.func_94165_a(block, 2, i1); + } - d2 -= d6; - d3 -= d6; - d4 -= d6; - d5 -= d6; - double d7; - double d8; - double d9; - double d10; - double d11; - double d12; - double d13; - double d14; + d2 -= d6; + d3 -= d6; + d4 -= d6; + d5 -= d6; + double d7; + double d8; + double d9; + double d10; + double d11; + double d12; + double d13; + double d14; - if (f8 < -999.0F) - { - d8 = (double) icon.getInterpolatedU(0.0D); - d12 = (double) icon.getInterpolatedV(0.0D); - d7 = d8; - d11 = (double) icon.getInterpolatedV(16.0D); - d10 = (double) icon.getInterpolatedU(16.0D); - d14 = d11; - d9 = d10; - d13 = d12; - } - else - { - f7 = MathHelper.sin(f8) * 0.25F; - float f9 = MathHelper.cos(f8) * 0.25F; - d8 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 - f7) * 16.0F)); - d12 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 + f7) * 16.0F)); - d7 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 + f7) * 16.0F)); - d11 = (double) icon.getInterpolatedV((double) (8.0F + (f9 + f7) * 16.0F)); - d10 = (double) icon.getInterpolatedU((double) (8.0F + (f9 + f7) * 16.0F)); - d14 = (double) icon.getInterpolatedV((double) (8.0F + (f9 - f7) * 16.0F)); - d9 = (double) icon.getInterpolatedU((double) (8.0F + (f9 - f7) * 16.0F)); - d13 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 - f7) * 16.0F)); - } + if (f8 < -999.0F) + { + d8 = (double) icon.getInterpolatedU(0.0D); + d12 = (double) icon.getInterpolatedV(0.0D); + d7 = d8; + d11 = (double) icon.getInterpolatedV(16.0D); + d10 = (double) icon.getInterpolatedU(16.0D); + d14 = d11; + d9 = d10; + d13 = d12; + } + else + { + f7 = MathHelper.sin(f8) * 0.25F; + float f9 = MathHelper.cos(f8) * 0.25F; + d8 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 - f7) * 16.0F)); + d12 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 + f7) * 16.0F)); + d7 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 + f7) * 16.0F)); + d11 = (double) icon.getInterpolatedV((double) (8.0F + (f9 + f7) * 16.0F)); + d10 = (double) icon.getInterpolatedU((double) (8.0F + (f9 + f7) * 16.0F)); + d14 = (double) icon.getInterpolatedV((double) (8.0F + (f9 - f7) * 16.0F)); + d9 = (double) icon.getInterpolatedU((double) (8.0F + (f9 - f7) * 16.0F)); + d13 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 - f7) * 16.0F)); + } - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - f7 = 1.0F; - tessellator.setColorOpaque_F(f4 * f7 * f, f4 * f7 * f1, f4 * f7 * f2); - tessellator.addVertexWithUV((double) (x + 0), (double) y + d2, (double) (z + 0), d8, d12); - tessellator.addVertexWithUV((double) (x + 0), (double) y + d3, (double) (z + 1), d7, d11); - tessellator.addVertexWithUV((double) (x + 1), (double) y + d4, (double) (z + 1), d10, d14); - tessellator.addVertexWithUV((double) (x + 1), (double) y + d5, (double) (z + 0), d9, d13); - } + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + f7 = 1.0F; + tessellator.setColorOpaque_F(f4 * f7 * f, f4 * f7 * f1, f4 * f7 * f2); + tessellator.addVertexWithUV((double) (x + 0), (double) y + d2, (double) (z + 0), d8, d12); + tessellator.addVertexWithUV((double) (x + 0), (double) y + d3, (double) (z + 1), d7, d11); + tessellator.addVertexWithUV((double) (x + 1), (double) y + d4, (double) (z + 1), d10, d14); + tessellator.addVertexWithUV((double) (x + 1), (double) y + d5, (double) (z + 0), d9, d13); + } - if (renderer.renderAllFaces || flag1) - { - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); - float f10 = 1.0F; - tessellator.setColorOpaque_F(f3 * f10, f3 * f10, f3 * f10); - renderer.renderFaceYNeg(block, (double) x, (double) y + d6, (double) z, block.getBlockTexture(world, x, y, z, 0)); - flag2 = true; - } + if (renderer.renderAllFaces || flag1) + { + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); + float f10 = 1.0F; + tessellator.setColorOpaque_F(f3 * f10, f3 * f10, f3 * f10); + renderer.renderFaceYNeg(block, (double) x, (double) y + d6, (double) z, block.getBlockTexture(world, x, y, z, 0)); + flag2 = true; + } - for (int side = 0; side < 4; ++side) - { - int xPos = x; - int zPos = z; + for (int side = 0; side < 4; ++side) + { + int xPos = x; + int zPos = z; - if (side == 0) - { - zPos = z - 1; - } + if (side == 0) + { + zPos = z - 1; + } - if (side == 1) - { - ++zPos; - } + if (side == 1) + { + ++zPos; + } - if (side == 2) - { - xPos = x - 1; - } + if (side == 2) + { + xPos = x - 1; + } - if (side == 3) - { - ++xPos; - } + if (side == 3) + { + ++xPos; + } - Icon icon1 = block.getBlockTexture(world, x, y, z, side+2);//renderer.func_94165_a(block, j1 + 2, i1); + Icon icon1 = block.getBlockTexture(world, x, y, z, side + 2);//renderer.func_94165_a(block, j1 + 2, i1); - if (renderer.renderAllFaces || aboolean[side]) - { - double d15; - double d16; - double d17; - double d18; - double d19; - double d20; + if (renderer.renderAllFaces || aboolean[side]) + { + double d15; + double d16; + double d17; + double d18; + double d19; + double d20; - if (side == 0) - { - d15 = d2; - d17 = d5; - d16 = (double) x; - d18 = (double) (x + 1); - d19 = (double) z + d6; - d20 = (double) z + d6; - } - else if (side == 1) - { - d15 = d4; - d17 = d3; - d16 = (double) (x + 1); - d18 = (double) x; - d19 = (double) (z + 1) - d6; - d20 = (double) (z + 1) - d6; - } - else if (side == 2) - { - d15 = d3; - d17 = d2; - d16 = (double) x + d6; - d18 = (double) x + d6; - d19 = (double) (z + 1); - d20 = (double) z; - } - else - { - d15 = d5; - d17 = d4; - d16 = (double) (x + 1) - d6; - d18 = (double) (x + 1) - d6; - d19 = (double) z; - d20 = (double) (z + 1); - } + if (side == 0) + { + d15 = d2; + d17 = d5; + d16 = (double) x; + d18 = (double) (x + 1); + d19 = (double) z + d6; + d20 = (double) z + d6; + } + else if (side == 1) + { + d15 = d4; + d17 = d3; + d16 = (double) (x + 1); + d18 = (double) x; + d19 = (double) (z + 1) - d6; + d20 = (double) (z + 1) - d6; + } + else if (side == 2) + { + d15 = d3; + d17 = d2; + d16 = (double) x + d6; + d18 = (double) x + d6; + d19 = (double) (z + 1); + d20 = (double) z; + } + else + { + d15 = d5; + d17 = d4; + d16 = (double) (x + 1) - d6; + d18 = (double) (x + 1) - d6; + d19 = (double) z; + d20 = (double) (z + 1); + } - flag2 = true; - float f11 = icon1.getInterpolatedU(0.0D); - f7 = icon1.getInterpolatedU(8.0D); - float f12 = icon1.getInterpolatedV((1.0D - d15) * 16.0D * 0.5D); - float f13 = icon1.getInterpolatedV((1.0D - d17) * 16.0D * 0.5D); - float f14 = icon1.getInterpolatedV(8.0D); - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, xPos, y, zPos)); - float f15 = 1.0F; + flag2 = true; + float f11 = icon1.getInterpolatedU(0.0D); + f7 = icon1.getInterpolatedU(8.0D); + float f12 = icon1.getInterpolatedV((1.0D - d15) * 16.0D * 0.5D); + float f13 = icon1.getInterpolatedV((1.0D - d17) * 16.0D * 0.5D); + float f14 = icon1.getInterpolatedV(8.0D); + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, xPos, y, zPos)); + float f15 = 1.0F; - if (side < 2) - { - f15 *= f5; - } - else - { - f15 *= f6; - } + if (side < 2) + { + f15 *= f5; + } + else + { + f15 *= f6; + } - tessellator.setColorOpaque_F(f4 * f15 * f, f4 * f15 * f1, f4 * f15 * f2); - tessellator.addVertexWithUV(d16, (double) y + d15, d19, (double) f11, (double) f12); - tessellator.addVertexWithUV(d18, (double) y + d17, d20, (double) f7, (double) f13); - tessellator.addVertexWithUV(d18, (double) (y + 0), d20, (double) f7, (double) f14); - tessellator.addVertexWithUV(d16, (double) (y + 0), d19, (double) f11, (double) f14); - } - } + tessellator.setColorOpaque_F(f4 * f15 * f, f4 * f15 * f1, f4 * f15 * f2); + tessellator.addVertexWithUV(d16, (double) y + d15, d19, (double) f11, (double) f12); + tessellator.addVertexWithUV(d18, (double) y + d17, d20, (double) f7, (double) f13); + tessellator.addVertexWithUV(d18, (double) (y + 0), d20, (double) f7, (double) f14); + tessellator.addVertexWithUV(d16, (double) (y + 0), d19, (double) f11, (double) f14); + } + } - renderer.renderMinY = d0; - renderer.renderMaxY = d1; - return flag2; - } - } + renderer.renderMinY = d0; + renderer.renderMaxY = d1; + return flag2; + } + } - /*public boolean renderLiquidMetalBases(RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z) - { - Tessellator tessellator = Tessellator.instance; - int blockColor = block.colorMultiplier(world, x, y, z); - float var7 = (float)(blockColor >> 16 & 255) / 255.0F; - float var8 = (float)(blockColor >> 8 & 255) / 255.0F; - float var9 = (float)(blockColor & 255) / 255.0F; - boolean renderTop = block.shouldSideBeRendered(world, x, y + 1, z, 1); - boolean renderBottom = block.shouldSideBeRendered(world, x, y - 1, z, 0); - boolean[] var12 = new boolean[] {block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), block.shouldSideBeRendered(world, x + 1, y, z, 5)}; + /*public boolean renderLiquidMetalBases(RenderBlocks renderer, IBlockAccess world, Block block, int x, int y, int z) + { + Tessellator tessellator = Tessellator.instance; + int blockColor = block.colorMultiplier(world, x, y, z); + float var7 = (float)(blockColor >> 16 & 255) / 255.0F; + float var8 = (float)(blockColor >> 8 & 255) / 255.0F; + float var9 = (float)(blockColor & 255) / 255.0F; + boolean renderTop = block.shouldSideBeRendered(world, x, y + 1, z, 1); + boolean renderBottom = block.shouldSideBeRendered(world, x, y - 1, z, 0); + boolean[] var12 = new boolean[] {block.shouldSideBeRendered(world, x, y, z - 1, 2), block.shouldSideBeRendered(world, x, y, z + 1, 3), block.shouldSideBeRendered(world, x - 1, y, z, 4), block.shouldSideBeRendered(world, x + 1, y, z, 5)}; - if (!renderTop && !renderBottom && !var12[0] && !var12[1] && !var12[2] && !var12[3]) - { - return false; - } - else - { - boolean var13 = false; - float var14 = 0.5F; - float var15 = 1.0F; - float var16 = 0.8F; - float var17 = 0.6F; - double var18 = 0.0D; - double var20 = 1.0D; - Material var22 = block.blockMaterial; - //int var23 = world.getBlockMetadata(x, y, z); - double var24 = (double)renderer.getFluidHeight(x, y, z, var22); - double var26 = (double)renderer.getFluidHeight(x, y, z + 1, var22); - double var28 = (double)renderer.getFluidHeight(x + 1, y, z + 1, var22); - double var30 = (double)renderer.getFluidHeight(x + 1, y, z, var22); - double var32 = 0.0010000000474974513D; - int texturePos; - int textureBase = block.getBlockTexture(world, x, y, z, 0); - int var37; + if (!renderTop && !renderBottom && !var12[0] && !var12[1] && !var12[2] && !var12[3]) + { + return false; + } + else + { + boolean var13 = false; + float var14 = 0.5F; + float var15 = 1.0F; + float var16 = 0.8F; + float var17 = 0.6F; + double var18 = 0.0D; + double var20 = 1.0D; + Material var22 = block.blockMaterial; + //int var23 = world.getBlockMetadata(x, y, z); + double var24 = (double)renderer.getFluidHeight(x, y, z, var22); + double var26 = (double)renderer.getFluidHeight(x, y, z + 1, var22); + double var28 = (double)renderer.getFluidHeight(x + 1, y, z + 1, var22); + double var30 = (double)renderer.getFluidHeight(x + 1, y, z, var22); + double var32 = 0.0010000000474974513D; + int texturePos; + int textureBase = block.getBlockTexture(world, x, y, z, 0); + int var37; - if (renderer.renderAllFaces || renderTop) - { - var13 = true; - texturePos = block.getBlockTextureFromSide(1) + textureBase; - float var35 = (float)LiquidMetalBase.getFlowDirection(world, x, y, z, var22); + if (renderer.renderAllFaces || renderTop) + { + var13 = true; + texturePos = block.getBlockTextureFromSide(1) + textureBase; + float var35 = (float)LiquidMetalBase.getFlowDirection(world, x, y, z, var22); - if (var35 > -999.0F) - { - texturePos = block.getBlockTextureFromSide(2) + textureBase; - } + if (var35 > -999.0F) + { + texturePos = block.getBlockTextureFromSide(2) + textureBase; + } - var24 -= var32; - var26 -= var32; - var28 -= var32; - var30 -= var32; - int var36 = (texturePos & 15) << 4; - var37 = texturePos & 240; - double var38 = ((double)var36 + 8.0D) / 256.0D; - double var40 = ((double)var37 + 8.0D) / 256.0D; + var24 -= var32; + var26 -= var32; + var28 -= var32; + var30 -= var32; + int var36 = (texturePos & 15) << 4; + var37 = texturePos & 240; + double var38 = ((double)var36 + 8.0D) / 256.0D; + double var40 = ((double)var37 + 8.0D) / 256.0D; - if (var35 < -999.0F) - { - var35 = 0.0F; - } - else - { - var38 = (double)((float)(var36 + 16) / 256.0F); - var40 = (double)((float)(var37 + 16) / 256.0F); - } + if (var35 < -999.0F) + { + var35 = 0.0F; + } + else + { + var38 = (double)((float)(var36 + 16) / 256.0F); + var40 = (double)((float)(var37 + 16) / 256.0F); + } - double var42 = (double)(MathHelper.sin(var35) * 8.0F) / 256.0D; - double var44 = (double)(MathHelper.cos(var35) * 8.0F) / 256.0D; - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - float var46 = 1.0F; - tessellator.setColorOpaque_F(var15 * var46 * var7, var15 * var46 * var8, var15 * var46 * var9); - tessellator.addVertexWithUV((double)(x + 0), (double)y + var24, (double)(z + 0), var38 - var44 - var42, var40 - var44 + var42); - tessellator.addVertexWithUV((double)(x + 0), (double)y + var26, (double)(z + 1), var38 - var44 + var42, var40 + var44 + var42); - tessellator.addVertexWithUV((double)(x + 1), (double)y + var28, (double)(z + 1), var38 + var44 + var42, var40 + var44 - var42); - tessellator.addVertexWithUV((double)(x + 1), (double)y + var30, (double)(z + 0), var38 + var44 - var42, var40 - var44 - var42); - } + double var42 = (double)(MathHelper.sin(var35) * 8.0F) / 256.0D; + double var44 = (double)(MathHelper.cos(var35) * 8.0F) / 256.0D; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + float var46 = 1.0F; + tessellator.setColorOpaque_F(var15 * var46 * var7, var15 * var46 * var8, var15 * var46 * var9); + tessellator.addVertexWithUV((double)(x + 0), (double)y + var24, (double)(z + 0), var38 - var44 - var42, var40 - var44 + var42); + tessellator.addVertexWithUV((double)(x + 0), (double)y + var26, (double)(z + 1), var38 - var44 + var42, var40 + var44 + var42); + tessellator.addVertexWithUV((double)(x + 1), (double)y + var28, (double)(z + 1), var38 + var44 + var42, var40 + var44 - var42); + tessellator.addVertexWithUV((double)(x + 1), (double)y + var30, (double)(z + 0), var38 + var44 - var42, var40 - var44 - var42); + } - if (renderer.renderAllFaces || renderBottom) - { - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); - float var65 = 1.0F; - tessellator.setColorOpaque_F(var14 * var65, var14 * var65, var14 * var65); - renderer.renderBottomFace(block, (double)x, (double)y + var32, (double)z, block.getBlockTextureFromSide(0)); - var13 = true; - } + if (renderer.renderAllFaces || renderBottom) + { + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); + float var65 = 1.0F; + tessellator.setColorOpaque_F(var14 * var65, var14 * var65, var14 * var65); + renderer.renderBottomFace(block, (double)x, (double)y + var32, (double)z, block.getBlockTextureFromSide(0)); + var13 = true; + } - for (texturePos = 0; texturePos < 4; ++texturePos) - { - int var64 = x; - var37 = z; + for (texturePos = 0; texturePos < 4; ++texturePos) + { + int var64 = x; + var37 = z; - if (texturePos == 0) - { - var37 = z - 1; - } + if (texturePos == 0) + { + var37 = z - 1; + } - if (texturePos == 1) - { - ++var37; - } + if (texturePos == 1) + { + ++var37; + } - if (texturePos == 2) - { - var64 = x - 1; - } + if (texturePos == 2) + { + var64 = x - 1; + } - if (texturePos == 3) - { - ++var64; - } + if (texturePos == 3) + { + ++var64; + } - int var66 = block.getBlockTextureFromSide(texturePos + 2) + textureBase; - int var39 = (var66 & 15) << 4; - int var67 = var66 & 240; + int var66 = block.getBlockTextureFromSide(texturePos + 2) + textureBase; + int var39 = (var66 & 15) << 4; + int var67 = var66 & 240; - if (renderer.renderAllFaces || var12[texturePos]) - { - double var43; - double var41; - double var47; - double var45; - double var51; - double var49; + if (renderer.renderAllFaces || var12[texturePos]) + { + double var43; + double var41; + double var47; + double var45; + double var51; + double var49; - if (texturePos == 0) - { - var41 = var24; - var43 = var30; - var45 = (double)x; - var49 = (double)(x + 1); - var47 = (double)z + var32; - var51 = (double)z + var32; - } - else if (texturePos == 1) - { - var41 = var28; - var43 = var26; - var45 = (double)(x + 1); - var49 = (double)x; - var47 = (double)(z + 1) - var32; - var51 = (double)(z + 1) - var32; - } - else if (texturePos == 2) - { - var41 = var26; - var43 = var24; - var45 = (double)x + var32; - var49 = (double)x + var32; - var47 = (double)(z + 1); - var51 = (double)z; - } - else - { - var41 = var30; - var43 = var28; - var45 = (double)(x + 1) - var32; - var49 = (double)(x + 1) - var32; - var47 = (double)z; - var51 = (double)(z + 1); - } + if (texturePos == 0) + { + var41 = var24; + var43 = var30; + var45 = (double)x; + var49 = (double)(x + 1); + var47 = (double)z + var32; + var51 = (double)z + var32; + } + else if (texturePos == 1) + { + var41 = var28; + var43 = var26; + var45 = (double)(x + 1); + var49 = (double)x; + var47 = (double)(z + 1) - var32; + var51 = (double)(z + 1) - var32; + } + else if (texturePos == 2) + { + var41 = var26; + var43 = var24; + var45 = (double)x + var32; + var49 = (double)x + var32; + var47 = (double)(z + 1); + var51 = (double)z; + } + else + { + var41 = var30; + var43 = var28; + var45 = (double)(x + 1) - var32; + var49 = (double)(x + 1) - var32; + var47 = (double)z; + var51 = (double)(z + 1); + } - var13 = true; - double var53 = (double)((float)(var39 + 0) / 256.0F); - double var55 = ((double)(var39 + 16) - 0.01D) / 256.0D; - double var57 = ((double)var67 + (1.0D - var41) * 16.0D) / 256.0D; - double var59 = ((double)var67 + (1.0D - var43) * 16.0D) / 256.0D; - double var61 = ((double)(var67 + 16) - 0.01D) / 256.0D; - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, var64, y, var37)); - float var63 = 1.0F; + var13 = true; + double var53 = (double)((float)(var39 + 0) / 256.0F); + double var55 = ((double)(var39 + 16) - 0.01D) / 256.0D; + double var57 = ((double)var67 + (1.0D - var41) * 16.0D) / 256.0D; + double var59 = ((double)var67 + (1.0D - var43) * 16.0D) / 256.0D; + double var61 = ((double)(var67 + 16) - 0.01D) / 256.0D; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, var64, y, var37)); + float var63 = 1.0F; - if (texturePos < 2) - { - var63 *= var16; - } - else - { - var63 *= var17; - } + if (texturePos < 2) + { + var63 *= var16; + } + else + { + var63 *= var17; + } - tessellator.setColorOpaque_F(var15 * var63 * var7, var15 * var63 * var8, var15 * var63 * var9); - tessellator.addVertexWithUV(var45, (double)y + var41, var47, var53, var57); - tessellator.addVertexWithUV(var49, (double)y + var43, var51, var55, var59); - tessellator.addVertexWithUV(var49, (double)(y + 0), var51, var55, var61); - tessellator.addVertexWithUV(var45, (double)(y + 0), var47, var53, var61); - } - } + tessellator.setColorOpaque_F(var15 * var63 * var7, var15 * var63 * var8, var15 * var63 * var9); + tessellator.addVertexWithUV(var45, (double)y + var41, var47, var53, var57); + tessellator.addVertexWithUV(var49, (double)y + var43, var51, var55, var59); + tessellator.addVertexWithUV(var49, (double)(y + 0), var51, var55, var61); + tessellator.addVertexWithUV(var45, (double)(y + 0), var47, var53, var61); + } + } - renderer.renderMinY = var18; - renderer.renderMaxY = var20; - return var13; - } - }*/ + renderer.renderMinY = var18; + renderer.renderMaxY = var20; + return var13; + } + }*/ } diff --git a/mods/tinker/tconstruct/client/block/FrypanRender.java b/mods/tinker/tconstruct/client/block/FrypanRender.java index d8688193..24e59633 100644 --- a/mods/tinker/tconstruct/client/block/FrypanRender.java +++ b/mods/tinker/tconstruct/client/block/FrypanRender.java @@ -8,40 +8,41 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class FrypanRender implements ISimpleBlockRenderingHandler { - public static int frypanModelID = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - //Inventory should be an item. This is not here! - } + public static int frypanModelID = RenderingRegistry.getNextAvailableRenderId(); - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.125F, 0.0F, 0.125F, 0.25F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.125F, 0.125F, 0.875F, 0.875F, 0.25F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.875F, 0.125F, 0.0F, 1.0F, 0.25F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.125F, 0.125F, 0.0F, 0.875F, 0.25F, 0.125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(1F, 0.0F, 0.4375F, 2F, 0.125F, 0.5625F); - renderer.renderStandardBlock(block, x, y, z); - return true; - } + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + //Inventory should be an item. This is not here! + } - @Override - public boolean shouldRender3DInInventory () - { - return true; - } + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.125F, 0.0F, 0.125F, 0.25F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.125F, 0.125F, 0.875F, 0.875F, 0.25F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.875F, 0.125F, 0.0F, 1.0F, 0.25F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.125F, 0.125F, 0.0F, 0.875F, 0.25F, 0.125F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(1F, 0.0F, 0.4375F, 2F, 0.125F, 0.5625F); + renderer.renderStandardBlock(block, x, y, z); + return true; + } - @Override - public int getRenderId () - { - return frypanModelID; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } + + @Override + public int getRenderId () + { + return frypanModelID; + } } diff --git a/mods/tinker/tconstruct/client/block/GolemCoreRender.java b/mods/tinker/tconstruct/client/block/GolemCoreRender.java index fdd3935f..5e212e61 100644 --- a/mods/tinker/tconstruct/client/block/GolemCoreRender.java +++ b/mods/tinker/tconstruct/client/block/GolemCoreRender.java @@ -14,52 +14,52 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class GolemCoreRender implements ISimpleBlockRenderingHandler { - public static int model = RenderingRegistry.getNextAvailableRenderId(); + public static int model = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - renderer.setRenderBounds(0.0F, 0F, 0.0F, 1.0F, 0.1875F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0F, 0.1875F, 0.0F, 0.1875F, 0.8125F, 0.1875F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.8175, 0.1875F, 0.0F, 1f, 0.8125F, 0.1875F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0F, 0.1875F, 0.8175, 0.1875F, 0.8125F, 1f); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.8175F, 0.1875F, 0.8175, 1f, 0.8125F, 1f); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + renderer.setRenderBounds(0.0F, 0F, 0.0F, 1.0F, 0.1875F, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0F, 0.1875F, 0.0F, 0.1875F, 0.8125F, 0.1875F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.8175, 0.1875F, 0.0F, 1f, 0.8125F, 0.1875F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0F, 0.1875F, 0.8175, 0.1875F, 0.8125F, 1f); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.8175F, 0.1875F, 0.8175, 1f, 0.8125F, 1f); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + } - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) - { - renderer.setRenderBounds(0.0F, 0F, 0.0F, 1.0F, 0.1875F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.1875F, 0.0F, 0.1875F, 0.8125F, 0.1875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.8175, 0.1875F, 0.0F, 1f, 0.8125F, 0.1875F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.1875F, 0.8175, 0.1875F, 0.8125F, 1f); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.8175F, 0.1875F, 0.8175, 1f, 0.8125F, 1f); - renderer.renderStandardBlock(block, x, y, z); - return true; - } + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) + { + renderer.setRenderBounds(0.0F, 0F, 0.0F, 1.0F, 0.1875F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.8125F, 0.0F, 1.0F, 1.0F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.1875F, 0.0F, 0.1875F, 0.8125F, 0.1875F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.8175, 0.1875F, 0.0F, 1f, 0.8125F, 0.1875F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.1875F, 0.8175, 0.1875F, 0.8125F, 1f); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.8175F, 0.1875F, 0.8175, 1f, 0.8125F, 1f); + renderer.renderStandardBlock(block, x, y, z); + return true; + } - @Override - public boolean shouldRender3DInInventory () - { - return true; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } - @Override - public int getRenderId () - { - return model; - } + @Override + public int getRenderId () + { + return model; + } } diff --git a/mods/tinker/tconstruct/client/block/GolemCoreSpecialRender.java b/mods/tinker/tconstruct/client/block/GolemCoreSpecialRender.java index a96ac04b..eeb3aaab 100644 --- a/mods/tinker/tconstruct/client/block/GolemCoreSpecialRender.java +++ b/mods/tinker/tconstruct/client/block/GolemCoreSpecialRender.java @@ -19,46 +19,46 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GolemCoreSpecialRender extends TileEntitySpecialRenderer { - @Override - public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) - { - this.render((GolemCoreLogic) logic, var2, var4, var6, var8); - } + @Override + public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) + { + this.render((GolemCoreLogic) logic, var2, var4, var6, var8); + } - public void render (GolemCoreLogic logic, double posX, double posY, double posZ, float var8) - { - GL11.glPushMatrix(); - float var10 = (float) (posX - 0.5F); - float var11 = (float) (posY - 0.5F); - float var12 = (float) (posZ - 0.5F); - GL11.glTranslatef(var10, var11, var12); + public void render (GolemCoreLogic logic, double posX, double posY, double posZ, float var8) + { + GL11.glPushMatrix(); + float var10 = (float) (posX - 0.5F); + float var11 = (float) (posY - 0.5F); + float var12 = (float) (posZ - 0.5F); + GL11.glTranslatef(var10, var11, var12); - ItemStack stack = logic.getStackInSlot(0); - if (stack != null) - renderItem(logic, stack); - - GL11.glPopMatrix(); - } - - void renderItem(GolemCoreLogic logic, ItemStack stack) - { - FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(1F, 0.675F, 1.0F); - //GL11.glRotatef(90F, 1, 0F, 0F); - GL11.glScalef(1.4F, 1.4F, 1.4F); - if (stack.getItem() instanceof ItemBlock) - { - GL11.glScalef(1.6F, 1.6F, 1.6F); - GL11.glTranslatef(0F, 0.045F, 0.0f); - } + ItemStack stack = logic.getStackInSlot(0); + if (stack != null) + renderItem(logic, stack); - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; + GL11.glPopMatrix(); + } - GL11.glPopMatrix(); - } + void renderItem (GolemCoreLogic logic, ItemStack stack) + { + FancyEntityItem entityitem = new FancyEntityItem(logic.worldObj, 0.0D, 0.0D, 0.0D, stack); + entityitem.getEntityItem().stackSize = 1; + entityitem.hoverStart = 0.0F; + GL11.glPushMatrix(); + GL11.glTranslatef(1F, 0.675F, 1.0F); + //GL11.glRotatef(90F, 1, 0F, 0F); + GL11.glScalef(1.4F, 1.4F, 1.4F); + if (stack.getItem() instanceof ItemBlock) + { + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0F, 0.045F, 0.0f); + } + + RenderItem.renderInFrame = true; + RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + RenderItem.renderInFrame = false; + + GL11.glPopMatrix(); + } } diff --git a/mods/tinker/tconstruct/client/block/MachineRender.java b/mods/tinker/tconstruct/client/block/MachineRender.java index 8debdc67..822b1ce6 100644 --- a/mods/tinker/tconstruct/client/block/MachineRender.java +++ b/mods/tinker/tconstruct/client/block/MachineRender.java @@ -38,12 +38,12 @@ public class MachineRender implements ISimpleBlockRenderingHandler } return true; } - - public boolean renderRotatedBlock(Block block, int x, int y, int z, IBlockAccess world, RenderBlocks renderer) + + public boolean renderRotatedBlock (Block block, int x, int y, int z, IBlockAccess world, RenderBlocks renderer) { IFacingLogic logic = (IFacingLogic) world.getBlockTileEntity(x, y, z); byte direction = logic.getRenderDirection(); - + if (direction == 0) { renderer.uvRotateEast = 3; diff --git a/mods/tinker/tconstruct/client/block/PaneRender.java b/mods/tinker/tconstruct/client/block/PaneRender.java index db1268a9..9b7d6970 100644 --- a/mods/tinker/tconstruct/client/block/PaneRender.java +++ b/mods/tinker/tconstruct/client/block/PaneRender.java @@ -76,24 +76,24 @@ public class PaneRender implements ISimpleBlockRenderingHandler Icon icon; Icon icon1; int meta = iblockaccess.getBlockMetadata(x, y, z); - icon = renderblocks.getBlockIconFromSideAndMetadata(pane, 0, meta); - icon1 = pane.getSideTextureIndex(meta); + icon = renderblocks.getBlockIconFromSideAndMetadata(pane, 0, meta); + icon1 = pane.getSideTextureIndex(meta); meta = icon.getOriginX(); int k1 = icon.getOriginY(); - double d = (double)icon.getMinU(); - double d1 = (double)icon.getInterpolatedU(8.0D); - double d2 = (double)icon.getMaxU(); - double d3 = (double)icon.getMinV(); - double d4 = (double)icon.getMaxV(); + double d = (double) icon.getMinU(); + double d1 = (double) icon.getInterpolatedU(8.0D); + double d2 = (double) icon.getMaxU(); + double d3 = (double) icon.getMinV(); + double d4 = (double) icon.getMaxV(); int l1 = icon1.getOriginX(); int i2 = icon1.getOriginY(); - double d5 = (double)icon1.getInterpolatedU(7.0D); - double d6 = (double)icon1.getInterpolatedU(9.0D); - double d7 = (double)icon1.getMinV(); - double d8 = (double)icon1.getInterpolatedV(8.0D); - double d9 = (double)icon1.getMaxV(); - + double d5 = (double) icon1.getInterpolatedU(7.0D); + double d6 = (double) icon1.getInterpolatedU(9.0D); + double d7 = (double) icon1.getMinV(); + double d8 = (double) icon1.getInterpolatedV(8.0D); + double d9 = (double) icon1.getMaxV(); + /*int blockTextureIndex; int blockSideIndex; @@ -115,7 +115,7 @@ public class PaneRender implements ISimpleBlockRenderingHandler double d7 = (float) l2 / 256F; double d8 = (float) (l2 + 8) / 256F; double d9 = ((float) l2 + 15.99F) / 256F;*/ - + double xBot = x; double xMid = (double) x + 0.5D; double xTop = x + 1; diff --git a/mods/tinker/tconstruct/client/block/SearedRender.java b/mods/tinker/tconstruct/client/block/SearedRender.java index 3da6dc96..5db7dddc 100644 --- a/mods/tinker/tconstruct/client/block/SearedRender.java +++ b/mods/tinker/tconstruct/client/block/SearedRender.java @@ -15,54 +15,54 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class SearedRender implements ISimpleBlockRenderingHandler { - public static int searedModel = RenderingRegistry.getNextAvailableRenderId(); + public static int searedModel = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (modelID == searedModel) - { - if (metadata == 0) - { - //Top - renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - - //Lip - renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - - //Legs - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } - else if (metadata == 1) - { - renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.25, 0.25, 0.625, 0.375, 0.625, 1); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.625, 0.25, 0.625, 0.75, 0.625, 1); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1); - } - else if (metadata == 2) - { - renderer.setRenderBounds(0.125F, 0.125f, 0.125F, 0.875F, 0.25F, 0.875F); + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (modelID == searedModel) + { + if (metadata == 0) + { + //Top + renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + + //Lip + renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + + //Legs + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + } + else if (metadata == 1) + { + renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.25, 0.25, 0.625, 0.375, 0.625, 1); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.625, 0.25, 0.625, 0.75, 0.625, 1); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1); + } + else if (metadata == 2) + { + renderer.setRenderBounds(0.125F, 0.125f, 0.125F, 0.875F, 0.25F, 0.875F); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + //Details renderer.setRenderBounds(0.001f, 0.1245f, 0.001f, 0.1245f, 0.999f, 0.4375f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); @@ -72,7 +72,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.001f, 0.1245f, 0.4375f, 0.1245f, 0.25F, 0.5625f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + renderer.setRenderBounds(0.8755f, 0.1245f, 0f, 0.999f, 0.999f, 0.4375f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.8755f, 0.1245f, 0.5625f, 0.999f, 0.999f, 0.999f); @@ -81,7 +81,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.8755f, 0.1245f, 0.4375f, 0.999f, 0.25F, 0.5625f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + renderer.setRenderBounds(0.1245f, 0.1245f, 0.8755f, 0.4375f, 0.999f, 0.999f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.5625f, 0.1245f, 0.8755f, 0.8755f, 0.999f, 0.999f); @@ -90,7 +90,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.4375f, 0.1245f, 0.8755f, 0.5625f, 0.2495F, 0.999f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + renderer.setRenderBounds(0.1245f, 0.1245f, 0.001f, 0.4375f, 0.999f, 0.1245f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.5625f, 0.1245f, 0.001f, 0.8755f, 0.999f, 0.1245f); @@ -99,17 +99,17 @@ public class SearedRender implements ISimpleBlockRenderingHandler TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.4375f, 0.1245f, 0.001f, 0.5625f, 0.25F, 0.1245f); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + //Legs renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.125, 0.3125F); TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.6875F, 0.0F, 0.0F, 1.0F, 0.125, 0.3125F); TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.0F, 0.0F, 0.6875F, 0.3125F, 0.125, 1.0F); - TProxyClient.renderStandardInvBlock(renderer, block, metadata); + TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.6875F, 0.0F, 0.6875F, 1.0F, 0.125, 1.0F); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - + //Outside renderer.setRenderBounds(0.0f, 0.125, 0f, 0.125, 1.0F, 1); TProxyClient.renderStandardInvBlock(renderer, block, metadata); @@ -119,168 +119,168 @@ public class SearedRender implements ISimpleBlockRenderingHandler TProxyClient.renderStandardInvBlock(renderer, block, metadata); renderer.setRenderBounds(0.125f, 0.125, 0.875f, 0.875f, 1.0F, 1); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } - else - { + } + else + { renderer.setRenderBounds(0, 0, 0, 1, 1, 1); TProxyClient.renderStandardInvBlock(renderer, block, metadata); - } - } - } + } + } + } - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - if (modelID == searedModel) - { - int metadata = world.getBlockMetadata(x, y, z); - if (metadata == 0) - { - //Top - renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + if (modelID == searedModel) + { + int metadata = world.getBlockMetadata(x, y, z); + if (metadata == 0) + { + //Top + renderer.setRenderBounds(0.0F, 0.625F, 0.0F, 1.0F, 0.9375F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); - //Lip - renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); - renderer.renderStandardBlock(block, x, y, z); + //Lip + renderer.setRenderBounds(0.0F, 0.9375, 0.0F, 0.0625, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0625, 0.9375, 0.9375, 0.9375, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.9375, 0.9375, 0.0F, 1.0F, 1.0, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0625, 0.9375, 0.0F, 0.9375, 1.0, 0.0625); + renderer.renderStandardBlock(block, x, y, z); - //Legs - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); + //Legs + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.625F, 0.3125F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.6875, 0.0F, 0.0F, 1.0F, 0.625F, 0.25F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.0F, 0.6875, 0.3125F, 0.625F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.6875, 0.0F, 0.6875, 1.0F, 0.625F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); - CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z); - if (logic.liquid != null) - { - float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F; - renderer.setRenderBounds(0.0625F, 0.9375F, 0.0625F, 0.9375F, 0.9375F + height, 0.9375F); - if (logic.liquid.itemID < 4096) //Block - { - Block liquidBlock = Block.blocksList[logic.liquid.itemID]; - if (liquidBlock != null) - { - //ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, logic.liquid.itemMeta, x, y, z, renderer, world); - } - } - else - //Item - { - Item liquidItem = Item.itemsList[logic.liquid.itemID]; - if (liquidItem != null) - { - //ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); - BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(logic.liquid.itemMeta), x, y, z, renderer, world); - } - } - } - } - else if (metadata == 1) - { - FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); - float xMin = 0.375F, zMin = 0.375F, xMax = 0.625F, zMax = 0.625F; - switch (logic.getRenderDirection()) - { - case 2: - renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.25, 0.375, 0.625, 0.375, 0.625, 1); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625, 0.375, 0.625, 0.75, 0.625, 1); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1); - zMin = 0.5F; - //zMin = 0.625F; - break; - case 3: - renderer.setRenderBounds(0.25, 0.25, 0, 0.75, 0.375, 0.375); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.25, 0.375, 0, 0.375, 0.625, 0.375); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625, 0.375, 0, 0.75, 0.625, 0.375); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.375, 0.375, 0, 0.625, 0.625, 0.375); - zMax = 0.5F; - break; - case 4: - renderer.setRenderBounds(0.625, 0.25, 0.25, 1, 0.375, 0.75); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625, 0.375, 0.25, 1, 0.625, 0.375); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625, 0.375, 0.625, 1, 0.625, 0.75); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.625, 0.375, 0.375, 1, 0.625, 0.625); - xMin = 0.5F; - break; - case 5: - renderer.setRenderBounds(0, 0.25, 0.25, 0.375, 0.375, 0.75); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0.375, 0.25, 0.375, 0.625, 0.375); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0.375, 0.625, 0.375, 0.625, 0.75); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0, 0.375, 0.375, 0.375, 0.625, 0.625); - xMax = 0.5F; - break; - } + CastingTableLogic logic = (CastingTableLogic) world.getBlockTileEntity(x, y, z); + if (logic.liquid != null) + { + float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F; + renderer.setRenderBounds(0.0625F, 0.9375F, 0.0625F, 0.9375F, 0.9375F + height, 0.9375F); + if (logic.liquid.itemID < 4096) //Block + { + Block liquidBlock = Block.blocksList[logic.liquid.itemID]; + if (liquidBlock != null) + { + //ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, logic.liquid.itemMeta, x, y, z, renderer, world); + } + } + else + //Item + { + Item liquidItem = Item.itemsList[logic.liquid.itemID]; + if (liquidItem != null) + { + //ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); + BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(logic.liquid.itemMeta), x, y, z, renderer, world); + } + } + } + } + else if (metadata == 1) + { + FaucetLogic logic = (FaucetLogic) world.getBlockTileEntity(x, y, z); + float xMin = 0.375F, zMin = 0.375F, xMax = 0.625F, zMax = 0.625F; + switch (logic.getRenderDirection()) + { + case 2: + renderer.setRenderBounds(0.25, 0.25, 0.625, 0.75, 0.375, 1); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.25, 0.375, 0.625, 0.375, 0.625, 1); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.625, 0.375, 0.625, 0.75, 0.625, 1); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.375, 0.375, 0.625, 0.625, 0.625, 1); + zMin = 0.5F; + //zMin = 0.625F; + break; + case 3: + renderer.setRenderBounds(0.25, 0.25, 0, 0.75, 0.375, 0.375); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.25, 0.375, 0, 0.375, 0.625, 0.375); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.625, 0.375, 0, 0.75, 0.625, 0.375); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.375, 0.375, 0, 0.625, 0.625, 0.375); + zMax = 0.5F; + break; + case 4: + renderer.setRenderBounds(0.625, 0.25, 0.25, 1, 0.375, 0.75); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.625, 0.375, 0.25, 1, 0.625, 0.375); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.625, 0.375, 0.625, 1, 0.625, 0.75); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.625, 0.375, 0.375, 1, 0.625, 0.625); + xMin = 0.5F; + break; + case 5: + renderer.setRenderBounds(0, 0.25, 0.25, 0.375, 0.375, 0.75); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0, 0.375, 0.25, 0.375, 0.625, 0.375); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0, 0.375, 0.625, 0.375, 0.625, 0.75); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0, 0.375, 0.375, 0.375, 0.625, 0.625); + xMax = 0.5F; + break; + } - float yMin = 0F; - int uID = world.getBlockId(x, y-1, z); - int uMeta = world.getBlockMetadata(x, y-1, z); - if (uID == TContent.searedBlock.blockID && uMeta == 0) - { - yMin = -0.125F; - } - else if (uID == TContent.searedBlock.blockID && uMeta == 2) + float yMin = 0F; + int uID = world.getBlockId(x, y - 1, z); + int uMeta = world.getBlockMetadata(x, y - 1, z); + if (uID == TContent.searedBlock.blockID && uMeta == 0) + { + yMin = -0.125F; + } + else if (uID == TContent.searedBlock.blockID && uMeta == 2) { yMin = -0.75F; } - else if (uID == TContent.lavaTank.blockID) - { - yMin = -1F; - } - - if (logic.liquid != null) - { - ItemStack blockToRender = new ItemStack(logic.liquid.itemID, 1, logic.liquid.itemMeta); - if (blockToRender.itemID < 4096) //Block - { - Block liquidBlock = Block.blocksList[blockToRender.itemID]; - //ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), x, y, z, renderer, world); - renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax); - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), x, y, z, renderer, world); - } - else - //Item - { - Item liquidItem = Item.itemsList[blockToRender.itemID]; - //ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); - int meta = blockToRender.getItemDamage(); - BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world); - renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax); - BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world); - } - //renderer.renderStandardBlock(block, x, y, z); - } + else if (uID == TContent.lavaTank.blockID) + { + yMin = -1F; + } - } - else if (metadata == 2) - { - renderer.setRenderBounds(0.125F, 0.125f, 0.125F, 0.875F, 0.25F, 0.875F); + if (logic.liquid != null) + { + ItemStack blockToRender = new ItemStack(logic.liquid.itemID, 1, logic.liquid.itemMeta); + if (blockToRender.itemID < 4096) //Block + { + Block liquidBlock = Block.blocksList[blockToRender.itemID]; + //ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), x, y, z, renderer, world); + renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax); + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), x, y, z, renderer, world); + } + else + //Item + { + Item liquidItem = Item.itemsList[blockToRender.itemID]; + //ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); + int meta = blockToRender.getItemDamage(); + BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world); + renderer.setRenderBounds(xMin, yMin, zMin, xMax, 0.625, zMax); + BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(meta), x, y, z, renderer, world); + } + //renderer.renderStandardBlock(block, x, y, z); + } + + } + else if (metadata == 2) + { + renderer.setRenderBounds(0.125F, 0.125f, 0.125F, 0.875F, 0.25F, 0.875F); renderer.renderStandardBlock(block, x, y, z); - + //Outside renderer.setRenderBounds(0.0f, 0.125, 0f, 0.125, 1.0F, 1); renderer.renderStandardBlock(block, x, y, z); @@ -290,9 +290,9 @@ public class SearedRender implements ISimpleBlockRenderingHandler renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.125f, 0.125, 0.875f, 0.875f, 1.0F, 1); renderer.renderStandardBlock(block, x, y, z); - + //Details - + renderer.setRenderBounds(0.001f, 0.1245f, 0.001f, 0.1245f, 0.999f, 0.4375f); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.001f, 0.1245f, 0.5625f, 0.1245f, 0.999f, 0.999f); @@ -301,7 +301,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.001f, 0.1245f, 0.4375f, 0.1245f, 0.25F, 0.5625f); renderer.renderStandardBlock(block, x, y, z); - + renderer.setRenderBounds(0.8755f, 0.1245f, 0f, 0.999f, 0.999f, 0.4375f); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.8755f, 0.1245f, 0.5625f, 0.999f, 0.999f, 0.999f); @@ -310,7 +310,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.8755f, 0.1245f, 0.4375f, 0.999f, 0.25F, 0.5625f); renderer.renderStandardBlock(block, x, y, z); - + renderer.setRenderBounds(0.1245f, 0.1245f, 0.8755f, 0.4375f, 0.999f, 0.999f); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.5625f, 0.1245f, 0.8755f, 0.8755f, 0.999f, 0.999f); @@ -319,7 +319,7 @@ public class SearedRender implements ISimpleBlockRenderingHandler renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.4375f, 0.1245f, 0.8755f, 0.5625f, 0.2495F, 0.999f); renderer.renderStandardBlock(block, x, y, z); - + renderer.setRenderBounds(0.1245f, 0.1245f, 0.001f, 0.4375f, 0.999f, 0.1245f); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.5625f, 0.1245f, 0.001f, 0.8755f, 0.999f, 0.1245f); @@ -328,17 +328,17 @@ public class SearedRender implements ISimpleBlockRenderingHandler renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.4375f, 0.1245f, 0.001f, 0.5625f, 0.25F, 0.1245f); renderer.renderStandardBlock(block, x, y, z); - + //Legs renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.3125F, 0.125, 0.3125F); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.6875F, 0.0F, 0.0F, 1.0F, 0.125, 0.3125F); renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.0F, 0.0F, 0.6875F, 0.3125F, 0.125, 1.0F); - renderer.renderStandardBlock(block, x, y, z); + renderer.renderStandardBlock(block, x, y, z); renderer.setRenderBounds(0.6875F, 0.0F, 0.6875F, 1.0F, 0.125, 1.0F); renderer.renderStandardBlock(block, x, y, z); - + //Liquids CastingBasinLogic logic = (CastingBasinLogic) world.getBlockTileEntity(x, y, z); if (logic.liquid != null) @@ -365,33 +365,33 @@ public class SearedRender implements ISimpleBlockRenderingHandler } } } - } - else - { - renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F); - renderer.renderStandardBlock(block, x, y, z); - } - } - return true; - } + } + else + { + renderer.setRenderBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 0.25F, 0.75F, 0.25F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.75F, 0.0F, 0.0F, 1.0F, 0.75F, 0.25F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.0F, 0.0F, 0.75F, 0.25F, 0.75F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + renderer.setRenderBounds(0.75F, 0.0F, 0.75F, 1.0F, 0.75F, 1.0F); + renderer.renderStandardBlock(block, x, y, z); + } + } + return true; + } - @Override - public boolean shouldRender3DInInventory () - { - return true; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } - @Override - public int getRenderId () - { - return searedModel; - } + @Override + public int getRenderId () + { + return searedModel; + } } diff --git a/mods/tinker/tconstruct/client/block/SmallFontRenderer.java b/mods/tinker/tconstruct/client/block/SmallFontRenderer.java index 4513e8f1..819ad8ac 100644 --- a/mods/tinker/tconstruct/client/block/SmallFontRenderer.java +++ b/mods/tinker/tconstruct/client/block/SmallFontRenderer.java @@ -141,13 +141,13 @@ public class SmallFontRenderer } } - public void readFontData() + public void readFontData () { this.readGlyphSizes(); this.readFontTexture(this.fontTextureName); } - private void readFontTexture(String par1Str) + private void readFontTexture (String par1Str) { BufferedImage bufferedimage; @@ -209,7 +209,7 @@ public class SmallFontRenderer } } - private void readGlyphSizes() + private void readGlyphSizes () { try { @@ -225,7 +225,7 @@ public class SmallFontRenderer /** * Pick how to render a single character and return the width used. */ - private float renderCharAtPos(int par1, char par2, boolean par3) + private float renderCharAtPos (int par1, char par2, boolean par3) { return par2 == 32 ? 4.0F : (par1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(par1 + 32, par3) : this.renderUnicodeChar(par2, par3)); } @@ -233,13 +233,13 @@ public class SmallFontRenderer /** * Render a single character with the default.png font at current (posX,posY) location... */ - private float renderDefaultChar(int par1, boolean par2) + private float renderDefaultChar (int par1, boolean par2) { - float f = (float)(par1 % 16 * 8); - float f1 = (float)(par1 / 16 * 8); + float f = (float) (par1 % 16 * 8); + float f1 = (float) (par1 / 16 * 8); float f2 = par2 ? 1.0F : 0.0F; this.renderEngine.bindTexture(this.fontTextureName); - float f3 = (float)this.charWidth[par1] - 0.01F; + float f3 = (float) this.charWidth[par1] - 0.01F; GL11.glBegin(GL11.GL_TRIANGLE_STRIP); GL11.glTexCoord2f(f / 128.0F, f1 / 128.0F); GL11.glVertex3f(this.posX + f2, this.posY, 0.0F); @@ -250,22 +250,22 @@ public class SmallFontRenderer GL11.glTexCoord2f((f + f3) / 128.0F, (f1 + 7.99F) / 128.0F); GL11.glVertex3f(this.posX + f3 - f2, this.posY + 7.99F, 0.0F); GL11.glEnd(); - return (float)this.charWidth[par1]; + return (float) this.charWidth[par1]; } /** * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. */ - private void loadGlyphTexture(int par1) + private void loadGlyphTexture (int par1) { - String s = String.format("/font/glyph_%02X.png", new Object[] {Integer.valueOf(par1)}); + String s = String.format("/font/glyph_%02X.png", new Object[] { Integer.valueOf(par1) }); this.renderEngine.bindTexture(s); } /** * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... */ - private float renderUnicodeChar(char par1, boolean par2) + private float renderUnicodeChar (char par1, boolean par2) { if (this.glyphWidth[par1] == 0) { @@ -277,10 +277,10 @@ public class SmallFontRenderer this.loadGlyphTexture(i); int j = this.glyphWidth[par1] >>> 4; int k = this.glyphWidth[par1] & 15; - float f = (float)j; - float f1 = (float)(k + 1); - float f2 = (float)(par1 % 16 * 16) + f; - float f3 = (float)((par1 & 255) / 16 * 16); + float f = (float) j; + float f1 = (float) (k + 1); + float f2 = (float) (par1 % 16 * 16) + f; + float f3 = (float) ((par1 & 255) / 16 * 16); float f4 = f1 - f - 0.02F; float f5 = par2 ? 1.0F : 0.0F; GL11.glBegin(GL11.GL_TRIANGLE_STRIP); @@ -300,7 +300,7 @@ public class SmallFontRenderer /** * Draws the specified string with a shadow. */ - public int drawStringWithShadow(String par1Str, int par2, int par3, int par4) + public int drawStringWithShadow (String par1Str, int par2, int par3, int par4) { return this.drawString(par1Str, par2, par3, par4, true); } @@ -308,7 +308,7 @@ public class SmallFontRenderer /** * Draws the specified string. */ - public int drawString(String par1Str, int par2, int par3, int par4) + public int drawString (String par1Str, int par2, int par3, int par4) { return this.drawString(par1Str, par2, par3, par4, false); } @@ -316,7 +316,7 @@ public class SmallFontRenderer /** * Draws the specified string. Args: string, x, y, color, dropShadow */ - public int drawString(String par1Str, int par2, int par3, int par4, boolean par5) + public int drawString (String par1Str, int par2, int par3, int par4, boolean par5) { this.resetStyles(); @@ -343,7 +343,7 @@ public class SmallFontRenderer /** * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. */ - private String bidiReorder(String par1Str) + private String bidiReorder (String par1Str) { if (par1Str != null && Bidi.requiresBidi(par1Str.toCharArray(), 0, par1Str.length())) { @@ -358,11 +358,11 @@ public class SmallFontRenderer i = bidi.getRunLimit(j); int l = bidi.getRunLevel(j); String s1 = par1Str.substring(k, i); - abyte[j] = (byte)l; + abyte[j] = (byte) l; astring[j] = s1; } - String[] astring1 = (String[])astring.clone(); + String[] astring1 = (String[]) astring.clone(); Bidi.reorderVisually(abyte, 0, astring, 0, abyte.length); StringBuilder stringbuilder = new StringBuilder(); i = 0; @@ -424,7 +424,7 @@ public class SmallFontRenderer /** * Reset all style flag fields in the class to false; called at the start of string rendering */ - private void resetStyles() + private void resetStyles () { this.randomStyle = false; this.boldStyle = false; @@ -436,7 +436,7 @@ public class SmallFontRenderer /** * Render a single line string at the current (posX,posY) and update posX */ - private void renderStringAtPos(String par1Str, boolean par2) + private void renderStringAtPos (String par1Str, boolean par2) { for (int i = 0; i < par1Str.length(); ++i) { @@ -468,7 +468,7 @@ public class SmallFontRenderer k = this.colorCode[j]; this.textColor = k; - GL11.glColor4f((float)(k >> 16) / 255.0F, (float)(k >> 8 & 255) / 255.0F, (float)(k & 255) / 255.0F, this.alpha); + GL11.glColor4f((float) (k >> 16) / 255.0F, (float) (k >> 8 & 255) / 255.0F, (float) (k & 255) / 255.0F, this.alpha); } else if (j == 16) { @@ -511,8 +511,7 @@ public class SmallFontRenderer do { k = this.fontRandom.nextInt(ChatAllowedCharacters.allowedCharacters.length()); - } - while (this.charWidth[j + 32] != this.charWidth[k + 32]); + } while (this.charWidth[j + 32] != this.charWidth[k + 32]); j = k; } @@ -563,10 +562,10 @@ public class SmallFontRenderer tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); - tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); - tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)(this.FONT_HEIGHT / 2)), 0.0D); - tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); - tessellator.addVertex((double)this.posX, (double)(this.posY + (float)(this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.addVertex((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) (this.FONT_HEIGHT / 2)), 0.0D); + tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D); + tessellator.addVertex((double) this.posX, (double) (this.posY + (float) (this.FONT_HEIGHT / 2) - 1.0F), 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } @@ -577,15 +576,15 @@ public class SmallFontRenderer GL11.glDisable(GL11.GL_TEXTURE_2D); tessellator.startDrawingQuads(); int l = this.underlineStyle ? -1 : 0; - tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); - tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)this.FONT_HEIGHT), 0.0D); - tessellator.addVertex((double)(this.posX + f1), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); - tessellator.addVertex((double)(this.posX + (float)l), (double)(this.posY + (float)this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.addVertex((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) this.FONT_HEIGHT), 0.0D); + tessellator.addVertex((double) (this.posX + f1), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D); + tessellator.addVertex((double) (this.posX + (float) l), (double) (this.posY + (float) this.FONT_HEIGHT - 1.0F), 0.0D); tessellator.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); } - this.posX += (float)((int)f1); + this.posX += (float) ((int) f1); } } } @@ -593,7 +592,7 @@ public class SmallFontRenderer /** * Render string either left or right aligned depending on bidiFlag */ - private int renderStringAligned(String par1Str, int par2, int par3, int par4, int par5, boolean par6) + private int renderStringAligned (String par1Str, int par2, int par3, int par4, int par5, boolean par6) { if (this.bidiFlag) { @@ -608,7 +607,7 @@ public class SmallFontRenderer /** * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() */ - private int renderString(String par1Str, int par2, int par3, int par4, boolean par5) + private int renderString (String par1Str, int par2, int par3, int par4, boolean par5) { if (par1Str == null) { @@ -626,22 +625,22 @@ public class SmallFontRenderer par4 = (par4 & 16579836) >> 2 | par4 & -16777216; } - this.red = (float)(par4 >> 16 & 255) / 255.0F; - this.blue = (float)(par4 >> 8 & 255) / 255.0F; - this.green = (float)(par4 & 255) / 255.0F; - this.alpha = (float)(par4 >> 24 & 255) / 255.0F; + this.red = (float) (par4 >> 16 & 255) / 255.0F; + this.blue = (float) (par4 >> 8 & 255) / 255.0F; + this.green = (float) (par4 & 255) / 255.0F; + this.alpha = (float) (par4 >> 24 & 255) / 255.0F; GL11.glColor4f(this.red, this.blue, this.green, this.alpha); - this.posX = (float)par2; - this.posY = (float)par3; + this.posX = (float) par2; + this.posY = (float) par3; this.renderStringAtPos(par1Str, par5); - return (int)this.posX; + return (int) this.posX; } } /** * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). */ - public int getStringWidth(String par1Str) + public int getStringWidth (String par1Str) { if (par1Str == null) { @@ -692,7 +691,7 @@ public class SmallFontRenderer /** * Returns the width of this character as rendered. */ - public int getCharWidth(char par1) + public int getCharWidth (char par1) { if (par1 == 167) { @@ -734,7 +733,7 @@ public class SmallFontRenderer /** * Trims a string to fit a specified Width. */ - public String trimStringToWidth(String par1Str, int par2) + public String trimStringToWidth (String par1Str, int par2) { return this.trimStringToWidth(par1Str, par2, false); } @@ -742,7 +741,7 @@ public class SmallFontRenderer /** * Trims a string to a specified width, and will reverse it if par3 is set. */ - public String trimStringToWidth(String par1Str, int par2, boolean par3) + public String trimStringToWidth (String par1Str, int par2, boolean par3) { StringBuilder stringbuilder = new StringBuilder(); int j = 0; @@ -807,7 +806,7 @@ public class SmallFontRenderer /** * Remove all newline characters from the end of the string */ - private String trimStringNewline(String par1Str) + private String trimStringNewline (String par1Str) { while (par1Str != null && par1Str.endsWith("\n")) { @@ -820,7 +819,7 @@ public class SmallFontRenderer /** * Splits and draws a String with wordwrap (maximum length is parameter k) */ - public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5) + public void drawSplitString (String par1Str, int par2, int par3, int par4, int par5) { this.resetStyles(); this.textColor = par5; @@ -832,13 +831,13 @@ public class SmallFontRenderer * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is * set */ - private void renderSplitString(String par1Str, int par2, int par3, int par4, boolean par5) + private void renderSplitString (String par1Str, int par2, int par3, int par4, boolean par5) { List list = this.listFormattedStringToWidth(par1Str, par4); for (Iterator iterator = list.iterator(); iterator.hasNext(); par3 += this.FONT_HEIGHT) { - String s1 = (String)iterator.next(); + String s1 = (String) iterator.next(); this.renderStringAligned(s1, par2, par3, par4, this.textColor, par5); } } @@ -846,7 +845,7 @@ public class SmallFontRenderer /** * Returns the width of the wordwrapped String (maximum length is parameter k) */ - public int splitStringWidth(String par1Str, int par2) + public int splitStringWidth (String par1Str, int par2) { return this.FONT_HEIGHT * this.listFormattedStringToWidth(par1Str, par2).size(); } @@ -855,7 +854,7 @@ public class SmallFontRenderer * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png * font. */ - public void setUnicodeFlag(boolean par1) + public void setUnicodeFlag (boolean par1) { this.unicodeFlag = par1; } @@ -864,7 +863,7 @@ public class SmallFontRenderer * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png * font. */ - public boolean getUnicodeFlag() + public boolean getUnicodeFlag () { return this.unicodeFlag; } @@ -872,7 +871,7 @@ public class SmallFontRenderer /** * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. */ - public void setBidiFlag(boolean par1) + public void setBidiFlag (boolean par1) { this.bidiFlag = par1; } @@ -880,7 +879,7 @@ public class SmallFontRenderer /** * Breaks a string into a list of pieces that will fit a specified width. */ - public List listFormattedStringToWidth(String par1Str, int par2) + public List listFormattedStringToWidth (String par1Str, int par2) { return Arrays.asList(this.wrapFormattedStringToWidth(par1Str, par2).split("\n")); } @@ -888,7 +887,7 @@ public class SmallFontRenderer /** * Inserts newline and formatting into a string to wrap it within the specified width. */ - String wrapFormattedStringToWidth(String par1Str, int par2) + String wrapFormattedStringToWidth (String par1Str, int par2) { int j = this.sizeStringToWidth(par1Str, par2); @@ -909,7 +908,7 @@ public class SmallFontRenderer /** * Determines how many characters from the string will fit into the specified width. */ - private int sizeStringToWidth(String par1Str, int par2) + private int sizeStringToWidth (String par1Str, int par2) { int j = par1Str.length(); int k = 0; @@ -922,38 +921,38 @@ public class SmallFontRenderer switch (c0) { - case 10: - --l; - break; - case 167: - if (l < j - 1) - { - ++l; - char c1 = par1Str.charAt(l); + case 10: + --l; + break; + case 167: + if (l < j - 1) + { + ++l; + char c1 = par1Str.charAt(l); - if (c1 != 108 && c1 != 76) + if (c1 != 108 && c1 != 76) + { + if (c1 == 114 || c1 == 82 || isFormatColor(c1)) { - if (c1 == 114 || c1 == 82 || isFormatColor(c1)) - { - flag = false; - } - } - else - { - flag = true; + flag = false; } } - - break; - case 32: - i1 = l; - default: - k += this.getCharWidth(c0); - - if (flag) + else { - ++k; + flag = true; } + } + + break; + case 32: + i1 = l; + default: + k += this.getCharWidth(c0); + + if (flag) + { + ++k; + } } if (c0 == 10) @@ -975,7 +974,7 @@ public class SmallFontRenderer /** * Checks if the char code is a hexadecimal character, used to set colour. */ - private static boolean isFormatColor(char par0) + private static boolean isFormatColor (char par0) { return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; } @@ -983,7 +982,7 @@ public class SmallFontRenderer /** * Checks if the char code is O-K...lLrRk-o... used to set special formatting. */ - private static boolean isFormatSpecial(char par0) + private static boolean isFormatSpecial (char par0) { return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; } @@ -991,7 +990,7 @@ public class SmallFontRenderer /** * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. */ - private static String getFormatFromString(String par0Str) + private static String getFormatFromString (String par0Str) { String s1 = ""; int i = -1; @@ -1020,7 +1019,7 @@ public class SmallFontRenderer /** * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string */ - public boolean getBidiFlag() + public boolean getBidiFlag () { return this.bidiFlag; } diff --git a/mods/tinker/tconstruct/client/block/TableRender.java b/mods/tinker/tconstruct/client/block/TableRender.java index 11dffb34..de024178 100644 --- a/mods/tinker/tconstruct/client/block/TableRender.java +++ b/mods/tinker/tconstruct/client/block/TableRender.java @@ -82,32 +82,32 @@ public class TableRender implements ISimpleBlockRenderingHandler public static void renderStandardInvBlock (RenderBlocks renderblocks, Block block, int meta) { - Tessellator tessellator = Tessellator.instance; - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); - tessellator.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); + Tessellator tessellator = Tessellator.instance; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); } } diff --git a/mods/tinker/tconstruct/client/block/TankRender.java b/mods/tinker/tconstruct/client/block/TankRender.java index cf50e008..2ceddefc 100644 --- a/mods/tinker/tconstruct/client/block/TankRender.java +++ b/mods/tinker/tconstruct/client/block/TankRender.java @@ -17,28 +17,28 @@ import cpw.mods.fml.client.registry.RenderingRegistry; public class TankRender implements ISimpleBlockRenderingHandler { - public static int tankModelID = RenderingRegistry.getNextAvailableRenderId(); + public static int tankModelID = RenderingRegistry.getNextAvailableRenderId(); - @Override - public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) - { - if (modelID == tankModelID) - { - TProxyClient.renderStandardInvBlock(renderer, block, metadata); - if (metadata == 0) - { - renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); - renderDoRe(renderer, block, metadata); - } - } - } + @Override + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) + { + if (modelID == tankModelID) + { + TProxyClient.renderStandardInvBlock(renderer, block, metadata); + if (metadata == 0) + { + renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); + renderDoRe(renderer, block, metadata); + } + } + } - @Override - public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) - { - if (modelID == tankModelID) - { - //Liquid + @Override + public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + if (modelID == tankModelID) + { + //Liquid LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z); if (logic.containsLiquid()) { @@ -56,60 +56,60 @@ public class TankRender implements ISimpleBlockRenderingHandler BlockSkinRenderHelper.renderFakeBlock(liquidItem.getIconFromDamage(liquid.itemMeta), x, y, z, renderer, world); } } - + //Block - int meta = world.getBlockMetadata(x, y, z); - if (meta == 0 && world.getBlockId(x, y + 1, z) == 0) - { - renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); - renderer.renderStandardBlock(block, x, y + 1, z); - } + int meta = world.getBlockMetadata(x, y, z); + if (meta == 0 && world.getBlockId(x, y + 1, z) == 0) + { + renderer.setRenderBounds(0.1875, 0, 0.1875, 0.8125, 0.125, 0.8125); + renderer.renderStandardBlock(block, x, y + 1, z); + } renderer.setRenderBounds(0, 0, 0, 1, 1, 1); - renderer.renderStandardBlock(block, x, y, z); - } - return true; - } + renderer.renderStandardBlock(block, x, y, z); + } + return true; + } - @Override - public boolean shouldRender3DInInventory () - { - return true; - } + @Override + public boolean shouldRender3DInInventory () + { + return true; + } - @Override - public int getRenderId () - { - return tankModelID; - } + @Override + public int getRenderId () + { + return tankModelID; + } - private void renderDoRe (RenderBlocks renderblocks, Block block, int meta) - { - Tessellator tessellator = Tessellator.instance; - GL11.glTranslatef(-0.5F, 0.5F, -0.5F); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, -1F, 0.0F); - renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, -1F); - renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 0.0F, 1.0F); - renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(-1F, 0.0F, 0.0F); - renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); - tessellator.draw(); - tessellator.startDrawingQuads(); - tessellator.setNormal(1.0F, 0.0F, 0.0F); - renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); - tessellator.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } + private void renderDoRe (RenderBlocks renderblocks, Block block, int meta) + { + Tessellator tessellator = Tessellator.instance; + GL11.glTranslatef(-0.5F, 0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1F, 0.0F); + renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(0, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(1, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1F); + renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(2, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(3, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1F, 0.0F, 0.0F); + renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, block.getIcon(4, meta)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, block.getIcon(5, meta)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } } diff --git a/mods/tinker/tconstruct/client/entity/CartRender.java b/mods/tinker/tconstruct/client/entity/CartRender.java index 72a0e873..6b9dcc19 100644 --- a/mods/tinker/tconstruct/client/entity/CartRender.java +++ b/mods/tinker/tconstruct/client/entity/CartRender.java @@ -27,18 +27,18 @@ public class CartRender extends Render renderblocks = new RenderBlocks(); } - public void renderPullcart(CartEntity cart, double posX, double posY, double posZ, float par8, float par9) + public void renderPullcart (CartEntity cart, double posX, double posY, double posZ, float par8, float par9) { GL11.glPushMatrix(); - long var10 = (long)cart.entityId * 493286711L; + long var10 = (long) cart.entityId * 493286711L; var10 = var10 * var10 * 4392167121L + var10 * 98761L; - float var12 = (((float)(var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var13 = (((float)(var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var14 = (((float)(var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float var12 = (((float) (var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float var13 = (((float) (var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; + float var14 = (((float) (var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; GL11.glTranslatef(var12, var13, var14); - double var15 = cart.lastTickPosX + (cart.posX - cart.lastTickPosX) * (double)par9; - double var17 = cart.lastTickPosY + (cart.posY - cart.lastTickPosY) * (double)par9; - double var19 = cart.lastTickPosZ + (cart.posZ - cart.lastTickPosZ) * (double)par9; + double var15 = cart.lastTickPosX + (cart.posX - cart.lastTickPosX) * (double) par9; + double var17 = cart.lastTickPosY + (cart.posY - cart.lastTickPosY) * (double) par9; + double var19 = cart.lastTickPosZ + (cart.posZ - cart.lastTickPosZ) * (double) par9; double var21 = 0.30000001192092896D; Vec3 var23 = cart.func_70489_a(var15, var17, var19); float var24 = cart.prevRotationPitch + (cart.rotationPitch - cart.prevRotationPitch) * par9; @@ -66,16 +66,16 @@ public class CartRender extends Render if (var27.lengthVector() != 0.0D) { var27 = var27.normalize(); - par8 = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); - var24 = (float)(Math.atan(var27.yCoord) * 73.0D); + par8 = (float) (Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); + var24 = (float) (Math.atan(var27.yCoord) * 73.0D); } } - GL11.glTranslatef((float)posX, (float)posY + 0.3125f, (float)posZ); + GL11.glTranslatef((float) posX, (float) posY + 0.3125f, (float) posZ); GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-var24, 0.0F, 0.0F, 1.0F); - float var28 = (float)cart.func_70496_j() - par9; - float var30 = (float)cart.getDamage() - par9; + float var28 = (float) cart.func_70496_j() - par9; + float var30 = (float) cart.getDamage() - par9; if (var30 < 0.0F) { @@ -84,7 +84,7 @@ public class CartRender extends Render if (var28 > 0.0F) { - GL11.glRotatef(MathHelper.sin(var28) * var28 * var30 / 10.0F * (float)cart.func_70493_k(), 1.0F, 0.0F, 0.0F); + GL11.glRotatef(MathHelper.sin(var28) * var28 * var30 / 10.0F * (float) cart.func_70493_k(), 1.0F, 0.0F, 0.0F); } if (cart.getCartType() != 0) @@ -125,8 +125,8 @@ public class CartRender extends Render * (Render> 16 & 255) / 255.0F; - f11 = (float)(k >> 8 & 255) / 255.0F; - f6 = (float)(k & 255) / 255.0F; + f12 = (float) (k >> 16 & 255) / 255.0F; + f11 = (float) (k >> 8 & 255) / 255.0F; + f6 = (float) (k & 255) / 255.0F; GL11.glColor4f(f12, f11, f6, 1.0F); this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, j); } @@ -156,9 +157,9 @@ public class CrystalGuardianRender extends RenderLiving else { j = itemstack.getItem().getColorFromItemStack(itemstack, 0); - f6 = (float)(j >> 16 & 255) / 255.0F; - f12 = (float)(j >> 8 & 255) / 255.0F; - f11 = (float)(j & 255) / 255.0F; + f6 = (float) (j >> 16 & 255) / 255.0F; + f12 = (float) (j >> 8 & 255) / 255.0F; + f11 = (float) (j & 255) / 255.0F; GL11.glColor4f(f6, f12, f11, 1.0F); this.renderManager.itemRenderer.renderItem(par1EntityLiving, itemstack, 0); } @@ -176,8 +177,8 @@ public class CrystalGuardianRender extends RenderLiving GL11.glPopMatrix(); } } - - protected void func_82422_c() + + protected void func_82422_c () { GL11.glTranslatef(0.0F, 0.1875F, 0.0F); } diff --git a/mods/tinker/tconstruct/client/entity/CrystalModelSmall.java b/mods/tinker/tconstruct/client/entity/CrystalModelSmall.java index b8f78c9c..a36417fe 100644 --- a/mods/tinker/tconstruct/client/entity/CrystalModelSmall.java +++ b/mods/tinker/tconstruct/client/entity/CrystalModelSmall.java @@ -7,48 +7,48 @@ import net.minecraft.entity.Entity; public class CrystalModelSmall extends ModelBase { - ModelRenderer body; - ModelRendererTurbo top; - ModelRendererTurbo bottom; + ModelRenderer body; + ModelRendererTurbo top; + ModelRendererTurbo bottom; - public CrystalModelSmall() - { - textureWidth = 32; - textureHeight = 32; - - body = new ModelRenderer(this, 0, 8); - body.addBox(-2F, 0F, -2F, 4, 6, 4); - body.setRotationPoint(0F, 0F, 0F); - setRotation(body, 0, 0.7853982F, 0); - top = new ModelRendererTurbo(this, 0, 0, 32, 32); - top.addCone(0, 0, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 8); - top.setRotationPoint(0F, -4F, 0F); - setRotation(top, 0F, 0F, 0F); - bottom = new ModelRendererTurbo(this, 0, 18, 32, 32); - top.addCone(0, 10, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8); - bottom.setRotationPoint(0F, 6F, 0F); - //setRotation(bottom, 0F, 0F, 0F); - } + public CrystalModelSmall() + { + textureWidth = 32; + textureHeight = 32; - public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - top.render(f5); - bottom.render(f5); - } + body = new ModelRenderer(this, 0, 8); + body.addBox(-2F, 0F, -2F, 4, 6, 4); + body.setRotationPoint(0F, 0F, 0F); + setRotation(body, 0, 0.7853982F, 0); + top = new ModelRendererTurbo(this, 0, 0, 32, 32); + top.addCone(0, 0, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_BOTTOM, 4, 8); + top.setRotationPoint(0F, -4F, 0F); + setRotation(top, 0F, 0F, 0F); + bottom = new ModelRendererTurbo(this, 0, 18, 32, 32); + top.addCone(0, 10, 0, 2.8F, 4, 4, 0, ModelRendererTurbo.MR_TOP, 4, 8); + bottom.setRotationPoint(0F, 6F, 0F); + //setRotation(bottom, 0F, 0F, 0F); + } - private void setRotation (ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } + public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + body.render(f5); + top.render(f5); + bottom.render(f5); + } - public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + private void setRotation (ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/mods/tinker/tconstruct/client/entity/CrystalRender.java b/mods/tinker/tconstruct/client/entity/CrystalRender.java index 393ab970..af6d2ef4 100644 --- a/mods/tinker/tconstruct/client/entity/CrystalRender.java +++ b/mods/tinker/tconstruct/client/entity/CrystalRender.java @@ -22,13 +22,13 @@ public class CrystalRender extends RenderLiving /** * A method used to render a creeper's powered form as a pass model. */ - protected int renderCreeperPassModel(Crystal par1EntityCreeper, int par2, float par3) + protected int renderCreeperPassModel (Crystal par1EntityCreeper, int par2, float par3) { return -1; } - protected int func_77061_b(Crystal par1EntityCreeper, int par2, float par3) + protected int func_77061_b (Crystal par1EntityCreeper, int par2, float par3) { return -1; } @@ -45,7 +45,7 @@ public class CrystalRender extends RenderLiving /** * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime */ - protected int getColorMultiplier(EntityLiving par1EntityLiving, float par2, float par3) + protected int getColorMultiplier (EntityLiving par1EntityLiving, float par2, float par3) { return super.getColorMultiplier(par1EntityLiving, par2, par3); } @@ -53,13 +53,13 @@ public class CrystalRender extends RenderLiving /** * Queries whether should render the specified pass or not. */ - protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int shouldRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.renderCreeperPassModel((Crystal)par1EntityLiving, par2, par3); + return this.renderCreeperPassModel((Crystal) par1EntityLiving, par2, par3); } - protected int inheritRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int inheritRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.func_77061_b((Crystal)par1EntityLiving, par2, par3); + return this.func_77061_b((Crystal) par1EntityLiving, par2, par3); } } diff --git a/mods/tinker/tconstruct/client/entity/GolemBaseModel.java b/mods/tinker/tconstruct/client/entity/GolemBaseModel.java index c29cc5a8..579f0fd3 100644 --- a/mods/tinker/tconstruct/client/entity/GolemBaseModel.java +++ b/mods/tinker/tconstruct/client/entity/GolemBaseModel.java @@ -58,7 +58,7 @@ public class GolemBaseModel extends ModelPig } @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); float f6 = 0.0F; diff --git a/mods/tinker/tconstruct/client/entity/GolemRender.java b/mods/tinker/tconstruct/client/entity/GolemRender.java index 95dd3792..8f92ce30 100644 --- a/mods/tinker/tconstruct/client/entity/GolemRender.java +++ b/mods/tinker/tconstruct/client/entity/GolemRender.java @@ -101,8 +101,8 @@ public class GolemRender extends RenderLiving renderBlocks.renderEastFace(Block.brick, d, d1 + 5D, d2, 1); renderBlocks.renderWestFace(Block.brick, d, d1 + 5D, d2, 1);*/ } - - protected void renderSnowmanPumpkin(GolemBase par1EntitySnowman, float par2) + + protected void renderSnowmanPumpkin (GolemBase par1EntitySnowman, float par2) { super.renderEquippedItems(par1EntitySnowman, par2); ItemStack itemstack = new ItemStack(Block.pumpkin, 1); @@ -128,9 +128,9 @@ public class GolemRender extends RenderLiving } } - protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) + protected void renderEquippedItems (EntityLiving par1EntityLiving, float par2) { - this.renderSnowmanPumpkin((GolemBase)par1EntityLiving, par2); + this.renderSnowmanPumpkin((GolemBase) par1EntityLiving, par2); } public void doRender (Entity entity, double d, double d1, double d2, float f, float f1) @@ -156,7 +156,7 @@ public class GolemRender extends RenderLiving //this.renderManager.itemRenderer.renderItem((EntityLiving) entity, itemstack, 0); GL11.glPopMatrix(); } - + boolean flag = false; float f2 = 1.0F; float f3 = 0.0F; diff --git a/mods/tinker/tconstruct/client/entity/MiniGardyRender.java b/mods/tinker/tconstruct/client/entity/MiniGardyRender.java index de9b32cd..65c485c1 100644 --- a/mods/tinker/tconstruct/client/entity/MiniGardyRender.java +++ b/mods/tinker/tconstruct/client/entity/MiniGardyRender.java @@ -29,7 +29,7 @@ public class MiniGardyRender extends RenderLiving } @Override - protected void renderEquippedItems(EntityLiving par1EntityLiving, float par2) + protected void renderEquippedItems (EntityLiving par1EntityLiving, float par2) { float f1 = 1.0F; GL11.glColor3f(f1, f1, f1); @@ -114,7 +114,8 @@ public class MiniGardyRender extends RenderLiving GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); } - else //if (Item.itemsList[heldItem.itemID].isFull3D()) + else + //if (Item.itemsList[heldItem.itemID].isFull3D()) { f2 = 0.625F; @@ -138,7 +139,7 @@ public class MiniGardyRender extends RenderLiving GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); }*/ - + float f6; float f11; int j; @@ -149,9 +150,9 @@ public class MiniGardyRender extends RenderLiving for (j = 0; j < heldItem.getItem().getRenderPasses(heldItem.getItemDamage()); j++) { int k = heldItem.getItem().getColorFromItemStack(heldItem, j); - f12 = (float)(k >> 16 & 255) / 255.0F; - f11 = (float)(k >> 8 & 255) / 255.0F; - f6 = (float)(k & 255) / 255.0F; + f12 = (float) (k >> 16 & 255) / 255.0F; + f11 = (float) (k >> 8 & 255) / 255.0F; + f6 = (float) (k & 255) / 255.0F; GL11.glColor4f(f12, f11, f6, 1.0F); this.renderManager.itemRenderer.renderItem(par1EntityLiving, heldItem, j); } @@ -159,9 +160,9 @@ public class MiniGardyRender extends RenderLiving else { j = heldItem.getItem().getColorFromItemStack(heldItem, 0); - f6 = (float)(j >> 16 & 255) / 255.0F; - f12 = (float)(j >> 8 & 255) / 255.0F; - f11 = (float)(j & 255) / 255.0F; + f6 = (float) (j >> 16 & 255) / 255.0F; + f12 = (float) (j >> 8 & 255) / 255.0F; + f11 = (float) (j & 255) / 255.0F; GL11.glColor4f(f6, f12, f11, 1.0F); this.renderManager.itemRenderer.renderItem(par1EntityLiving, heldItem, 0); } @@ -169,8 +170,8 @@ public class MiniGardyRender extends RenderLiving GL11.glPopMatrix(); } } - - protected void translateItem() + + protected void translateItem () { GL11.glTranslatef(0.0F, 0.1875F, 0.0F); } diff --git a/mods/tinker/tconstruct/client/entity/ModelBoxDegrees.java b/mods/tinker/tconstruct/client/entity/ModelBoxDegrees.java index c3e91a25..f498d1a9 100644 --- a/mods/tinker/tconstruct/client/entity/ModelBoxDegrees.java +++ b/mods/tinker/tconstruct/client/entity/ModelBoxDegrees.java @@ -40,14 +40,14 @@ public class ModelBoxDegrees this.posX1 = par4; this.posY1 = par5; this.posZ1 = par6; - this.posX2 = par4 + (float)par7; - this.posY2 = par5 + (float)par8; - this.posZ2 = par6 + (float)par9; + this.posX2 = par4 + (float) par7; + this.posY2 = par5 + (float) par8; + this.posZ2 = par6 + (float) par9; this.vertexPositions = new PositionTextureVertex[8]; this.quadList = new TexturedQuad[6]; - float f4 = par4 + (float)par7; - float f5 = par5 + (float)par8; - float f6 = par6 + (float)par9; + float f4 = par4 + (float) par7; + float f5 = par5 + (float) par8; + float f6 = par6 + (float) par9; par4 -= par10; par5 -= par10; par6 -= par10; @@ -78,12 +78,18 @@ public class ModelBoxDegrees this.vertexPositions[5] = positiontexturevertex5; this.vertexPositions[6] = positiontexturevertex6; this.vertexPositions[7] = positiontexturevertex7; - this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex5, positiontexturevertex1, positiontexturevertex2, positiontexturevertex6}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex4, positiontexturevertex7, positiontexturevertex3}, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex5, positiontexturevertex4, positiontexturevertex, positiontexturevertex1}, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex2, positiontexturevertex3, positiontexturevertex7, positiontexturevertex6}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex, positiontexturevertex3, positiontexturevertex2}, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); - this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex5, positiontexturevertex6, positiontexturevertex7}, par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex5, positiontexturevertex1, positiontexturevertex2, positiontexturevertex6 }, par2 + par9 + par7, par3 + + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex, positiontexturevertex4, positiontexturevertex7, positiontexturevertex3 }, par2, par3 + par9, par2 + + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex5, positiontexturevertex4, positiontexturevertex, positiontexturevertex1 }, par2 + par9, par3, par2 + + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex2, positiontexturevertex3, positiontexturevertex7, positiontexturevertex6 }, par2 + par9 + par7, par3 + + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex1, positiontexturevertex, positiontexturevertex3, positiontexturevertex2 }, par2 + par9, par3 + par9, + par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); + this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { positiontexturevertex4, positiontexturevertex5, positiontexturevertex6, positiontexturevertex7 }, par2 + par9 + par7 + par9, + par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); if (par1ModelRenderer.mirror) { @@ -98,7 +104,7 @@ public class ModelBoxDegrees * Draw the six sided box defined by this ModelBox */ @SideOnly(Side.CLIENT) - public void render(Tessellator par1Tessellator, float par2) + public void render (Tessellator par1Tessellator, float par2) { for (int i = 0; i < this.quadList.length; ++i) { @@ -106,7 +112,7 @@ public class ModelBoxDegrees } } - public ModelBoxDegrees func_78244_a(String par1Str) + public ModelBoxDegrees func_78244_a (String par1Str) { this.field_78247_g = par1Str; return this; diff --git a/mods/tinker/tconstruct/client/entity/ModelPullcart.java b/mods/tinker/tconstruct/client/entity/ModelPullcart.java index d3819cf6..fbe645b1 100644 --- a/mods/tinker/tconstruct/client/entity/ModelPullcart.java +++ b/mods/tinker/tconstruct/client/entity/ModelPullcart.java @@ -6,276 +6,276 @@ import net.minecraft.entity.Entity; public class ModelPullcart extends ModelBase { - ModelRenderer BackPanel; - ModelRenderer FrontPanel; - ModelRenderer RightPanel; - ModelRenderer LeftPanel; - ModelRenderer BottomPanel; - ModelRenderer RightHandle; - ModelRenderer LeftHandle; - ModelRenderer RightSpokeUp; - ModelRenderer RightSpokeRight; - ModelRenderer RightSpokeDown; - ModelRenderer RightSpokeLeft; - ModelRenderer RightAxle; - ModelRenderer WheelRight1; - ModelRenderer WheelRight2; - ModelRenderer WheelRight3; - ModelRenderer WheelRight4; - ModelRenderer WheelRight5; - ModelRenderer WheelRight6; - ModelRenderer WheelRight7; - ModelRenderer WheelRight8; - ModelRenderer WheelRight9; - ModelRenderer WheelRight10; - ModelRenderer WheelRight11; - ModelRenderer WheelRight12; - ModelRenderer LeftSpokeRight; - ModelRenderer LeftSpokeLeft; - ModelRenderer LeftSpokeDown; - ModelRenderer LeftSpokeUp; - ModelRenderer LeftAxle; - ModelRenderer WheelLeft1; - ModelRenderer WheelLeft2; - ModelRenderer WheelLeft3; - ModelRenderer WheelLeft4; - ModelRenderer WheelLeft5; - ModelRenderer WheelLeft6; - ModelRenderer WheelLeft7; - ModelRenderer WheelLeft8; - ModelRenderer WheelLeft9; - ModelRenderer WheelLeft10; - ModelRenderer WheelLeft11; - ModelRenderer WheelLeft12; + ModelRenderer BackPanel; + ModelRenderer FrontPanel; + ModelRenderer RightPanel; + ModelRenderer LeftPanel; + ModelRenderer BottomPanel; + ModelRenderer RightHandle; + ModelRenderer LeftHandle; + ModelRenderer RightSpokeUp; + ModelRenderer RightSpokeRight; + ModelRenderer RightSpokeDown; + ModelRenderer RightSpokeLeft; + ModelRenderer RightAxle; + ModelRenderer WheelRight1; + ModelRenderer WheelRight2; + ModelRenderer WheelRight3; + ModelRenderer WheelRight4; + ModelRenderer WheelRight5; + ModelRenderer WheelRight6; + ModelRenderer WheelRight7; + ModelRenderer WheelRight8; + ModelRenderer WheelRight9; + ModelRenderer WheelRight10; + ModelRenderer WheelRight11; + ModelRenderer WheelRight12; + ModelRenderer LeftSpokeRight; + ModelRenderer LeftSpokeLeft; + ModelRenderer LeftSpokeDown; + ModelRenderer LeftSpokeUp; + ModelRenderer LeftAxle; + ModelRenderer WheelLeft1; + ModelRenderer WheelLeft2; + ModelRenderer WheelLeft3; + ModelRenderer WheelLeft4; + ModelRenderer WheelLeft5; + ModelRenderer WheelLeft6; + ModelRenderer WheelLeft7; + ModelRenderer WheelLeft8; + ModelRenderer WheelLeft9; + ModelRenderer WheelLeft10; + ModelRenderer WheelLeft11; + ModelRenderer WheelLeft12; - public ModelPullcart() - { - textureWidth = 128; - textureHeight = 64; + public ModelPullcart() + { + textureWidth = 128; + textureHeight = 64; - BackPanel = new ModelRenderer(this, 0, 12); - BackPanel.addBox(-10F, 0F, 0F, 20, 10, 2); - BackPanel.setRotationPoint(0F, -8F, 8F); - setRotation(BackPanel, 0F, 0F, 0F); - FrontPanel = new ModelRenderer(this, 0, 0); - FrontPanel.addBox(-10F, 0F, 0F, 20, 10, 2); - FrontPanel.setRotationPoint(0F, -8F, -10F); - setRotation(FrontPanel, 0F, 0F, 0F); - RightPanel = new ModelRenderer(this, 0, 35); - RightPanel.addBox(0F, 0F, -10F, 2, 8, 20); - RightPanel.setRotationPoint(-12F, -6F, 0F); - setRotation(RightPanel, 0F, 0F, 0F); - LeftPanel = new ModelRenderer(this, 24, 15); - LeftPanel.addBox(0F, 0F, -10F, 2, 8, 20); - LeftPanel.setRotationPoint(10F, -6F, 0F); - setRotation(LeftPanel, 0F, 0F, 0F); - BottomPanel = new ModelRenderer(this, 40, 43); - BottomPanel.addBox(-12F, 0F, -10F, 24, 1, 20); - BottomPanel.setRotationPoint(0F, 2F, 0F); - setRotation(BottomPanel, 0F, 0F, 0F); - RightHandle = new ModelRenderer(this, 92, 33); - RightHandle.addBox(0F, 0F, 0F, 16, 2, 2); - RightHandle.setRotationPoint(-28F, 0F, -7F); - setRotation(RightHandle, 0F, 0F, 0F); - LeftHandle = new ModelRenderer(this, 92, 38); - LeftHandle.addBox(0F, 0F, 0F, 16, 2, 2); - LeftHandle.setRotationPoint(-28F, 0F, 5F); - setRotation(LeftHandle, 0F, 0F, 0F); - RightSpokeUp = new ModelRenderer(this, 99, 3); - RightSpokeUp.addBox(-2F, -8F, 0F, 4, 6, 1); - RightSpokeUp.setRotationPoint(0F, 3F, -11F); - setRotation(RightSpokeUp, 0F, 0F, 0F); - RightSpokeRight = new ModelRenderer(this, 112, 15); - RightSpokeRight.addBox(2F, -2F, 0F, 6, 4, 1); - RightSpokeRight.setRotationPoint(0F, 3F, -11F); - setRotation(RightSpokeRight, 0F, 0F, 0F); - RightSpokeDown = new ModelRenderer(this, 99, 25); - RightSpokeDown.addBox(-2F, 2F, 0F, 4, 6, 1); - RightSpokeDown.setRotationPoint(0F, 3F, -11F); - setRotation(RightSpokeDown, 0F, 0F, 0F); - RightSpokeLeft = new ModelRenderer(this, 82, 15); - RightSpokeLeft.addBox(-8F, -2F, 0F, 6, 4, 1); - RightSpokeLeft.setRotationPoint(0F, 3F, -11F); - setRotation(RightSpokeLeft, 0F, 0F, 0F); - RightAxle = new ModelRenderer(this, 98, 14); - RightAxle.addBox(-2F, -2F, 0F, 4, 4, 2); - RightAxle.setRotationPoint(0F, 3F, -12F); - setRotation(RightAxle, 0F, 0F, 0F); - WheelRight1 = new ModelRenderer(this, 110, 3); - WheelRight1.addBox(2F, -7F, 0F, 2, 2, 1); - WheelRight1.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight1, 0F, 0F, 0F); - WheelRight2 = new ModelRenderer(this, 117, 5); - WheelRight2.addBox(4F, -6F, 0F, 2, 2, 1); - WheelRight2.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight2, 0F, 0F, 0F); - WheelRight3 = new ModelRenderer(this, 122, 9); - WheelRight3.addBox(5F, -4F, 0F, 2, 2, 1); - WheelRight3.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight3, 0F, 0F, 0F); - WheelRight4 = new ModelRenderer(this, 122, 23); - WheelRight4.addBox(5F, 2F, 0F, 2, 2, 1); - WheelRight4.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight4, 0F, 0F, 0F); - WheelRight5 = new ModelRenderer(this, 117, 27); - WheelRight5.addBox(4F, 4F, 0F, 2, 2, 1); - WheelRight5.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight5, 0F, 0F, 0F); - WheelRight6 = new ModelRenderer(this, 110, 29); - WheelRight6.addBox(2F, 5F, 0F, 2, 2, 1); - WheelRight6.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight6, 0F, 0F, 0F); - WheelRight7 = new ModelRenderer(this, 92, 29); - WheelRight7.addBox(-4F, 5F, 0F, 2, 2, 1); - WheelRight7.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight7, 0F, 0F, 0F); - WheelRight8 = new ModelRenderer(this, 85, 27); - WheelRight8.addBox(-6F, 4F, 0F, 2, 2, 1); - WheelRight8.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight8, 0F, 0F, 0F); - WheelRight9 = new ModelRenderer(this, 80, 23); - WheelRight9.addBox(-7F, 2F, 0F, 2, 2, 1); - WheelRight9.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight9, 0F, 0F, 0F); - WheelRight10 = new ModelRenderer(this, 80, 9); - WheelRight10.addBox(-7F, -4F, 0F, 2, 2, 1); - WheelRight10.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight10, 0F, 0F, 0F); - WheelRight11 = new ModelRenderer(this, 85, 5); - WheelRight11.addBox(-6F, -6F, 0F, 2, 2, 1); - WheelRight11.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight11, 0F, 0F, 0F); - WheelRight12 = new ModelRenderer(this, 92, 3); - WheelRight12.addBox(-4F, -7F, 0F, 2, 2, 1); - WheelRight12.setRotationPoint(0F, 3F, -11F); - setRotation(WheelRight12, 0F, 0F, 0F); - LeftSpokeRight = new ModelRenderer(this, 82, 15); - LeftSpokeRight.addBox(-8F, -2F, 0F, 6, 4, 1); - LeftSpokeRight.setRotationPoint(0F, 3F, 10F); - setRotation(LeftSpokeRight, 0F, 0F, 0F); - LeftSpokeLeft = new ModelRenderer(this, 112, 15); - LeftSpokeLeft.addBox(2F, -2F, 0F, 6, 4, 1); - LeftSpokeLeft.setRotationPoint(0F, 3F, 10F); - setRotation(LeftSpokeLeft, 0F, 0F, 0F); - LeftSpokeDown = new ModelRenderer(this, 99, 25); - LeftSpokeDown.addBox(-2F, 2F, 0F, 4, 6, 1); - LeftSpokeDown.setRotationPoint(0F, 3F, 10F); - setRotation(LeftSpokeDown, 0F, 0F, 0F); - LeftSpokeUp = new ModelRenderer(this, 99, 3); - LeftSpokeUp.addBox(-2F, -8F, 0F, 4, 6, 1); - LeftSpokeUp.setRotationPoint(0F, 3F, 10F); - setRotation(LeftSpokeUp, 0F, 0F, 0F); - LeftAxle = new ModelRenderer(this, 98, 14); - LeftAxle.addBox(-2F, -2F, 0F, 4, 4, 2); - LeftAxle.setRotationPoint(0F, 3F, 10F); - setRotation(LeftAxle, 0F, 0F, 0F); - WheelLeft1 = new ModelRenderer(this, 92, 3); - WheelLeft1.addBox(-4F, -7F, 0F, 2, 2, 1); - WheelLeft1.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft1, 0F, 0F, 0F); - WheelLeft2 = new ModelRenderer(this, 117, 5); - WheelLeft2.addBox(-6F, -6F, 0F, 2, 2, 1); - WheelLeft2.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft2, 0F, 0F, 0F); - WheelLeft3 = new ModelRenderer(this, 80, 9); - WheelLeft3.addBox(-7F, -4F, 0F, 2, 2, 1); - WheelLeft3.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft3, 0F, 0F, 0F); - WheelLeft4 = new ModelRenderer(this, 80, 23); - WheelLeft4.addBox(-7F, 2F, 0F, 2, 2, 1); - WheelLeft4.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft4, 0F, 0F, 0F); - WheelLeft5 = new ModelRenderer(this, 117, 27); - WheelLeft5.addBox(-6F, 4F, 0F, 2, 2, 1); - WheelLeft5.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft5, 0F, 0F, 0F); - WheelLeft6 = new ModelRenderer(this, 110, 29); - WheelLeft6.addBox(-4F, 5F, 0F, 2, 2, 1); - WheelLeft6.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft6, 0F, 0F, 0F); - WheelLeft7 = new ModelRenderer(this, 92, 29); - WheelLeft7.addBox(2F, 5F, 0F, 2, 2, 1); - WheelLeft7.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft7, 0F, 0F, 0F); - WheelLeft8 = new ModelRenderer(this, 85, 27); - WheelLeft8.addBox(4F, 4F, 0F, 2, 2, 1); - WheelLeft8.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft8, 0F, 0F, 0F); - WheelLeft9 = new ModelRenderer(this, 122, 23); - WheelLeft9.addBox(5F, 2F, 0F, 2, 2, 1); - WheelLeft9.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft9, 0F, 0F, 0F); - WheelLeft10 = new ModelRenderer(this, 122, 9); - WheelLeft10.addBox(5F, -4F, 0F, 2, 2, 1); - WheelLeft10.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft10, 0F, 0F, 0F); - WheelLeft11 = new ModelRenderer(this, 85, 5); - WheelLeft11.addBox(4F, -6F, 0F, 2, 2, 1); - WheelLeft11.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft11, 0F, 0F, 0F); - WheelLeft12 = new ModelRenderer(this, 110, 3); - WheelLeft12.addBox(2F, -7F, 0F, 2, 2, 1); - WheelLeft12.setRotationPoint(0F, 3F, 10F); - setRotation(WheelLeft12, 0F, 0F, 0F); - } + BackPanel = new ModelRenderer(this, 0, 12); + BackPanel.addBox(-10F, 0F, 0F, 20, 10, 2); + BackPanel.setRotationPoint(0F, -8F, 8F); + setRotation(BackPanel, 0F, 0F, 0F); + FrontPanel = new ModelRenderer(this, 0, 0); + FrontPanel.addBox(-10F, 0F, 0F, 20, 10, 2); + FrontPanel.setRotationPoint(0F, -8F, -10F); + setRotation(FrontPanel, 0F, 0F, 0F); + RightPanel = new ModelRenderer(this, 0, 35); + RightPanel.addBox(0F, 0F, -10F, 2, 8, 20); + RightPanel.setRotationPoint(-12F, -6F, 0F); + setRotation(RightPanel, 0F, 0F, 0F); + LeftPanel = new ModelRenderer(this, 24, 15); + LeftPanel.addBox(0F, 0F, -10F, 2, 8, 20); + LeftPanel.setRotationPoint(10F, -6F, 0F); + setRotation(LeftPanel, 0F, 0F, 0F); + BottomPanel = new ModelRenderer(this, 40, 43); + BottomPanel.addBox(-12F, 0F, -10F, 24, 1, 20); + BottomPanel.setRotationPoint(0F, 2F, 0F); + setRotation(BottomPanel, 0F, 0F, 0F); + RightHandle = new ModelRenderer(this, 92, 33); + RightHandle.addBox(0F, 0F, 0F, 16, 2, 2); + RightHandle.setRotationPoint(-28F, 0F, -7F); + setRotation(RightHandle, 0F, 0F, 0F); + LeftHandle = new ModelRenderer(this, 92, 38); + LeftHandle.addBox(0F, 0F, 0F, 16, 2, 2); + LeftHandle.setRotationPoint(-28F, 0F, 5F); + setRotation(LeftHandle, 0F, 0F, 0F); + RightSpokeUp = new ModelRenderer(this, 99, 3); + RightSpokeUp.addBox(-2F, -8F, 0F, 4, 6, 1); + RightSpokeUp.setRotationPoint(0F, 3F, -11F); + setRotation(RightSpokeUp, 0F, 0F, 0F); + RightSpokeRight = new ModelRenderer(this, 112, 15); + RightSpokeRight.addBox(2F, -2F, 0F, 6, 4, 1); + RightSpokeRight.setRotationPoint(0F, 3F, -11F); + setRotation(RightSpokeRight, 0F, 0F, 0F); + RightSpokeDown = new ModelRenderer(this, 99, 25); + RightSpokeDown.addBox(-2F, 2F, 0F, 4, 6, 1); + RightSpokeDown.setRotationPoint(0F, 3F, -11F); + setRotation(RightSpokeDown, 0F, 0F, 0F); + RightSpokeLeft = new ModelRenderer(this, 82, 15); + RightSpokeLeft.addBox(-8F, -2F, 0F, 6, 4, 1); + RightSpokeLeft.setRotationPoint(0F, 3F, -11F); + setRotation(RightSpokeLeft, 0F, 0F, 0F); + RightAxle = new ModelRenderer(this, 98, 14); + RightAxle.addBox(-2F, -2F, 0F, 4, 4, 2); + RightAxle.setRotationPoint(0F, 3F, -12F); + setRotation(RightAxle, 0F, 0F, 0F); + WheelRight1 = new ModelRenderer(this, 110, 3); + WheelRight1.addBox(2F, -7F, 0F, 2, 2, 1); + WheelRight1.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight1, 0F, 0F, 0F); + WheelRight2 = new ModelRenderer(this, 117, 5); + WheelRight2.addBox(4F, -6F, 0F, 2, 2, 1); + WheelRight2.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight2, 0F, 0F, 0F); + WheelRight3 = new ModelRenderer(this, 122, 9); + WheelRight3.addBox(5F, -4F, 0F, 2, 2, 1); + WheelRight3.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight3, 0F, 0F, 0F); + WheelRight4 = new ModelRenderer(this, 122, 23); + WheelRight4.addBox(5F, 2F, 0F, 2, 2, 1); + WheelRight4.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight4, 0F, 0F, 0F); + WheelRight5 = new ModelRenderer(this, 117, 27); + WheelRight5.addBox(4F, 4F, 0F, 2, 2, 1); + WheelRight5.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight5, 0F, 0F, 0F); + WheelRight6 = new ModelRenderer(this, 110, 29); + WheelRight6.addBox(2F, 5F, 0F, 2, 2, 1); + WheelRight6.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight6, 0F, 0F, 0F); + WheelRight7 = new ModelRenderer(this, 92, 29); + WheelRight7.addBox(-4F, 5F, 0F, 2, 2, 1); + WheelRight7.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight7, 0F, 0F, 0F); + WheelRight8 = new ModelRenderer(this, 85, 27); + WheelRight8.addBox(-6F, 4F, 0F, 2, 2, 1); + WheelRight8.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight8, 0F, 0F, 0F); + WheelRight9 = new ModelRenderer(this, 80, 23); + WheelRight9.addBox(-7F, 2F, 0F, 2, 2, 1); + WheelRight9.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight9, 0F, 0F, 0F); + WheelRight10 = new ModelRenderer(this, 80, 9); + WheelRight10.addBox(-7F, -4F, 0F, 2, 2, 1); + WheelRight10.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight10, 0F, 0F, 0F); + WheelRight11 = new ModelRenderer(this, 85, 5); + WheelRight11.addBox(-6F, -6F, 0F, 2, 2, 1); + WheelRight11.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight11, 0F, 0F, 0F); + WheelRight12 = new ModelRenderer(this, 92, 3); + WheelRight12.addBox(-4F, -7F, 0F, 2, 2, 1); + WheelRight12.setRotationPoint(0F, 3F, -11F); + setRotation(WheelRight12, 0F, 0F, 0F); + LeftSpokeRight = new ModelRenderer(this, 82, 15); + LeftSpokeRight.addBox(-8F, -2F, 0F, 6, 4, 1); + LeftSpokeRight.setRotationPoint(0F, 3F, 10F); + setRotation(LeftSpokeRight, 0F, 0F, 0F); + LeftSpokeLeft = new ModelRenderer(this, 112, 15); + LeftSpokeLeft.addBox(2F, -2F, 0F, 6, 4, 1); + LeftSpokeLeft.setRotationPoint(0F, 3F, 10F); + setRotation(LeftSpokeLeft, 0F, 0F, 0F); + LeftSpokeDown = new ModelRenderer(this, 99, 25); + LeftSpokeDown.addBox(-2F, 2F, 0F, 4, 6, 1); + LeftSpokeDown.setRotationPoint(0F, 3F, 10F); + setRotation(LeftSpokeDown, 0F, 0F, 0F); + LeftSpokeUp = new ModelRenderer(this, 99, 3); + LeftSpokeUp.addBox(-2F, -8F, 0F, 4, 6, 1); + LeftSpokeUp.setRotationPoint(0F, 3F, 10F); + setRotation(LeftSpokeUp, 0F, 0F, 0F); + LeftAxle = new ModelRenderer(this, 98, 14); + LeftAxle.addBox(-2F, -2F, 0F, 4, 4, 2); + LeftAxle.setRotationPoint(0F, 3F, 10F); + setRotation(LeftAxle, 0F, 0F, 0F); + WheelLeft1 = new ModelRenderer(this, 92, 3); + WheelLeft1.addBox(-4F, -7F, 0F, 2, 2, 1); + WheelLeft1.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft1, 0F, 0F, 0F); + WheelLeft2 = new ModelRenderer(this, 117, 5); + WheelLeft2.addBox(-6F, -6F, 0F, 2, 2, 1); + WheelLeft2.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft2, 0F, 0F, 0F); + WheelLeft3 = new ModelRenderer(this, 80, 9); + WheelLeft3.addBox(-7F, -4F, 0F, 2, 2, 1); + WheelLeft3.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft3, 0F, 0F, 0F); + WheelLeft4 = new ModelRenderer(this, 80, 23); + WheelLeft4.addBox(-7F, 2F, 0F, 2, 2, 1); + WheelLeft4.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft4, 0F, 0F, 0F); + WheelLeft5 = new ModelRenderer(this, 117, 27); + WheelLeft5.addBox(-6F, 4F, 0F, 2, 2, 1); + WheelLeft5.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft5, 0F, 0F, 0F); + WheelLeft6 = new ModelRenderer(this, 110, 29); + WheelLeft6.addBox(-4F, 5F, 0F, 2, 2, 1); + WheelLeft6.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft6, 0F, 0F, 0F); + WheelLeft7 = new ModelRenderer(this, 92, 29); + WheelLeft7.addBox(2F, 5F, 0F, 2, 2, 1); + WheelLeft7.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft7, 0F, 0F, 0F); + WheelLeft8 = new ModelRenderer(this, 85, 27); + WheelLeft8.addBox(4F, 4F, 0F, 2, 2, 1); + WheelLeft8.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft8, 0F, 0F, 0F); + WheelLeft9 = new ModelRenderer(this, 122, 23); + WheelLeft9.addBox(5F, 2F, 0F, 2, 2, 1); + WheelLeft9.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft9, 0F, 0F, 0F); + WheelLeft10 = new ModelRenderer(this, 122, 9); + WheelLeft10.addBox(5F, -4F, 0F, 2, 2, 1); + WheelLeft10.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft10, 0F, 0F, 0F); + WheelLeft11 = new ModelRenderer(this, 85, 5); + WheelLeft11.addBox(4F, -6F, 0F, 2, 2, 1); + WheelLeft11.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft11, 0F, 0F, 0F); + WheelLeft12 = new ModelRenderer(this, 110, 3); + WheelLeft12.addBox(2F, -7F, 0F, 2, 2, 1); + WheelLeft12.setRotationPoint(0F, 3F, 10F); + setRotation(WheelLeft12, 0F, 0F, 0F); + } - public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BackPanel.render(f5); - FrontPanel.render(f5); - RightPanel.render(f5); - LeftPanel.render(f5); - BottomPanel.render(f5); - RightHandle.render(f5); - LeftHandle.render(f5); - RightSpokeUp.render(f5); - RightSpokeRight.render(f5); - RightSpokeDown.render(f5); - RightSpokeLeft.render(f5); - RightAxle.render(f5); - WheelRight1.render(f5); - WheelRight2.render(f5); - WheelRight3.render(f5); - WheelRight4.render(f5); - WheelRight5.render(f5); - WheelRight6.render(f5); - WheelRight7.render(f5); - WheelRight8.render(f5); - WheelRight9.render(f5); - WheelRight10.render(f5); - WheelRight11.render(f5); - WheelRight12.render(f5); - LeftSpokeRight.render(f5); - LeftSpokeLeft.render(f5); - LeftSpokeDown.render(f5); - LeftSpokeUp.render(f5); - LeftAxle.render(f5); - WheelLeft1.render(f5); - WheelLeft2.render(f5); - WheelLeft3.render(f5); - WheelLeft4.render(f5); - WheelLeft5.render(f5); - WheelLeft6.render(f5); - WheelLeft7.render(f5); - WheelLeft8.render(f5); - WheelLeft9.render(f5); - WheelLeft10.render(f5); - WheelLeft11.render(f5); - WheelLeft12.render(f5); - } + public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + BackPanel.render(f5); + FrontPanel.render(f5); + RightPanel.render(f5); + LeftPanel.render(f5); + BottomPanel.render(f5); + RightHandle.render(f5); + LeftHandle.render(f5); + RightSpokeUp.render(f5); + RightSpokeRight.render(f5); + RightSpokeDown.render(f5); + RightSpokeLeft.render(f5); + RightAxle.render(f5); + WheelRight1.render(f5); + WheelRight2.render(f5); + WheelRight3.render(f5); + WheelRight4.render(f5); + WheelRight5.render(f5); + WheelRight6.render(f5); + WheelRight7.render(f5); + WheelRight8.render(f5); + WheelRight9.render(f5); + WheelRight10.render(f5); + WheelRight11.render(f5); + WheelRight12.render(f5); + LeftSpokeRight.render(f5); + LeftSpokeLeft.render(f5); + LeftSpokeDown.render(f5); + LeftSpokeUp.render(f5); + LeftAxle.render(f5); + WheelLeft1.render(f5); + WheelLeft2.render(f5); + WheelLeft3.render(f5); + WheelLeft4.render(f5); + WheelLeft5.render(f5); + WheelLeft6.render(f5); + WheelLeft7.render(f5); + WheelLeft8.render(f5); + WheelLeft9.render(f5); + WheelLeft10.render(f5); + WheelLeft11.render(f5); + WheelLeft12.render(f5); + } - private void setRotation (ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } + private void setRotation (ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } - public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/mods/tinker/tconstruct/client/entity/ModelRendererDegrees.java b/mods/tinker/tconstruct/client/entity/ModelRendererDegrees.java index b204d8bb..2ba7eca7 100644 --- a/mods/tinker/tconstruct/client/entity/ModelRendererDegrees.java +++ b/mods/tinker/tconstruct/client/entity/ModelRendererDegrees.java @@ -67,7 +67,7 @@ public class ModelRendererDegrees public ModelRendererDegrees(ModelBase par1ModelBase) { - this(par1ModelBase, (String)null); + this(par1ModelBase, (String) null); } public ModelRendererDegrees(ModelBase par1ModelBase, int par2, int par3) @@ -79,7 +79,7 @@ public class ModelRendererDegrees /** * Sets the current box's rotation points and rotation angles to another box. */ - public void addChild(ModelRendererDegrees par1ModelRenderer) + public void addChild (ModelRendererDegrees par1ModelRenderer) { if (this.childModels == null) { @@ -89,14 +89,14 @@ public class ModelRendererDegrees this.childModels.add(par1ModelRenderer); } - public ModelRendererDegrees setTextureOffset(int par1, int par2) + public ModelRendererDegrees setTextureOffset (int par1, int par2) { this.textureOffsetX = par1; this.textureOffsetY = par2; return this; } - public ModelRendererDegrees addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) + public ModelRendererDegrees addBox (String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) { par1Str = this.boxName + "." + par1Str; TextureOffset textureoffset = this.baseModel.getTextureOffset(par1Str); @@ -105,7 +105,7 @@ public class ModelRendererDegrees return this; } - public ModelRendererDegrees addBox(float par1, float par2, float par3, int par4, int par5, int par6) + public ModelRendererDegrees addBox (float par1, float par2, float par3, int par4, int par5, int par6) { this.cubeList.add(new ModelBoxDegrees(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F)); return this; @@ -114,20 +114,20 @@ public class ModelRendererDegrees /** * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. */ - public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) + public void addBox (float par1, float par2, float par3, int par4, int par5, int par6, float par7) { this.cubeList.add(new ModelBoxDegrees(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7)); } - public void setRotationPoint(float par1, float par2, float par3) + public void setRotationPoint (float par1, float par2, float par3) { this.rotationPointX = par1; this.rotationPointY = par2; this.rotationPointZ = par3; } - + @SideOnly(Side.CLIENT) - public void render(float par1) + public void render (float par1) { if (!this.isHidden) { @@ -151,7 +151,7 @@ public class ModelRendererDegrees { for (i = 0; i < this.childModels.size(); ++i) { - ((ModelRendererDegrees)this.childModels.get(i)).render(par1); + ((ModelRendererDegrees) this.childModels.get(i)).render(par1); } } } @@ -164,7 +164,7 @@ public class ModelRendererDegrees { for (i = 0; i < this.childModels.size(); ++i) { - ((ModelRendererDegrees)this.childModels.get(i)).render(par1); + ((ModelRendererDegrees) this.childModels.get(i)).render(par1); } } @@ -197,7 +197,7 @@ public class ModelRendererDegrees { for (i = 0; i < this.childModels.size(); ++i) { - ((ModelRendererDegrees)this.childModels.get(i)).render(par1); + ((ModelRendererDegrees) this.childModels.get(i)).render(par1); } } @@ -210,7 +210,7 @@ public class ModelRendererDegrees } @SideOnly(Side.CLIENT) - public void renderWithRotation(float par1) + public void renderWithRotation (float par1) { if (!this.isHidden) { @@ -226,17 +226,17 @@ public class ModelRendererDegrees if (this.rotateAngleY != 0.0F) { - GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); } if (this.rotateAngleX != 0.0F) { - GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F); } if (this.rotateAngleZ != 0.0F) { - GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F); } GL11.glCallList(this.displayList); @@ -249,7 +249,7 @@ public class ModelRendererDegrees * Allows the changing of Angles after a box has been rendered */ @SideOnly(Side.CLIENT) - public void postRender(float par1) + public void postRender (float par1) { if (!this.isHidden) { @@ -294,7 +294,7 @@ public class ModelRendererDegrees * Compiles a GL display list for this model */ @SideOnly(Side.CLIENT) - private void compileDisplayList(float par1) + private void compileDisplayList (float par1) { this.displayList = GLAllocation.generateDisplayLists(1); GL11.glNewList(this.displayList, GL11.GL_COMPILE); @@ -302,7 +302,7 @@ public class ModelRendererDegrees for (int i = 0; i < this.cubeList.size(); ++i) { - ((ModelBoxDegrees)this.cubeList.get(i)).render(tessellator, par1); + ((ModelBoxDegrees) this.cubeList.get(i)).render(tessellator, par1); } GL11.glEndList(); @@ -312,10 +312,10 @@ public class ModelRendererDegrees /** * Returns the model renderer with the new texture parameters. */ - public ModelRendererDegrees setTextureSize(int par1, int par2) + public ModelRendererDegrees setTextureSize (int par1, int par2) { - this.textureWidth = (float)par1; - this.textureHeight = (float)par2; + this.textureWidth = (float) par1; + this.textureHeight = (float) par2; return this; } } diff --git a/mods/tinker/tconstruct/client/entity/ModelWagon.java b/mods/tinker/tconstruct/client/entity/ModelWagon.java index 47edbd93..546b012e 100644 --- a/mods/tinker/tconstruct/client/entity/ModelWagon.java +++ b/mods/tinker/tconstruct/client/entity/ModelWagon.java @@ -381,7 +381,7 @@ public class ModelWagon extends ModelBase * Sets the models various rotation angles then renders the model. */ @Override - public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) + public void render (Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { super.render(var1, var2, var3, var4, var5, var6, var7); this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); @@ -440,7 +440,7 @@ public class ModelWagon extends ModelBase this.StandRight.render(var7); } - private void setRotation(ModelRenderer var1, float var2, float var3, float var4) + private void setRotation (ModelRenderer var1, float var2, float var3, float var4) { var1.rotateAngleX = var2; var1.rotateAngleY = var3; @@ -451,7 +451,7 @@ public class ModelWagon extends ModelBase * Sets the models various rotation angles. */ @Override - public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity par7Entity) + public void setRotationAngles (float var1, float var2, float var3, float var4, float var5, float var6, Entity par7Entity) { super.setRotationAngles(var1, var2, var3, var4, var5, var6, par7Entity); } diff --git a/mods/tinker/tconstruct/client/entity/SkylaModel.java b/mods/tinker/tconstruct/client/entity/SkylaModel.java index 277e2ab9..f7b9735d 100644 --- a/mods/tinker/tconstruct/client/entity/SkylaModel.java +++ b/mods/tinker/tconstruct/client/entity/SkylaModel.java @@ -7,251 +7,251 @@ import net.minecraft.entity.Entity; public class SkylaModel extends ModelBase { - ModelRenderer Head; - ModelRenderer Hair; - ModelRenderer Neck; - ModelRenderer Torso; - ModelRendererTurbo Skirt; - ModelRenderer Breast; - ModelRenderer RightArm; - ModelRenderer RightBand; - ModelRendererTurbo RightSleeve; - ModelRenderer RightHand; - ModelRenderer LeftArm; - ModelRenderer LeftBand; - ModelRendererTurbo LeftSleeve; - ModelRenderer LeftHand; - ModelRenderer RightLeg; - ModelRenderer RightFoot; - ModelRenderer LeftLeg; - ModelRenderer LeftFoot; - ModelRenderer WingBaseRight; - ModelRenderer WingEdgeRight; - ModelRenderer WingInsetRight; - ModelRenderer WingCenterRight; - ModelRenderer WingFlangeRight; - ModelRenderer WingAuxRight; - ModelRenderer WingBaseLeft; - ModelRenderer WingEdgeLeft; - ModelRenderer WingInsetLeft; - ModelRenderer WingCenterLeft; - ModelRenderer WingFlangeLeft; - ModelRenderer WingAuxLeft; + ModelRenderer Head; + ModelRenderer Hair; + ModelRenderer Neck; + ModelRenderer Torso; + ModelRendererTurbo Skirt; + ModelRenderer Breast; + ModelRenderer RightArm; + ModelRenderer RightBand; + ModelRendererTurbo RightSleeve; + ModelRenderer RightHand; + ModelRenderer LeftArm; + ModelRenderer LeftBand; + ModelRendererTurbo LeftSleeve; + ModelRenderer LeftHand; + ModelRenderer RightLeg; + ModelRenderer RightFoot; + ModelRenderer LeftLeg; + ModelRenderer LeftFoot; + ModelRenderer WingBaseRight; + ModelRenderer WingEdgeRight; + ModelRenderer WingInsetRight; + ModelRenderer WingCenterRight; + ModelRenderer WingFlangeRight; + ModelRenderer WingAuxRight; + ModelRenderer WingBaseLeft; + ModelRenderer WingEdgeLeft; + ModelRenderer WingInsetLeft; + ModelRenderer WingCenterLeft; + ModelRenderer WingFlangeLeft; + ModelRenderer WingAuxLeft; - public SkylaModel() - { - textureWidth = 64; - textureHeight = 64; + public SkylaModel() + { + textureWidth = 64; + textureHeight = 64; - Head = new ModelRenderer(this, 0, 0); - Head.addBox(-4F, -8F, -4F, 8, 8, 8); - //Head.addCylinder(0, 0, 0, 8, 16, 24, 0, ModelRendererTurbo.MR_BOTTOM); - Head.setRotationPoint(0F, -3F, 0F); - setRotation(Head, 0F, 0F, 0F); + Head = new ModelRenderer(this, 0, 0); + Head.addBox(-4F, -8F, -4F, 8, 8, 8); + //Head.addCylinder(0, 0, 0, 8, 16, 24, 0, ModelRendererTurbo.MR_BOTTOM); + Head.setRotationPoint(0F, -3F, 0F); + setRotation(Head, 0F, 0F, 0F); - Hair = new ModelRenderer(this, 32, 0); - Hair.addBox(-4F, -4F, -4F, 8, 8, 8, 0.5F); - Hair.setRotationPoint(0F, -7F, 0F); - setRotation(Hair, 0F, 0F, 0F); + Hair = new ModelRenderer(this, 32, 0); + Hair.addBox(-4F, -4F, -4F, 8, 8, 8, 0.5F); + Hair.setRotationPoint(0F, -7F, 0F); + setRotation(Hair, 0F, 0F, 0F); - Neck = new ModelRenderer(this, 0, 0); - Neck.addBox(-1F, 0F, -1F, 2, 1, 2); - Neck.setRotationPoint(0F, -1F, 0F); - setRotation(Neck, 0F, 0F, 0F); + Neck = new ModelRenderer(this, 0, 0); + Neck.addBox(-1F, 0F, -1F, 2, 1, 2); + Neck.setRotationPoint(0F, -1F, 0F); + setRotation(Neck, 0F, 0F, 0F); - Torso = new ModelRenderer(this, 0, 16); - Torso.addBox(-1.5F, 0F, -1F, 3, 8, 2); - Torso.setRotationPoint(0F, -2F, 0F); - setRotation(Torso, 0F, 0F, 0F); + Torso = new ModelRenderer(this, 0, 16); + Torso.addBox(-1.5F, 0F, -1F, 3, 8, 2); + Torso.setRotationPoint(0F, -2F, 0F); + setRotation(Torso, 0F, 0F, 0F); - Breast = new ModelRenderer(this, 0, 4); - Breast.addBox(-1.5F, 0F, 0F, 3, 3, 1); - Breast.setRotationPoint(0F, 1F, -1F); - setRotation(Breast, -0.2617994F, 0F, 0F); - - Torso.addChild(Neck); - Torso.addChild(Breast); + Breast = new ModelRenderer(this, 0, 4); + Breast.addBox(-1.5F, 0F, 0F, 3, 3, 1); + Breast.setRotationPoint(0F, 1F, -1F); + setRotation(Breast, -0.2617994F, 0F, 0F); - Skirt = new ModelRendererTurbo(this, 22, 42, textureWidth, textureHeight); - Skirt.addTrapezoid(-3F, 0F, -2F, 6, 4, 4, 0, -0.5f, 4); - Skirt.setRotationPoint(0F, 5F, 0F); - setRotation(Skirt, 0F, 0F, 0F); + Torso.addChild(Neck); + Torso.addChild(Breast); - RightArm = new ModelRenderer(this, 14, 16); - RightArm.addBox(-1F, -1F, -1F, 2, 7, 2); - RightArm.setRotationPoint(-2.5F, -1F, 0.1F); - setRotation(RightArm, 0F, 0F, 0F); + Skirt = new ModelRendererTurbo(this, 22, 42, textureWidth, textureHeight); + Skirt.addTrapezoid(-3F, 0F, -2F, 6, 4, 4, 0, -0.5f, 4); + Skirt.setRotationPoint(0F, 5F, 0F); + setRotation(Skirt, 0F, 0F, 0F); - RightBand = new ModelRenderer(this, 10, 25); - RightBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3); - RightBand.setRotationPoint(0F, 0F, 0.1F); - setRotation(RightBand, 0F, 0F, 0F); + RightArm = new ModelRenderer(this, 14, 16); + RightArm.addBox(-1F, -1F, -1F, 2, 7, 2); + RightArm.setRotationPoint(-2.5F, -1F, 0.1F); + setRotation(RightArm, 0F, 0F, 0F); - RightSleeve = new ModelRendererTurbo(this, 10, 30, textureWidth, textureHeight); - RightSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4); - RightSleeve.setRotationPoint(0F, 6F, 1.0F); - setRotation(RightSleeve, 0F, 0F, 0F); + RightBand = new ModelRenderer(this, 10, 25); + RightBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3); + RightBand.setRotationPoint(0F, 0F, 0.1F); + setRotation(RightBand, 0F, 0F, 0F); - RightHand = new ModelRenderer(this, 12, 39); - RightHand.addBox(-1F, 0F, -1F, 2, 2, 2); - RightHand.setRotationPoint(0F, 12F, 0F); - setRotation(RightHand, 0F, 0F, 0F); + RightSleeve = new ModelRendererTurbo(this, 10, 30, textureWidth, textureHeight); + RightSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4); + RightSleeve.setRotationPoint(0F, 6F, 1.0F); + setRotation(RightSleeve, 0F, 0F, 0F); - RightArm.addChild(RightBand); - RightArm.addChild(RightSleeve); - RightArm.addChild(RightHand); + RightHand = new ModelRenderer(this, 12, 39); + RightHand.addBox(-1F, 0F, -1F, 2, 2, 2); + RightHand.setRotationPoint(0F, 12F, 0F); + setRotation(RightHand, 0F, 0F, 0F); - LeftArm = new ModelRenderer(this, 22, 16); - LeftArm.addBox(-1F, -1F, -1F, 2, 7, 2); - LeftArm.setRotationPoint(2.5F, -1F, 0.1F); - setRotation(LeftArm, 0F, 0F, 0F); + RightArm.addChild(RightBand); + RightArm.addChild(RightSleeve); + RightArm.addChild(RightHand); - LeftBand = new ModelRenderer(this, 22, 25); - LeftBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3); - LeftBand.setRotationPoint(0F, 0F, 0.1F); - setRotation(LeftBand, 0F, 0F, 0F); + LeftArm = new ModelRenderer(this, 22, 16); + LeftArm.addBox(-1F, -1F, -1F, 2, 7, 2); + LeftArm.setRotationPoint(2.5F, -1F, 0.1F); + setRotation(LeftArm, 0F, 0F, 0F); - LeftSleeve = new ModelRendererTurbo(this, 22, 30, textureWidth, textureHeight); - LeftSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4); - //LeftSleeve.addBox(-1.5F, 0F, -2.5F, 3, 6, 3); - LeftSleeve.setRotationPoint(0F, 6F, 1.0F); - setRotation(LeftSleeve, 0F, 0F, 0F); + LeftBand = new ModelRenderer(this, 22, 25); + LeftBand.addBox(-1.5F, 0F, -1.5F, 3, 2, 3); + LeftBand.setRotationPoint(0F, 0F, 0.1F); + setRotation(LeftBand, 0F, 0F, 0F); - LeftHand = new ModelRenderer(this, 20, 39); - LeftHand.addBox(-1F, 0F, -1F, 2, 2, 2); - LeftHand.setRotationPoint(0F, 12F, 0F); - setRotation(LeftHand, 0F, 0F, 0F); + LeftSleeve = new ModelRendererTurbo(this, 22, 30, textureWidth, textureHeight); + LeftSleeve.addTrapezoid(-1.5F, 0F, -2.5F, 3, 6, 3, 0, -0.5f, 4); + //LeftSleeve.addBox(-1.5F, 0F, -2.5F, 3, 6, 3); + LeftSleeve.setRotationPoint(0F, 6F, 1.0F); + setRotation(LeftSleeve, 0F, 0F, 0F); - LeftArm.addChild(LeftBand); - LeftArm.addChild(LeftSleeve); - LeftArm.addChild(LeftHand); + LeftHand = new ModelRenderer(this, 20, 39); + LeftHand.addBox(-1F, 0F, -1F, 2, 2, 2); + LeftHand.setRotationPoint(0F, 12F, 0F); + setRotation(LeftHand, 0F, 0F, 0F); - RightLeg = new ModelRenderer(this, 34, 16); - RightLeg.addBox(-1F, 0F, -1F, 2, 8, 2); - RightLeg.setRotationPoint(-1F, 6F, 0F); - setRotation(RightLeg, 0F, 0F, 0F); + LeftArm.addChild(LeftBand); + LeftArm.addChild(LeftSleeve); + LeftArm.addChild(LeftHand); - RightFoot = new ModelRenderer(this, 34, 28); - RightFoot.addBox(-1F, 0F, 0F, 2, 8, 2); - RightFoot.setRotationPoint(0F, 8F, -1F); - setRotation(RightFoot, 0F, 0F, 0F); + RightLeg = new ModelRenderer(this, 34, 16); + RightLeg.addBox(-1F, 0F, -1F, 2, 8, 2); + RightLeg.setRotationPoint(-1F, 6F, 0F); + setRotation(RightLeg, 0F, 0F, 0F); - LeftLeg = new ModelRenderer(this, 42, 16); - LeftLeg.addBox(-1F, 0F, -1F, 2, 8, 2); - LeftLeg.setRotationPoint(1F, 6F, 0F); - setRotation(LeftLeg, 0F, 0F, 0F); + RightFoot = new ModelRenderer(this, 34, 28); + RightFoot.addBox(-1F, 0F, 0F, 2, 8, 2); + RightFoot.setRotationPoint(0F, 8F, -1F); + setRotation(RightFoot, 0F, 0F, 0F); - LeftFoot = new ModelRenderer(this, 42, 28); - LeftFoot.addBox(-1F, 0F, 0F, 2, 8, 2); - LeftFoot.setRotationPoint(0F, 8F, -1F); - setRotation(LeftFoot, 0F, 0F, 0F); + LeftLeg = new ModelRenderer(this, 42, 16); + LeftLeg.addBox(-1F, 0F, -1F, 2, 8, 2); + LeftLeg.setRotationPoint(1F, 6F, 0F); + setRotation(LeftLeg, 0F, 0F, 0F); - LeftLeg.addChild(LeftFoot); - RightLeg.addChild(RightFoot); + LeftFoot = new ModelRenderer(this, 42, 28); + LeftFoot.addBox(-1F, 0F, 0F, 2, 8, 2); + LeftFoot.setRotationPoint(0F, 8F, -1F); + setRotation(LeftFoot, 0F, 0F, 0F); - //Right Wing - WingBaseRight = new ModelRenderer(this, 0, 41); - WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10); - WingBaseRight.setRotationPoint(-1F, 1F, 0F); - setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F); + LeftLeg.addChild(LeftFoot); + RightLeg.addChild(RightFoot); - WingEdgeRight = new ModelRenderer(this, 0, 53); //Texture position - WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size - WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position - setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians + //Right Wing + WingBaseRight = new ModelRenderer(this, 0, 41); + WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseRight.setRotationPoint(-1F, 1F, 0F); + setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F); - WingInsetRight = new ModelRenderer(this, 6, 53); - WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2); - WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F); - setRotation(WingInsetRight, 0.3490659F, 0F, 0F); + WingEdgeRight = new ModelRenderer(this, 0, 53); //Texture position + WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size + WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position + setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians - WingCenterRight = new ModelRenderer(this, 12, 53); - WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2); - WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F); - setRotation(WingCenterRight, 0.1745329F, 0F, 0F); + WingInsetRight = new ModelRenderer(this, 6, 53); + WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetRight, 0.3490659F, 0F, 0F); - WingFlangeRight = new ModelRenderer(this, 18, 53); - WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2); - WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F); - setRotation(WingFlangeRight, 0F, 0F, 0F); + WingCenterRight = new ModelRenderer(this, 12, 53); + WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterRight, 0.1745329F, 0F, 0F); - WingAuxRight = new ModelRenderer(this, 24, 53); - WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2); - WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F); - setRotation(WingAuxRight, -0.1745329F, 0F, 0F); + WingFlangeRight = new ModelRenderer(this, 18, 53); + WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeRight, 0F, 0F, 0F); - WingBaseRight.addChild(WingEdgeRight); - WingBaseRight.addChild(WingInsetRight); - WingBaseRight.addChild(WingCenterRight); - WingBaseRight.addChild(WingFlangeRight); - WingBaseRight.addChild(WingAuxRight); + WingAuxRight = new ModelRenderer(this, 24, 53); + WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxRight, -0.1745329F, 0F, 0F); - //Left Wing - WingBaseLeft = new ModelRenderer(this, 42, 41); - WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10); - WingBaseLeft.setRotationPoint(1F, 1F, 0F); - setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F); + WingBaseRight.addChild(WingEdgeRight); + WingBaseRight.addChild(WingInsetRight); + WingBaseRight.addChild(WingCenterRight); + WingBaseRight.addChild(WingFlangeRight); + WingBaseRight.addChild(WingAuxRight); - WingEdgeLeft = new ModelRenderer(this, 58, 53); - WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2); - WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F); - setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F); + //Left Wing + WingBaseLeft = new ModelRenderer(this, 42, 41); + WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseLeft.setRotationPoint(1F, 1F, 0F); + setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F); - WingInsetLeft = new ModelRenderer(this, 52, 53); - WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2); - WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F); - setRotation(WingInsetLeft, 0.3490659F, 0F, 0F); + WingEdgeLeft = new ModelRenderer(this, 58, 53); + WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2); + WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F); + setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F); - WingCenterLeft = new ModelRenderer(this, 46, 53); - WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2); - WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F); - setRotation(WingCenterLeft, 0.1745329F, 0F, 0F); + WingInsetLeft = new ModelRenderer(this, 52, 53); + WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetLeft, 0.3490659F, 0F, 0F); - WingFlangeLeft = new ModelRenderer(this, 40, 53); - WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2); - WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F); - setRotation(WingFlangeLeft, 0F, 0F, 0F); + WingCenterLeft = new ModelRenderer(this, 46, 53); + WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterLeft, 0.1745329F, 0F, 0F); - WingAuxLeft = new ModelRenderer(this, 34, 53); - WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2); - WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F); - setRotation(WingAuxLeft, -0.1745329F, 0F, 0F); + WingFlangeLeft = new ModelRenderer(this, 40, 53); + WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeLeft, 0F, 0F, 0F); - WingBaseLeft.addChild(WingEdgeLeft); - WingBaseLeft.addChild(WingInsetLeft); - WingBaseLeft.addChild(WingCenterLeft); - WingBaseLeft.addChild(WingFlangeLeft); - WingBaseLeft.addChild(WingAuxLeft); - } + WingAuxLeft = new ModelRenderer(this, 34, 53); + WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxLeft, -0.1745329F, 0F, 0F); - public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - Head.render(f5); - Hair.render(f5); - //Neck.render(f5); - Torso.render(f5); - //Breast.render(f5); - Skirt.render(f5); - RightArm.render(f5); - LeftArm.render(f5); - RightLeg.render(f5); - LeftLeg.render(f5); - WingBaseRight.render(f5); - WingBaseLeft.render(f5); - } + WingBaseLeft.addChild(WingEdgeLeft); + WingBaseLeft.addChild(WingInsetLeft); + WingBaseLeft.addChild(WingCenterLeft); + WingBaseLeft.addChild(WingFlangeLeft); + WingBaseLeft.addChild(WingAuxLeft); + } - private void setRotation (ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } + public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Head.render(f5); + Hair.render(f5); + //Neck.render(f5); + Torso.render(f5); + //Breast.render(f5); + Skirt.render(f5); + RightArm.render(f5); + LeftArm.render(f5); + RightLeg.render(f5); + LeftLeg.render(f5); + WingBaseRight.render(f5); + WingBaseLeft.render(f5); + } - public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - } + private void setRotation (ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } } diff --git a/mods/tinker/tconstruct/client/entity/SkylaRender.java b/mods/tinker/tconstruct/client/entity/SkylaRender.java index c5f5022b..1a66261d 100644 --- a/mods/tinker/tconstruct/client/entity/SkylaRender.java +++ b/mods/tinker/tconstruct/client/entity/SkylaRender.java @@ -21,13 +21,13 @@ public class SkylaRender extends RenderLiving /** * A method used to render a creeper's powered form as a pass model. */ - protected int renderCreeperPassModel(Skyla par1EntityCreeper, int par2, float par3) + protected int renderCreeperPassModel (Skyla par1EntityCreeper, int par2, float par3) { return -1; } - protected int func_77061_b(Skyla par1EntityCreeper, int par2, float par3) + protected int func_77061_b (Skyla par1EntityCreeper, int par2, float par3) { return -1; } @@ -44,7 +44,7 @@ public class SkylaRender extends RenderLiving /** * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime */ - protected int getColorMultiplier(EntityLiving par1EntityLiving, float par2, float par3) + protected int getColorMultiplier (EntityLiving par1EntityLiving, float par2, float par3) { return super.getColorMultiplier(par1EntityLiving, par2, par3); } @@ -52,13 +52,13 @@ public class SkylaRender extends RenderLiving /** * Queries whether should render the specified pass or not. */ - protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int shouldRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.renderCreeperPassModel((Skyla)par1EntityLiving, par2, par3); + return this.renderCreeperPassModel((Skyla) par1EntityLiving, par2, par3); } - protected int inheritRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int inheritRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.func_77061_b((Skyla)par1EntityLiving, par2, par3); + return this.func_77061_b((Skyla) par1EntityLiving, par2, par3); } } diff --git a/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java b/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java index 1f115e22..c6147977 100644 --- a/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java +++ b/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java @@ -24,7 +24,7 @@ public class SlimeCloneRender extends RenderLiving /** * Determines whether Slime Render should pass or not. */ - protected int shouldSlimeRenderPass(SlimeClone blueSlime, int par2, float par3) + protected int shouldSlimeRenderPass (SlimeClone blueSlime, int par2, float par3) { if (blueSlime.isInvisible()) { @@ -53,7 +53,7 @@ public class SlimeCloneRender extends RenderLiving /** * sets the scale for the slime based on getSlimeSize in EdibleSlime */ - protected void scaleSlime(SlimeClone slimeClone, float par2) + protected void scaleSlime (SlimeClone slimeClone, float par2) { float f1 = slimeClone.getSlimeSize(); float f2 = (slimeClone.sizeHeight + (slimeClone.sizeFactor - slimeClone.sizeHeight) * par2) / (f1 * 0.5F + 1.0F); @@ -65,27 +65,27 @@ public class SlimeCloneRender extends RenderLiving * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ - protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) + protected void preRenderCallback (EntityLiving par1EntityLiving, float par2) { - this.scaleSlime((SlimeClone)par1EntityLiving, par2); + this.scaleSlime((SlimeClone) par1EntityLiving, par2); } /** * Queries whether should render the specified pass or not. */ - protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int shouldRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.shouldSlimeRenderPass((SlimeClone)par1EntityLiving, par2, par3); + return this.shouldSlimeRenderPass((SlimeClone) par1EntityLiving, par2, par3); } - - protected void func_98191_a(SlimeClone slime) + + protected void func_98191_a (SlimeClone slime) { this.loadDownloadableImageTexture(slime.skinUrl, slime.getTexture()); } - + @Override - protected void func_98190_a(EntityLiving par1EntityLiving) + protected void func_98190_a (EntityLiving par1EntityLiving) { - this.func_98191_a((SlimeClone)par1EntityLiving); + this.func_98191_a((SlimeClone) par1EntityLiving); } } diff --git a/mods/tinker/tconstruct/client/entity/SlimeModel.java b/mods/tinker/tconstruct/client/entity/SlimeModel.java index a2b3a4a1..87ca9fca 100644 --- a/mods/tinker/tconstruct/client/entity/SlimeModel.java +++ b/mods/tinker/tconstruct/client/entity/SlimeModel.java @@ -42,7 +42,7 @@ public class SlimeModel extends ModelBase /** * Sets the models various rotation angles then renders the model. */ - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) + public void render (Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); this.slimeBodies.render(par7); diff --git a/mods/tinker/tconstruct/client/entity/SlimeRender.java b/mods/tinker/tconstruct/client/entity/SlimeRender.java index b39b00be..0714e55f 100644 --- a/mods/tinker/tconstruct/client/entity/SlimeRender.java +++ b/mods/tinker/tconstruct/client/entity/SlimeRender.java @@ -23,22 +23,22 @@ public class SlimeRender extends RenderLiving this.scaleAmount = par2ModelBase; } - public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) + public void doRenderLiving (EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { - super.doRenderLiving(par1EntityLiving, par2, par4, par6, par8, par9); - renderBossHealth((BlueSlime) par1EntityLiving); + super.doRenderLiving(par1EntityLiving, par2, par4, par6, par8, par9); + renderBossHealth((BlueSlime) par1EntityLiving); } - - public void renderBossHealth(BlueSlime slime) + + public void renderBossHealth (BlueSlime slime) { - if (slime.getSlimeSize() >= 8) - BossStatus.func_82824_a(slime, true); + if (slime.getSlimeSize() >= 8) + BossStatus.func_82824_a(slime, true); } - + /** * Determines whether Slime Render should pass or not. */ - protected int shouldSlimeRenderPass(BlueSlime blueSlime, int par2, float par3) + protected int shouldSlimeRenderPass (BlueSlime blueSlime, int par2, float par3) { if (blueSlime.isInvisible()) { @@ -67,9 +67,9 @@ public class SlimeRender extends RenderLiving /** * sets the scale for the slime based on getSlimeSize in EdibleSlime */ - protected void scaleSlime(BlueSlime par1EdibleSlime, float par2) + protected void scaleSlime (BlueSlime par1EdibleSlime, float par2) { - float f1 = (float)par1EdibleSlime.getSlimeSize(); + float f1 = (float) par1EdibleSlime.getSlimeSize(); float f2 = (par1EdibleSlime.sizeHeight + (par1EdibleSlime.sizeFactor - par1EdibleSlime.sizeHeight) * par2) / (f1 * 0.5F + 1.0F); float f3 = 1.0F / (f2 + 1.0F); GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1); @@ -79,16 +79,16 @@ public class SlimeRender extends RenderLiving * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: * entityLiving, partialTickTime */ - protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) + protected void preRenderCallback (EntityLiving par1EntityLiving, float par2) { - this.scaleSlime((BlueSlime)par1EntityLiving, par2); + this.scaleSlime((BlueSlime) par1EntityLiving, par2); } /** * Queries whether should render the specified pass or not. */ - protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + protected int shouldRenderPass (EntityLiving par1EntityLiving, int par2, float par3) { - return this.shouldSlimeRenderPass((BlueSlime)par1EntityLiving, par2, par3); + return this.shouldSlimeRenderPass((BlueSlime) par1EntityLiving, par2, par3); } } diff --git a/mods/tinker/tconstruct/client/entity/projectile/DaggerRenderOld.java b/mods/tinker/tconstruct/client/entity/projectile/DaggerRenderOld.java index f95f8720..1632b6fa 100644 --- a/mods/tinker/tconstruct/client/entity/projectile/DaggerRenderOld.java +++ b/mods/tinker/tconstruct/client/entity/projectile/DaggerRenderOld.java @@ -1,4 +1,5 @@ package mods.tinker.tconstruct.client.entity.projectile; + import java.util.Random; import mods.tinker.tconstruct.entity.projectile.DaggerEntity; @@ -14,19 +15,19 @@ public class DaggerRenderOld extends RangedRenderBase System.out.println("new renderer"); shadowSize = 0.15F; shadowOpaque = 0.75F; - daggerRotation = (float)d; + daggerRotation = (float) d; } - public void doRender(DaggerEntity dagger, double d, double d1, double d2, float f, float f1) + public void doRender (DaggerEntity dagger, double d, double d1, double d2, float f, float f1) { - if((new Random()).nextFloat() > 0.8) + if ((new Random()).nextFloat() > 0.8) System.out.println("rendering dagger " + dagger.texID + " " + dagger.tex2ID); GL11.glPushMatrix(); - GL11.glTranslatef((float)d, (float)d1, (float)d2); + GL11.glTranslatef((float) d, (float) d1, (float) d2); GL11.glRotatef(f, 0.0F, 1.0F, 0.0F); float f2 = dagger.prevRotationPitch + (dagger.rotationPitch - dagger.prevRotationPitch) * f1; GL11.glRotatef(-f2, 1.0F, 0.0F, 0.0F); - if(!dagger.onGround) + if (!dagger.onGround) { float f3 = dagger.prevBoomerangRotation + (dagger.boomerangRotation - dagger.prevBoomerangRotation) * f1 * 1.1F; GL11.glRotatef(f3, 1.0F, 0.0F, 0.0F); @@ -35,23 +36,23 @@ public class DaggerRenderOld extends RangedRenderBase loadTexture("/infi2x2/daggers.png"); Tessellator tessellator = Tessellator.instance; int i = 0;//dagger.getTexID(); - float f4 = ((float)((i % 16) * 16) + 0.0F) / 256F; - float f5 = ((float)((i % 16) * 16) + 15.99F) / 256F; - float f6 = ((float)((i / 16) * 16) + 0.0F) / 256F; - float f7 = ((float)((i / 16) * 16) + 15.99F) / 256F; + float f4 = ((float) ((i % 16) * 16) + 0.0F) / 256F; + float f5 = ((float) ((i % 16) * 16) + 15.99F) / 256F; + float f6 = ((float) ((i / 16) * 16) + 0.0F) / 256F; + float f7 = ((float) ((i / 16) * 16) + 15.99F) / 256F; float f8 = 1.0F; GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/); float f9 = 0.0625F; GL11.glTranslatef(-0.5F, 0.0F, -0.5F); renderItem(tessellator, f4, f5, f6, f7, f8, f9); GL11.glPopMatrix(); - + } @Override - public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) + public void doRender (Entity entity, double d, double d1, double d2, float f, float f1) { - doRender((DaggerEntity)entity, d, d1, d2, f, f1); + doRender((DaggerEntity) entity, d, d1, d2, f, f1); } public float daggerRotation; diff --git a/mods/tinker/tconstruct/client/entity/projectile/LaunchedItemRender.java b/mods/tinker/tconstruct/client/entity/projectile/LaunchedItemRender.java index e14e82c3..2e95f84e 100644 --- a/mods/tinker/tconstruct/client/entity/projectile/LaunchedItemRender.java +++ b/mods/tinker/tconstruct/client/entity/projectile/LaunchedItemRender.java @@ -38,14 +38,14 @@ public class LaunchedItemRender extends Render * (Render> 16 & 255) / 255.0F; - float f3 = (float)(i >> 8 & 255) / 255.0F; - float f4 = (float)(i & 255) / 255.0F; + int i = PotionHelper.func_77915_a(((LaunchedPotion) par1Entity).getPotionDamage(), false); + float f2 = (float) (i >> 16 & 255) / 255.0F; + float f3 = (float) (i >> 8 & 255) / 255.0F; + float f4 = (float) (i & 255) / 255.0F; GL11.glColor3f(f2, f3, f4); GL11.glPushMatrix(); this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents")); @@ -70,7 +70,7 @@ public class LaunchedItemRender extends Render } } - private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) + private void func_77026_a (Tessellator par1Tessellator, Icon par2Icon) { float f = par2Icon.getMinU(); float f1 = par2Icon.getMaxU(); @@ -83,10 +83,10 @@ public class LaunchedItemRender extends Render GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); - par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); - par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); - par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); - par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); + par1Tessellator.addVertexWithUV((double) (0.0F - f5), (double) (0.0F - f6), 0.0D, (double) f, (double) f3); + par1Tessellator.addVertexWithUV((double) (f4 - f5), (double) (0.0F - f6), 0.0D, (double) f1, (double) f3); + par1Tessellator.addVertexWithUV((double) (f4 - f5), (double) (f4 - f6), 0.0D, (double) f1, (double) f2); + par1Tessellator.addVertexWithUV((double) (0.0F - f5), (double) (f4 - f6), 0.0D, (double) f, (double) f2); par1Tessellator.draw(); } } diff --git a/mods/tinker/tconstruct/client/entity/projectile/RangedRenderBase.java b/mods/tinker/tconstruct/client/entity/projectile/RangedRenderBase.java index be33f052..0d5f4eaf 100644 --- a/mods/tinker/tconstruct/client/entity/projectile/RangedRenderBase.java +++ b/mods/tinker/tconstruct/client/entity/projectile/RangedRenderBase.java @@ -1,4 +1,5 @@ package mods.tinker.tconstruct.client.entity.projectile; + import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; @@ -9,19 +10,18 @@ public class RangedRenderBase extends Render { } - public void doRender(Entity entity, double d, double d1, double d2, - float f, float f1) + public void doRender (Entity entity, double d, double d1, double d2, float f, float f1) { } - public void renderItem(Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) + public void renderItem (Tessellator tessellator, float f, float f1, float f2, float f3, float f4, float f5) { tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, 1.0F); - tessellator.addVertexWithUV(0.0D, 0.0D - (double)f5, 0.0D, f1, f3); - tessellator.addVertexWithUV(f4, 0.0D - (double)f5, 0.0D, f, f3); - tessellator.addVertexWithUV(f4, 0.0D - (double)f5, 1.0D, f, f2); - tessellator.addVertexWithUV(0.0D, 0.0D - (double)f5, 1.0D, f1, f2); + tessellator.addVertexWithUV(0.0D, 0.0D - (double) f5, 0.0D, f1, f3); + tessellator.addVertexWithUV(f4, 0.0D - (double) f5, 0.0D, f, f3); + tessellator.addVertexWithUV(f4, 0.0D - (double) f5, 1.0D, f, f2); + tessellator.addVertexWithUV(0.0D, 0.0D - (double) f5, 1.0D, f1, f2); tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 0.0F, -1F); @@ -32,9 +32,9 @@ public class RangedRenderBase extends Render tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(-1F, 0.0F, 0.0F); - for(int i = 0; i < 16; i++) + for (int i = 0; i < 16; i++) { - float f6 = (float)i / 16F; + float f6 = (float) i / 16F; float f10 = (f1 + (f - f1) * f6) - 0.001953125F; float f14 = f4 * f6 + 0.0625F; tessellator.addVertexWithUV(f14, 0.0F - f5, 0.0D, f10, f3); @@ -46,9 +46,9 @@ public class RangedRenderBase extends Render tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(1.0F, 0.0F, 0.0F); - for(int j = 0; j < 16; j++) + for (int j = 0; j < 16; j++) { - float f7 = (float)j / 16F; + float f7 = (float) j / 16F; float f11 = (f1 + (f - f1) * f7) - 0.001953125F; float f15 = f4 * f7; tessellator.addVertexWithUV(f15, 0.0F - f5, 1.0D, f11, f2); @@ -60,9 +60,9 @@ public class RangedRenderBase extends Render tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F, 0.0F); - for(int k = 0; k < 16; k++) + for (int k = 0; k < 16; k++) { - float f8 = (float)k / 16F; + float f8 = (float) k / 16F; float f12 = (f3 + (f2 - f3) * f8) - 0.001953125F; float f16 = f4 * f8; tessellator.addVertexWithUV(0.0D, 0.0D, f16, f1, f12); @@ -74,9 +74,9 @@ public class RangedRenderBase extends Render tessellator.draw(); tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, -1F, 0.0F); - for(int l = 0; l < 16; l++) + for (int l = 0; l < 16; l++) { - float f9 = (float)l / 16F; + float f9 = (float) l / 16F; float f13 = (f3 + (f2 - f3) * f9) - 0.001953125F; float f17 = f4 * f9 + 0.0625F; tessellator.addVertexWithUV(f4, 0.0D, f17, f, f13); diff --git a/mods/tinker/tconstruct/client/gui/DrawbridgeGui.java b/mods/tinker/tconstruct/client/gui/DrawbridgeGui.java index 13dfda92..25b00082 100644 --- a/mods/tinker/tconstruct/client/gui/DrawbridgeGui.java +++ b/mods/tinker/tconstruct/client/gui/DrawbridgeGui.java @@ -18,14 +18,14 @@ public class DrawbridgeGui extends GuiContainer logic = frypan; } - protected void drawGuiContainerForegroundLayer(int par1, int par2) + protected void drawGuiContainerForegroundLayer (int par1, int par2) { //fontRenderer.drawString(StatCollector.translateToLocal("aggregator.glowstone"), 60, 6, 0x404040); fontRenderer.drawString("Drawbridge", 8, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 2, 0x404040); } - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture("/mods/tinker/textures/gui/drawbridge.png"); diff --git a/mods/tinker/tconstruct/client/gui/FrypanGui.java b/mods/tinker/tconstruct/client/gui/FrypanGui.java index 1f973044..d35a16c4 100644 --- a/mods/tinker/tconstruct/client/gui/FrypanGui.java +++ b/mods/tinker/tconstruct/client/gui/FrypanGui.java @@ -18,13 +18,13 @@ public class FrypanGui extends GuiContainer logic = frypan; } - protected void drawGuiContainerForegroundLayer(int par1, int par2) + protected void drawGuiContainerForegroundLayer (int par1, int par2) { fontRenderer.drawString(StatCollector.translateToLocal("crafters.Frypan"), 60, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 2, 0x404040); } - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture("/mods/tinker/textures/gui/frypan.png"); diff --git a/mods/tinker/tconstruct/client/gui/GlowstoneAggregatorGui.java b/mods/tinker/tconstruct/client/gui/GlowstoneAggregatorGui.java index 3287b974..ad2f7968 100644 --- a/mods/tinker/tconstruct/client/gui/GlowstoneAggregatorGui.java +++ b/mods/tinker/tconstruct/client/gui/GlowstoneAggregatorGui.java @@ -18,14 +18,14 @@ public class GlowstoneAggregatorGui extends GuiContainer logic = frypan; } - protected void drawGuiContainerForegroundLayer(int par1, int par2) + protected void drawGuiContainerForegroundLayer (int par1, int par2) { //fontRenderer.drawString(StatCollector.translateToLocal("aggregator.glowstone"), 60, 6, 0x404040); fontRenderer.drawString("Glowstone Aggregator", 8, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 2, 0x404040); } - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture("/mods/tinker/textures/gui/aggregator.png"); diff --git a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java index 350365eb..dc8b4105 100644 --- a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java +++ b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java @@ -32,7 +32,7 @@ public class GuiButtonTool extends GuiButton /** * Draws this button to the screen. */ - public void drawButton(Minecraft mc, int mouseX, int mouseY) + public void drawButton (Minecraft mc, int mouseX, int mouseY) { if (this.drawButton) { @@ -43,8 +43,8 @@ public class GuiButtonTool extends GuiButton this.field_82253_i = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; int var5 = this.getHoverState(this.field_82253_i); int index = 18 * getHoverState(field_82253_i); - this.drawTexturedModalRect(this.xPosition, this.yPosition, 144 + index*2, 216, 18, 18); - this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX*18, textureY*18, 18, 18); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 144 + index * 2, 216, 18, 18); + this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX * 18, textureY * 18, 18, 18); } } } diff --git a/mods/tinker/tconstruct/client/gui/GuiManual.java b/mods/tinker/tconstruct/client/gui/GuiManual.java index 39038a25..3422d2e2 100644 --- a/mods/tinker/tconstruct/client/gui/GuiManual.java +++ b/mods/tinker/tconstruct/client/gui/GuiManual.java @@ -181,8 +181,8 @@ public class GuiManual extends GuiScreen { return mc; } - - public boolean doesGuiPauseGame() + + public boolean doesGuiPauseGame () { return false; } diff --git a/mods/tinker/tconstruct/client/gui/InventoryTab.java b/mods/tinker/tconstruct/client/gui/InventoryTab.java index fe747693..228a4630 100644 --- a/mods/tinker/tconstruct/client/gui/InventoryTab.java +++ b/mods/tinker/tconstruct/client/gui/InventoryTab.java @@ -30,33 +30,33 @@ public class InventoryTab extends GuiButton /** * Draws this button to the screen. */ - public void drawButton(Minecraft mc, int mouseX, int mouseY) + public void drawButton (Minecraft mc, int mouseX, int mouseY) { if (this.drawButton) - { + { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(texture); - + int yTexPos = this.enabled ? 0 : 32; int ySize = this.enabled ? 28 : 32; - - this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX*28, yTexPos, 28, ySize); + + this.drawTexturedModalRect(this.xPosition, this.yPosition, textureX * 28, yTexPos, 28, ySize); RenderHelper.enableGUIStandardItemLighting(); this.zLevel = 100.0F; TProxyClient.itemRenderer.zLevel = 100.0F; GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - TProxyClient.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition+6, yPosition+8); - TProxyClient.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition+6, yPosition+8); + TProxyClient.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); + TProxyClient.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8); GL11.glDisable(GL11.GL_LIGHTING); TProxyClient.itemRenderer.zLevel = 0.0F; this.zLevel = 0.0F; RenderHelper.disableStandardItemLighting(); } } - - public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) + + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) { boolean inWindow = this.enabled && this.drawButton && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; if (inWindow) diff --git a/mods/tinker/tconstruct/client/gui/KnapsackGui.java b/mods/tinker/tconstruct/client/gui/KnapsackGui.java index 2a376034..af01525d 100644 --- a/mods/tinker/tconstruct/client/gui/KnapsackGui.java +++ b/mods/tinker/tconstruct/client/gui/KnapsackGui.java @@ -28,31 +28,31 @@ public class KnapsackGui extends GuiContainer inv = inventoryplayer; stats = holder; } - - public void initGui() + + public void initGui () { super.initGui(); - + int cornerX = guiLeft; int cornerY = (this.height - this.ySize) / 2; this.buttonList.clear(); InventoryTab tab = new InventoryTab(2, cornerX, cornerY - 28, new ItemStack(Block.workbench), 0); this.buttonList.add(tab); - tab = new InventoryTab(3, cornerX+28, cornerY - 28, new ItemStack(Item.plateDiamond), 1); + tab = new InventoryTab(3, cornerX + 28, cornerY - 28, new ItemStack(Item.plateDiamond), 1); this.buttonList.add(tab); - tab = new InventoryTab(4, cornerX+56, cornerY - 28, new ItemStack(TContent.knapsack), 1); + tab = new InventoryTab(4, cornerX + 56, cornerY - 28, new ItemStack(TContent.knapsack), 1); tab.enabled = false; this.buttonList.add(tab); } - protected void drawGuiContainerForegroundLayer(int par1, int par2) + protected void drawGuiContainerForegroundLayer (int par1, int par2) { fontRenderer.drawString(StatCollector.translateToLocal("inventory.knapsack"), 8, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 4, 0x404040); } - - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + + protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture("/mods/tinker/textures/gui/knapsack.png"); @@ -60,7 +60,7 @@ public class KnapsackGui extends GuiContainer int cornerY = (height - ySize) / 2; drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize); } - + /*protected void keyTyped(char par1, int par2) { if (par2 == TControls.armorKey.keyCode) diff --git a/mods/tinker/tconstruct/client/gui/PatternChestGui.java b/mods/tinker/tconstruct/client/gui/PatternChestGui.java index 5e4ef710..d05d2783 100644 --- a/mods/tinker/tconstruct/client/gui/PatternChestGui.java +++ b/mods/tinker/tconstruct/client/gui/PatternChestGui.java @@ -20,13 +20,13 @@ public class PatternChestGui extends GuiContainer ySize = 168; } - protected void drawGuiContainerForegroundLayer(int par1, int par2) + protected void drawGuiContainerForegroundLayer (int par1, int par2) { fontRenderer.drawString(StatCollector.translateToLocal("inventory.PatternChest"), 60, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 17, (ySize - 96) + 2, 0x404040); } - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchest.png"); diff --git a/mods/tinker/tconstruct/client/gui/ToolForgeGui.java b/mods/tinker/tconstruct/client/gui/ToolForgeGui.java index 0e084c49..833749d4 100644 --- a/mods/tinker/tconstruct/client/gui/ToolForgeGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolForgeGui.java @@ -65,15 +65,16 @@ public class ToolForgeGui extends ToolStationGui for (int iter = 0; iter < TConstructClientRegistry.tierTwoButtons.size(); iter++) { ToolGuiElement element = TConstructClientRegistry.tierTwoButtons.get(iter); - GuiButtonTool button = new GuiButtonTool(iter+1, cornerX - 110 + 22 * ((iter + 1) % 5), cornerY + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, element.texture, element); + GuiButtonTool button = new GuiButtonTool(iter + 1, cornerX - 110 + 22 * ((iter + 1) % 5), cornerY + 22 * ((iter + 1) / 5), element.buttonIconX, element.buttonIconY, element.texture, + element); this.buttonList.add(button); } for (int iter = 1; iter < TConstructClientRegistry.toolButtons.size(); iter++) { ToolGuiElement element = TConstructClientRegistry.toolButtons.get(iter); - GuiButtonTool button = new GuiButtonTool(iter+offset, cornerX - 110 + 22 * ((iter + offset) % 5), cornerY + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY, element.texture, - element); + GuiButtonTool button = new GuiButtonTool(iter + offset, cornerX - 110 + 22 * ((iter + offset) % 5), cornerY + 22 * ((iter + offset) / 5), element.buttonIconX, element.buttonIconY, + element.texture, element); this.buttonList.add(button); } } @@ -91,7 +92,7 @@ public class ToolForgeGui extends ToolStationGui title = "\u00A7n" + b.element.title; body = b.element.body; } - + @Override void resetGui () { diff --git a/mods/tinker/tconstruct/client/gui/ToolStationGui.java b/mods/tinker/tconstruct/client/gui/ToolStationGui.java index 2fe725c5..6ff86404 100644 --- a/mods/tinker/tconstruct/client/gui/ToolStationGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolStationGui.java @@ -260,22 +260,22 @@ public class ToolStationGui extends NewContainerGui offset++; String heart = attack == 2 ? " Heart" : " Hearts"; if (attack % 2 == 0) - this.fontRenderer.drawString("- "+attack / 2 + heart, xSize + 8, base + offset * 10, 0xffffff); + this.fontRenderer.drawString("- " + attack / 2 + heart, xSize + 8, base + offset * 10, 0xffffff); else - this.fontRenderer.drawString("- "+attack / 2f + heart, xSize + 8, base + offset * 10, 0xffffff); + this.fontRenderer.drawString("- " + attack / 2f + heart, xSize + 8, base + offset * 10, 0xffffff); offset++; int minAttack = attack; - int maxAttack = attack *2; + int maxAttack = attack * 2; heart = " Hearts"; this.fontRenderer.drawString("Shortbow Attack:", xSize + 8, base + offset * 10, 0xffffff); offset++; - this.fontRenderer.drawString(df.format(minAttack / 2f)+"-"+df.format(maxAttack / 2f)+heart, xSize + 8, base + offset * 10, 0xffffff); + this.fontRenderer.drawString(df.format(minAttack / 2f) + "-" + df.format(maxAttack / 2f) + heart, xSize + 8, base + offset * 10, 0xffffff); offset++; offset++; - + this.fontRenderer.drawString("Weight: " + df.format(mass), xSize + 8, base + offset * 10, 0xffffff); offset++; - this.fontRenderer.drawString("Accuracy: " + df.format(accuracy-4)+"%", xSize + 8, base + offset * 10, 0xffffff); + this.fontRenderer.drawString("Accuracy: " + df.format(accuracy - 4) + "%", xSize + 8, base + offset * 10, 0xffffff); offset++; /*this.fontRenderer.drawString("Chance to break: " + df.format(shatter)+"%", xSize + 8, base + offset * 10, 0xffffff); offset++;*/ diff --git a/mods/tinker/tconstruct/client/gui/TurnPageButton.java b/mods/tinker/tconstruct/client/gui/TurnPageButton.java index 772f6ca5..dced38dc 100644 --- a/mods/tinker/tconstruct/client/gui/TurnPageButton.java +++ b/mods/tinker/tconstruct/client/gui/TurnPageButton.java @@ -25,7 +25,7 @@ public class TurnPageButton extends GuiButton /** * Draws this button to the screen. */ - public void drawButton(Minecraft par1Minecraft, int par2, int par3) + public void drawButton (Minecraft par1Minecraft, int par2, int par3) { if (this.drawButton) { diff --git a/mods/tinker/tconstruct/client/pages/BlankPage.java b/mods/tinker/tconstruct/client/pages/BlankPage.java index e16b48d2..ca860529 100644 --- a/mods/tinker/tconstruct/client/pages/BlankPage.java +++ b/mods/tinker/tconstruct/client/pages/BlankPage.java @@ -2,7 +2,6 @@ package mods.tinker.tconstruct.client.pages; import org.w3c.dom.Element; - public class BlankPage extends BookPage { diff --git a/mods/tinker/tconstruct/client/pages/BlockCastPage.java b/mods/tinker/tconstruct/client/pages/BlockCastPage.java index a4ee4d24..f32c4d37 100644 --- a/mods/tinker/tconstruct/client/pages/BlockCastPage.java +++ b/mods/tinker/tconstruct/client/pages/BlockCastPage.java @@ -51,9 +51,9 @@ public class BlockCastPage extends BookPage RenderHelper.disableStandardItemLighting(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); manual.fonts.drawString("Ingredients:", localWidth + 120, localHeight + 32, 0); - manual.fonts.drawString("- "+icons[1].getDisplayName(), localWidth + 120, localHeight + 42, 0); + manual.fonts.drawString("- " + icons[1].getDisplayName(), localWidth + 120, localHeight + 42, 0); if (icons[2] != null) - manual.fonts.drawString("- "+icons[2].getDisplayName(), localWidth + 120, localHeight + 50, 0); + manual.fonts.drawString("- " + icons[2].getDisplayName(), localWidth + 120, localHeight + 50, 0); } public void renderBackgroundLayer (int localWidth, int localHeight) diff --git a/mods/tinker/tconstruct/client/pages/BookPage.java b/mods/tinker/tconstruct/client/pages/BookPage.java index 2dd4e76a..e527647a 100644 --- a/mods/tinker/tconstruct/client/pages/BookPage.java +++ b/mods/tinker/tconstruct/client/pages/BookPage.java @@ -8,12 +8,18 @@ public abstract class BookPage { protected GuiManual manual; protected int side; - public void init(GuiManual manual, int side) + + public void init (GuiManual manual, int side) { this.manual = manual; this.side = side; } - public abstract void readPageFromXML(Element element); - public void renderBackgroundLayer(int localwidth, int localheight) {} - public abstract void renderContentLayer(int localwidth, int localheight); + + public abstract void readPageFromXML (Element element); + + public void renderBackgroundLayer (int localwidth, int localheight) + { + } + + public abstract void renderContentLayer (int localwidth, int localheight); } diff --git a/mods/tinker/tconstruct/client/pages/CraftingPage.java b/mods/tinker/tconstruct/client/pages/CraftingPage.java index a9b075ba..f7e985ab 100644 --- a/mods/tinker/tconstruct/client/pages/CraftingPage.java +++ b/mods/tinker/tconstruct/client/pages/CraftingPage.java @@ -16,6 +16,7 @@ public class CraftingPage extends BookPage String text; String size; ItemStack[] icons; + @Override public void readPageFromXML (Element element) { @@ -40,7 +41,7 @@ public class CraftingPage extends BookPage if (size.equals("three")) drawCraftingPage(text, icons, 3, localWidth + (side != 1 ? 6 : 0), localHeight + 12); } - + public void drawCraftingPage (String info, ItemStack[] icons, int recipeSize, int localWidth, int localHeight) { if (info != null) @@ -81,7 +82,7 @@ public class CraftingPage extends BookPage GL11.glDisable(GL12.GL_RESCALE_NORMAL); } - public void renderBackgroundLayer(int localwidth, int localheight) + public void renderBackgroundLayer (int localwidth, int localheight) { if (size.equals("two")) drawBackground(2, localwidth, localheight + 12); diff --git a/mods/tinker/tconstruct/client/pages/FurnacePage.java b/mods/tinker/tconstruct/client/pages/FurnacePage.java index 32150ff8..56a5f188 100644 --- a/mods/tinker/tconstruct/client/pages/FurnacePage.java +++ b/mods/tinker/tconstruct/client/pages/FurnacePage.java @@ -15,6 +15,7 @@ public class FurnacePage extends BookPage { String text; ItemStack[] icons; + @Override public void readPageFromXML (Element element) { @@ -51,7 +52,7 @@ public class FurnacePage extends BookPage GL11.glDisable(GL12.GL_RESCALE_NORMAL); } - public void renderBackgroundLayer(int localWidth, int localHeight) + public void renderBackgroundLayer (int localWidth, int localHeight) { manual.getMC().renderEngine.bindTexture("/mods/tinker/textures/gui/bookfurnace.png"); manual.drawTexturedModalRect(localWidth + 32, localHeight + 32, 0, 0, 111, 114); diff --git a/mods/tinker/tconstruct/client/pages/MaterialPage.java b/mods/tinker/tconstruct/client/pages/MaterialPage.java index 7ece1e89..ea86bf03 100644 --- a/mods/tinker/tconstruct/client/pages/MaterialPage.java +++ b/mods/tinker/tconstruct/client/pages/MaterialPage.java @@ -19,6 +19,7 @@ public class MaterialPage extends BookPage ItemStack[] icons; String iconText; ToolMaterial material; + @Override public void readPageFromXML (Element element) { diff --git a/mods/tinker/tconstruct/client/pages/ModifierPage.java b/mods/tinker/tconstruct/client/pages/ModifierPage.java index fb737d18..83ee74ed 100644 --- a/mods/tinker/tconstruct/client/pages/ModifierPage.java +++ b/mods/tinker/tconstruct/client/pages/ModifierPage.java @@ -15,6 +15,7 @@ public class ModifierPage extends BookPage { String type; ItemStack[] icons; + @Override public void readPageFromXML (Element element) { @@ -52,7 +53,7 @@ public class ModifierPage extends BookPage GL11.glDisable(GL12.GL_RESCALE_NORMAL); } - public void renderBackgroundLayer(int localWidth, int localHeight) + public void renderBackgroundLayer (int localWidth, int localHeight) { manual.getMC().renderEngine.bindTexture("/mods/tinker/textures/gui/bookmodify.png"); manual.drawTexturedModalRect(localWidth + 12, localHeight + 32, 0, 0, 154, 78); diff --git a/mods/tinker/tconstruct/client/pages/PicturePage.java b/mods/tinker/tconstruct/client/pages/PicturePage.java index 6218ece4..4e387c65 100644 --- a/mods/tinker/tconstruct/client/pages/PicturePage.java +++ b/mods/tinker/tconstruct/client/pages/PicturePage.java @@ -15,6 +15,7 @@ public class PicturePage extends BookPage { String text; String location; + @Override public void readPageFromXML (Element element) { @@ -33,7 +34,7 @@ public class PicturePage extends BookPage manual.fonts.drawSplitString(text, localWidth + 8, localHeight, 178, 0); } - public void renderBackgroundLayer(int localWidth, int localHeight) + public void renderBackgroundLayer (int localWidth, int localHeight) { manual.getMC().renderEngine.bindTexture(location); manual.drawTexturedModalRect(localWidth, localHeight + 12, 0, 0, 170, 144); diff --git a/mods/tinker/tconstruct/client/pages/SectionPage.java b/mods/tinker/tconstruct/client/pages/SectionPage.java index 0d9d0391..803bf7a8 100644 --- a/mods/tinker/tconstruct/client/pages/SectionPage.java +++ b/mods/tinker/tconstruct/client/pages/SectionPage.java @@ -15,6 +15,7 @@ public class SectionPage extends BookPage { String title; String body; + @Override public void readPageFromXML (Element element) { diff --git a/mods/tinker/tconstruct/client/pages/SidebarPage.java b/mods/tinker/tconstruct/client/pages/SidebarPage.java index 5c20d735..de260f84 100644 --- a/mods/tinker/tconstruct/client/pages/SidebarPage.java +++ b/mods/tinker/tconstruct/client/pages/SidebarPage.java @@ -19,7 +19,7 @@ public class SidebarPage extends BookPage @Override public void readPageFromXML (Element element) - { + { NodeList nodes = element.getElementsByTagName("text"); if (nodes != null) text = nodes.item(0).getTextContent(); @@ -37,7 +37,7 @@ public class SidebarPage extends BookPage @Override public void renderContentLayer (int localWidth, int localHeight) - { + { manual.fonts.drawSplitString(text, localWidth, localHeight, 178, 0); GL11.glEnable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableGUIStandardItemLighting(); diff --git a/mods/tinker/tconstruct/client/pages/TextPage.java b/mods/tinker/tconstruct/client/pages/TextPage.java index a65cc8ed..33494ee7 100644 --- a/mods/tinker/tconstruct/client/pages/TextPage.java +++ b/mods/tinker/tconstruct/client/pages/TextPage.java @@ -14,6 +14,7 @@ import org.w3c.dom.NodeList; public class TextPage extends BookPage { String text; + @Override public void readPageFromXML (Element element) { diff --git a/mods/tinker/tconstruct/client/pages/TitlePage.java b/mods/tinker/tconstruct/client/pages/TitlePage.java index 328644d6..2b55f781 100644 --- a/mods/tinker/tconstruct/client/pages/TitlePage.java +++ b/mods/tinker/tconstruct/client/pages/TitlePage.java @@ -14,6 +14,7 @@ import org.w3c.dom.NodeList; public class TitlePage extends BookPage { String text; + @Override public void readPageFromXML (Element element) { diff --git a/mods/tinker/tconstruct/client/pages/ToolPage.java b/mods/tinker/tconstruct/client/pages/ToolPage.java index f2dc2037..488e13d6 100644 --- a/mods/tinker/tconstruct/client/pages/ToolPage.java +++ b/mods/tinker/tconstruct/client/pages/ToolPage.java @@ -18,6 +18,7 @@ public class ToolPage extends BookPage String title; ItemStack[] icons; String[] iconText; + @Override public void readPageFromXML (Element element) { @@ -65,7 +66,7 @@ public class ToolPage extends BookPage for (int i = 1; i < icons.length; i++) { manual.renderitem.renderItemAndEffectIntoGUI(manual.fonts, manual.getMC().renderEngine, icons[i], localWidth + 120, localHeight + 20 + 10 * size + 18 * i); - int partOffset = iconText[i+1].length() > 11 ? -3 : 0; + int partOffset = iconText[i + 1].length() > 11 ? -3 : 0; manual.fonts.drawSplitString(iconText[i + 1], localWidth + 140, localHeight + 24 + 10 * size + 18 * i + partOffset, 44, 0); } manual.renderitem.zLevel = 0; diff --git a/mods/tinker/tconstruct/client/tmt/Angle3D.java b/mods/tinker/tconstruct/client/tmt/Angle3D.java index e9ee0bef..152b982b 100644 --- a/mods/tinker/tconstruct/client/tmt/Angle3D.java +++ b/mods/tinker/tconstruct/client/tmt/Angle3D.java @@ -8,92 +8,92 @@ package mods.tinker.tconstruct.client.tmt; */ public class Angle3D { - /** - * The constructor to create a new Angle3D. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public Angle3D(float x, float y, float z) - { - angleX = x; - angleY = y; - angleZ = z; - } - - /** - * Adds the given angles to the current angles. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public void addAngles(float x, float y, float z) - { - angleX+= x; - angleY+= y; - angleZ+= z; - } - - /** - * Adds the angles of another Angle3D to the current angles. - * @param angles the Angle3D - */ - public void addAngles(Angle3D angles) - { - angleX+= angles.angleX; - angleY+= angles.angleY; - angleZ+= angles.angleZ; - } - - /** - * Multiplies the angles with the given angles. - * @param x the x-rotation - * @param y the y-rotation - * @param z the z-rotation - */ - public void multiplyAngles(float x, float y, float z) - { - angleX*= x; - angleY*= y; - angleZ*= z; - } - - /** - * Multiplies the angles with a given Angle3D. - * @param angles the Angle3D - */ - public void multiplyAngles(Angle3D angles) - { - angleX*= angles.angleX; - angleY*= angles.angleY; - angleZ*= angles.angleZ; - } - - /** - * Gets the center angle between two angles. - * @param angles1 the first Angle3D - * @param angles2 the second Angle3D - * @return the center Angle3D - */ - public static Angle3D getCenter(Angle3D angles1, Angle3D angles2) - { - Angle3D angles = new Angle3D(0, 0, 0); - angles.addAngles(angles1); - angles.addAngles(angles2); - angles.multiplyAngles(0.5F, 0.5F, 0.5F); - return angles; - } - - /** - * Copies the current Angle3D over to a new Angle3D instance. - * @return a copy of the Angle3D instance - */ - public Angle3D copy() - { - return new Angle3D(angleX, angleY, angleZ); - } - - public float angleX; - public float angleY; - public float angleZ; + /** + * The constructor to create a new Angle3D. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public Angle3D(float x, float y, float z) + { + angleX = x; + angleY = y; + angleZ = z; + } + + /** + * Adds the given angles to the current angles. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public void addAngles (float x, float y, float z) + { + angleX += x; + angleY += y; + angleZ += z; + } + + /** + * Adds the angles of another Angle3D to the current angles. + * @param angles the Angle3D + */ + public void addAngles (Angle3D angles) + { + angleX += angles.angleX; + angleY += angles.angleY; + angleZ += angles.angleZ; + } + + /** + * Multiplies the angles with the given angles. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public void multiplyAngles (float x, float y, float z) + { + angleX *= x; + angleY *= y; + angleZ *= z; + } + + /** + * Multiplies the angles with a given Angle3D. + * @param angles the Angle3D + */ + public void multiplyAngles (Angle3D angles) + { + angleX *= angles.angleX; + angleY *= angles.angleY; + angleZ *= angles.angleZ; + } + + /** + * Gets the center angle between two angles. + * @param angles1 the first Angle3D + * @param angles2 the second Angle3D + * @return the center Angle3D + */ + public static Angle3D getCenter (Angle3D angles1, Angle3D angles2) + { + Angle3D angles = new Angle3D(0, 0, 0); + angles.addAngles(angles1); + angles.addAngles(angles2); + angles.multiplyAngles(0.5F, 0.5F, 0.5F); + return angles; + } + + /** + * Copies the current Angle3D over to a new Angle3D instance. + * @return a copy of the Angle3D instance + */ + public Angle3D copy () + { + return new Angle3D(angleX, angleY, angleZ); + } + + public float angleX; + public float angleY; + public float angleZ; } diff --git a/mods/tinker/tconstruct/client/tmt/Bone.java b/mods/tinker/tconstruct/client/tmt/Bone.java index 4fd2ae06..0d1c1795 100644 --- a/mods/tinker/tconstruct/client/tmt/Bone.java +++ b/mods/tinker/tconstruct/client/tmt/Bone.java @@ -99,452 +99,452 @@ import net.minecraft.util.Vec3; */ public class Bone { - /** - * Constructor to create a bone. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - * @param l the length of the bone - */ - public Bone(float x, float y, float z, float l) - { - neutralAngles = new Angle3D(x, y, z); - relativeAngles = new Angle3D(0, 0, 0); - absoluteAngles = new Angle3D(0, 0, 0); - positionVector = Vec3.createVectorHelper(0, 0, 0); - length = l; - childNodes = new ArrayList(); - models = new ArrayList(); - modelBaseRot = new HashMap(); - parentNode = null; - offsetX = 0; - offsetY = 0; - offsetZ = 0; - positionVector = Vec3.createVectorHelper(0, 0, 0); - } - - /** - * Constructor to create a bone. - * @param xOrig the x-offset of the origin - * @param yOrig the y-offset of the origin - * @param zOrig the z-offset of the origin - * @param xRot the x-rotation of the bone - * @param yRot the y-rotation of the bone - * @param zRot the z-rotation of the bone - * @param l the length of the bone - */ - public Bone(float xOrig, float yOrig, float zOrig, float xRot, float yRot, float zRot, float l) - { - this(xRot, yRot, zRot, l); - positionVector = setOffset(xOrig, yOrig, zOrig); - } - - /** - * Constructor to create a bone. This attaches the bone to a parent bone, and will - * calculate its current position relative to the origin. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - * @param l the length of the bone - * @param parent the parent Bone node this Bone is attached to - */ - public Bone(float x, float y, float z, float l, Bone parent) - { - this(x, y, z, l); - attachBone(parent); - } - - /** - * Detaches the bone from its parent. - */ - public void detachBone() - { - parentNode.childNodes.remove(this); - parentNode = null; - } - - /** - * Attaches the bone to a parent. If the parent is already set, detaches the bone - * from the previous parent. - * @param parent the parent Bone node this Bone is attached to - */ - public void attachBone(Bone parent) - { - if(parentNode != null) - detachBone(); - parentNode = parent; - parent.addChildBone(this); - offsetX = parent.offsetX; - offsetY = parent.offsetY; - offsetZ = parent.offsetZ; - resetOffset(); - } - - /** - * Sets the current offset of the parent root Bone. Note that this will - * always set the parent root Bone, not the current Bone, as its offset - * is determined by the offset, rotation and length of its parent. - * @param x the x-position - * @param y the y-position - * @param z the z-position - * @return a Vec3 with the new coordinates of the current bone - */ - public Vec3 setOffset(float x, float y, float z) - { - if(parentNode != null) - { - Vec3 vector = parentNode.setOffset(x, y, z); - offsetX = (float)vector.xCoord; - offsetY = (float)vector.yCoord; - offsetZ = (float)vector.zCoord; - return vector; - } - offsetX = x; - offsetY = y; - offsetZ = z; - resetOffset(true); - return Vec3.createVectorHelper(x, y, z); - } - - /** - * Resets the offset. - */ - public void resetOffset() - { - resetOffset(false); - } - - /** - * Resets the offset. - * @param doRecursive - */ - public void resetOffset(boolean doRecursive) - { - if(parentNode != null) - { - positionVector = Vec3.createVectorHelper(0, 0, parentNode.length); - parentNode.setVectorRotations(positionVector); - positionVector.xCoord += parentNode.positionVector.xCoord; - positionVector.yCoord += parentNode.positionVector.yCoord; - positionVector.zCoord += parentNode.positionVector.zCoord; - } - if(doRecursive && !childNodes.isEmpty()) - { - for(int index = 0; index < childNodes.size(); index++) - { - childNodes.get(index).resetOffset(doRecursive); - } - } - } - - /** - * Sets the current neutral rotation of the bone. This is the same rotation as in - * the constructor. - * @param x the x-rotation of the bone - * @param y the y-rotation of the bone - * @param z the z-rotation of the bone - */ - public void setNeutralRotation(float x, float y, float z) - { - neutralAngles.angleX = x; - neutralAngles.angleY = y; - neutralAngles.angleZ = z; - } - - /** - * Gets the root parent bone. - * @return the root parent Bone. - */ - public Bone getRootParent() - { - if(parentNode == null) - return this; - else - return parentNode.getRootParent(); - } - - /** - * Attaches a model to the bone. Its base rotation will be set to the neutral - * rotation of the model. - * @param model the model to attach - */ - public void addModel(ModelRenderer model) - { - addModel(model, false); - } - - /** - * Attaches a model to the bone. If inherit is true, it sets the base rotation - * to the neutral rotation of the Bone, otherwise it's set to the neutral - * rotation of the model. - * @param model the model to attach - * @param inherit whether the model should inherit the Bone's base rotations - */ - public void addModel(ModelRenderer model, boolean inherit) - { - addModel(model, 0F, 0F, 0F, inherit); - } - - /** - * Attaches a model to the bone. If inherit is true, it sets the base rotation - * to the neutral rotation of the Bone, otherwise it's set to the neutral - * rotation of the model. When isUpright is set, the model will be rotated - * (-PI / 2, 0, 0). - * @param model the model to attach - * @param inherit whether the model should inherit the Bone's base rotations - * @param isUpright whether the model is modeled in the upright position - */ - public void addModel(ModelRenderer model, boolean inherit, boolean isUpright) - { - addModel(model, 0F, 0F, 0F, inherit, isUpright); - } - - /** - * Attaches a model to the bone with a given base rotation. - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - */ - public void addModel(ModelRenderer model, float x, float y, float z) - { - addModel(model, x, y, z, false); - } - - /** - * Attaches a model to the bone with a given base rotation. When inherit is - * true, it will add the Bone's neutral rotation to the given angles. - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - * @param inherit whether the model should inherit the Bone's base rotations - */ - public void addModel(ModelRenderer model, float x, float y, float z, boolean inherit) - { - addModel(model, x, y, z, inherit, false); - } - - /** - * Attaches a model to the bone with a given base rotation. When inherit is - * true, it will add the Bone's neutral rotation to the given angles. - * When isUpright is set, the model will be rotated (-PI / 2, 0, 0). - * @param model the model to attach - * @param x the base x-rotation - * @param y the base y-rotation - * @param z the base z-rotation - * @param inherit whether the model should inherit the Bone's base rotations - * @param isUpright whether the model is modeled in the upright position - */ - public void addModel(ModelRenderer model, float x, float y, float z, boolean inherit, boolean isUpright) - { - if(inherit) - { - x += neutralAngles.angleX + (isUpright ? (float)Math.PI / 2 : 0); - y += neutralAngles.angleY; - z += neutralAngles.angleZ; - } - models.add(model); - modelBaseRot.put(model, new Angle3D(x, y, z)); - } - - /** - * Removes the given model from the Bone. Always detach the model before adding - * it to another Bone. The best thing however is to just keep the model to one - * bone. - * @param model the model to remove from the bone - */ - public void removeModel(ModelRenderer model) - { - models.remove(model); - modelBaseRot.remove(model); - } - - /** - * Gets the current absolute angles. The absolute angle is calculated by getting - * the sum of all parent Bones' relative angles plus the current relative angle. - * This must be called after using the prepareDraw method. - * @return an Angle3D object which holds the current angles of the current node. - */ - public Angle3D getAbsoluteAngle() - { - return new Angle3D(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - - /** - * Gets the current position of the bone. You should call this after all rotations - * and positions are applied, e.g. after prepareDraw has been called. - * @return a vector containing the current position relative to the origin. - */ - public Vec3 getPosition() - { - return Vec3.createVectorHelper(positionVector.xCoord, positionVector.yCoord, positionVector.zCoord); - } - - protected void addChildBone(Bone bone) - { - childNodes.add(bone); - } - - /** - * Prepares the bones for rendering. This will automatically take the root Bone - * if it isn't. - */ - public void prepareDraw() - { - if(parentNode != null) - parentNode.prepareDraw(); - else - { - setAbsoluteRotations(); - setVectors(); - } - } - - /** - * Sets the current rotation of the Bone, not calculating any parent bones in. - * @param x - * @param y - * @param z - */ - public void setRotations(float x, float y, float z) - { - relativeAngles.angleX = x; - relativeAngles.angleY = y; - relativeAngles.angleZ = z; - } - - protected void setAbsoluteRotations() - { - absoluteAngles.angleX = relativeAngles.angleX; - absoluteAngles.angleY = relativeAngles.angleY; - absoluteAngles.angleZ = relativeAngles.angleZ; - for(int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - } - - protected void setAbsoluteRotations(float x, float y, float z) - { - absoluteAngles.angleX = relativeAngles.angleX + x; - absoluteAngles.angleY = relativeAngles.angleY + y; - absoluteAngles.angleZ = relativeAngles.angleZ + z; - for(int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); - } - - } - - protected void setVectorRotations(Vec3 vector) - { - float x = neutralAngles.angleX + absoluteAngles.angleX; - float y = neutralAngles.angleY + absoluteAngles.angleY; - float z = neutralAngles.angleZ + absoluteAngles.angleZ; - setVectorRotations(vector, x, y, z); - } - - protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; + /** + * Constructor to create a bone. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + * @param l the length of the bone + */ + public Bone(float x, float y, float z, float l) + { + neutralAngles = new Angle3D(x, y, z); + relativeAngles = new Angle3D(0, 0, 0); + absoluteAngles = new Angle3D(0, 0, 0); + positionVector = Vec3.createVectorHelper(0, 0, 0); + length = l; + childNodes = new ArrayList(); + models = new ArrayList(); + modelBaseRot = new HashMap(); + parentNode = null; + offsetX = 0; + offsetY = 0; + offsetZ = 0; + positionVector = Vec3.createVectorHelper(0, 0, 0); + } + + /** + * Constructor to create a bone. + * @param xOrig the x-offset of the origin + * @param yOrig the y-offset of the origin + * @param zOrig the z-offset of the origin + * @param xRot the x-rotation of the bone + * @param yRot the y-rotation of the bone + * @param zRot the z-rotation of the bone + * @param l the length of the bone + */ + public Bone(float xOrig, float yOrig, float zOrig, float xRot, float yRot, float zRot, float l) + { + this(xRot, yRot, zRot, l); + positionVector = setOffset(xOrig, yOrig, zOrig); + } + + /** + * Constructor to create a bone. This attaches the bone to a parent bone, and will + * calculate its current position relative to the origin. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + * @param l the length of the bone + * @param parent the parent Bone node this Bone is attached to + */ + public Bone(float x, float y, float z, float l, Bone parent) + { + this(x, y, z, l); + attachBone(parent); + } + + /** + * Detaches the bone from its parent. + */ + public void detachBone () + { + parentNode.childNodes.remove(this); + parentNode = null; + } + + /** + * Attaches the bone to a parent. If the parent is already set, detaches the bone + * from the previous parent. + * @param parent the parent Bone node this Bone is attached to + */ + public void attachBone (Bone parent) + { + if (parentNode != null) + detachBone(); + parentNode = parent; + parent.addChildBone(this); + offsetX = parent.offsetX; + offsetY = parent.offsetY; + offsetZ = parent.offsetZ; + resetOffset(); + } + + /** + * Sets the current offset of the parent root Bone. Note that this will + * always set the parent root Bone, not the current Bone, as its offset + * is determined by the offset, rotation and length of its parent. + * @param x the x-position + * @param y the y-position + * @param z the z-position + * @return a Vec3 with the new coordinates of the current bone + */ + public Vec3 setOffset (float x, float y, float z) + { + if (parentNode != null) + { + Vec3 vector = parentNode.setOffset(x, y, z); + offsetX = (float) vector.xCoord; + offsetY = (float) vector.yCoord; + offsetZ = (float) vector.zCoord; + return vector; + } + offsetX = x; + offsetY = y; + offsetZ = z; + resetOffset(true); + return Vec3.createVectorHelper(x, y, z); + } + + /** + * Resets the offset. + */ + public void resetOffset () + { + resetOffset(false); + } + + /** + * Resets the offset. + * @param doRecursive + */ + public void resetOffset (boolean doRecursive) + { + if (parentNode != null) + { + positionVector = Vec3.createVectorHelper(0, 0, parentNode.length); + parentNode.setVectorRotations(positionVector); + positionVector.xCoord += parentNode.positionVector.xCoord; + positionVector.yCoord += parentNode.positionVector.yCoord; + positionVector.zCoord += parentNode.positionVector.zCoord; + } + if (doRecursive && !childNodes.isEmpty()) + { + for (int index = 0; index < childNodes.size(); index++) + { + childNodes.get(index).resetOffset(doRecursive); + } + } + } + + /** + * Sets the current neutral rotation of the bone. This is the same rotation as in + * the constructor. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + */ + public void setNeutralRotation (float x, float y, float z) + { + neutralAngles.angleX = x; + neutralAngles.angleY = y; + neutralAngles.angleZ = z; + } + + /** + * Gets the root parent bone. + * @return the root parent Bone. + */ + public Bone getRootParent () + { + if (parentNode == null) + return this; + else + return parentNode.getRootParent(); + } + + /** + * Attaches a model to the bone. Its base rotation will be set to the neutral + * rotation of the model. + * @param model the model to attach + */ + public void addModel (ModelRenderer model) + { + addModel(model, false); + } + + /** + * Attaches a model to the bone. If inherit is true, it sets the base rotation + * to the neutral rotation of the Bone, otherwise it's set to the neutral + * rotation of the model. + * @param model the model to attach + * @param inherit whether the model should inherit the Bone's base rotations + */ + public void addModel (ModelRenderer model, boolean inherit) + { + addModel(model, 0F, 0F, 0F, inherit); + } + + /** + * Attaches a model to the bone. If inherit is true, it sets the base rotation + * to the neutral rotation of the Bone, otherwise it's set to the neutral + * rotation of the model. When isUpright is set, the model will be rotated + * (-PI / 2, 0, 0). + * @param model the model to attach + * @param inherit whether the model should inherit the Bone's base rotations + * @param isUpright whether the model is modeled in the upright position + */ + public void addModel (ModelRenderer model, boolean inherit, boolean isUpright) + { + addModel(model, 0F, 0F, 0F, inherit, isUpright); + } + + /** + * Attaches a model to the bone with a given base rotation. + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + */ + public void addModel (ModelRenderer model, float x, float y, float z) + { + addModel(model, x, y, z, false); + } + + /** + * Attaches a model to the bone with a given base rotation. When inherit is + * true, it will add the Bone's neutral rotation to the given angles. + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + * @param inherit whether the model should inherit the Bone's base rotations + */ + public void addModel (ModelRenderer model, float x, float y, float z, boolean inherit) + { + addModel(model, x, y, z, inherit, false); + } + + /** + * Attaches a model to the bone with a given base rotation. When inherit is + * true, it will add the Bone's neutral rotation to the given angles. + * When isUpright is set, the model will be rotated (-PI / 2, 0, 0). + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + * @param inherit whether the model should inherit the Bone's base rotations + * @param isUpright whether the model is modeled in the upright position + */ + public void addModel (ModelRenderer model, float x, float y, float z, boolean inherit, boolean isUpright) + { + if (inherit) + { + x += neutralAngles.angleX + (isUpright ? (float) Math.PI / 2 : 0); + y += neutralAngles.angleY; + z += neutralAngles.angleZ; + } + models.add(model); + modelBaseRot.put(model, new Angle3D(x, y, z)); + } + + /** + * Removes the given model from the Bone. Always detach the model before adding + * it to another Bone. The best thing however is to just keep the model to one + * bone. + * @param model the model to remove from the bone + */ + public void removeModel (ModelRenderer model) + { + models.remove(model); + modelBaseRot.remove(model); + } + + /** + * Gets the current absolute angles. The absolute angle is calculated by getting + * the sum of all parent Bones' relative angles plus the current relative angle. + * This must be called after using the prepareDraw method. + * @return an Angle3D object which holds the current angles of the current node. + */ + public Angle3D getAbsoluteAngle () + { + return new Angle3D(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + + /** + * Gets the current position of the bone. You should call this after all rotations + * and positions are applied, e.g. after prepareDraw has been called. + * @return a vector containing the current position relative to the origin. + */ + public Vec3 getPosition () + { + return Vec3.createVectorHelper(positionVector.xCoord, positionVector.yCoord, positionVector.zCoord); + } + + protected void addChildBone (Bone bone) + { + childNodes.add(bone); + } + + /** + * Prepares the bones for rendering. This will automatically take the root Bone + * if it isn't. + */ + public void prepareDraw () + { + if (parentNode != null) + parentNode.prepareDraw(); + else + { + setAbsoluteRotations(); + setVectors(); + } + } + + /** + * Sets the current rotation of the Bone, not calculating any parent bones in. + * @param x + * @param y + * @param z + */ + public void setRotations (float x, float y, float z) + { + relativeAngles.angleX = x; + relativeAngles.angleY = y; + relativeAngles.angleZ = z; + } + + protected void setAbsoluteRotations () + { + absoluteAngles.angleX = relativeAngles.angleX; + absoluteAngles.angleY = relativeAngles.angleY; + absoluteAngles.angleZ = relativeAngles.angleZ; + for (int i = 0; i < childNodes.size(); i++) + { + childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + } + + protected void setAbsoluteRotations (float x, float y, float z) + { + absoluteAngles.angleX = relativeAngles.angleX + x; + absoluteAngles.angleY = relativeAngles.angleY + y; + absoluteAngles.angleZ = relativeAngles.angleZ + z; + for (int i = 0; i < childNodes.size(); i++) + { + childNodes.get(i).setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + + } + + protected void setVectorRotations (Vec3 vector) + { + float x = neutralAngles.angleX + absoluteAngles.angleX; + float y = neutralAngles.angleY + absoluteAngles.angleY; + float z = neutralAngles.angleZ + absoluteAngles.angleZ; + setVectorRotations(vector, x, y, z); + } + + protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; float xC = MathHelper.cos(x); float xS = MathHelper.sin(x); float yC = MathHelper.cos(y); float yS = MathHelper.sin(y); float zC = MathHelper.cos(z); float zS = MathHelper.sin(z); - + double xVec = vector.xCoord; double yVec = vector.yCoord; double zVec = vector.zCoord; - + // rotation around x - double xy = xC*yVec - xS*zVec; - double xz = xC*zVec + xS*yVec; - // rotation around y - double yz = yC*xz - yS*xVec; - double yx = yC*xVec + yS*xz; - // rotation around z - double zx = zC*yx - zS*xy; - double zy = zC*xy + zS*yx; - - xVec = zx; - yVec = zy; - zVec = yz; - + double xy = xC * yVec - xS * zVec; + double xz = xC * zVec + xS * yVec; + // rotation around y + double yz = yC * xz - yS * xVec; + double yx = yC * xVec + yS * xz; + // rotation around z + double zx = zC * yx - zS * xy; + double zy = zC * xy + zS * yx; + + xVec = zx; + yVec = zy; + zVec = yz; + vector.xCoord = xVec; vector.yCoord = yVec; vector.zCoord = zVec; - } + } - protected void addVector(Vec3 destVec, Vec3 srcVec) - { - destVec.xCoord += srcVec.xCoord; - destVec.yCoord += srcVec.yCoord; - destVec.zCoord += srcVec.zCoord; - } + protected void addVector (Vec3 destVec, Vec3 srcVec) + { + destVec.xCoord += srcVec.xCoord; + destVec.yCoord += srcVec.yCoord; + destVec.zCoord += srcVec.zCoord; + } - protected void setVectors() - { - Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); - positionVector = Vec3.createVectorHelper(offsetX, offsetY, offsetZ); - addVector(tempVec, positionVector); - setVectorRotations(tempVec); - for(int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setVectors(tempVec); - } - } - - protected void setVectors(Vec3 vector) - { - positionVector = vector; - Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); - setVectorRotations(tempVec); - addVector(tempVec, vector); - for(int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setVectors(tempVec); - } - - } - - /** - * Sets the current angles of the Bone to the models attached to it. - */ - public void setAnglesToModels() - { - for(int i = 0; i < models.size(); i++) - { - ModelRenderer currentModel = models.get(i); - Angle3D baseAngles = modelBaseRot.get(currentModel); - currentModel.rotateAngleX = baseAngles.angleX + absoluteAngles.angleX; - currentModel.rotateAngleY = baseAngles.angleY + absoluteAngles.angleY; - currentModel.rotateAngleZ = baseAngles.angleZ + absoluteAngles.angleZ; - currentModel.rotationPointX = (float)positionVector.xCoord; - currentModel.rotationPointY = (float)positionVector.yCoord; - currentModel.rotationPointZ = (float)positionVector.zCoord; - } - - for(int i = 0; i < childNodes.size(); i++) - { - childNodes.get(i).setAnglesToModels(); - } - } - - protected Angle3D neutralAngles; - public Angle3D relativeAngles; - protected Angle3D absoluteAngles; - private Vec3 positionVector; - private float length; - private Bone parentNode; - protected ArrayList childNodes; - private ArrayList models; - private Map modelBaseRot; - private float offsetX; - private float offsetY; - private float offsetZ; + protected void setVectors () + { + Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); + positionVector = Vec3.createVectorHelper(offsetX, offsetY, offsetZ); + addVector(tempVec, positionVector); + setVectorRotations(tempVec); + for (int i = 0; i < childNodes.size(); i++) + { + childNodes.get(i).setVectors(tempVec); + } + } + + protected void setVectors (Vec3 vector) + { + positionVector = vector; + Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); + setVectorRotations(tempVec); + addVector(tempVec, vector); + for (int i = 0; i < childNodes.size(); i++) + { + childNodes.get(i).setVectors(tempVec); + } + + } + + /** + * Sets the current angles of the Bone to the models attached to it. + */ + public void setAnglesToModels () + { + for (int i = 0; i < models.size(); i++) + { + ModelRenderer currentModel = models.get(i); + Angle3D baseAngles = modelBaseRot.get(currentModel); + currentModel.rotateAngleX = baseAngles.angleX + absoluteAngles.angleX; + currentModel.rotateAngleY = baseAngles.angleY + absoluteAngles.angleY; + currentModel.rotateAngleZ = baseAngles.angleZ + absoluteAngles.angleZ; + currentModel.rotationPointX = (float) positionVector.xCoord; + currentModel.rotationPointY = (float) positionVector.yCoord; + currentModel.rotationPointZ = (float) positionVector.zCoord; + } + + for (int i = 0; i < childNodes.size(); i++) + { + childNodes.get(i).setAnglesToModels(); + } + } + + protected Angle3D neutralAngles; + public Angle3D relativeAngles; + protected Angle3D absoluteAngles; + private Vec3 positionVector; + private float length; + private Bone parentNode; + protected ArrayList childNodes; + private ArrayList models; + private Map modelBaseRot; + private float offsetX; + private float offsetY; + private float offsetZ; } diff --git a/mods/tinker/tconstruct/client/tmt/Coord2D.java b/mods/tinker/tconstruct/client/tmt/Coord2D.java index 36ca8e97..c55282c2 100644 --- a/mods/tinker/tconstruct/client/tmt/Coord2D.java +++ b/mods/tinker/tconstruct/client/tmt/Coord2D.java @@ -8,24 +8,23 @@ package mods.tinker.tconstruct.client.tmt; */ public class Coord2D { - public Coord2D(double x, double y) - { - xCoord = x; - yCoord = y; - uCoord = (int)Math.floor(x); - vCoord = (int)Math.floor(y); - } - + public Coord2D(double x, double y) + { + xCoord = x; + yCoord = y; + uCoord = (int) Math.floor(x); + vCoord = (int) Math.floor(y); + } - public Coord2D(double x, double y, int u, int v) - { - this(x, y); - uCoord = u; - vCoord = v; - } + public Coord2D(double x, double y, int u, int v) + { + this(x, y); + uCoord = u; + vCoord = v; + } - public double xCoord; - public double yCoord; - public int uCoord; - public int vCoord; + public double xCoord; + public double yCoord; + public int uCoord; + public int vCoord; } diff --git a/mods/tinker/tconstruct/client/tmt/ModelPool.java b/mods/tinker/tconstruct/client/tmt/ModelPool.java index 013216e8..ab348ade 100644 --- a/mods/tinker/tconstruct/client/tmt/ModelPool.java +++ b/mods/tinker/tconstruct/client/tmt/ModelPool.java @@ -8,53 +8,50 @@ import net.minecraft.client.Minecraft; public class ModelPool { - public static ModelPoolEntry addFile(String file, Class modelClass, Map group, Map textureGroup) - { - ModelPoolEntry entry = null; - if(modelMap.containsKey(file)) - { - entry = modelMap.get(file); - entry.applyGroups(group, textureGroup); - return entry; - } - try - { - entry = (ModelPoolEntry)modelClass.newInstance(); - } - catch(Exception e) - { - System.out.println("A new " + entry.getClass().getName() + " could not be initialized."); - System.out.println(e.getMessage()); - return null; - } - File modelFile = null; - for(int i = 0; i < resourceDir.length && (modelFile == null || !modelFile.exists()); i++) - { - String absPath = Minecraft.getAppDir(resourceDir[i]).getAbsolutePath(); - if(!absPath.endsWith("/") || !absPath.endsWith("\\")) - absPath+= "/"; - modelFile = entry.checkValidPath(absPath + file); - } - if(modelFile == null || !modelFile.exists()) - { - System.out.println("The model with the name " + file + " does not exist."); - return null; - } - entry.groups = new HashMap(); - entry.textures = new HashMap(); - entry.name = file; - entry.setGroup("0"); - entry.setTextureGroup("0"); - entry.getModel(modelFile); - entry.applyGroups(group, textureGroup); - modelMap.put(file, entry); - return entry; - } - + public static ModelPoolEntry addFile (String file, Class modelClass, Map group, Map textureGroup) + { + ModelPoolEntry entry = null; + if (modelMap.containsKey(file)) + { + entry = modelMap.get(file); + entry.applyGroups(group, textureGroup); + return entry; + } + try + { + entry = (ModelPoolEntry) modelClass.newInstance(); + } + catch (Exception e) + { + System.out.println("A new " + entry.getClass().getName() + " could not be initialized."); + System.out.println(e.getMessage()); + return null; + } + File modelFile = null; + for (int i = 0; i < resourceDir.length && (modelFile == null || !modelFile.exists()); i++) + { + String absPath = Minecraft.getAppDir(resourceDir[i]).getAbsolutePath(); + if (!absPath.endsWith("/") || !absPath.endsWith("\\")) + absPath += "/"; + modelFile = entry.checkValidPath(absPath + file); + } + if (modelFile == null || !modelFile.exists()) + { + System.out.println("The model with the name " + file + " does not exist."); + return null; + } + entry.groups = new HashMap(); + entry.textures = new HashMap(); + entry.name = file; + entry.setGroup("0"); + entry.setTextureGroup("0"); + entry.getModel(modelFile); + entry.applyGroups(group, textureGroup); + modelMap.put(file, entry); + return entry; + } + private static Map modelMap = new HashMap(); - private static String[] resourceDir = new String[] { - "minecraft/resources/models/", - "minecraft/resources/mod/models/" - }; + private static String[] resourceDir = new String[] { "minecraft/resources/models/", "minecraft/resources/mod/models/" }; public static final Class OBJ = ModelPoolObjEntry.class; } diff --git a/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java b/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java index 4b9f7dd8..74d9790d 100644 --- a/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java +++ b/mods/tinker/tconstruct/client/tmt/ModelPoolEntry.java @@ -8,37 +8,37 @@ import java.util.Set; public abstract class ModelPoolEntry { - public File checkValidPath(String path) - { - File file = null; - - for(int index = 0; index < fileExtensions.length && (file == null || !file.exists()); index++) - { - String absPath = path; - - if(!path.endsWith("." + fileExtensions[index])) - absPath+= "." + fileExtensions[index]; - - file = new File(absPath); - } - if(file == null || !file.exists()) - return null; - return file; - } - - public abstract void getModel(File file); - + public File checkValidPath (String path) + { + File file = null; + + for (int index = 0; index < fileExtensions.length && (file == null || !file.exists()); index++) + { + String absPath = path; + + if (!path.endsWith("." + fileExtensions[index])) + absPath += "." + fileExtensions[index]; + + file = new File(absPath); + } + if (file == null || !file.exists()) + return null; + return file; + } + + public abstract void getModel (File file); + /** * Sets the current transformation group. The transformation group is used * to allow for vertex transformation. If a transformation group does not exist, * a new one will be created. * @param groupName the name of the transformation group you want to switch to */ - protected void setGroup(String groupName) + protected void setGroup (String groupName) { - setGroup(groupName, new Bone(0, 0, 0, 0), 1D); + setGroup(groupName, new Bone(0, 0, 0, 0), 1D); } - + /** * Sets the current transformation group. The transformation group is used * to allow for vertex transformation. If a transformation group does not exist, @@ -47,13 +47,13 @@ public abstract class ModelPoolEntry * @param bone the Bone this transformation group is attached to * @param weight the weight of the transformation group */ - protected void setGroup(String groupName, Bone bone, double weight) + protected void setGroup (String groupName, Bone bone, double weight) { - if(groups.size() == 0 || !groups.containsKey(groupName)) - groups.put(groupName, new TransformGroupBone(bone, weight)); - group = groups.get(groupName); + if (groups.size() == 0 || !groups.containsKey(groupName)) + groups.put(groupName, new TransformGroupBone(bone, weight)); + group = groups.get(groupName); } - + /** * Sets the current texture group, which is used to switch the * textures on a per-model base. Do note that any model that is @@ -63,56 +63,56 @@ public abstract class ModelPoolEntry * @param groupName The name of the texture group. If the texture * group doesn't exist, it creates a new group automatically. */ - protected void setTextureGroup(String groupName) + protected void setTextureGroup (String groupName) { - if(textures.size() == 0 || !textures.containsKey(groupName)) - { - textures.put(groupName, new TextureGroup()); - } - texture = textures.get(groupName); + if (textures.size() == 0 || !textures.containsKey(groupName)) + { + textures.put(groupName, new TextureGroup()); + } + texture = textures.get(groupName); } - - protected void applyGroups(Map groupsMap, Map texturesMap) + + protected void applyGroups (Map groupsMap, Map texturesMap) { - Set groupsCol = groups.keySet(); - Collection texturesCol = textures.keySet(); - - Iterator groupsItr = groupsCol.iterator(); - Iterator texturesItr = texturesCol.iterator(); - - while(groupsItr.hasNext()) - { - int nameIdx = 0; - String groupKey = groupsItr.next(); - String currentGroup = name + "_" + nameIdx + ":" + groupKey; - while(groupsMap.size() > 0 && groupsMap.containsKey(currentGroup)) - { - nameIdx++; - currentGroup = name + "_" + nameIdx + ":" + groupKey; - } - groupsMap.put(currentGroup, groups.get(groupKey)); - } - - while(texturesItr.hasNext()) - { - int nameIdx = 0; - String groupKey = texturesItr.next(); - String currentGroup = name + "_" + nameIdx + ":" + groupKey; - while(groupsMap.size() > 0 && texturesMap.containsKey(currentGroup)) - { - nameIdx++; - currentGroup = name + "_" + nameIdx + ":" + groupKey; - } - texturesMap.put(currentGroup, textures.get(groupKey)); - } + Set groupsCol = groups.keySet(); + Collection texturesCol = textures.keySet(); + + Iterator groupsItr = groupsCol.iterator(); + Iterator texturesItr = texturesCol.iterator(); + + while (groupsItr.hasNext()) + { + int nameIdx = 0; + String groupKey = groupsItr.next(); + String currentGroup = name + "_" + nameIdx + ":" + groupKey; + while (groupsMap.size() > 0 && groupsMap.containsKey(currentGroup)) + { + nameIdx++; + currentGroup = name + "_" + nameIdx + ":" + groupKey; + } + groupsMap.put(currentGroup, groups.get(groupKey)); + } + + while (texturesItr.hasNext()) + { + int nameIdx = 0; + String groupKey = texturesItr.next(); + String currentGroup = name + "_" + nameIdx + ":" + groupKey; + while (groupsMap.size() > 0 && texturesMap.containsKey(currentGroup)) + { + nameIdx++; + currentGroup = name + "_" + nameIdx + ":" + groupKey; + } + texturesMap.put(currentGroup, textures.get(groupKey)); + } } - + public String name; - public PositionTransformVertex[] vertices; - public TexturedPolygon[] faces; - public Map groups; - public Map textures; - protected TransformGroupBone group; - protected TextureGroup texture; - protected String[] fileExtensions; + public PositionTransformVertex[] vertices; + public TexturedPolygon[] faces; + public Map groups; + public Map textures; + protected TransformGroupBone group; + protected TextureGroup texture; + protected String[] fileExtensions; } diff --git a/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java b/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java index 6a1a44d6..a182c2e8 100644 --- a/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java +++ b/mods/tinker/tconstruct/client/tmt/ModelPoolObjEntry.java @@ -11,213 +11,213 @@ import net.minecraft.util.Vec3; public class ModelPoolObjEntry extends ModelPoolEntry { - public ModelPoolObjEntry() - { - fileExtensions = new String[] {"obj"}; - } - - public void getModel(File file) - { - try - { - BufferedReader in = new BufferedReader(new FileReader(file)); - - String s; - - ArrayList verts = new ArrayList(); - ArrayList uvs = new ArrayList(); - ArrayList normals = new ArrayList(); - ArrayList face = new ArrayList(); - - while((s = in.readLine()) != null) - { - if(s.indexOf("#") > -1) - { - s = s.substring(0, s.indexOf("#")); - } - - s = s.trim(); - - if(s.equals("")) - continue; + public ModelPoolObjEntry() + { + fileExtensions = new String[] { "obj" }; + } - if(s.startsWith("g ")) - { - setTextureGroup(s.substring(s.indexOf(" ") + 1).trim()); - continue; - } - if(s.startsWith("v ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[3]; - for(int i = 0; i < 3; i++) - { - int ind = s.indexOf(" "); - if(ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - float flt = v[2]; - v[2] = -v[1]; - v[1] = flt; - - verts.add(new PositionTransformVertex(v[0], v[1], v[2], 0, 0)); - continue; - } - if(s.startsWith("vt ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[2]; - for(int i = 0; i < 2; i++) - { - int ind = s.indexOf(" "); - if(ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - uvs.add(new float[] {v[0], 1F - v[1]}); - continue; - } - if(s.startsWith("vn ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - float[] v = new float[3]; - for(int i = 0; i < 3; i++) - { - int ind = s.indexOf(" "); - if(ind > -1) - v[i] = Float.parseFloat(s.substring(0, ind)); - else - v[i] = Float.parseFloat(s.substring(0)); - s = s.substring(s.indexOf(" ") + 1).trim(); - } - - float flt = v[2]; - v[2] = v[1]; - v[1] = flt; + public void getModel (File file) + { + try + { + BufferedReader in = new BufferedReader(new FileReader(file)); - normals.add(new float[] {v[0], v[1], v[2]}); - continue; - } - if(s.startsWith("f ")) - { - s = s.substring(s.indexOf(" ") + 1).trim(); - ArrayList v = new ArrayList(); - String s1; - int finalPhase = 0; - float[] normal = new float[] {0F, 0F, 0F}; - ArrayList iNormal = new ArrayList(); - do - { - int vInt; - float[] curUV; - float[] curNormals; - int ind = s.indexOf(" "); - s1 = s; - if(ind > -1) - s1 = s.substring(0, ind); - if(s1.indexOf("/") > -1) - { - String[] f = s1.split("/"); - vInt = Integer.parseInt(f[0]) - 1; - if(f[1].equals("")) - f[1] = f[0]; - int vtInt = Integer.parseInt(f[1]) - 1; - if(uvs.size() > vtInt) - curUV = uvs.get(vtInt); - else - curUV = new float[] {0, 0}; - int vnInt = 0; - if(f.length == 3) - { - if(f[2].equals("")) - f[2] = f[0]; - vnInt = Integer.parseInt(f[2]) - 1; - } - else - vnInt = Integer.parseInt(f[0]) - 1; - if(normals.size() > vnInt) - curNormals = normals.get(vnInt); - else - curNormals = new float[] {0, 0, 0}; - } - else - { - vInt = Integer.parseInt(s1) - 1; - if(uvs.size() > vInt) - curUV = uvs.get(vInt); - else - curUV = new float[] {0, 0}; - if(normals.size() > vInt) - curNormals = normals.get(vInt); - else - curNormals = new float[] {0, 0, 0}; - } - - iNormal.add(Vec3.createVectorHelper(curNormals[0], curNormals[1], curNormals[2])); + String s; - normal[0]+= curNormals[0]; - normal[1]+= curNormals[1]; - normal[2]+= curNormals[2]; - - if(vInt < verts.size()) - { - v.add(verts.get(vInt).setTexturePosition(curUV[0], curUV[1])); - if(verts.get(vInt) instanceof PositionTransformVertex) - { - ((PositionTransformVertex)verts.get(vInt)).addGroup(group); - } - } - if(ind > -1) - s = s.substring(s.indexOf(" ") + 1).trim(); - else - finalPhase++; - } while(finalPhase < 1); - - float d = MathHelper.sqrt_double(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2]); - - normal[0]/= d; - normal[1]/= d; - normal[2]/= d; - - PositionTextureVertex[] vToArr = new PositionTextureVertex[v.size()]; - - for(int i = 0; i < v.size(); i++) - { - vToArr[i] = v.get(i); - } - - TexturedPolygon poly = new TexturedPolygon(vToArr); - poly.setNormals(normal[0], normal[1], normal[2]); - poly.setNormals(iNormal); - - face.add(poly); - texture.addPoly(poly); - continue; - } - } - - vertices = new PositionTransformVertex[verts.size()]; - for(int i = 0; i < verts.size(); i++) - { - vertices[i] = verts.get(i); - } - faces = new TexturedPolygon[face.size()]; - for(int i = 0; i < face.size(); i++) - { - faces[i] = face.get(i); - } - in.close(); - } - catch(Throwable e) - { - - } - } + ArrayList verts = new ArrayList(); + ArrayList uvs = new ArrayList(); + ArrayList normals = new ArrayList(); + ArrayList face = new ArrayList(); + + while ((s = in.readLine()) != null) + { + if (s.indexOf("#") > -1) + { + s = s.substring(0, s.indexOf("#")); + } + + s = s.trim(); + + if (s.equals("")) + continue; + + if (s.startsWith("g ")) + { + setTextureGroup(s.substring(s.indexOf(" ") + 1).trim()); + continue; + } + if (s.startsWith("v ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[3]; + for (int i = 0; i < 3; i++) + { + int ind = s.indexOf(" "); + if (ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + float flt = v[2]; + v[2] = -v[1]; + v[1] = flt; + + verts.add(new PositionTransformVertex(v[0], v[1], v[2], 0, 0)); + continue; + } + if (s.startsWith("vt ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[2]; + for (int i = 0; i < 2; i++) + { + int ind = s.indexOf(" "); + if (ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + uvs.add(new float[] { v[0], 1F - v[1] }); + continue; + } + if (s.startsWith("vn ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[3]; + for (int i = 0; i < 3; i++) + { + int ind = s.indexOf(" "); + if (ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + float flt = v[2]; + v[2] = v[1]; + v[1] = flt; + + normals.add(new float[] { v[0], v[1], v[2] }); + continue; + } + if (s.startsWith("f ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + ArrayList v = new ArrayList(); + String s1; + int finalPhase = 0; + float[] normal = new float[] { 0F, 0F, 0F }; + ArrayList iNormal = new ArrayList(); + do + { + int vInt; + float[] curUV; + float[] curNormals; + int ind = s.indexOf(" "); + s1 = s; + if (ind > -1) + s1 = s.substring(0, ind); + if (s1.indexOf("/") > -1) + { + String[] f = s1.split("/"); + vInt = Integer.parseInt(f[0]) - 1; + if (f[1].equals("")) + f[1] = f[0]; + int vtInt = Integer.parseInt(f[1]) - 1; + if (uvs.size() > vtInt) + curUV = uvs.get(vtInt); + else + curUV = new float[] { 0, 0 }; + int vnInt = 0; + if (f.length == 3) + { + if (f[2].equals("")) + f[2] = f[0]; + vnInt = Integer.parseInt(f[2]) - 1; + } + else + vnInt = Integer.parseInt(f[0]) - 1; + if (normals.size() > vnInt) + curNormals = normals.get(vnInt); + else + curNormals = new float[] { 0, 0, 0 }; + } + else + { + vInt = Integer.parseInt(s1) - 1; + if (uvs.size() > vInt) + curUV = uvs.get(vInt); + else + curUV = new float[] { 0, 0 }; + if (normals.size() > vInt) + curNormals = normals.get(vInt); + else + curNormals = new float[] { 0, 0, 0 }; + } + + iNormal.add(Vec3.createVectorHelper(curNormals[0], curNormals[1], curNormals[2])); + + normal[0] += curNormals[0]; + normal[1] += curNormals[1]; + normal[2] += curNormals[2]; + + if (vInt < verts.size()) + { + v.add(verts.get(vInt).setTexturePosition(curUV[0], curUV[1])); + if (verts.get(vInt) instanceof PositionTransformVertex) + { + ((PositionTransformVertex) verts.get(vInt)).addGroup(group); + } + } + if (ind > -1) + s = s.substring(s.indexOf(" ") + 1).trim(); + else + finalPhase++; + } while (finalPhase < 1); + + float d = MathHelper.sqrt_double(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2]); + + normal[0] /= d; + normal[1] /= d; + normal[2] /= d; + + PositionTextureVertex[] vToArr = new PositionTextureVertex[v.size()]; + + for (int i = 0; i < v.size(); i++) + { + vToArr[i] = v.get(i); + } + + TexturedPolygon poly = new TexturedPolygon(vToArr); + poly.setNormals(normal[0], normal[1], normal[2]); + poly.setNormals(iNormal); + + face.add(poly); + texture.addPoly(poly); + continue; + } + } + + vertices = new PositionTransformVertex[verts.size()]; + for (int i = 0; i < verts.size(); i++) + { + vertices[i] = verts.get(i); + } + faces = new TexturedPolygon[face.size()]; + for (int i = 0; i < face.size(); i++) + { + faces[i] = face.get(i); + } + in.close(); + } + catch (Throwable e) + { + + } + } } diff --git a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java b/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java index ba5f6b78..086b3e57 100644 --- a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java +++ b/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java @@ -19,6 +19,7 @@ import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.MathHelper; import org.lwjgl.opengl.GL11; + /** * An extension to the ModelRenderer class. It basically is a copy to ModelRenderer, * however, it contains various new methods to make your models. @@ -32,10 +33,10 @@ import org.lwjgl.opengl.GL11; */ public class ModelRendererTurbo extends ModelRenderer { - public ModelRendererTurbo(ModelBase modelbase, String s) - { - super(modelbase, s); - flip = false; + public ModelRendererTurbo(ModelBase modelbase, String s) + { + super(modelbase, s); + flip = false; compiled = false; displayList = 0; mirror = false; @@ -50,27 +51,27 @@ public class ModelRendererTurbo extends ModelRenderer textureGroup.put("0", new TextureGroup()); currentTextureGroup = textureGroup.get("0"); boxName = s; - + defaultTexture = ""; - + useLegacyCompiler = false; - } - - public ModelRendererTurbo(ModelBase modelbase) - { - this(modelbase, null); - } - - /** - * Creates a new ModelRenderTurbo object. It requires the coordinates of the - * position of the texture. - * @param modelbase - * @param textureX the x-coordinate on the texture - * @param textureY the y-coordinate on the texture - */ + } + + public ModelRendererTurbo(ModelBase modelbase) + { + this(modelbase, null); + } + + /** + * Creates a new ModelRenderTurbo object. It requires the coordinates of the + * position of the texture. + * @param modelbase + * @param textureX the x-coordinate on the texture + * @param textureY the y-coordinate on the texture + */ public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY) { - this(modelbase, textureX, textureY, 64, 32); + this(modelbase, textureX, textureY, 64, 32); } /** @@ -85,42 +86,42 @@ public class ModelRendererTurbo extends ModelRenderer */ public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY, int textureU, int textureV) { - this(modelbase); + this(modelbase); textureOffsetX = textureX; textureOffsetY = textureY; textureWidth = textureU; textureHeight = textureV; } - + /** * Creates a new polygon. * @param verts an array of vertices */ - public void addPolygon(PositionTextureVertex[] verts) + public void addPolygon (PositionTextureVertex[] verts) { - copyTo(verts, new TexturedPolygon[] {new TexturedPolygon(verts)}); + copyTo(verts, new TexturedPolygon[] { new TexturedPolygon(verts) }); } - + /** * Creates a new polygon, and adds UV mapping to it. * @param verts an array of vertices * @param uv an array of UV coordinates */ - public void addPolygon(PositionTextureVertex[] verts, int[][] uv) + public void addPolygon (PositionTextureVertex[] verts, int[][] uv) { - try - { - for(int i = 0; i < verts.length; i++) - { - verts[i] = verts[i].setTexturePosition((float)uv[i][0] / textureWidth, (float)uv[i][1] / textureHeight); - } - } - finally - { - addPolygon(verts); - } + try + { + for (int i = 0; i < verts.length; i++) + { + verts[i] = verts[i].setTexturePosition((float) uv[i][0] / textureWidth, (float) uv[i][1] / textureHeight); + } + } + finally + { + addPolygon(verts); + } } - + /** * Creates a new polygon with a given UV. * @param verts an array of vertices @@ -129,59 +130,59 @@ public class ModelRendererTurbo extends ModelRenderer * @param u2 * @param v2 */ - public void addPolygon(PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) + public void addPolygon (PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) { - copyTo(verts, new TexturedPolygon[] {addPolygonReturn(verts, u1, v1, u2, v2)}); + copyTo(verts, new TexturedPolygon[] { addPolygonReturn(verts, u1, v1, u2, v2) }); } - - private TexturedPolygon addPolygonReturn(PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) + + private TexturedPolygon addPolygonReturn (PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) { - if(verts.length < 3) - return null; - float uOffs = 1.0F / ((float) textureWidth * 10.0F); - float vOffs = 1.0F / ((float) textureHeight * 10.0F); - if(verts.length < 4) - { - float xMin = -1; - float yMin = -1; - float xMax = 0; - float yMax = 0; - - for(int i = 0; i < verts.length; i++) - { - float xPos = verts[i].texturePositionX; - float yPos = verts[i].texturePositionY; - xMax = Math.max(xMax, xPos); - xMin = (xMin < -1 ? xPos : Math.min(xMin, xPos)); - yMax = Math.max(yMax, yPos); - yMin = (yMin < -1 ? yPos : Math.min(yMin, yPos)); - } - float uMin = (float) u1 / (float) textureWidth + uOffs; - float vMin = (float) v1 / (float) textureHeight + vOffs; - float uSize = (float) (u2 - u1) / (float) textureWidth - uOffs * 2; - float vSize = (float) (v2 - v1) / (float) textureHeight - vOffs * 2; - - float xSize = xMax - xMin; - float ySize = yMax - yMin; - for(int i = 0; i < verts.length; i++) - { - float xPos = verts[i].texturePositionX; - float yPos = verts[i].texturePositionY; - xPos = (xPos - xMin) / xSize; - yPos = (yPos - yMin) / ySize; - verts[i] = verts[i].setTexturePosition(uMin + (xPos * uSize), vMin + (yPos * vSize)); - } - } - else - { - verts[0] = verts[0].setTexturePosition((float)u2 / (float) textureWidth - uOffs, (float)v1 / (float)textureHeight + vOffs); - verts[1] = verts[1].setTexturePosition((float)u1 / (float) textureWidth + uOffs, (float)v1 / (float)textureHeight + vOffs); - verts[2] = verts[2].setTexturePosition((float)u1 / (float) textureWidth + uOffs, (float)v2 / (float)textureHeight - vOffs); - verts[3] = verts[3].setTexturePosition((float)u2 / (float) textureWidth - uOffs, (float)v2 / (float)textureHeight - vOffs); - } - return new TexturedPolygon(verts); + if (verts.length < 3) + return null; + float uOffs = 1.0F / ((float) textureWidth * 10.0F); + float vOffs = 1.0F / ((float) textureHeight * 10.0F); + if (verts.length < 4) + { + float xMin = -1; + float yMin = -1; + float xMax = 0; + float yMax = 0; + + for (int i = 0; i < verts.length; i++) + { + float xPos = verts[i].texturePositionX; + float yPos = verts[i].texturePositionY; + xMax = Math.max(xMax, xPos); + xMin = (xMin < -1 ? xPos : Math.min(xMin, xPos)); + yMax = Math.max(yMax, yPos); + yMin = (yMin < -1 ? yPos : Math.min(yMin, yPos)); + } + float uMin = (float) u1 / (float) textureWidth + uOffs; + float vMin = (float) v1 / (float) textureHeight + vOffs; + float uSize = (float) (u2 - u1) / (float) textureWidth - uOffs * 2; + float vSize = (float) (v2 - v1) / (float) textureHeight - vOffs * 2; + + float xSize = xMax - xMin; + float ySize = yMax - yMin; + for (int i = 0; i < verts.length; i++) + { + float xPos = verts[i].texturePositionX; + float yPos = verts[i].texturePositionY; + xPos = (xPos - xMin) / xSize; + yPos = (yPos - yMin) / ySize; + verts[i] = verts[i].setTexturePosition(uMin + (xPos * uSize), vMin + (yPos * vSize)); + } + } + else + { + verts[0] = verts[0].setTexturePosition((float) u2 / (float) textureWidth - uOffs, (float) v1 / (float) textureHeight + vOffs); + verts[1] = verts[1].setTexturePosition((float) u1 / (float) textureWidth + uOffs, (float) v1 / (float) textureHeight + vOffs); + verts[2] = verts[2].setTexturePosition((float) u1 / (float) textureWidth + uOffs, (float) v2 / (float) textureHeight - vOffs); + verts[3] = verts[3].setTexturePosition((float) u2 / (float) textureWidth - uOffs, (float) v2 / (float) textureHeight - vOffs); + } + return new TexturedPolygon(verts); } - + /** * Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, * as the method requires eight vector coordinates. @@ -197,9 +198,9 @@ public class ModelRendererTurbo extends ModelRenderer * @param h the height of the shape, used in determining the texture * @param d the depth of the shape, used in determining the texture */ - public void addRectShape(float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d) + public void addRectShape (float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d) { - PositionTextureVertex[] verts = new PositionTextureVertex[8]; + PositionTextureVertex[] verts = new PositionTextureVertex[8]; TexturedPolygon[] poly = new TexturedPolygon[6]; PositionTextureVertex positionTexturevertex = new PositionTextureVertex(v[0], v[1], v[2], 0.0F, 0.0F); PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(v1[0], v1[1], v1[2], 0.0F, 8F); @@ -217,33 +218,27 @@ public class ModelRendererTurbo extends ModelRenderer verts[5] = positionTexturevertex5; verts[6] = positionTexturevertex6; verts[7] = positionTexturevertex7; - poly[0] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 - }, textureOffsetX + d + w, textureOffsetY + d, textureOffsetX + d + w + d, textureOffsetY + d + h); - poly[1] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 - }, textureOffsetX + 0, textureOffsetY + d, textureOffsetX + d, textureOffsetY + d + h); - poly[2] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 - }, textureOffsetX + d, textureOffsetY + 0, textureOffsetX + d + w, textureOffsetY + d); - poly[3] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 - }, textureOffsetX + d + w, textureOffsetY + 0, textureOffsetX + d + w + w, textureOffsetY + d); - poly[4] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 - }, textureOffsetX + d, textureOffsetY + d, textureOffsetX + d + w, textureOffsetY + d + h); - poly[5] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 - }, textureOffsetX + d + w + d, textureOffsetY + d, textureOffsetX + d + w + d + w, textureOffsetY + d + h); - if(mirror ^ flip) + poly[0] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, textureOffsetX + d + w, + textureOffsetY + d, textureOffsetX + d + w + d, textureOffsetY + d + h); + poly[1] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, textureOffsetX + 0, textureOffsetY + + d, textureOffsetX + d, textureOffsetY + d + h); + poly[2] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, textureOffsetX + d, + textureOffsetY + 0, textureOffsetX + d + w, textureOffsetY + d); + poly[3] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, textureOffsetX + d + w, + textureOffsetY + 0, textureOffsetX + d + w + w, textureOffsetY + d); + poly[4] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, textureOffsetX + d, textureOffsetY + + d, textureOffsetX + d + w, textureOffsetY + d + h); + poly[5] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, textureOffsetX + d + w + d, + textureOffsetY + d, textureOffsetX + d + w + d + w, textureOffsetY + d + h); + if (mirror ^ flip) { - for(int l = 0; l < poly.length; l++) + for (int l = 0; l < poly.length; l++) { - poly[l].flipFace(); + poly[l].flipFace(); } } - + copyTo(verts, poly); } @@ -256,12 +251,12 @@ public class ModelRendererTurbo extends ModelRenderer * @param h the height (over the y-direction) * @param d the depth (over the z-direction) */ - public ModelRendererTurbo addBox(float x, float y, float z, int w, int h, int d) + public ModelRendererTurbo addBox (float x, float y, float z, int w, int h, int d) { addBox(x, y, z, w, h, d, 0.0F); return this; } - + /** * Adds a new box to the model. * @param x the starting x-position @@ -272,11 +267,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param d the depth (over the z-direction) * @param expansion the expansion of the box. It increases the size in each direction by that many. */ - public void addBox(float x, float y, float z, int w, int h, int d, float expansion) + public void addBox (float x, float y, float z, int w, int h, int d, float expansion) { - addBox(x, y, z, w, h, d, expansion, 1F); + addBox(x, y, z, w, h, d, expansion, 1F); } - + /** * Adds a new box to the model. * @param x the starting x-position @@ -288,44 +283,44 @@ public class ModelRendererTurbo extends ModelRenderer * @param expansion the expansion of the box. It increases the size in each direction by that many. It's independent from the scale. * @param scale */ - public void addBox(float x, float y, float z, int w, int h, int d, float expansion, float scale) + public void addBox (float x, float y, float z, int w, int h, int d, float expansion, float scale) { - float scaleX = (float)w * scale; - float scaleY = (float)h * scale; - float scaleZ = (float)d * scale; - + float scaleX = (float) w * scale; + float scaleY = (float) h * scale; + float scaleZ = (float) d * scale; + float x1 = x + scaleX; float y1 = y + scaleY; float z1 = z + scaleZ; - - float expX = expansion + scaleX - (float)w; - float expY = expansion + scaleY - (float)h; - float expZ = expansion + scaleZ - (float)d; - + + float expX = expansion + scaleX - (float) w; + float expY = expansion + scaleY - (float) h; + float expZ = expansion + scaleZ - (float) d; + x -= expX; y -= expY; z -= expZ; x1 += expansion; y1 += expansion; z1 += expansion; - if(mirror) + if (mirror) { float xTemp = x1; x1 = x; x = xTemp; } - - float[] v = {x, y, z}; - float[] v1 = {x1, y, z}; - float[] v2 = {x1, y1, z}; - float[] v3 = {x, y1, z}; - float[] v4 = {x, y, z1}; - float[] v5 = {x1, y, z1}; - float[] v6 = {x1, y1, z1}; - float[] v7 = {x, y1, z1}; + + float[] v = { x, y, z }; + float[] v1 = { x1, y, z }; + float[] v2 = { x1, y1, z }; + float[] v3 = { x, y1, z }; + float[] v4 = { x, y, z1 }; + float[] v5 = { x1, y, z1 }; + float[] v6 = { x1, y1, z1 }; + float[] v7 = { x, y1, z1 }; addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); } - + /** * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. * You can use the static variables MR_RIGHT, MR_LEFT, @@ -341,102 +336,102 @@ public class ModelRendererTurbo extends ModelRenderer * @param bottomScale the "scale" of the bottom * @param dir the side the scaling is applied to */ - public void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir) + public void addTrapezoid (float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir) { - float width = x + (float)w; - float height = y + (float)h; - float depth = z + (float)d; + float width = x + (float) w; + float height = y + (float) h; + float depth = z + (float) d; x -= scale; y -= scale; z -= scale; width += scale; height += scale; depth += scale; - + int m = (mirror ? -1 : 1); - if(mirror) + if (mirror) { float f7 = width; width = x; x = f7; } - - float[] v = {x, y, z}; - float[] v1 = {width, y, z}; - float[] v2 = {width, height, z}; - float[] v3 = {x, height, z}; - float[] v4 = {x, y, depth}; - float[] v5 = {width, y, depth}; - float[] v6 = {width, height, depth}; - float[] v7 = {x, height, depth}; - - switch(dir) + + float[] v = { x, y, z }; + float[] v1 = { width, y, z }; + float[] v2 = { width, height, z }; + float[] v3 = { x, height, z }; + float[] v4 = { x, y, depth }; + float[] v5 = { width, y, depth }; + float[] v6 = { width, height, depth }; + float[] v7 = { x, height, depth }; + + switch (dir) { case MR_RIGHT: - v[1] -= bottomScale; - v[2] -= bottomScale; - v3[1] += bottomScale; - v3[2] -= bottomScale; - v4[1] -= bottomScale; - v4[2] += bottomScale; - v7[1] += bottomScale; - v7[2] += bottomScale; - break; + v[1] -= bottomScale; + v[2] -= bottomScale; + v3[1] += bottomScale; + v3[2] -= bottomScale; + v4[1] -= bottomScale; + v4[2] += bottomScale; + v7[1] += bottomScale; + v7[2] += bottomScale; + break; case MR_LEFT: - v1[1] -= bottomScale; - v1[2] -= bottomScale; - v2[1] += bottomScale; - v2[2] -= bottomScale; - v5[1] -= bottomScale; - v5[2] += bottomScale; - v6[1] += bottomScale; - v6[2] += bottomScale; - break; + v1[1] -= bottomScale; + v1[2] -= bottomScale; + v2[1] += bottomScale; + v2[2] -= bottomScale; + v5[1] -= bottomScale; + v5[2] += bottomScale; + v6[1] += bottomScale; + v6[2] += bottomScale; + break; case MR_FRONT: - v[0] -= m * bottomScale; - v[1] -= bottomScale; - v1[0] += m * bottomScale; - v1[1] -= bottomScale; - v2[0] += m * bottomScale; - v2[1] += bottomScale; - v3[0] -= m * bottomScale; - v3[1] += bottomScale; - break; + v[0] -= m * bottomScale; + v[1] -= bottomScale; + v1[0] += m * bottomScale; + v1[1] -= bottomScale; + v2[0] += m * bottomScale; + v2[1] += bottomScale; + v3[0] -= m * bottomScale; + v3[1] += bottomScale; + break; case MR_BACK: - v4[0] -= m * bottomScale; - v4[1] -= bottomScale; - v5[0] += m * bottomScale; - v5[1] -= bottomScale; - v6[0] += m * bottomScale; - v6[1] += bottomScale; - v7[0] -= m * bottomScale; - v7[1] += bottomScale; - break; + v4[0] -= m * bottomScale; + v4[1] -= bottomScale; + v5[0] += m * bottomScale; + v5[1] -= bottomScale; + v6[0] += m * bottomScale; + v6[1] += bottomScale; + v7[0] -= m * bottomScale; + v7[1] += bottomScale; + break; case MR_TOP: - v[0] -= m * bottomScale; - v[2] -= bottomScale; - v1[0] += m * bottomScale; - v1[2] -= bottomScale; - v4[0] -= m * bottomScale; - v4[2] += bottomScale; - v5[0] += m * bottomScale; - v5[2] += bottomScale; - break; + v[0] -= m * bottomScale; + v[2] -= bottomScale; + v1[0] += m * bottomScale; + v1[2] -= bottomScale; + v4[0] -= m * bottomScale; + v4[2] += bottomScale; + v5[0] += m * bottomScale; + v5[2] += bottomScale; + break; case MR_BOTTOM: - v2[0] += m * bottomScale; - v2[2] -= bottomScale; - v3[0] -= m * bottomScale; - v3[2] -= bottomScale; - v6[0] += m * bottomScale; - v6[2] += bottomScale; - v7[0] -= m * bottomScale; - v7[2] += bottomScale; - break; + v2[0] += m * bottomScale; + v2[2] -= bottomScale; + v3[0] -= m * bottomScale; + v3[2] -= bottomScale; + v6[0] += m * bottomScale; + v6[2] += bottomScale; + v7[0] -= m * bottomScale; + v7[2] += bottomScale; + break; } addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); } - + /** * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. * You can use the static variables MR_RIGHT, MR_LEFT, @@ -547,7 +542,7 @@ public class ModelRendererTurbo extends ModelRenderer addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); }*/ - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -561,11 +556,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param sideTextureHeight the height of the texture of the side of the shape * @param direction the direction the starting point of the shape is facing */ - public void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + public void addShape3D (float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) { - addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); } - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -581,11 +576,12 @@ public class ModelRendererTurbo extends ModelRenderer * @param faceLengths An array with the length of each face. Used to set * the texture width of each face on the side manually. */ - public void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + public void addShape3D (float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, + float[] faceLengths) { - addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); + addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); } - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -599,11 +595,12 @@ public class ModelRendererTurbo extends ModelRenderer * @param sideTextureHeight the height of the texture of the side of the shape * @param direction the direction the starting point of the shape is facing */ - public void addShape3D(float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + public void addShape3D (float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, + int direction) { - addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); } - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -619,9 +616,10 @@ public class ModelRendererTurbo extends ModelRenderer * @param faceLengths An array with the length of each face. Used to set * the texture width of each face on the side manually. */ - public void addShape3D(float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + public void addShape3D (float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, + int direction, float[] faceLengths) { - addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); + addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); } /** @@ -637,11 +635,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param sideTextureHeight the height of the texture of the side of the shape * @param direction the direction the starting point of the shape is facing */ - public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) { - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); } - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -657,34 +655,35 @@ public class ModelRendererTurbo extends ModelRenderer * @param faceLengths An array with the length of each face. Used to set * the texture width of each face on the side manually. */ - public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, + float[] faceLengths) { - float rotX = 0; - float rotY = 0; - float rotZ = 0; - switch(direction) - { - case MR_LEFT: - rotY = pi / 2; - break; - case MR_RIGHT: - rotY = -pi / 2; - break; - case MR_TOP: - rotX = pi / 2; - break; - case MR_BOTTOM: - rotX = -pi / 2; - break; - case MR_FRONT: - rotY = pi; - break; - case MR_BACK: - break; - } - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, faceLengths); + float rotX = 0; + float rotY = 0; + float rotZ = 0; + switch (direction) + { + case MR_LEFT: + rotY = pi / 2; + break; + case MR_RIGHT: + rotY = -pi / 2; + break; + case MR_TOP: + rotX = pi / 2; + break; + case MR_BOTTOM: + rotX = -pi / 2; + break; + case MR_FRONT: + rotY = pi; + break; + case MR_BACK: + break; + } + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, faceLengths); } - + /** * Creates a shape from a 2D vector shape. * @param x the starting x position @@ -700,26 +699,29 @@ public class ModelRendererTurbo extends ModelRenderer * @param rotY the rotation around the y-axis * @param rotZ the rotation around the z-axis */ - public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ) + public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, + float rotZ) { - addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, null); + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, null); } - - public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ, float[] faceLengths) + + public void addShape3D (float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, + float rotZ, float[] faceLengths) { - Shape3D shape3D = shape.extrude(x, y, z, rotX, rotY, rotZ, depth, textureOffsetX, textureOffsetY, textureWidth, textureHeight, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, faceLengths); - - if(flip) - { - for(int idx = 0; idx < shape3D.faces.length; idx++) - { - shape3D.faces[idx].flipFace(); - } - } - - copyTo(shape3D.vertices, shape3D.faces); + Shape3D shape3D = shape.extrude(x, y, z, rotX, rotY, rotZ, depth, textureOffsetX, textureOffsetY, textureWidth, textureHeight, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, + sideTextureHeight, faceLengths); + + if (flip) + { + for (int idx = 0; idx < shape3D.faces.length; idx++) + { + shape3D.faces[idx].flipFace(); + } + } + + copyTo(shape3D.vertices, shape3D.faces); } - + /** * Adds a cube the size of one pixel. It will take a pixel from the texture and * uses that as the texture of said cube. The accurate name would actually be @@ -732,11 +734,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param height the height of the box * @param length the length of the box */ - public void addPixel(float x, float y, float z, float width, float height, float length) + public void addPixel (float x, float y, float z, float width, float height, float length) { - addPixel(x, y, z, new float[] {width, height, length}, textureOffsetX, textureOffsetY); + addPixel(x, y, z, new float[] { width, height, length }, textureOffsetX, textureOffsetY); } - + /** * Adds a cube the size of one pixel. It will take a pixel from the texture and * uses that as the texture of said cube. The accurate name would actually be @@ -749,23 +751,23 @@ public class ModelRendererTurbo extends ModelRenderer * @param w the x-coordinate on the texture * @param h the y-coordinate on the texture */ - public void addPixel(float x, float y, float z, float[] scale, int w, int h) + public void addPixel (float x, float y, float z, float[] scale, int w, int h) { - PositionTextureVertex[] verts = new PositionTextureVertex[8]; - TexturedPolygon[] poly = new TexturedPolygon[6]; - - float x1 = x + scale[0]; - float y1 = y + scale[1]; - float z1 = z + scale[2]; - - float[] f = {x, y, z}; - float[] f1 = {x1, y, z}; - float[] f2 = {x1, y1, z}; - float[] f3 = {x, y1, z}; - float[] f4 = {x, y, z1}; - float[] f5 = {x1, y, z1}; - float[] f6 = {x1, y1, z1}; - float[] f7 = {x, y1, z1}; + PositionTextureVertex[] verts = new PositionTextureVertex[8]; + TexturedPolygon[] poly = new TexturedPolygon[6]; + + float x1 = x + scale[0]; + float y1 = y + scale[1]; + float z1 = z + scale[2]; + + float[] f = { x, y, z }; + float[] f1 = { x1, y, z }; + float[] f2 = { x1, y1, z }; + float[] f3 = { x, y1, z }; + float[] f4 = { x, y, z1 }; + float[] f5 = { x1, y, z1 }; + float[] f6 = { x1, y1, z1 }; + float[] f7 = { x, y1, z1 }; PositionTextureVertex positionTexturevertex = new PositionTextureVertex(f[0], f[1], f[2], 0.0F, 0.0F); PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(f1[0], f1[1], f1[2], 0.0F, 8F); PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(f2[0], f2[1], f2[2], 8F, 8F); @@ -783,29 +785,17 @@ public class ModelRendererTurbo extends ModelRenderer verts[5] = positionTexturevertex5; verts[6] = positionTexturevertex6; verts[7] = positionTexturevertex7; - - poly[0] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 - }, w, h, w + 1, h + 1); - poly[1] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 - }, w, h, w + 1, h + 1); - poly[2] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 - }, w, h, w + 1, h + 1); - poly[3] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 - }, w, h, w + 1, h + 1); - poly[4] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 - }, w, h, w + 1, h + 1); - poly[5] = addPolygonReturn(new PositionTextureVertex[] { - positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 - }, w, h, w + 1, h + 1); - + + poly[0] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, w, h, w + 1, h + 1); + poly[1] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, w, h, w + 1, h + 1); + poly[2] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, w, h, w + 1, h + 1); + poly[3] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, w, h, w + 1, h + 1); + poly[4] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, w, h, w + 1, h + 1); + poly[5] = addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, w, h, w + 1, h + 1); + copyTo(verts, poly); } - + /** * Creates a model shaped like the exact image on the texture. Note that this method will * increase the amount of quads on your model, which could effectively slow down your @@ -818,11 +808,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param h the height of the sprite * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. */ - public void addSprite(float x, float y, float z, int w, int h, float expansion) + public void addSprite (float x, float y, float z, int w, int h, float expansion) { - addSprite(x, y, z, w, h, 1, false, false, false, false, false, expansion); + addSprite(x, y, z, w, h, 1, false, false, false, false, false, expansion); } - + /** * Creates a model shaped like the exact image on the texture. Note that this method will * increase the amount of quads on your model, which could effectively slow down your @@ -840,11 +830,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param mirrorY a boolean to define if the sprite should be flipped * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. */ - public void addSprite(float x, float y, float z, int w, int h, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + public void addSprite (float x, float y, float z, int w, int h, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) { - addSprite(x, y, z, w, h, 1, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + addSprite(x, y, z, w, h, 1, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); } - + /** * Creates a model shaped like the exact image on the texture. Note that this method will * increase the amount of quads on your model, which could effectively slow down your @@ -863,11 +853,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param mirrorY a boolean to define if the sprite should be flipped * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. */ - public void addSprite(float x, float y, float z, int w, int h, int d, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + public void addSprite (float x, float y, float z, int w, int h, int d, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) { - addSprite(x, y, z, w, h, d, 1.0F, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + addSprite(x, y, z, w, h, d, 1.0F, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); } - + /** * Creates a model shaped like the exact image on the texture. Note that this method will * increase the amount of quads on your model, which could effectively slow down your @@ -887,14 +877,14 @@ public class ModelRendererTurbo extends ModelRenderer * @param mirrorY a boolean to define if the sprite should be flipped * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. */ - public void addSprite(float x, float y, float z, int w, int h, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + public void addSprite (float x, float y, float z, int w, int h, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) { - String[] mask = new String[h]; - char[] str = new char[w]; - Arrays.fill(str, '1'); - Arrays.fill(mask, new String(str)); - - addSprite(x, y, z, mask, d, pixelScale, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + String[] mask = new String[h]; + char[] str = new char[w]; + Arrays.fill(str, '1'); + Arrays.fill(mask, new String(str)); + + addSprite(x, y, z, mask, d, pixelScale, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); } /** @@ -919,118 +909,116 @@ public class ModelRendererTurbo extends ModelRenderer * @param mirrorY a boolean to define if the sprite should be flipped * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. */ - public void addSprite(float x, float y, float z, String[] mask, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + public void addSprite (float x, float y, float z, String[] mask, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) { - int w = mask[0].length(); - int h = mask.length; - - float x1 = x - expansion; - float y1 = y - expansion; - float z1 = z - expansion; - - int wDir = 0; - int hDir = 0; - int dDir = 0; - - float wScale = 1F + (expansion / ((float) w * pixelScale)); - float hScale = 1F + (expansion / ((float) h * pixelScale)); - - if(!rotX) - { - if(!rotY) - { - if(!rotZ) - { - wDir = 0; - hDir = 1; - dDir = 2; - } - else - { - wDir = 1; - hDir = 0; - dDir = 2; - } - } - else - { - if(!rotZ) - { - wDir = 2; - hDir = 1; - dDir = 0; - } - else - { - wDir = 2; - hDir = 0; - dDir = 1; - } - } - } - else - { - if(!rotY) - { - if(!rotZ) - { - wDir = 0; - hDir = 2; - dDir = 1; - } - else - { - wDir = 1; - hDir = 2; - dDir = 0; - } - } - else - { - if(!rotZ) - { - wDir = 2; - hDir = 0; - dDir = 1; - } - else - { - wDir = 2; - hDir = 1; - dDir = 0; - } - } - } - - int texStartX = textureOffsetX + (mirrorX ? w * 1 - 1 : 0); - int texStartY = textureOffsetY + (mirrorY ? h * 1 - 1 : 0); - int texDirX = (mirrorX ? -1 : 1); - int texDirY = (mirrorY ? -1 : 1); - - float wVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, wDir, 1, 1); - float hVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, hDir, 1, 1); - float dVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, dDir, 1, 1); - - for(int i = 0; i < w; i++) - { - for(int j = 0; j < h; j++) - { - if(mask[j].charAt(i) == '1') - { - addPixel(x1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 0, i, j), - y1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 1, i, j), - z1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 2, i, j), - new float[] {wVoxSize, hVoxSize, dVoxSize}, texStartX + texDirX * i, texStartY + texDirY * j); - } - } - } + int w = mask[0].length(); + int h = mask.length; + + float x1 = x - expansion; + float y1 = y - expansion; + float z1 = z - expansion; + + int wDir = 0; + int hDir = 0; + int dDir = 0; + + float wScale = 1F + (expansion / ((float) w * pixelScale)); + float hScale = 1F + (expansion / ((float) h * pixelScale)); + + if (!rotX) + { + if (!rotY) + { + if (!rotZ) + { + wDir = 0; + hDir = 1; + dDir = 2; + } + else + { + wDir = 1; + hDir = 0; + dDir = 2; + } + } + else + { + if (!rotZ) + { + wDir = 2; + hDir = 1; + dDir = 0; + } + else + { + wDir = 2; + hDir = 0; + dDir = 1; + } + } + } + else + { + if (!rotY) + { + if (!rotZ) + { + wDir = 0; + hDir = 2; + dDir = 1; + } + else + { + wDir = 1; + hDir = 2; + dDir = 0; + } + } + else + { + if (!rotZ) + { + wDir = 2; + hDir = 0; + dDir = 1; + } + else + { + wDir = 2; + hDir = 1; + dDir = 0; + } + } + } + + int texStartX = textureOffsetX + (mirrorX ? w * 1 - 1 : 0); + int texStartY = textureOffsetY + (mirrorY ? h * 1 - 1 : 0); + int texDirX = (mirrorX ? -1 : 1); + int texDirY = (mirrorY ? -1 : 1); + + float wVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, wDir, 1, 1); + float hVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, hDir, 1, 1); + float dVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, dDir, 1, 1); + + for (int i = 0; i < w; i++) + { + for (int j = 0; j < h; j++) + { + if (mask[j].charAt(i) == '1') + { + addPixel(x1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 0, i, j), y1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 1, i, j), + z1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 2, i, j), new float[] { wVoxSize, hVoxSize, dVoxSize }, texStartX + texDirX * i, texStartY + texDirY * j); + } + } + } } - - private float getPixelSize(float wScale, float hScale, float dScale, int wDir, int hDir, int checkDir, int texPosX, int texPosY) + + private float getPixelSize (float wScale, float hScale, float dScale, int wDir, int hDir, int checkDir, int texPosX, int texPosY) { - return (wDir == checkDir ? wScale * texPosX : (hDir == checkDir ? hScale * texPosY : dScale)); + return (wDir == checkDir ? wScale * texPosX : (hDir == checkDir ? hScale * texPosY : dScale)); } - + /** * Adds a spherical shape. * @param x @@ -1042,95 +1030,95 @@ public class ModelRendererTurbo extends ModelRenderer * @param textureW * @param textureH */ - public void addSphere(float x, float y, float z, float r, int segs, int rings, int textureW, int textureH) + public void addSphere (float x, float y, float z, float r, int segs, int rings, int textureW, int textureH) { - if(segs < 3) - segs = 3; - rings++; - PositionTextureVertex[] tempVerts = new PositionTextureVertex[segs * (rings - 1) + 2]; - TexturedPolygon[] poly = new TexturedPolygon[segs * rings]; - - tempVerts[0] = new PositionTextureVertex(x, y - r, z, 0, 0); - tempVerts[tempVerts.length - 1] = new PositionTextureVertex(x, y + r, z, 0, 0); - - float uOffs = 1.0F / ((float) textureWidth * 10.0F); - float vOffs = 1.0F / ((float) textureHeight * 10.0F); - float texW = (float) textureW / (float)textureWidth - 2F * uOffs; - float texH = (float) textureH / (float)textureHeight - 2F * vOffs; - float segW = texW / (float) segs; - float segH = texH / (float) rings; - float startU = (float) textureOffsetX / (float) textureWidth; - float startV = (float) textureOffsetY / (float) textureHeight; - - int currentFace = 0; - - for(int j = 1; j < rings; j++) - { - for(int i = 0; i < segs; i++) - { - float yWidth = MathHelper.cos(-pi / 2 + (pi / (float)rings) * (float) j); - float yHeight = MathHelper.sin(-pi / 2 + (pi / (float)rings) * (float) j); - float xSize = MathHelper.sin((pi / (float)segs) * i * 2F + pi) * yWidth; - float zSize = -MathHelper.cos((pi / (float)segs) * i * 2F + pi) * yWidth; - int curVert = 1 + i + segs * (j - 1); - tempVerts[curVert] = new PositionTextureVertex(x + xSize * r, y + yHeight * r, z + zSize * r, 0, 0); - if(i > 0) - { - PositionTextureVertex[] verts; - if(j == 1) - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); - verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); - verts[2] = tempVerts[0].setTexturePosition(startU + segW * (i - 1), startV); - verts[3] = tempVerts[0].setTexturePosition(startU + segW + segW * i, startV); - } - else - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); - verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); - verts[2] = tempVerts[curVert - 1 - segs].setTexturePosition(startU + segW * (i - 1), startV + segH * (j - 1)); - verts[3] = tempVerts[curVert - segs].setTexturePosition(startU + segW * i, startV + segH * (j - 1)); - } - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - } - PositionTextureVertex[] verts; - if(j == 1) - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[1].setTexturePosition(startU + segW * segs, startV + segH * j); - verts[1] = tempVerts[segs].setTexturePosition(startU + segW * (segs - 1), startV + segH * j); - verts[2] = tempVerts[0].setTexturePosition(startU + segW * (segs - 1), startV); - verts[3] = tempVerts[0].setTexturePosition(startU + segW * segs, startV); - } - else - { - verts = new PositionTextureVertex[4]; - verts[0] = tempVerts[1 + segs * (j - 1)].setTexturePosition(startU + texW, startV + segH * j); - verts[1] = tempVerts[segs * (j - 1) + segs].setTexturePosition(startU + texW - segW, startV + segH * j); - verts[2] = tempVerts[segs * (j - 1)].setTexturePosition(startU + texW - segW, startV + segH * (j - 1)); - verts[3] = tempVerts[1 + segs * (j - 1) - segs].setTexturePosition(startU + texW, startV + segH * (j - 1)); - } - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - for(int i = 0; i < segs; i++) - { - PositionTextureVertex[] verts = new PositionTextureVertex[3]; - int curVert = tempVerts.length - (segs + 1); - verts[0] = tempVerts[tempVerts.length - 1].setTexturePosition(startU + segW * (i + 0.5F), startV + texH); - verts[1] = tempVerts[curVert + i].setTexturePosition(startU + segW * i, startV + texH - segH); - verts[2] = tempVerts[curVert + ((i + 1) % segs)].setTexturePosition(startU + segW * (i + 1), startV + texH - segH); - poly[currentFace] = new TexturedPolygon(verts); - currentFace++; - } - - copyTo(tempVerts, poly); + if (segs < 3) + segs = 3; + rings++; + PositionTextureVertex[] tempVerts = new PositionTextureVertex[segs * (rings - 1) + 2]; + TexturedPolygon[] poly = new TexturedPolygon[segs * rings]; + + tempVerts[0] = new PositionTextureVertex(x, y - r, z, 0, 0); + tempVerts[tempVerts.length - 1] = new PositionTextureVertex(x, y + r, z, 0, 0); + + float uOffs = 1.0F / ((float) textureWidth * 10.0F); + float vOffs = 1.0F / ((float) textureHeight * 10.0F); + float texW = (float) textureW / (float) textureWidth - 2F * uOffs; + float texH = (float) textureH / (float) textureHeight - 2F * vOffs; + float segW = texW / (float) segs; + float segH = texH / (float) rings; + float startU = (float) textureOffsetX / (float) textureWidth; + float startV = (float) textureOffsetY / (float) textureHeight; + + int currentFace = 0; + + for (int j = 1; j < rings; j++) + { + for (int i = 0; i < segs; i++) + { + float yWidth = MathHelper.cos(-pi / 2 + (pi / (float) rings) * (float) j); + float yHeight = MathHelper.sin(-pi / 2 + (pi / (float) rings) * (float) j); + float xSize = MathHelper.sin((pi / (float) segs) * i * 2F + pi) * yWidth; + float zSize = -MathHelper.cos((pi / (float) segs) * i * 2F + pi) * yWidth; + int curVert = 1 + i + segs * (j - 1); + tempVerts[curVert] = new PositionTextureVertex(x + xSize * r, y + yHeight * r, z + zSize * r, 0, 0); + if (i > 0) + { + PositionTextureVertex[] verts; + if (j == 1) + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); + verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); + verts[2] = tempVerts[0].setTexturePosition(startU + segW * (i - 1), startV); + verts[3] = tempVerts[0].setTexturePosition(startU + segW + segW * i, startV); + } + else + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); + verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); + verts[2] = tempVerts[curVert - 1 - segs].setTexturePosition(startU + segW * (i - 1), startV + segH * (j - 1)); + verts[3] = tempVerts[curVert - segs].setTexturePosition(startU + segW * i, startV + segH * (j - 1)); + } + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + } + PositionTextureVertex[] verts; + if (j == 1) + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[1].setTexturePosition(startU + segW * segs, startV + segH * j); + verts[1] = tempVerts[segs].setTexturePosition(startU + segW * (segs - 1), startV + segH * j); + verts[2] = tempVerts[0].setTexturePosition(startU + segW * (segs - 1), startV); + verts[3] = tempVerts[0].setTexturePosition(startU + segW * segs, startV); + } + else + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[1 + segs * (j - 1)].setTexturePosition(startU + texW, startV + segH * j); + verts[1] = tempVerts[segs * (j - 1) + segs].setTexturePosition(startU + texW - segW, startV + segH * j); + verts[2] = tempVerts[segs * (j - 1)].setTexturePosition(startU + texW - segW, startV + segH * (j - 1)); + verts[3] = tempVerts[1 + segs * (j - 1) - segs].setTexturePosition(startU + texW, startV + segH * (j - 1)); + } + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + for (int i = 0; i < segs; i++) + { + PositionTextureVertex[] verts = new PositionTextureVertex[3]; + int curVert = tempVerts.length - (segs + 1); + verts[0] = tempVerts[tempVerts.length - 1].setTexturePosition(startU + segW * (i + 0.5F), startV + texH); + verts[1] = tempVerts[curVert + i].setTexturePosition(startU + segW * i, startV + texH - segH); + verts[2] = tempVerts[curVert + ((i + 1) % segs)].setTexturePosition(startU + segW * (i + 1), startV + texH - segH); + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + + copyTo(tempVerts, poly); } - + /** * Adds a cone. * @param x the x-position of the base @@ -1140,11 +1128,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param length the length of the cylinder * @param segments the amount of segments the cylinder is made of */ - public void addCone(float x, float y, float z, float radius, float length, int segments) + public void addCone (float x, float y, float z, float radius, float length, int segments) { - addCone(x, y, z, radius, length, segments, 1F); + addCone(x, y, z, radius, length, segments, 1F); } - + /** * Adds a cone. * @@ -1158,11 +1146,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param segments the amount of segments the cylinder is made of * @param baseScale the scaling of the base. Can be negative. */ - public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale) + public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale) { - addCone(x, y, z, radius, length, segments, baseScale, MR_TOP); + addCone(x, y, z, radius, length, segments, baseScale, MR_TOP); } - + /** * Adds a cone. * @@ -1179,12 +1167,12 @@ public class ModelRendererTurbo extends ModelRenderer * @param segments the amount of segments the cylinder is made of * @param baseScale the scaling of the base. Can be negative. * @param baseDirection the direction it faces - */ - public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection) + */ + public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection) { - addCone(x, y, z, radius, length, segments, baseScale, baseDirection, (int)Math.floor(radius * 2F), (int)Math.floor(radius * 2F)); + addCone(x, y, z, radius, length, segments, baseScale, baseDirection, (int) Math.floor(radius * 2F), (int) Math.floor(radius * 2F)); } - + /** * Adds a cone. * @@ -1206,11 +1194,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param textureCircleDiameterW the diameter width of the circle on the texture * @param textureCircleDiameterH the diameter height of the circle on the texture */ - public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH) + public void addCone (float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH) { - addCylinder(x, y, z, radius, length, segments, baseScale, 0.0F, baseDirection, textureCircleDiameterW, textureCircleDiameterH, 1); + addCylinder(x, y, z, radius, length, segments, baseScale, 0.0F, baseDirection, textureCircleDiameterW, textureCircleDiameterH, 1); } - + /** * Adds a cylinder. * @param x the x-position of the base @@ -1220,11 +1208,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param length the length of the cylinder * @param segments the amount of segments the cylinder is made of */ - public void addCylinder(float x, float y, float z, float radius, float length, int segments) + public void addCylinder (float x, float y, float z, float radius, float length, int segments) { - addCylinder(x, y, z, radius, length, segments, 1F, 1F); + addCylinder(x, y, z, radius, length, segments, 1F, 1F); } - + /** * Adds a cylinder. * @@ -1240,11 +1228,11 @@ public class ModelRendererTurbo extends ModelRenderer * @param baseScale the scaling of the base. Can be negative. * @param topScale the scaling of the top. Can be negative. */ - public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale) + public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale) { - addCylinder(x, y, z, radius, length, segments, baseScale, topScale, MR_TOP); + addCylinder(x, y, z, radius, length, segments, baseScale, topScale, MR_TOP); } - + /** * Adds a cylinder. * @@ -1263,12 +1251,12 @@ public class ModelRendererTurbo extends ModelRenderer * @param baseScale the scaling of the base. Can be negative. * @param topScale the scaling of the top. Can be negative. * @param baseDirection the direction it faces - */ - public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection) + */ + public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection) { - addCylinder(x, y, z, radius, length, segments, baseScale, topScale, baseDirection, (int)Math.floor(radius * 2F), (int)Math.floor(radius * 2F), (int)Math.floor(length)); + addCylinder(x, y, z, radius, length, segments, baseScale, topScale, baseDirection, (int) Math.floor(radius * 2F), (int) Math.floor(radius * 2F), (int) Math.floor(length)); } - + /** * Adds a cylinder. * @@ -1294,161 +1282,162 @@ public class ModelRendererTurbo extends ModelRenderer * @param textureCircleDiameterH the diameter height of the circle on the texture * @param textureH the height of the texture of the body */ - public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH, int textureH) + public void addCylinder (float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection, int textureCircleDiameterW, + int textureCircleDiameterH, int textureH) { - boolean dirTop = (baseDirection == MR_TOP || baseDirection == MR_BOTTOM); - boolean dirSide = (baseDirection == MR_RIGHT || baseDirection == MR_LEFT); - boolean dirFront = (baseDirection == MR_FRONT || baseDirection == MR_BACK); - boolean dirMirror = (baseDirection == MR_LEFT || baseDirection == MR_BOTTOM || baseDirection == MR_BACK); - - boolean coneBase = (baseScale == 0); - boolean coneTop = (topScale == 0); - - if(coneBase && coneTop) - { - baseScale = 1F; - coneBase = false; - } - - PositionTextureVertex[] tempVerts = new PositionTextureVertex[segments * (coneBase || coneTop ? 1 : 2) + 2]; - TexturedPolygon[] poly = new TexturedPolygon[segments * (coneBase || coneTop ? 2 : 3)]; - - float xLength = (dirSide ? length : 0); - float yLength = (dirTop ? length : 0); - float zLength = (dirFront ? length : 0); - - float xStart = (dirMirror ? x + xLength : x); - float yStart = (dirMirror ? y + yLength : y); - float zStart = (dirMirror ? z + zLength : z); - float xEnd = (!dirMirror ? x + xLength : x); - float yEnd = (!dirMirror ? y + yLength : y); - float zEnd = (!dirMirror ? z + zLength : z); - - tempVerts[0] = new PositionTextureVertex(xStart, yStart, zStart, 0, 0); - tempVerts[tempVerts.length - 1] = new PositionTextureVertex(xEnd, yEnd, zEnd, 0, 0); - - float xCur = xStart; - float yCur = yStart; - float zCur = zStart; - float sCur = (coneBase ? topScale : baseScale); - for(int repeat = 0; repeat < (coneBase || coneTop ? 1 : 2); repeat++) - { - for(int index = 0; index < segments; index++) - { - float xSize = (mirror ^ dirMirror ? -1 : 1) * MathHelper.sin((pi / (float)segments) * index * 2F + pi) * radius * sCur; - float zSize = -MathHelper.cos((pi / (float)segments) * index * 2F + pi) * radius * sCur; - - float xPlace = xCur + (!dirSide ? xSize : 0); - float yPlace = yCur + (!dirTop ? zSize : 0); - float zPlace = zCur + (dirSide ? xSize : (dirTop ? zSize : 0)); - - tempVerts[1 + index + repeat * segments] = new PositionTextureVertex(xPlace, yPlace, zPlace, 0, 0 ); - } - xCur = xEnd; - yCur = yEnd; - zCur = zEnd; - sCur = topScale; - } - - float uScale = 1.0F / (float) textureWidth; - float vScale = 1.0F / (float) textureHeight; - float uOffset = uScale / 20.0F; - float vOffset = vScale / 20.0F; - float uCircle = (float)textureCircleDiameterW * uScale; - float vCircle = (float)textureCircleDiameterH * vScale; - float uWidth = (uCircle * 2F - uOffset * 2F) / (float) segments; - float vHeight = (float)textureH * vScale - uOffset * 2f; - float uStart = (float)textureOffsetX * uScale; - float vStart = (float)textureOffsetY * vScale; - - PositionTextureVertex[] vert; - for(int index = 0; index < segments; index++) - { - int index2 = (index + 1) % segments; - float uSize = MathHelper.sin((pi / (float)segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); - float vSize = MathHelper.cos((pi / (float)segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); - float uSize1 = MathHelper.sin((pi / (float)segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); - float vSize1 = MathHelper.cos((pi / (float)segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); - vert = new PositionTextureVertex[3]; - - vert[0] = tempVerts[0].setTexturePosition(uStart + 0.5F * uCircle, vStart + 0.5F * vCircle); - vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + 0.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); - vert[2] = tempVerts[1 + index].setTexturePosition(uStart + 0.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); - - poly[index] = new TexturedPolygon(vert); - if(mirror ^ flip) - poly[index].flipFace(); - - if(!coneBase && !coneTop) - { - vert = new PositionTextureVertex[4]; - - vert[0] = tempVerts[1 + index].setTexturePosition(uStart + uOffset + uWidth * (float)index, vStart + vOffset + vCircle); - vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + uOffset + uWidth * (float)(index + 1), vStart + vOffset + vCircle); - vert[2] = tempVerts[1 + segments + index2].setTexturePosition(uStart + uOffset + uWidth * (float)(index + 1), vStart + vOffset + vCircle + vHeight); - vert[3] = tempVerts[1 + segments + index].setTexturePosition(uStart + uOffset + uWidth * (float)index, vStart + vOffset + vCircle + vHeight); - poly[index + segments] = new TexturedPolygon(vert); - if(mirror ^ flip) - poly[index + segments].flipFace(); - } - - vert = new PositionTextureVertex[3]; - - vert[0] = tempVerts[tempVerts.length - 1].setTexturePosition(uStart + 1.5F * uCircle, vStart + 0.5F * vCircle); - vert[1] = tempVerts[tempVerts.length - 2 - index].setTexturePosition(uStart + 1.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); - vert[2] = tempVerts[tempVerts.length - (1 + segments) + ((segments - index) % segments)].setTexturePosition(uStart + 1.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); - - poly[poly.length - segments + index] = new TexturedPolygon(vert); - if(mirror ^ flip) - poly[poly.length - segments + index].flipFace(); - } - copyTo(tempVerts, poly); + boolean dirTop = (baseDirection == MR_TOP || baseDirection == MR_BOTTOM); + boolean dirSide = (baseDirection == MR_RIGHT || baseDirection == MR_LEFT); + boolean dirFront = (baseDirection == MR_FRONT || baseDirection == MR_BACK); + boolean dirMirror = (baseDirection == MR_LEFT || baseDirection == MR_BOTTOM || baseDirection == MR_BACK); + + boolean coneBase = (baseScale == 0); + boolean coneTop = (topScale == 0); + + if (coneBase && coneTop) + { + baseScale = 1F; + coneBase = false; + } + + PositionTextureVertex[] tempVerts = new PositionTextureVertex[segments * (coneBase || coneTop ? 1 : 2) + 2]; + TexturedPolygon[] poly = new TexturedPolygon[segments * (coneBase || coneTop ? 2 : 3)]; + + float xLength = (dirSide ? length : 0); + float yLength = (dirTop ? length : 0); + float zLength = (dirFront ? length : 0); + + float xStart = (dirMirror ? x + xLength : x); + float yStart = (dirMirror ? y + yLength : y); + float zStart = (dirMirror ? z + zLength : z); + float xEnd = (!dirMirror ? x + xLength : x); + float yEnd = (!dirMirror ? y + yLength : y); + float zEnd = (!dirMirror ? z + zLength : z); + + tempVerts[0] = new PositionTextureVertex(xStart, yStart, zStart, 0, 0); + tempVerts[tempVerts.length - 1] = new PositionTextureVertex(xEnd, yEnd, zEnd, 0, 0); + + float xCur = xStart; + float yCur = yStart; + float zCur = zStart; + float sCur = (coneBase ? topScale : baseScale); + for (int repeat = 0; repeat < (coneBase || coneTop ? 1 : 2); repeat++) + { + for (int index = 0; index < segments; index++) + { + float xSize = (mirror ^ dirMirror ? -1 : 1) * MathHelper.sin((pi / (float) segments) * index * 2F + pi) * radius * sCur; + float zSize = -MathHelper.cos((pi / (float) segments) * index * 2F + pi) * radius * sCur; + + float xPlace = xCur + (!dirSide ? xSize : 0); + float yPlace = yCur + (!dirTop ? zSize : 0); + float zPlace = zCur + (dirSide ? xSize : (dirTop ? zSize : 0)); + + tempVerts[1 + index + repeat * segments] = new PositionTextureVertex(xPlace, yPlace, zPlace, 0, 0); + } + xCur = xEnd; + yCur = yEnd; + zCur = zEnd; + sCur = topScale; + } + + float uScale = 1.0F / (float) textureWidth; + float vScale = 1.0F / (float) textureHeight; + float uOffset = uScale / 20.0F; + float vOffset = vScale / 20.0F; + float uCircle = (float) textureCircleDiameterW * uScale; + float vCircle = (float) textureCircleDiameterH * vScale; + float uWidth = (uCircle * 2F - uOffset * 2F) / (float) segments; + float vHeight = (float) textureH * vScale - uOffset * 2f; + float uStart = (float) textureOffsetX * uScale; + float vStart = (float) textureOffsetY * vScale; + + PositionTextureVertex[] vert; + for (int index = 0; index < segments; index++) + { + int index2 = (index + 1) % segments; + float uSize = MathHelper.sin((pi / (float) segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); + float vSize = MathHelper.cos((pi / (float) segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); + float uSize1 = MathHelper.sin((pi / (float) segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); + float vSize1 = MathHelper.cos((pi / (float) segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); + vert = new PositionTextureVertex[3]; + + vert[0] = tempVerts[0].setTexturePosition(uStart + 0.5F * uCircle, vStart + 0.5F * vCircle); + vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + 0.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); + vert[2] = tempVerts[1 + index].setTexturePosition(uStart + 0.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); + + poly[index] = new TexturedPolygon(vert); + if (mirror ^ flip) + poly[index].flipFace(); + + if (!coneBase && !coneTop) + { + vert = new PositionTextureVertex[4]; + + vert[0] = tempVerts[1 + index].setTexturePosition(uStart + uOffset + uWidth * (float) index, vStart + vOffset + vCircle); + vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + uOffset + uWidth * (float) (index + 1), vStart + vOffset + vCircle); + vert[2] = tempVerts[1 + segments + index2].setTexturePosition(uStart + uOffset + uWidth * (float) (index + 1), vStart + vOffset + vCircle + vHeight); + vert[3] = tempVerts[1 + segments + index].setTexturePosition(uStart + uOffset + uWidth * (float) index, vStart + vOffset + vCircle + vHeight); + poly[index + segments] = new TexturedPolygon(vert); + if (mirror ^ flip) + poly[index + segments].flipFace(); + } + + vert = new PositionTextureVertex[3]; + + vert[0] = tempVerts[tempVerts.length - 1].setTexturePosition(uStart + 1.5F * uCircle, vStart + 0.5F * vCircle); + vert[1] = tempVerts[tempVerts.length - 2 - index].setTexturePosition(uStart + 1.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); + vert[2] = tempVerts[tempVerts.length - (1 + segments) + ((segments - index) % segments)].setTexturePosition(uStart + 1.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); + + poly[poly.length - segments + index] = new TexturedPolygon(vert); + if (mirror ^ flip) + poly[poly.length - segments + index].flipFace(); + } + copyTo(tempVerts, poly); } - + /** * Adds a Waveform .obj file as a model. Model files use the entire texture file. * @param file the location of the .obj file. The location is relative to the base directories, * which are either resources/models or resources/mods/models. */ - public void addObj(String file) + public void addObj (String file) { - addModel(file, ModelPool.OBJ); + addModel(file, ModelPool.OBJ); } - + /** * Adds model format support. Model files use the entire texture file. * @param file the location of the model file. The location is relative to the base directories, * which are either resources/models or resources/mods/models. * @param modelFormat the class of the model format interpreter */ - public void addModel(String file, Class modelFormat) + public void addModel (String file, Class modelFormat) { - ModelPoolEntry entry = ModelPool.addFile(file, modelFormat, transformGroup, textureGroup); - if(entry == null) - return; - PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length); - TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length); - if(flip) - { - for(int l = 0; l < faces.length; l++) + ModelPoolEntry entry = ModelPool.addFile(file, modelFormat, transformGroup, textureGroup); + if (entry == null) + return; + PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length); + TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length); + if (flip) + { + for (int l = 0; l < faces.length; l++) { faces[l].flipFace(); } - } - - copyTo(verts, poly, false); + } + + copyTo(verts, poly, false); } - + /** * Sets a new position for the texture offset. * @param x the x-coordinate of the texture start * @param y the y-coordinate of the texture start */ - public ModelRendererTurbo setTextureOffset(int x, int y) + public ModelRendererTurbo setTextureOffset (int x, int y) { - textureOffsetX = x; - textureOffsetY = y; - return this; + textureOffsetX = x; + textureOffsetY = y; + return this; } /** @@ -1458,70 +1447,70 @@ public class ModelRendererTurbo extends ModelRenderer * @param y the y-position of the shape * @param z the z-position of the shape */ - public void setPosition(float x, float y, float z) + public void setPosition (float x, float y, float z) { rotationPointX = x; rotationPointY = y; rotationPointZ = z; } - + /** * Mirrors the model in any direction. * @param x whether the model should be mirrored in the x-direction * @param y whether the model should be mirrored in the y-direction * @param z whether the model should be mirrored in the z-direction */ - public void doMirror(boolean x, boolean y, boolean z) + public void doMirror (boolean x, boolean y, boolean z) { - for(int i = 0; i < faces.length; i++) - { - PositionTextureVertex[] verts = faces[i].vertexPositions; - for(int j = 0; j < verts.length; j++) - { - verts[j].vector3D.xCoord *= (x ? -1 : 1); - verts[j].vector3D.yCoord *= (y ? -1 : 1); - verts[j].vector3D.zCoord *= (z ? -1 : 1); - } - if(x^y^z) - faces[i].flipFace(); - } + for (int i = 0; i < faces.length; i++) + { + PositionTextureVertex[] verts = faces[i].vertexPositions; + for (int j = 0; j < verts.length; j++) + { + verts[j].vector3D.xCoord *= (x ? -1 : 1); + verts[j].vector3D.yCoord *= (y ? -1 : 1); + verts[j].vector3D.zCoord *= (z ? -1 : 1); + } + if (x ^ y ^ z) + faces[i].flipFace(); + } } - + /** * Sets whether the shape is mirrored or not. This has effect on the way the textures * get displayed. When working with addSprite, addPixel and addObj, it will be ignored. * @param isMirrored a boolean to define whether the shape is mirrored */ - public void setMirrored(boolean isMirrored) + public void setMirrored (boolean isMirrored) { - mirror = isMirrored; + mirror = isMirrored; } - + /** * Sets whether the shape's faces are flipped or not. When GL_CULL_FACE is enabled, * it won't render the back faces, effectively giving you the possibility to make * "hollow" shapes. When working with addSprite and addPixel, it will be ignored. * @param isFlipped a boolean to define whether the shape is flipped */ - public void setFlipped(boolean isFlipped) + public void setFlipped (boolean isFlipped) { - flip = isFlipped; + flip = isFlipped; } - + /** * Clears the current shape. Since all shapes are stacked into one shape, you can't * just replace a shape by overwriting the shape with another one. In this case you * would need to clear the shape first. */ - public void clear() + public void clear () { - vertices = new PositionTextureVertex[0]; - faces = new TexturedPolygon[0]; + vertices = new PositionTextureVertex[0]; + faces = new TexturedPolygon[0]; transformGroup.clear(); transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D)); currentGroup = transformGroup.get("0"); } - + /** * Copies an array of vertices and polygons to the current shape. This mainly is * used to copy each shape to the main class, but you can just use it to copy @@ -1529,59 +1518,59 @@ public class ModelRendererTurbo extends ModelRenderer * @param verts the array of vertices you want to copy * @param poly the array of polygons you want to copy */ - public void copyTo(PositionTextureVertex[] verts, TexturedPolygon[] poly) + public void copyTo (PositionTextureVertex[] verts, TexturedPolygon[] poly) { - copyTo(verts, poly, true); + copyTo(verts, poly, true); } - - public void copyTo(PositionTextureVertex[] verts, TexturedPolygon[] poly, boolean copyGroup) + + public void copyTo (PositionTextureVertex[] verts, TexturedPolygon[] poly, boolean copyGroup) { vertices = Arrays.copyOf(vertices, vertices.length + verts.length); faces = Arrays.copyOf(faces, faces.length + poly.length); - - for(int idx = 0; idx < verts.length; idx++) + + for (int idx = 0; idx < verts.length; idx++) { - vertices[vertices.length - verts.length + idx] = verts[idx]; - if(copyGroup && verts[idx] instanceof PositionTransformVertex) - ((PositionTransformVertex)verts[idx]).addGroup(currentGroup); + vertices[vertices.length - verts.length + idx] = verts[idx]; + if (copyGroup && verts[idx] instanceof PositionTransformVertex) + ((PositionTransformVertex) verts[idx]).addGroup(currentGroup); } - - for(int idx = 0; idx < poly.length; idx++) + + for (int idx = 0; idx < poly.length; idx++) { - faces[faces.length - poly.length + idx] = poly[idx]; - if(copyGroup) - currentTextureGroup.addPoly(poly[idx]); + faces[faces.length - poly.length + idx] = poly[idx]; + if (copyGroup) + currentTextureGroup.addPoly(poly[idx]); } } - + /** * Copies an array of vertices and quads to the current shape. This method * converts quads to polygons and then calls the main copyTo method. * @param verts the array of vertices you want to copy * @param quad the array of quads you want to copy */ - public void copyTo(PositionTextureVertex[] verts, TexturedQuad[] quad) + public void copyTo (PositionTextureVertex[] verts, TexturedQuad[] quad) { - TexturedPolygon[] poly = new TexturedPolygon[quad.length]; - for(int idx = 0; idx < quad.length; idx++) - { - poly[idx] = new TexturedPolygon(quad[idx].vertexPositions); - } - - copyTo(verts, poly); + TexturedPolygon[] poly = new TexturedPolygon[quad.length]; + for (int idx = 0; idx < quad.length; idx++) + { + poly[idx] = new TexturedPolygon(quad[idx].vertexPositions); + } + + copyTo(verts, poly); } - + /** * Sets the current transformation group. The transformation group is used * to allow for vertex transformation. If a transformation group does not exist, * a new one will be created. * @param groupName the name of the transformation group you want to switch to */ - public void setGroup(String groupName) + public void setGroup (String groupName) { - setGroup(groupName, new Bone(0, 0, 0, 0), 1D); + setGroup(groupName, new Bone(0, 0, 0, 0), 1D); } - + /** * Sets the current transformation group. The transformation group is used * to allow for vertex transformation. If a transformation group does not exist, @@ -1590,33 +1579,33 @@ public class ModelRendererTurbo extends ModelRenderer * @param bone the Bone this transformation group is attached to * @param weight the weight of the transformation group */ - public void setGroup(String groupName, Bone bone, double weight) + public void setGroup (String groupName, Bone bone, double weight) { - if(!transformGroup.containsKey(groupName)) - transformGroup.put(groupName, new TransformGroupBone(bone, weight)); - currentGroup = transformGroup.get(groupName); + if (!transformGroup.containsKey(groupName)) + transformGroup.put(groupName, new TransformGroupBone(bone, weight)); + currentGroup = transformGroup.get(groupName); } /** * Gets the current transformation group. * @return the current PositionTransformGroup. */ - public TransformGroup getGroup() + public TransformGroup getGroup () { - return currentGroup; + return currentGroup; } - + /** * Gets the transformation group with a given group name. * @return the current PositionTransformGroup. */ - public TransformGroup getGroup(String groupName) + public TransformGroup getGroup (String groupName) { - if(!transformGroup.containsKey(groupName)) - return null; - return transformGroup.get(groupName); + if (!transformGroup.containsKey(groupName)) + return null; + return transformGroup.get(groupName); } - + /** * Sets the current texture group, which is used to switch the * textures on a per-model base. Do note that any model that is @@ -1626,45 +1615,45 @@ public class ModelRendererTurbo extends ModelRenderer * @param groupName The name of the texture group. If the texture * group doesn't exist, it creates a new group automatically. */ - public void setTextureGroup(String groupName) + public void setTextureGroup (String groupName) { - if(!textureGroup.containsKey(groupName)) - { - textureGroup.put(groupName, new TextureGroup()); - } - currentTextureGroup = textureGroup.get(groupName); + if (!textureGroup.containsKey(groupName)) + { + textureGroup.put(groupName, new TextureGroup()); + } + currentTextureGroup = textureGroup.get(groupName); } - + /** * Gets the current texture group. * @return a TextureGroup object. */ - public TextureGroup getTextureGroup() + public TextureGroup getTextureGroup () { - return currentTextureGroup; + return currentTextureGroup; } - + /** * Gets the texture group with the given name. * @param groupName the name of the texture group to return * @return a TextureGroup object. */ - public TextureGroup getTextureGroup(String groupName) + public TextureGroup getTextureGroup (String groupName) { - if(!textureGroup.containsKey(groupName)) - return null; - return textureGroup.get(groupName); + if (!textureGroup.containsKey(groupName)) + return null; + return textureGroup.get(groupName); } - + /** * Sets the texture of the current texture group. * @param s the filename */ - public void setGroupTexture(String s) + public void setGroupTexture (String s) { - currentTextureGroup.texture = s; + currentTextureGroup.texture = s; } - + /** * Sets the default texture. When left as an empty string, * it will use the texture that has been set previously. @@ -1672,108 +1661,109 @@ public class ModelRendererTurbo extends ModelRenderer * of the same entity. * @param s the filename */ - public void setDefaultTexture(String s) + public void setDefaultTexture (String s) { - defaultTexture = s; + defaultTexture = s; } /** * Renders the shape. * @param worldScale the scale of the shape. Usually is 0.0625. */ - public void render(float worldScale) + public void render (float worldScale) { - if(field_1402_i) + if (field_1402_i) { return; } - if(!showModel) + if (!showModel) { return; } - if(!compiled || forcedRecompile) + if (!compiled || forcedRecompile) { compileDisplayList(worldScale); } - if(rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) + if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) { GL11.glPushMatrix(); GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); - if(rotateAngleZ != 0.0F) + if (rotateAngleZ != 0.0F) { GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); } - if(rotateAngleY != 0.0F) + if (rotateAngleY != 0.0F) { GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); } - if(rotateAngleX != 0.0F) + if (rotateAngleX != 0.0F) { GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); } callDisplayList(); - if(childModels != null) + if (childModels != null) { - for(int i = 0; i < childModels.size(); i++) + for (int i = 0; i < childModels.size(); i++) { - ((ModelRenderer)childModels.get(i)).render(worldScale); + ((ModelRenderer) childModels.get(i)).render(worldScale); } } GL11.glPopMatrix(); - } else - if(rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) + } + else if (rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) { GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); callDisplayList(); - if(childModels != null) + if (childModels != null) { - for(int i = 0; i < childModels.size(); i++) + for (int i = 0; i < childModels.size(); i++) { - ((ModelRenderer)childModels.get(i)).render(worldScale); + ((ModelRenderer) childModels.get(i)).render(worldScale); } } GL11.glTranslatef(-rotationPointX * worldScale, -rotationPointY * worldScale, -rotationPointZ * worldScale); - } else + } + else { - callDisplayList(); - if(childModels != null) + callDisplayList(); + if (childModels != null) { - for(int i = 0; i < childModels.size(); i++) + for (int i = 0; i < childModels.size(); i++) { - ((ModelRenderer)childModels.get(i)).render(worldScale); + ((ModelRenderer) childModels.get(i)).render(worldScale); } } } } - - public void renderWithRotation(float f) + + public void renderWithRotation (float f) { - if(field_1402_i) + if (field_1402_i) { return; } - if(!showModel) + if (!showModel) { return; } - if(!compiled) + if (!compiled) { compileDisplayList(f); } GL11.glPushMatrix(); GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); - if(rotateAngleY != 0.0F) + if (rotateAngleY != 0.0F) { GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); } - if(rotateAngleX != 0.0F) + if (rotateAngleX != 0.0F) { GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); } - if(rotateAngleZ != 0.0F) + if (rotateAngleZ != 0.0F) { GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); } @@ -1781,99 +1771,99 @@ public class ModelRendererTurbo extends ModelRenderer GL11.glPopMatrix(); } - public void postRender(float f) + public void postRender (float f) { - if(field_1402_i) + if (field_1402_i) { return; } - if(!showModel) + if (!showModel) { return; } - if(!compiled || forcedRecompile) + if (!compiled || forcedRecompile) { compileDisplayList(f); } - if(rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) + if (rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) { GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); - if(rotateAngleZ != 0.0F) + if (rotateAngleZ != 0.0F) { GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); } - if(rotateAngleY != 0.0F) + if (rotateAngleY != 0.0F) { GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); } - if(rotateAngleX != 0.0F) + if (rotateAngleX != 0.0F) { GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); } - } else - if(rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) + } + else if (rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) { GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); } } - - private void callDisplayList() + + private void callDisplayList () { - if(useLegacyCompiler) - GL11.glCallList(displayList); - else - { - RenderEngine renderEngine = RenderManager.instance.renderEngine; - - Collection textures = textureGroup.values(); - - Iterator itr = textures.iterator(); - for(int i = 0; itr.hasNext(); i++) - { - TextureGroup curTexGroup = (TextureGroup)itr.next(); - curTexGroup.loadTexture(); - GL11.glCallList(displayListArray[i]); - if(!defaultTexture.equals("")) - renderEngine.bindTexture(defaultTexture); - } - } + if (useLegacyCompiler) + GL11.glCallList(displayList); + else + { + RenderEngine renderEngine = RenderManager.instance.renderEngine; + + Collection textures = textureGroup.values(); + + Iterator itr = textures.iterator(); + for (int i = 0; itr.hasNext(); i++) + { + TextureGroup curTexGroup = (TextureGroup) itr.next(); + curTexGroup.loadTexture(); + GL11.glCallList(displayListArray[i]); + if (!defaultTexture.equals("")) + renderEngine.bindTexture(defaultTexture); + } + } } - private void compileDisplayList(float worldScale) + private void compileDisplayList (float worldScale) { - if(useLegacyCompiler) - compileLegacyDisplayList(worldScale); - else - { - Collection textures = textureGroup.values(); - - Iterator itr = textures.iterator(); - displayListArray = new int[textureGroup.size()]; - for(int i = 0; itr.hasNext(); i++) - { - displayListArray[i] = GLAllocation.generateDisplayLists(1); - GL11.glNewList(displayListArray[i], 4864); - Tessellator tessellator = Tessellator.instance; - - TextureGroup usedGroup = (TextureGroup)itr.next(); - for(int j = 0; j < usedGroup.poly.size(); j++) - { - usedGroup.poly.get(j).draw(tessellator, worldScale); - } - - GL11.glEndList(); - } - } + if (useLegacyCompiler) + compileLegacyDisplayList(worldScale); + else + { + Collection textures = textureGroup.values(); + + Iterator itr = textures.iterator(); + displayListArray = new int[textureGroup.size()]; + for (int i = 0; itr.hasNext(); i++) + { + displayListArray[i] = GLAllocation.generateDisplayLists(1); + GL11.glNewList(displayListArray[i], 4864); + Tessellator tessellator = Tessellator.instance; + + TextureGroup usedGroup = (TextureGroup) itr.next(); + for (int j = 0; j < usedGroup.poly.size(); j++) + { + usedGroup.poly.get(j).draw(tessellator, worldScale); + } + + GL11.glEndList(); + } + } compiled = true; } - - private void compileLegacyDisplayList(float worldScale) + + private void compileLegacyDisplayList (float worldScale) { displayList = GLAllocation.generateDisplayLists(1); GL11.glNewList(displayList, 4864 /*GL_COMPILE*/); Tessellator tessellator = Tessellator.instance; - for(int i = 0; i < faces.length; i++) + for (int i = 0; i < faces.length; i++) { faces[i].draw(tessellator, worldScale); } @@ -1901,15 +1891,15 @@ public class ModelRendererTurbo extends ModelRenderer public List cubeList; public List childModels; public final String boxName; - + private String defaultTexture; - + public static final int MR_FRONT = 0; public static final int MR_BACK = 1; public static final int MR_LEFT = 2; public static final int MR_RIGHT = 3; public static final int MR_TOP = 4; public static final int MR_BOTTOM = 5; - - private static final float pi = (float) Math.PI; + + private static final float pi = (float) Math.PI; } diff --git a/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java b/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java index a099d99a..0dd1b92d 100644 --- a/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java +++ b/mods/tinker/tconstruct/client/tmt/PositionTransformVertex.java @@ -7,72 +7,72 @@ import net.minecraft.util.Vec3; public class PositionTransformVertex extends PositionTextureVertex { - public PositionTransformVertex(float x, float y, float z, float u, float v) - { - this(Vec3.createVectorHelper((double)x, (double)y, (double)z), u, v); - } - - public PositionTransformVertex(PositionTextureVertex vertex, float u, float v) - { - super(vertex, u, v); - if(vertex instanceof PositionTransformVertex) - neutralVector = ((PositionTransformVertex)vertex).neutralVector; - else - neutralVector = Vec3.createVectorHelper(vertex.vector3D.xCoord, vertex.vector3D.yCoord, vertex.vector3D.zCoord); - } - - public PositionTransformVertex(PositionTextureVertex vertex) - { - this(vertex, vertex.texturePositionX, vertex.texturePositionY); - } - - public PositionTransformVertex(Vec3 vector, float u, float v) - { - super(vector, u, v); - neutralVector = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); - } - - public void setTransformation() - { - if(transformGroups.size() == 0) - { - vector3D.xCoord = neutralVector.xCoord; - vector3D.yCoord = neutralVector.yCoord; - vector3D.zCoord = neutralVector.zCoord; - return; - } - double weight = 0D; - for(int i = 0; i < transformGroups.size(); i++) - { - weight += transformGroups.get(i).getWeight(); - } - vector3D.xCoord = 0; - vector3D.yCoord = 0; - vector3D.zCoord = 0; - - for(int i = 0; i < transformGroups.size(); i++) - { - TransformGroup group = transformGroups.get(i); - double cWeight = group.getWeight() / weight; - Vec3 vector = group.doTransformation(this); - - vector3D.xCoord += cWeight * vector.xCoord; - vector3D.yCoord += cWeight * vector.yCoord; - vector3D.zCoord += cWeight * vector.zCoord; - } - } - - public void addGroup(TransformGroup group) - { - transformGroups.add(group); - } - - public void removeGroup(TransformGroup group) - { - transformGroups.remove(group); - } - - public Vec3 neutralVector; - public ArrayList transformGroups = new ArrayList(); - + public PositionTransformVertex(float x, float y, float z, float u, float v) + { + this(Vec3.createVectorHelper((double) x, (double) y, (double) z), u, v); + } + + public PositionTransformVertex(PositionTextureVertex vertex, float u, float v) + { + super(vertex, u, v); + if (vertex instanceof PositionTransformVertex) + neutralVector = ((PositionTransformVertex) vertex).neutralVector; + else + neutralVector = Vec3.createVectorHelper(vertex.vector3D.xCoord, vertex.vector3D.yCoord, vertex.vector3D.zCoord); + } + + public PositionTransformVertex(PositionTextureVertex vertex) + { + this(vertex, vertex.texturePositionX, vertex.texturePositionY); + } + + public PositionTransformVertex(Vec3 vector, float u, float v) + { + super(vector, u, v); + neutralVector = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); + } + + public void setTransformation () + { + if (transformGroups.size() == 0) + { + vector3D.xCoord = neutralVector.xCoord; + vector3D.yCoord = neutralVector.yCoord; + vector3D.zCoord = neutralVector.zCoord; + return; + } + double weight = 0D; + for (int i = 0; i < transformGroups.size(); i++) + { + weight += transformGroups.get(i).getWeight(); + } + vector3D.xCoord = 0; + vector3D.yCoord = 0; + vector3D.zCoord = 0; + + for (int i = 0; i < transformGroups.size(); i++) + { + TransformGroup group = transformGroups.get(i); + double cWeight = group.getWeight() / weight; + Vec3 vector = group.doTransformation(this); + + vector3D.xCoord += cWeight * vector.xCoord; + vector3D.yCoord += cWeight * vector.yCoord; + vector3D.zCoord += cWeight * vector.zCoord; + } + } + + public void addGroup (TransformGroup group) + { + transformGroups.add(group); + } + + public void removeGroup (TransformGroup group) + { + transformGroups.remove(group); + } + + public Vec3 neutralVector; + public ArrayList transformGroups = new ArrayList(); + } diff --git a/mods/tinker/tconstruct/client/tmt/Shape2D.java b/mods/tinker/tconstruct/client/tmt/Shape2D.java index 4077e267..b6dfac72 100644 --- a/mods/tinker/tconstruct/client/tmt/Shape2D.java +++ b/mods/tinker/tconstruct/client/tmt/Shape2D.java @@ -7,145 +7,141 @@ import net.minecraft.util.Vec3; public class Shape2D { - public Shape2D() - { - coords = new ArrayList(); - } - - public Shape2D(Coord2D[] coordArray) - { - coords = new ArrayList(); - - for(int idx = 0; idx < coordArray.length; idx++) - { - coords.add(coordArray[idx]); - } - } - - public Shape2D(ArrayList coordList) - { - coords = coordList; - } - - public Coord2D[] getCoordArray() - { - return (Coord2D[]) coords.toArray(); - } - - public Shape3D extrude(float x, float y, float z, float rotX, float rotY, float rotZ, float depth, int u, int v, float textureWidth, float textureHeight, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float[] faceLengths) - { - PositionTransformVertex[] verts = new PositionTransformVertex[coords.size() * 2]; - PositionTransformVertex[] vertsTop = new PositionTransformVertex[coords.size()]; - PositionTransformVertex[] vertsBottom = new PositionTransformVertex[coords.size()]; - TexturedPolygon[] poly = new TexturedPolygon[coords.size() + 2]; - - Vec3 extrudeVector = Vec3.createVectorHelper(0, 0, depth); + public Shape2D() + { + coords = new ArrayList(); + } - setVectorRotations(extrudeVector, rotX, rotY, rotZ); - - if(faceLengths != null && faceLengths.length < coords.size()) - faceLengths = null; + public Shape2D(Coord2D[] coordArray) + { + coords = new ArrayList(); - float totalLength = 0; - - for(int idx = 0; idx < coords.size(); idx++) - { - Coord2D curCoord = coords.get(idx); - Coord2D nextCoord = coords.get((idx + 1) % coords.size()); - float texU1 = ((float)(curCoord.uCoord + u) / (float)textureWidth); - float texU2 = ((float)(shapeTextureWidth * 2 - curCoord.uCoord + u) / (float)textureWidth); - float texV = ((float)(curCoord.vCoord + v) / (float)textureHeight); - - Vec3 vecCoord = Vec3.createVectorHelper(curCoord.xCoord, curCoord.yCoord, 0); - - setVectorRotations(vecCoord, rotX, rotY, rotZ); - - verts[idx] = new PositionTransformVertex( - x + (float)vecCoord.xCoord, - y + (float)vecCoord.yCoord, - z + (float)vecCoord.zCoord, texU1, texV); - verts[idx + coords.size()] = new PositionTransformVertex( - x + (float)vecCoord.xCoord - (float)extrudeVector.xCoord, - y + (float)vecCoord.yCoord - (float)extrudeVector.yCoord, - z + (float)vecCoord.zCoord - (float)extrudeVector.zCoord, texU2, texV); - - vertsTop[idx] = new PositionTransformVertex(verts[idx]); - vertsBottom[coords.size() - idx - 1] = new PositionTransformVertex(verts[idx + coords.size()]); + for (int idx = 0; idx < coordArray.length; idx++) + { + coords.add(coordArray[idx]); + } + } - if(faceLengths != null) - totalLength+= faceLengths[idx]; - else - totalLength+= Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); - } - - poly[coords.size()] = new TexturedPolygon(vertsTop); - poly[coords.size() + 1] = new TexturedPolygon(vertsBottom); - - float currentLengthPosition = totalLength; - - for(int idx = 0; idx < coords.size(); idx++) - { - Coord2D curCoord = coords.get(idx); - Coord2D nextCoord = coords.get((idx + 1) % coords.size()); - float currentLength = (float)Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); - if(faceLengths != null) - currentLength = faceLengths[faceLengths.length - idx - 1]; - float ratioPosition = currentLengthPosition / totalLength; - float ratioLength = (currentLengthPosition - currentLength) / totalLength; - - float texU1 = ((float)(ratioLength * (float)sideTextureWidth + u) / (float)textureWidth); - float texU2 = ((float)(ratioPosition * (float)sideTextureWidth + u) / (float)textureWidth); - float texV1 = (((float)v + (float)shapeTextureHeight) / (float)textureHeight); - float texV2 = (((float)v + (float)shapeTextureHeight + (float)sideTextureHeight) / (float)textureHeight); + public Shape2D(ArrayList coordList) + { + coords = coordList; + } - PositionTransformVertex[] polySide = new PositionTransformVertex[4]; - - polySide[0] = new PositionTransformVertex(verts[idx], texU2, texV1); - polySide[1] = new PositionTransformVertex(verts[coords.size() + idx], texU2, texV2); - polySide[2] = new PositionTransformVertex(verts[coords.size() + ((idx + 1) % coords.size())], texU1, texV2); - polySide[3] = new PositionTransformVertex(verts[(idx + 1) % coords.size()], texU1, texV1); - - poly[idx] = new TexturedPolygon(polySide); - currentLengthPosition -= currentLength; - } - - return new Shape3D(verts, poly); - } - - protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; + public Coord2D[] getCoordArray () + { + return (Coord2D[]) coords.toArray(); + } + + public Shape3D extrude (float x, float y, float z, float rotX, float rotY, float rotZ, float depth, int u, int v, float textureWidth, float textureHeight, int shapeTextureWidth, + int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float[] faceLengths) + { + PositionTransformVertex[] verts = new PositionTransformVertex[coords.size() * 2]; + PositionTransformVertex[] vertsTop = new PositionTransformVertex[coords.size()]; + PositionTransformVertex[] vertsBottom = new PositionTransformVertex[coords.size()]; + TexturedPolygon[] poly = new TexturedPolygon[coords.size() + 2]; + + Vec3 extrudeVector = Vec3.createVectorHelper(0, 0, depth); + + setVectorRotations(extrudeVector, rotX, rotY, rotZ); + + if (faceLengths != null && faceLengths.length < coords.size()) + faceLengths = null; + + float totalLength = 0; + + for (int idx = 0; idx < coords.size(); idx++) + { + Coord2D curCoord = coords.get(idx); + Coord2D nextCoord = coords.get((idx + 1) % coords.size()); + float texU1 = ((float) (curCoord.uCoord + u) / (float) textureWidth); + float texU2 = ((float) (shapeTextureWidth * 2 - curCoord.uCoord + u) / (float) textureWidth); + float texV = ((float) (curCoord.vCoord + v) / (float) textureHeight); + + Vec3 vecCoord = Vec3.createVectorHelper(curCoord.xCoord, curCoord.yCoord, 0); + + setVectorRotations(vecCoord, rotX, rotY, rotZ); + + verts[idx] = new PositionTransformVertex(x + (float) vecCoord.xCoord, y + (float) vecCoord.yCoord, z + (float) vecCoord.zCoord, texU1, texV); + verts[idx + coords.size()] = new PositionTransformVertex(x + (float) vecCoord.xCoord - (float) extrudeVector.xCoord, y + (float) vecCoord.yCoord - (float) extrudeVector.yCoord, z + + (float) vecCoord.zCoord - (float) extrudeVector.zCoord, texU2, texV); + + vertsTop[idx] = new PositionTransformVertex(verts[idx]); + vertsBottom[coords.size() - idx - 1] = new PositionTransformVertex(verts[idx + coords.size()]); + + if (faceLengths != null) + totalLength += faceLengths[idx]; + else + totalLength += Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); + } + + poly[coords.size()] = new TexturedPolygon(vertsTop); + poly[coords.size() + 1] = new TexturedPolygon(vertsBottom); + + float currentLengthPosition = totalLength; + + for (int idx = 0; idx < coords.size(); idx++) + { + Coord2D curCoord = coords.get(idx); + Coord2D nextCoord = coords.get((idx + 1) % coords.size()); + float currentLength = (float) Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); + if (faceLengths != null) + currentLength = faceLengths[faceLengths.length - idx - 1]; + float ratioPosition = currentLengthPosition / totalLength; + float ratioLength = (currentLengthPosition - currentLength) / totalLength; + + float texU1 = ((float) (ratioLength * (float) sideTextureWidth + u) / (float) textureWidth); + float texU2 = ((float) (ratioPosition * (float) sideTextureWidth + u) / (float) textureWidth); + float texV1 = (((float) v + (float) shapeTextureHeight) / (float) textureHeight); + float texV2 = (((float) v + (float) shapeTextureHeight + (float) sideTextureHeight) / (float) textureHeight); + + PositionTransformVertex[] polySide = new PositionTransformVertex[4]; + + polySide[0] = new PositionTransformVertex(verts[idx], texU2, texV1); + polySide[1] = new PositionTransformVertex(verts[coords.size() + idx], texU2, texV2); + polySide[2] = new PositionTransformVertex(verts[coords.size() + ((idx + 1) % coords.size())], texU1, texV2); + polySide[3] = new PositionTransformVertex(verts[(idx + 1) % coords.size()], texU1, texV1); + + poly[idx] = new TexturedPolygon(polySide); + currentLengthPosition -= currentLength; + } + + return new Shape3D(verts, poly); + } + + protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; float xC = MathHelper.cos(x); float xS = MathHelper.sin(x); float yC = MathHelper.cos(y); float yS = MathHelper.sin(y); float zC = MathHelper.cos(z); float zS = MathHelper.sin(z); - + double xVec = vector.xCoord; double yVec = vector.yCoord; double zVec = vector.zCoord; - + // rotation around x - double xy = xC*yVec - xS*zVec; - double xz = xC*zVec + xS*yVec; - // rotation around y - double yz = yC*xz - yS*xVec; - double yx = yC*xVec + yS*xz; - // rotation around z - double zx = zC*yx - zS*xy; - double zy = zC*xy + zS*yx; - - xVec = zx; - yVec = zy; - zVec = yz; - + double xy = xC * yVec - xS * zVec; + double xz = xC * zVec + xS * yVec; + // rotation around y + double yz = yC * xz - yS * xVec; + double yx = yC * xVec + yS * xz; + // rotation around z + double zx = zC * yx - zS * xy; + double zy = zC * xy + zS * yx; + + xVec = zx; + yVec = zy; + zVec = yz; + vector.xCoord = xVec; vector.yCoord = yVec; vector.zCoord = zVec; - } - - public ArrayList coords; + } + + public ArrayList coords; } diff --git a/mods/tinker/tconstruct/client/tmt/Shape3D.java b/mods/tinker/tconstruct/client/tmt/Shape3D.java index ce370121..6855c664 100644 --- a/mods/tinker/tconstruct/client/tmt/Shape3D.java +++ b/mods/tinker/tconstruct/client/tmt/Shape3D.java @@ -2,11 +2,12 @@ package mods.tinker.tconstruct.client.tmt; public class Shape3D { - public Shape3D(PositionTransformVertex[] verts, TexturedPolygon[] poly) - { - vertices = verts; - faces = poly; - } - public PositionTransformVertex[] vertices; - public TexturedPolygon[] faces; + public Shape3D(PositionTransformVertex[] verts, TexturedPolygon[] poly) + { + vertices = verts; + faces = poly; + } + + public PositionTransformVertex[] vertices; + public TexturedPolygon[] faces; } diff --git a/mods/tinker/tconstruct/client/tmt/TextureGroup.java b/mods/tinker/tconstruct/client/tmt/TextureGroup.java index 4a1d5644..79e85aeb 100644 --- a/mods/tinker/tconstruct/client/tmt/TextureGroup.java +++ b/mods/tinker/tconstruct/client/tmt/TextureGroup.java @@ -8,35 +8,35 @@ import net.minecraft.client.renderer.entity.RenderManager; public class TextureGroup { - public TextureGroup() - { - poly = new ArrayList(); - texture = ""; - } - - public void addPoly(TexturedQuad quad) - { - poly.add(quad); - } + public TextureGroup() + { + poly = new ArrayList(); + texture = ""; + } - public void loadTexture() - { - loadTexture(-1); - } - - public void loadTexture(int defaultTexture) - { - if(!texture.equals("")) - { - RenderEngine renderengine = RenderManager.instance.renderEngine; - renderengine.bindTexture(texture); - } - /*else if(defaultTexture > -1) - { - RenderManager.instance.renderEngine.bindTexture(defaultTexture); - }*/ - } - - public ArrayList poly; - public String texture; + public void addPoly (TexturedQuad quad) + { + poly.add(quad); + } + + public void loadTexture () + { + loadTexture(-1); + } + + public void loadTexture (int defaultTexture) + { + if (!texture.equals("")) + { + RenderEngine renderengine = RenderManager.instance.renderEngine; + renderengine.bindTexture(texture); + } + /*else if(defaultTexture > -1) + { + RenderManager.instance.renderEngine.bindTexture(defaultTexture); + }*/ + } + + public ArrayList poly; + public String texture; } diff --git a/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java b/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java index 1f7cba70..9873561d 100644 --- a/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java +++ b/mods/tinker/tconstruct/client/tmt/TexturedPolygon.java @@ -11,87 +11,90 @@ import org.lwjgl.opengl.GL11; public class TexturedPolygon extends TexturedQuad { - public TexturedPolygon(PositionTextureVertex apositionTexturevertex[]) + public TexturedPolygon(PositionTextureVertex apositionTexturevertex[]) { - super(apositionTexturevertex); - invertNormal = false; - normals = new float[0]; - iNormals = new ArrayList(); + super(apositionTexturevertex); + invertNormal = false; + normals = new float[0]; + iNormals = new ArrayList(); } - - public void setInvertNormal(boolean isSet) - { - invertNormal = isSet; - } - - public void setNormals(float x, float y, float z) - { - normals = new float[] {x, y, z}; - } - - public void setNormals(ArrayList vec) - { - iNormals = vec; - } - - public void draw(Tessellator tessellator, float f) + + public void setInvertNormal (boolean isSet) { - - if(nVertices == 3) - tessellator.startDrawing(GL11.GL_TRIANGLES); + invertNormal = isSet; + } + + public void setNormals (float x, float y, float z) + { + normals = new float[] { x, y, z }; + } + + public void setNormals (ArrayList vec) + { + iNormals = vec; + } + + public void draw (Tessellator tessellator, float f) + { + + if (nVertices == 3) + tessellator.startDrawing(GL11.GL_TRIANGLES); else if (nVertices == 4) - tessellator.startDrawingQuads(); + tessellator.startDrawingQuads(); else - tessellator.startDrawing(GL11.GL_POLYGON); - - if(iNormals.size() == 0) + tessellator.startDrawing(GL11.GL_POLYGON); + + if (iNormals.size() == 0) { - if(normals.length == 3) - { - if(invertNormal) - { - tessellator.setNormal(-normals[0], -normals[1], -normals[2]); - } else - { - tessellator.setNormal(normals[0], normals[1], normals[2]); - } - } else - if(vertexPositions.length >= 3) - { - Vec3 Vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D); - Vec3 Vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D); - Vec3 Vec32 = Vec31.crossProduct(Vec3).normalize(); - - if(invertNormal) - { - tessellator.setNormal(-(float)Vec32.xCoord, -(float)Vec32.yCoord, -(float)Vec32.zCoord); - } else - { - tessellator.setNormal((float)Vec32.xCoord, (float)Vec32.yCoord, (float)Vec32.zCoord); - } - } - else - { - return; - } + if (normals.length == 3) + { + if (invertNormal) + { + tessellator.setNormal(-normals[0], -normals[1], -normals[2]); + } + else + { + tessellator.setNormal(normals[0], normals[1], normals[2]); + } + } + else if (vertexPositions.length >= 3) + { + Vec3 Vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D); + Vec3 Vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D); + Vec3 Vec32 = Vec31.crossProduct(Vec3).normalize(); + + if (invertNormal) + { + tessellator.setNormal(-(float) Vec32.xCoord, -(float) Vec32.yCoord, -(float) Vec32.zCoord); + } + else + { + tessellator.setNormal((float) Vec32.xCoord, (float) Vec32.yCoord, (float) Vec32.zCoord); + } + } + else + { + return; + } } - for(int i = 0; i < nVertices; i++) + for (int i = 0; i < nVertices; i++) { PositionTextureVertex positionTexturevertex = vertexPositions[i]; - if(positionTexturevertex instanceof PositionTransformVertex) - ((PositionTransformVertex)positionTexturevertex).setTransformation(); - if(i < iNormals.size()) + if (positionTexturevertex instanceof PositionTransformVertex) + ((PositionTransformVertex) positionTexturevertex).setTransformation(); + if (i < iNormals.size()) { - if(invertNormal) - { - tessellator.setNormal(-(float)iNormals.get(i).xCoord, -(float)iNormals.get(i).yCoord, -(float)iNormals.get(i).zCoord); - } - else - { - tessellator.setNormal((float)iNormals.get(i).xCoord, (float)iNormals.get(i).yCoord, (float)iNormals.get(i).zCoord); - } + if (invertNormal) + { + tessellator.setNormal(-(float) iNormals.get(i).xCoord, -(float) iNormals.get(i).yCoord, -(float) iNormals.get(i).zCoord); + } + else + { + tessellator.setNormal((float) iNormals.get(i).xCoord, (float) iNormals.get(i).yCoord, (float) iNormals.get(i).zCoord); + } } - tessellator.addVertexWithUV((float)positionTexturevertex.vector3D.xCoord * f, (float)positionTexturevertex.vector3D.yCoord * f, (float)positionTexturevertex.vector3D.zCoord * f, positionTexturevertex.texturePositionX, positionTexturevertex.texturePositionY); + tessellator.addVertexWithUV((float) positionTexturevertex.vector3D.xCoord * f, (float) positionTexturevertex.vector3D.yCoord * f, (float) positionTexturevertex.vector3D.zCoord * f, + positionTexturevertex.texturePositionX, positionTexturevertex.texturePositionY); } tessellator.draw(); diff --git a/mods/tinker/tconstruct/client/tmt/TransformGroup.java b/mods/tinker/tconstruct/client/tmt/TransformGroup.java index ae26e25d..28e76241 100644 --- a/mods/tinker/tconstruct/client/tmt/TransformGroup.java +++ b/mods/tinker/tconstruct/client/tmt/TransformGroup.java @@ -4,6 +4,7 @@ import net.minecraft.util.Vec3; public abstract class TransformGroup { - public abstract double getWeight(); - public abstract Vec3 doTransformation(PositionTransformVertex vertex); + public abstract double getWeight (); + + public abstract Vec3 doTransformation (PositionTransformVertex vertex); } diff --git a/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java b/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java index e953f4a4..a5467671 100644 --- a/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java +++ b/mods/tinker/tconstruct/client/tmt/TransformGroupBone.java @@ -10,102 +10,102 @@ import net.minecraft.util.Vec3; */ public class TransformGroupBone extends TransformGroup { - public TransformGroupBone(Bone bone, double wght) - { - baseVector = bone.getPosition(); - baseAngles = bone.getAbsoluteAngle(); - attachedBone = bone; - weight = wght; - } - - public Angle3D getBaseAngles() - { - return baseAngles.copy(); - } - - public Angle3D getTransformAngle() - { - Angle3D returnAngle = attachedBone.getAbsoluteAngle().copy(); - returnAngle.angleX-= baseAngles.angleX; - returnAngle.angleY-= baseAngles.angleY; - returnAngle.angleZ-= baseAngles.angleZ; - return returnAngle; - } - - public Vec3 getBaseVector() - { - return Vec3.createVectorHelper(baseVector.xCoord, baseVector.yCoord, baseVector.zCoord); - } - - public Vec3 getTransformVector() - { - return baseVector.subtract(attachedBone.getPosition()); - } - - public Vec3 getCurrentVector() - { - return attachedBone.getPosition(); - } - - public double getWeight() - { - return weight; - } - - public void attachBone(Bone bone) - { - baseVector = bone.getPosition(); - baseAngles = bone.getAbsoluteAngle(); - attachedBone = bone; - } - - public Vec3 doTransformation(PositionTransformVertex vertex) - { - Vec3 vector = Vec3.createVectorHelper(vertex.neutralVector.xCoord, vertex.neutralVector.yCoord, vertex.neutralVector.zCoord); - vector = getBaseVector().subtract(vector); - Angle3D angle = getTransformAngle(); - setVectorRotations(vector, angle.angleX, angle.angleY, angle.angleZ); - - return vector; - } - - protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) - { - float x = xRot; - float y = yRot; - float z = zRot; + public TransformGroupBone(Bone bone, double wght) + { + baseVector = bone.getPosition(); + baseAngles = bone.getAbsoluteAngle(); + attachedBone = bone; + weight = wght; + } + + public Angle3D getBaseAngles () + { + return baseAngles.copy(); + } + + public Angle3D getTransformAngle () + { + Angle3D returnAngle = attachedBone.getAbsoluteAngle().copy(); + returnAngle.angleX -= baseAngles.angleX; + returnAngle.angleY -= baseAngles.angleY; + returnAngle.angleZ -= baseAngles.angleZ; + return returnAngle; + } + + public Vec3 getBaseVector () + { + return Vec3.createVectorHelper(baseVector.xCoord, baseVector.yCoord, baseVector.zCoord); + } + + public Vec3 getTransformVector () + { + return baseVector.subtract(attachedBone.getPosition()); + } + + public Vec3 getCurrentVector () + { + return attachedBone.getPosition(); + } + + public double getWeight () + { + return weight; + } + + public void attachBone (Bone bone) + { + baseVector = bone.getPosition(); + baseAngles = bone.getAbsoluteAngle(); + attachedBone = bone; + } + + public Vec3 doTransformation (PositionTransformVertex vertex) + { + Vec3 vector = Vec3.createVectorHelper(vertex.neutralVector.xCoord, vertex.neutralVector.yCoord, vertex.neutralVector.zCoord); + vector = getBaseVector().subtract(vector); + Angle3D angle = getTransformAngle(); + setVectorRotations(vector, angle.angleX, angle.angleY, angle.angleZ); + + return vector; + } + + protected void setVectorRotations (Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; float xC = MathHelper.cos(x); float xS = MathHelper.sin(x); float yC = MathHelper.cos(y); float yS = MathHelper.sin(y); float zC = MathHelper.cos(z); float zS = MathHelper.sin(z); - + double xVec = vector.xCoord; double yVec = vector.yCoord; double zVec = vector.zCoord; - + // rotation around x - double xy = xC*yVec - xS*zVec; - double xz = xC*zVec + xS*yVec; - // rotation around y - double yz = yC*xz - yS*xVec; - double yx = yC*xVec + yS*xz; - // rotation around z - double zx = zC*yx - zS*xy; - double zy = zC*xy + zS*yx; - - xVec = zx; - yVec = zy; - zVec = yz; - + double xy = xC * yVec - xS * zVec; + double xz = xC * zVec + xS * yVec; + // rotation around y + double yz = yC * xz - yS * xVec; + double yx = yC * xVec + yS * xz; + // rotation around z + double zx = zC * yx - zS * xy; + double zy = zC * xy + zS * yx; + + xVec = zx; + yVec = zy; + zVec = yz; + vector.xCoord = xVec; vector.yCoord = yVec; vector.zCoord = zVec; - } - - protected Angle3D baseAngles; - protected Vec3 baseVector; - protected Bone attachedBone; - protected double weight; + } + + protected Angle3D baseAngles; + protected Vec3 baseVector; + protected Bone attachedBone; + protected double weight; } diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index bca97d17..05f0b278 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -642,7 +642,7 @@ public class TContent implements IFuelHandler TConstructRegistry.addBowMaterial(15, 768, 40, 1.2f); //Alumite TConstructRegistry.addBowMaterial(16, 768, 40, 1.2f); //Steel TConstructRegistry.addBowMaterial(17, 576, 20, 1.2f); //Blue Slime - + //Material ID, mass, fragility TConstructRegistry.addArrowMaterial(0, 0.69F, 1.0F, 100F); //Wood TConstructRegistry.addArrowMaterial(1, 2.5F, 5.0F, 100F); //Stone diff --git a/mods/tinker/tconstruct/common/TimeTicker.java b/mods/tinker/tconstruct/common/TimeTicker.java index 15cc77a2..a964f490 100644 --- a/mods/tinker/tconstruct/common/TimeTicker.java +++ b/mods/tinker/tconstruct/common/TimeTicker.java @@ -11,6 +11,7 @@ public class TimeTicker implements ITickHandler public static int tickParts = 0; public static int seconds = 0; public static int minutes = 0; + @Override public void tickStart (EnumSet type, Object... tickData) { diff --git a/mods/tinker/tconstruct/crystal/TheftValueTracker.java b/mods/tinker/tconstruct/crystal/TheftValueTracker.java index 9ddb7e4e..d66e86e6 100644 --- a/mods/tinker/tconstruct/crystal/TheftValueTracker.java +++ b/mods/tinker/tconstruct/crystal/TheftValueTracker.java @@ -9,6 +9,7 @@ import mods.tinker.tconstruct.library.util.CoordTuple; public class TheftValueTracker { public static HashMap crystallinity = new HashMap(); + //public static HashMap> crystallinity = new HashMap>(); public static void updateCrystallinity (int dim, int posX, int posZ, int value) diff --git a/mods/tinker/tconstruct/dimension/TinkerChunkManager.java b/mods/tinker/tconstruct/dimension/TinkerChunkManager.java index a66fb78f..2afb0faa 100644 --- a/mods/tinker/tconstruct/dimension/TinkerChunkManager.java +++ b/mods/tinker/tconstruct/dimension/TinkerChunkManager.java @@ -27,7 +27,7 @@ public class TinkerChunkManager extends WorldChunkManager /** * Returns the BiomeGenBase related to the x, z position on the world. */ - public BiomeGenBase getBiomeGenAt(int par1, int par2) + public BiomeGenBase getBiomeGenAt (int par1, int par2) { return this.biomeGenerator; } @@ -35,7 +35,7 @@ public class TinkerChunkManager extends WorldChunkManager /** * Returns an array of biomes for the location input. */ - public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) + public BiomeGenBase[] getBiomesForGeneration (BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { @@ -49,7 +49,7 @@ public class TinkerChunkManager extends WorldChunkManager /** * Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length */ - public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) + public float[] getTemperatures (float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { @@ -63,7 +63,7 @@ public class TinkerChunkManager extends WorldChunkManager /** * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. */ - public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) + public float[] getRainfall (float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { @@ -78,7 +78,7 @@ public class TinkerChunkManager extends WorldChunkManager * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the * WorldChunkManager Args: oldBiomeList, x, z, width, depth */ - public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) + public BiomeGenBase[] loadBlockGeneratorData (BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { @@ -93,7 +93,7 @@ public class TinkerChunkManager extends WorldChunkManager * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, * don't check biomeCache to avoid infinite loop in BiomeCacheBlock) */ - public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6) + public BiomeGenBase[] getBiomeGenAt (BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6) { return this.loadBlockGeneratorData(par1ArrayOfBiomeGenBase, par2, par3, par4, par5); } @@ -102,7 +102,7 @@ public class TinkerChunkManager extends WorldChunkManager * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks. * Strongly favors positive y positions. */ - public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random) + public ChunkPosition findBiomePosition (int par1, int par2, int par3, List par4List, Random par5Random) { return par4List.contains(this.biomeGenerator) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null; } @@ -110,7 +110,7 @@ public class TinkerChunkManager extends WorldChunkManager /** * checks given Chunk's Biomes against List of allowed ones */ - public boolean areBiomesViable(int par1, int par2, int par3, List par4List) + public boolean areBiomesViable (int par1, int par2, int par3, List par4List) { return par4List.contains(this.biomeGenerator); } diff --git a/mods/tinker/tconstruct/dimension/TinkerChunkProvider.java b/mods/tinker/tconstruct/dimension/TinkerChunkProvider.java index fc20ee9f..30d291b3 100644 --- a/mods/tinker/tconstruct/dimension/TinkerChunkProvider.java +++ b/mods/tinker/tconstruct/dimension/TinkerChunkProvider.java @@ -66,7 +66,7 @@ public class TinkerChunkProvider implements IChunkProvider double[] noiseData3; double[] noiseData4; double[] noiseData5; - + double[] secondNoiseData1; double[] secondNoiseData2; double[] secondNoiseData3; @@ -547,9 +547,10 @@ public class TinkerChunkProvider implements IChunkProvider this.genNetherBridge.generate(this, this.worldObj, par1, par2, (byte[]) null); } - @Override - public void func_104112_b() { - // TODO Auto-generated method stub - - } + @Override + public void func_104112_b () + { + // TODO Auto-generated method stub + + } } diff --git a/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java b/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java index bbe698f8..5bdd0fa3 100644 --- a/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java +++ b/mods/tinker/tconstruct/dimension/TinkerWorldProvider.java @@ -12,7 +12,7 @@ public class TinkerWorldProvider extends WorldProvider /** * creates a new world chunk manager for WorldProvider */ - public void registerWorldChunkManager() + public void registerWorldChunkManager () { this.worldChunkMgr = new TinkerChunkManager(BiomeGenBase.iceMountains, 1.0F, 0.0F); this.isHellWorld = true; @@ -23,7 +23,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Creates the light to brightness table */ - protected void generateLightBrightnessTable() + protected void generateLightBrightnessTable () { float f = 1.0F; @@ -37,7 +37,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Returns a new chunk provider which generates chunks for this world */ - public IChunkProvider createChunkGenerator() + public IChunkProvider createChunkGenerator () { return new TinkerChunkProvider(this.worldObj, this.worldObj.getSeed()); } @@ -45,7 +45,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. */ - public boolean isSurfaceWorld() + public boolean isSurfaceWorld () { return false; } @@ -53,7 +53,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Will check if the x, z position specified is alright to be set as the map spawn point */ - public boolean canCoordinateBeSpawn(int par1, int par2) + public boolean canCoordinateBeSpawn (int par1, int par2) { return false; } @@ -61,7 +61,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) */ - public float calculateCelestialAngle(long par1, float par3) + public float calculateCelestialAngle (long par1, float par3) { return 0.5F; } @@ -69,17 +69,16 @@ public class TinkerWorldProvider extends WorldProvider /** * True if the player can respawn in this dimension (true = overworld, false = nether). */ - public boolean canRespawnHere() + public boolean canRespawnHere () { return false; } @SideOnly(Side.CLIENT) - /** * Returns true if the given X,Z coordinate should show environmental fog. */ - public boolean doesXZShowFog(int par1, int par2) + public boolean doesXZShowFog (int par1, int par2) { return false; } @@ -87,7 +86,7 @@ public class TinkerWorldProvider extends WorldProvider /** * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". */ - public String getDimensionName() + public String getDimensionName () { return "Skylands"; } diff --git a/mods/tinker/tconstruct/entity/Automaton.java b/mods/tinker/tconstruct/entity/Automaton.java index 89a4fc4e..8d5f6d86 100644 --- a/mods/tinker/tconstruct/entity/Automaton.java +++ b/mods/tinker/tconstruct/entity/Automaton.java @@ -7,33 +7,34 @@ import net.minecraft.world.World; public class Automaton extends GolemBase { - int state; - /*TaskBase currentTask; - HashMap taskList = new HashMap();*/ + int state; - public Automaton(World world) - { - super(world); + /*TaskBase currentTask; + HashMap taskList = new HashMap();*/ + + public Automaton(World world) + { + super(world); this.setSize(0.9F, 2.42F); this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; this.tasks.addTask(1, new GAIAttackTarget(this)); this.tasks.addTask(2, new GAIFindTarget(this)); this.tasks.addTask(3, new GAIFollowOwner(this)); - - /*taskList.put("wait", new TaskWait(this)); - TaskBase task = new TaskClearcut(this); - taskList.put("clearcut", task); - currentTask = task;*/ - } - @Override + /*taskList.put("wait", new TaskWait(this)); + TaskBase task = new TaskClearcut(this); + taskList.put("clearcut", task); + currentTask = task;*/ + } + + @Override public void initCreature () { - baseAttack = 5; - maxHealth = 50; + baseAttack = 5; + maxHealth = 50; } - - /*@Override + + /*@Override public void updateAITick() { if (!currentTask.update()) @@ -41,8 +42,8 @@ public class Automaton extends GolemBase currentTask.finishTask(); } }*/ - - protected String getHurtSound() + + protected String getHurtSound () { return "mob.irongolem.hit"; } @@ -50,7 +51,7 @@ public class Automaton extends GolemBase /** * Returns the sound this mob makes on death. */ - protected String getDeathSound() + protected String getDeathSound () { return "mob.irongolem.death"; } @@ -58,12 +59,12 @@ public class Automaton extends GolemBase /** * Plays step sound at given x, y, z for the entity */ - protected void playStepSound(int par1, int par2, int par3, int par4) + protected void playStepSound (int par1, int par2, int par3, int par4) { this.playSound("mob.irongolem.walk", 1.0F, 1.0F); } - - public boolean interact(EntityPlayer par1EntityPlayer) + + public boolean interact (EntityPlayer par1EntityPlayer) { this.setCurrentItemOrArmor(0, par1EntityPlayer.getCurrentEquippedItem().copy()); return true; diff --git a/mods/tinker/tconstruct/entity/BlueSlime.java b/mods/tinker/tconstruct/entity/BlueSlime.java index ff5a91be..1e8406b5 100644 --- a/mods/tinker/tconstruct/entity/BlueSlime.java +++ b/mods/tinker/tconstruct/entity/BlueSlime.java @@ -26,538 +26,538 @@ import net.minecraftforge.common.ForgeHooks; public class BlueSlime extends EntityLiving implements IMob, IBossDisplayData { - private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; - public float sizeOffset; - public float sizeFactor; - public float sizeHeight; + private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; + public float sizeOffset; + public float sizeFactor; + public float sizeHeight; - /** the time between each jump of the slime */ - protected int slimeJumpDelay = 0; + /** the time between each jump of the slime */ + protected int slimeJumpDelay = 0; - public BlueSlime(World world) - { - super(world); - this.texture = "/mods/tinker/textures/mob/slimeedible.png"; - int offset = this.rand.nextInt(299); - if (offset < 149) - offset = 1; - else if (offset < 298) - offset = 2; - else - offset = 3; - int size = 1 << offset; - this.yOffset = 0.0F; - this.slimeJumpDelay = this.rand.nextInt(120) + 40; - this.setSlimeSize(size); - this.jumpMovementFactor = 0.004F * size + 0.01F; - } + public BlueSlime(World world) + { + super(world); + this.texture = "/mods/tinker/textures/mob/slimeedible.png"; + int offset = this.rand.nextInt(299); + if (offset < 149) + offset = 1; + else if (offset < 298) + offset = 2; + else + offset = 3; + int size = 1 << offset; + this.yOffset = 0.0F; + this.slimeJumpDelay = this.rand.nextInt(120) + 40; + this.setSlimeSize(size); + this.jumpMovementFactor = 0.004F * size + 0.01F; + } - protected void damageEntity (DamageSource damageSource, int damage) - { - //Minecraft.getMinecraft().getLogAgent().logInfo("Damage: "+damage); - if (damageSource.damageType.equals("arrow")) - damage = damage / 2; - super.damageEntity(damageSource, damage); - } + protected void damageEntity (DamageSource damageSource, int damage) + { + //Minecraft.getMinecraft().getLogAgent().logInfo("Damage: "+damage); + if (damageSource.damageType.equals("arrow")) + damage = damage / 2; + super.damageEntity(damageSource, damage); + } - public String getEntityName () - { - String s = EntityList.getEntityString(this); + public String getEntityName () + { + String s = EntityList.getEntityString(this); - if (s == null) - { - s = "generic"; - } + if (s == null) + { + s = "generic"; + } - if (getSlimeSize() >= 8) - s = "TConstruct.KingSlime"; + if (getSlimeSize() >= 8) + s = "TConstruct.KingSlime"; - return StatCollector.translateToLocal("entity." + s + ".name"); - } + return StatCollector.translateToLocal("entity." + s + ".name"); + } - @Override - public void initCreature () - { - if (getSlimeSize() == 2 && rand.nextInt(8) == 0) - { - EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); - entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - entityskeleton.initCreature(); - this.worldObj.spawnEntityInWorld(entityskeleton); - entityskeleton.mountEntity(this); - } - if (getSlimeSize() == 4 && rand.nextInt(12) == 0) - { - EntityCreeper creeper = new EntityCreeper(this.worldObj); - creeper.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - creeper.initCreature(); - this.worldObj.spawnEntityInWorld(creeper); - creeper.mountEntity(this); - } - if (getSlimeSize() == 8) - { - for (int i = 0; i < 5; i++) - { - BlueSlime slime = new BlueSlime(this.worldObj); - slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - slime.initCreature(); - this.worldObj.spawnEntityInWorld(slime); - } + @Override + public void initCreature () + { + if (getSlimeSize() == 2 && rand.nextInt(8) == 0) + { + EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); + entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityskeleton.initCreature(); + this.worldObj.spawnEntityInWorld(entityskeleton); + entityskeleton.mountEntity(this); + } + if (getSlimeSize() == 4 && rand.nextInt(12) == 0) + { + EntityCreeper creeper = new EntityCreeper(this.worldObj); + creeper.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + creeper.initCreature(); + this.worldObj.spawnEntityInWorld(creeper); + creeper.mountEntity(this); + } + if (getSlimeSize() == 8) + { + for (int i = 0; i < 5; i++) + { + BlueSlime slime = new BlueSlime(this.worldObj); + slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + slime.initCreature(); + this.worldObj.spawnEntityInWorld(slime); + } - BlueSlime slime = new BlueSlime(this.worldObj); - slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - slime.setSlimeSize(2); - this.worldObj.spawnEntityInWorld(slime); + BlueSlime slime = new BlueSlime(this.worldObj); + slime.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + slime.setSlimeSize(2); + this.worldObj.spawnEntityInWorld(slime); - EntitySkeleton skelton = new EntitySkeleton(this.worldObj); - skelton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - skelton.initCreature(); - this.worldObj.spawnEntityInWorld(skelton); - skelton.mountEntity(slime); - } - } + EntitySkeleton skelton = new EntitySkeleton(this.worldObj); + skelton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + skelton.initCreature(); + this.worldObj.spawnEntityInWorld(skelton); + skelton.mountEntity(slime); + } + } - @Override - public double getMountedYOffset () - { - return this.height * 0.3; - } + @Override + public double getMountedYOffset () + { + return this.height * 0.3; + } - protected void jump () - { - this.motionY = 0.05 * getSlimeSize() + 0.37; + protected void jump () + { + this.motionY = 0.05 * getSlimeSize() + 0.37; - if (this.isPotionActive(Potion.jump)) - { - this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); - } + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } - if (this.isSprinting()) - { - float f = this.rotationYaw * 0.017453292F; - this.motionX -= (double) (MathHelper.sin(f) * 0.2F); - this.motionZ += (double) (MathHelper.cos(f) * 0.2F); - } + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double) (MathHelper.sin(f) * 0.2F); + this.motionZ += (double) (MathHelper.cos(f) * 0.2F); + } - if (this.getBrightness(1.0F) > 0.9F && rand.nextInt(5) == 0 - && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) - { - int size = this.getSlimeSize() - 1; - if (size < 7) - { - if (size <= 0) - this.kill(); - else - this.setSlimeSize(size); - } - } + if (this.getBrightness(1.0F) > 0.9F && rand.nextInt(5) == 0 + && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) + { + int size = this.getSlimeSize() - 1; + if (size < 7) + { + if (size <= 0) + this.kill(); + else + this.setSlimeSize(size); + } + } - this.isAirBorne = true; - ForgeHooks.onLivingJump(this); - } + this.isAirBorne = true; + ForgeHooks.onLivingJump(this); + } - protected void fall (float par1) - { - } + protected void fall (float par1) + { + } - protected String getSlimeParticle () - { - return "blueslime"; - } + protected String getSlimeParticle () + { + return "blueslime"; + } - @Override - public boolean getCanSpawnHere () - { - return isValidLightLevel() && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox); - } + @Override + public boolean getCanSpawnHere () + { + return isValidLightLevel() && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() + && !this.worldObj.isAnyLiquid(this.boundingBox); + } - protected boolean isValidLightLevel () - { - int x = MathHelper.floor_double(this.posX); - int y = MathHelper.floor_double(this.boundingBox.minY); - int z = MathHelper.floor_double(this.posZ); + protected boolean isValidLightLevel () + { + int x = MathHelper.floor_double(this.posX); + int y = MathHelper.floor_double(this.boundingBox.minY); + int z = MathHelper.floor_double(this.posZ); - if (y < 60 && rand.nextInt(5) != 0) - { - return false; - } + if (y < 60 && rand.nextInt(5) != 0) + { + return false; + } - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32)) - { - return false; - } - else - { - int light = this.worldObj.getBlockLightValue(x, y, z); + if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32)) + { + return false; + } + else + { + int light = this.worldObj.getBlockLightValue(x, y, z); - if (this.worldObj.isThundering()) - { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - light = this.worldObj.getBlockLightValue(x, y, z); - this.worldObj.skylightSubtracted = i1; - } + if (this.worldObj.isThundering()) + { + int i1 = this.worldObj.skylightSubtracted; + this.worldObj.skylightSubtracted = 10; + light = this.worldObj.getBlockLightValue(x, y, z); + this.worldObj.skylightSubtracted = i1; + } - return light <= this.rand.nextInt(8); - } - } + return light <= this.rand.nextInt(8); + } + } - protected void entityInit () - { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 1)); - this.dataWatcher.addObject(17, new Integer(100)); - } + protected void entityInit () + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 1)); + this.dataWatcher.addObject(17, new Integer(100)); + } - public void setSlimeSize (int size) - { - this.dataWatcher.updateObject(16, new Byte((byte) size)); - this.setSize(0.6F * size, 0.6F * size); - this.setPosition(this.posX, this.posY, this.posZ); - this.setEntityHealth(this.getMaxHealth()); - this.experienceValue = size + 2; - if (size >= 8) - this.experienceValue = 500; - } + public void setSlimeSize (int size) + { + this.dataWatcher.updateObject(16, new Byte((byte) size)); + this.setSize(0.6F * size, 0.6F * size); + this.setPosition(this.posX, this.posY, this.posZ); + this.setEntityHealth(this.getMaxHealth()); + this.experienceValue = size + 2; + if (size >= 8) + this.experienceValue = 500; + } - public int getMaxHealth () - { - int i = this.getSlimeSize(); - if (i == 1) - return 4; - if (i == 8) - return 100; - return (int) Math.min(i * i + 8, 49); - } + public int getMaxHealth () + { + int i = this.getSlimeSize(); + if (i == 1) + return 4; + if (i == 8) + return 100; + return (int) Math.min(i * i + 8, 49); + } - /** - * Returns the size of the slime. - */ - public int getSlimeSize () - { - return this.dataWatcher.getWatchableObjectByte(16); - } + /** + * Returns the size of the slime. + */ + public int getSlimeSize () + { + return this.dataWatcher.getWatchableObjectByte(16); + } - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound) - { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); - } + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); + } - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) - { - super.readEntityFromNBT(par1NBTTagCompound); - this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); - this.dataWatcher.updateObject(17, Integer.valueOf(this.health)); - } + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); + this.dataWatcher.updateObject(17, Integer.valueOf(this.health)); + } - /** - * Returns the name of the sound played when the slime jumps. - */ - protected String getJumpSound () - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } - /** - * Called to update the entity's position/logic. - */ - public void onUpdate () - { - if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) - { - this.isDead = true; - } + /** + * Called to update the entity's position/logic. + */ + public void onUpdate () + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) + { + this.isDead = true; + } - if (!this.worldObj.isRemote) - { - this.dataWatcher.updateObject(17, Integer.valueOf(this.health)); - } + if (!this.worldObj.isRemote) + { + this.dataWatcher.updateObject(17, Integer.valueOf(this.health)); + } - this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; - this.sizeHeight = this.sizeFactor; - boolean flag = this.onGround; - super.onUpdate(); - int i; + this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; + this.sizeHeight = this.sizeFactor; + boolean flag = this.onGround; + super.onUpdate(); + int i; - if (this.onGround && !flag) - { - i = this.getSlimeSize(); + if (this.onGround && !flag) + { + i = this.getSlimeSize(); - for (int j = 0; j < i * 8; ++j) - { - float f = this.rand.nextFloat() * (float) Math.PI * 2.0F; - float offset = this.rand.nextFloat() * 0.5F + 0.5F; - float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset; - float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset; - TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); - } + for (int j = 0; j < i * 8; ++j) + { + float f = this.rand.nextFloat() * (float) Math.PI * 2.0F; + float offset = this.rand.nextFloat() * 0.5F + 0.5F; + float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset; + float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset; + TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); + } - if (this.makesSoundOnLand()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); - } + if (this.makesSoundOnLand()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } - this.sizeOffset = -0.5F; - } - else if (!this.onGround && flag) - { - this.sizeOffset = 1.0F; - } + this.sizeOffset = -0.5F; + } + else if (!this.onGround && flag) + { + this.sizeOffset = 1.0F; + } - this.func_70808_l(); + this.func_70808_l(); - if (this.worldObj.isRemote) - { - i = this.getSlimeSize(); - this.setSize(0.6F * (float) i, 0.6F * (float) i); - } - } + if (this.worldObj.isRemote) + { + i = this.getSlimeSize(); + this.setSize(0.6F * (float) i, 0.6F * (float) i); + } + } - protected void updateEntityActionState () - { - //Minecraft.getMinecraft().getLogAgent().logInfo("Collided with "+entity.getEntityName()); - this.despawnEntity(); - EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + protected void updateEntityActionState () + { + //Minecraft.getMinecraft().getLogAgent().logInfo("Collided with "+entity.getEntityName()); + this.despawnEntity(); + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - if (entityplayer != null) - { - this.faceEntity(entityplayer, 10.0F, 20.0F); - } - else if (this.onGround && this.slimeJumpDelay == 1) - { - this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90; - if (rotationYaw > 360) - rotationYaw -= 360; - if (rotationYaw < 0) - rotationYaw += 360; - } + if (entityplayer != null) + { + this.faceEntity(entityplayer, 10.0F, 20.0F); + } + else if (this.onGround && this.slimeJumpDelay == 1) + { + this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90; + if (rotationYaw > 360) + rotationYaw -= 360; + if (rotationYaw < 0) + rotationYaw += 360; + } - if (this.onGround && this.slimeJumpDelay-- <= 0) - { - this.slimeJumpDelay = this.getJumpDelay(); + if (this.onGround && this.slimeJumpDelay-- <= 0) + { + this.slimeJumpDelay = this.getJumpDelay(); - if (entityplayer != null) - { - this.slimeJumpDelay /= 12; - } + if (entityplayer != null) + { + this.slimeJumpDelay /= 12; + } - this.isJumping = true; + this.isJumping = true; - if (this.makesSoundOnJump()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); - } + if (this.makesSoundOnJump()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } - this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; - this.moveForward = (float) (1 * this.getSlimeSize()); - } - else - { - this.isJumping = false; + this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float) (1 * this.getSlimeSize()); + } + else + { + this.isJumping = false; - if (this.onGround) - { - this.moveStrafing = this.moveForward = 0.0F; - } - } - } - - public boolean handleWaterMovement() + if (this.onGround) + { + this.moveStrafing = this.moveForward = 0.0F; + } + } + } + + public boolean handleWaterMovement () { return false; } - protected void func_70808_l () - { - this.sizeOffset *= 0.6F; - } + protected void func_70808_l () + { + this.sizeOffset *= 0.6F; + } - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay () - { - return this.rand.nextInt(120) + 40; - } + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay () + { + return this.rand.nextInt(120) + 40; + } - protected BlueSlime createInstance () - { - return new BlueSlime(this.worldObj); - } + protected BlueSlime createInstance () + { + return new BlueSlime(this.worldObj); + } - /** - * Will get destroyed next tick. - */ - public void setDead () - { - int size = this.getSlimeSize(); + /** + * Will get destroyed next tick. + */ + public void setDead () + { + int size = this.getSlimeSize(); - if (!this.worldObj.isRemote && size > 1 && this.getHealth() <= 0 && size < 8) - { - float f = (-0.5F) * (float) size / 4.0F; - float f1 = (-0.5F) * (float) size / 4.0F; - BlueSlime entityslime = this.createInstance(); - entityslime.setSlimeSize(size / 2); - entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); - this.worldObj.spawnEntityInWorld(entityslime); - } + if (!this.worldObj.isRemote && size > 1 && this.getHealth() <= 0 && size < 8) + { + float f = (-0.5F) * (float) size / 4.0F; + float f1 = (-0.5F) * (float) size / 4.0F; + BlueSlime entityslime = this.createInstance(); + entityslime.setSlimeSize(size / 2); + entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityslime); + } - super.setDead(); - } + super.setDead(); + } - protected void dropFewItems (boolean par1, int par2) - { - int size = this.getSlimeSize(); - int j = this.getDropItemId(); + protected void dropFewItems (boolean par1, int par2) + { + int size = this.getSlimeSize(); + int j = this.getDropItemId(); - if (j > 0 && (rand.nextInt(2) == 0) || size >= 8) - { - int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); + if (j > 0 && (rand.nextInt(2) == 0) || size >= 8) + { + int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); - if (par2 > 0) - { - k += this.rand.nextInt(par2 + 1); - } + if (par2 > 0) + { + k += this.rand.nextInt(par2 + 1); + } - for (int l = 0; l < k; ++l) - { - this.dropItem(j, 1); - } - } + for (int l = 0; l < k; ++l) + { + this.dropItem(j, 1); + } + } - if (size == 8) - { - ToolCore tool = getValidTool(); + if (size == 8) + { + ToolCore tool = getValidTool(); - Item accessory = tool.getAccessoryItem(); - ItemStack accessoryStack = accessory != null ? new ItemStack(tool.getAccessoryItem(), 1, 17) : null; - ItemStack toolStack = ToolBuilder.instance.buildTool(new ItemStack(tool.getHeadItem(), 1, 17), new ItemStack(tool.getHandleItem(), 1, 17), accessoryStack, - "King Slime " + tool.getToolName()); + Item accessory = tool.getAccessoryItem(); + ItemStack accessoryStack = accessory != null ? new ItemStack(tool.getAccessoryItem(), 1, 17) : null; + ItemStack toolStack = ToolBuilder.instance.buildTool(new ItemStack(tool.getHeadItem(), 1, 17), new ItemStack(tool.getHandleItem(), 1, 17), accessoryStack, + "King Slime " + tool.getToolName()); - NBTTagCompound tags = toolStack.getTagCompound().getCompoundTag("InfiTool"); - tags.setInteger("Attack", 3 + tool.getDamageVsEntity(null)); - tags.setInteger("TotalDurability", 1500); - tags.setInteger("BaseDurability", 1500); - tags.setInteger("MiningSpeed", 800); + NBTTagCompound tags = toolStack.getTagCompound().getCompoundTag("InfiTool"); + tags.setInteger("Attack", 3 + tool.getDamageVsEntity(null)); + tags.setInteger("TotalDurability", 1500); + tags.setInteger("BaseDurability", 1500); + tags.setInteger("MiningSpeed", 800); - this.entityDropItem(toolStack, 0f); - if (rand.nextInt(5) == 0) - { - ItemStack dropStack = new ItemStack(TContent.heartCanister, 1, 1); - this.entityDropItem(dropStack, 0f); - } - } - } - - ToolCore getValidTool() - { + this.entityDropItem(toolStack, 0f); + if (rand.nextInt(5) == 0) + { + ItemStack dropStack = new ItemStack(TContent.heartCanister, 1, 1); + this.entityDropItem(dropStack, 0f); + } + } + } + + ToolCore getValidTool () + { ToolCore tool = TConstructRegistry.tools.get(rand.nextInt(TConstructRegistry.tools.size())); if (tool.getAccessoryItem() != null) tool = getValidTool(); return tool; - } + } - /** - * Called by a player entity when they collide with an entity - */ - public void onCollideWithPlayer (EntityPlayer par1EntityPlayer) - { - if (this.canDamagePlayer()) - { - int i = this.getSlimeSize(); + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer (EntityPlayer par1EntityPlayer) + { + if (this.canDamagePlayer()) + { + int i = this.getSlimeSize(); - if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double) i * 0.6D * (double) i - && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength())) - { - this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - } - } - } + if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double) i * 0.6D * (double) i + && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength())) + { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + } - /** - * Indicates weather the slime is able to damage the player (based upon the slime's size) - */ - protected boolean canDamagePlayer () - { - return this.getSlimeSize() > 1; - } + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer () + { + return this.getSlimeSize() > 1; + } - /** - * Gets the amount of damage dealt to the player when "attacked" by the slime. - */ - protected int getAttackStrength () - { - return this.getSlimeSize(); - } + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength () + { + return this.getSlimeSize(); + } - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound () - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } - /** - * Returns the sound this mob makes on death. - */ - protected String getDeathSound () - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } - /** - * Returns the item ID for the item the mob drops on death. - */ - protected int getDropItemId () - { - return TContent.strangeFood.itemID; - } + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId () + { + return TContent.strangeFood.itemID; + } - /** - * Returns the volume for the sounds this mob makes. - */ - protected float getSoundVolume () - { - return Math.min(0.05F * (float) this.getSlimeSize(), 0.3f); - } + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume () + { + return Math.min(0.05F * (float) this.getSlimeSize(), 0.3f); + } - /** - * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently - * use in wolves. - */ - public int getVerticalFaceSpeed () - { - return 0; - } + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed () + { + return 0; + } - /** - * Returns true if the slime makes a sound when it jumps (based upon the slime's size) - */ - protected boolean makesSoundOnJump () - { - return this.getSlimeSize() > 0; - } + /** + * Returns true if the slime makes a sound when it jumps (based upon the slime's size) + */ + protected boolean makesSoundOnJump () + { + return this.getSlimeSize() > 0; + } - /** - * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) - */ - protected boolean makesSoundOnLand () - { - return this.getSlimeSize() > 2; - } + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand () + { + return this.getSlimeSize() > 2; + } - @Override - public int getBossHealth () - { - return this.dataWatcher.getWatchableObjectInt(17); - } + @Override + public int getBossHealth () + { + return this.dataWatcher.getWatchableObjectInt(17); + } } diff --git a/mods/tinker/tconstruct/entity/CartEntity.java b/mods/tinker/tconstruct/entity/CartEntity.java index 7b432514..90c831cf 100644 --- a/mods/tinker/tconstruct/entity/CartEntity.java +++ b/mods/tinker/tconstruct/entity/CartEntity.java @@ -29,8 +29,7 @@ import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class CartEntity extends Entity - implements IInventory, IEntityAdditionalSpawnData +public class CartEntity extends Entity implements IInventory, IEntityAdditionalSpawnData { /** Array of item stacks stored in minecart (for storage minecarts). */ protected ItemStack[] cargoItems; @@ -44,7 +43,8 @@ public class CartEntity extends Entity protected boolean field_82345_h; /** Minecart rotational logic matrix */ - protected static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; + protected static final int[][][] matrix = new int[][][] { { { 0, 0, -1 }, { 0, 0, 1 } }, { { -1, 0, 0 }, { 1, 0, 0 } }, { { -1, -1, 0 }, { 1, 0, 0 } }, { { -1, 0, 0 }, { 1, -1, 0 } }, + { { 0, 0, -1 }, { 0, -1, 1 } }, { { 0, -1, -1 }, { 0, 0, 1 } }, { { 0, 0, 1 }, { 1, 0, 0 } }, { { 0, 0, 1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { -1, 0, 0 } }, { { 0, 0, -1 }, { 1, 0, 0 } } }; /** appears to be the progress of the turn */ protected int turnProgress; @@ -77,7 +77,7 @@ public class CartEntity extends Entity protected float maxSpeedAirLateral; protected float maxSpeedAirVertical; protected double dragAir; - + Entity entityFollowing; public CartEntity(World par1World) @@ -104,11 +104,11 @@ public class CartEntity extends Entity this(world); pullcartType = type; } - + public CartEntity(World world, double x, double y, double z, int type) { this(world); - this.setPosition(x, y + (double)this.yOffset, z); + this.setPosition(x, y + (double) this.yOffset, z); this.motionX = 0.0D; this.motionY = 0.0D; this.motionZ = 0.0D; @@ -123,14 +123,14 @@ public class CartEntity extends Entity * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to * prevent them from trampling crops */ - protected boolean canTriggerWalking() + protected boolean canTriggerWalking () { return false; } - protected void entityInit() + protected void entityInit () { - this.dataWatcher.addObject(16, new Byte((byte)0)); + this.dataWatcher.addObject(16, new Byte((byte) 0)); this.dataWatcher.addObject(17, new Integer(0)); this.dataWatcher.addObject(18, new Integer(1)); this.dataWatcher.addObject(19, new Integer(0)); @@ -140,7 +140,7 @@ public class CartEntity extends Entity * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be * pushable on contact, like boats or minecarts. */ - public AxisAlignedBB getCollisionBox(Entity par1Entity) + public AxisAlignedBB getCollisionBox (Entity par1Entity) { return par1Entity.boundingBox; } @@ -148,7 +148,7 @@ public class CartEntity extends Entity /** * returns the bounding box for this entity */ - public AxisAlignedBB getBoundingBox() + public AxisAlignedBB getBoundingBox () { return this.boundingBox; } @@ -156,7 +156,7 @@ public class CartEntity extends Entity /** * Returns true if this entity should push and be pushed by other entities when colliding. */ - public boolean canBePushed() + public boolean canBePushed () { return canBePushed; } @@ -164,15 +164,15 @@ public class CartEntity extends Entity /** * Returns the Y offset from the entity's position for any entity riding this one. */ - public double getMountedYOffset() + public double getMountedYOffset () { - return (double)this.height * 0.0D - 0.30000001192092896D; + return (double) this.height * 0.0D - 0.30000001192092896D; } /** * Called when the entity is attacked. */ - public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) + public boolean attackEntityFrom (DamageSource par1DamageSource, int par2) { if (!this.worldObj.isRemote && !this.isDead) { @@ -187,7 +187,7 @@ public class CartEntity extends Entity this.setBeenAttacked(); this.setDamage(this.getDamage() + par2 * 10); - if (par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode) + if (par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer) par1DamageSource.getEntity()).capabilities.isCreativeMode) { this.setDamage(100); } @@ -213,11 +213,10 @@ public class CartEntity extends Entity } @SideOnly(Side.CLIENT) - /** * Setups the entity to do the hurt animation. Only used by packets in multiplayer. */ - public void performHurtAnimation() + public void performHurtAnimation () { this.func_70494_i(-this.func_70493_k()); this.func_70497_h(10); @@ -227,7 +226,7 @@ public class CartEntity extends Entity /** * Returns true if other Entities should be prevented from moving through this Entity. */ - public boolean canBeCollidedWith() + public boolean canBeCollidedWith () { return !this.isDead; } @@ -235,7 +234,7 @@ public class CartEntity extends Entity /** * Will get destroyed next tick. */ - public void setDead() + public void setDead () { if (this.field_82345_h) { @@ -259,17 +258,18 @@ public class CartEntity extends Entity } var2.stackSize -= var6; - EntityItem entityitem = new EntityItem(this.worldObj, this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, new ItemStack(var2.itemID, var6, var2.getItemDamage())); + EntityItem entityitem = new EntityItem(this.worldObj, this.posX + (double) var3, this.posY + (double) var4, this.posZ + (double) var5, new ItemStack(var2.itemID, var6, + var2.getItemDamage())); if (var2.hasTagCompound()) { - entityitem.getEntityItem().setTagCompound((NBTTagCompound)var2.getTagCompound().copy()); + entityitem.getEntityItem().setTagCompound((NBTTagCompound) var2.getTagCompound().copy()); } float var8 = 0.05F; - entityitem.motionX = (double)((float)this.rand.nextGaussian() * var8); - entityitem.motionY = (double)((float)this.rand.nextGaussian() * var8 + 0.2F); - entityitem.motionZ = (double)((float)this.rand.nextGaussian() * var8); + entityitem.motionX = (double) ((float) this.rand.nextGaussian() * var8); + entityitem.motionY = (double) ((float) this.rand.nextGaussian() * var8 + 0.2F); + entityitem.motionZ = (double) ((float) this.rand.nextGaussian() * var8); this.worldObj.spawnEntityInWorld(entityitem); } } @@ -282,7 +282,7 @@ public class CartEntity extends Entity /** * Teleports the entity to another dimension. Params: Dimension number to teleport to */ - public void travelToDimension(int par1) + public void travelToDimension (int par1) { this.field_82345_h = false; super.travelToDimension(par1); @@ -291,7 +291,7 @@ public class CartEntity extends Entity /** * Called to update the entity's position/logic. */ - public void onUpdate() + public void onUpdate () { if (this.func_70496_j() > 0) { @@ -318,7 +318,7 @@ public class CartEntity extends Entity if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { this.worldObj.theProfiler.startSection("portal"); - MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer(); + MinecraftServer var1 = ((WorldServer) this.worldObj).getMinecraftServer(); var2 = this.getMaxInPortalTime(); if (this.inPortal) @@ -372,12 +372,12 @@ public class CartEntity extends Entity { if (this.turnProgress > 0) { - double var46 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; - double var48 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; - double var5 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; - double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double)this.rotationYaw); - this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.turnProgress); - this.rotationPitch = (float)((double)this.rotationPitch + (this.minecartPitch - (double)this.rotationPitch) / (double)this.turnProgress); + double var46 = this.posX + (this.minecartX - this.posX) / (double) this.turnProgress; + double var48 = this.posY + (this.minecartY - this.posY) / (double) this.turnProgress; + double var5 = this.posZ + (this.minecartZ - this.posZ) / (double) this.turnProgress; + double var7 = MathHelper.wrapAngleTo180_double(this.minecartYaw - (double) this.rotationYaw); + this.rotationYaw = (float) ((double) this.rotationYaw + var7 / (double) this.turnProgress); + this.rotationPitch = (float) ((double) this.rotationPitch + (this.minecartPitch - (double) this.rotationPitch) / (double) this.turnProgress); --this.turnProgress; this.setPosition(var46, var48, var5); this.setRotation(this.rotationYaw, this.rotationPitch); @@ -409,7 +409,7 @@ public class CartEntity extends Entity moveMinecartOffRail(var45, var2, var47); if (entityFollowing != null) - moveTowardsEntity(entityFollowing); + moveTowardsEntity(entityFollowing); this.doBlockCollisions(); this.rotationPitch = 0.0F; @@ -418,7 +418,7 @@ public class CartEntity extends Entity if (var49 * var49 + var50 * var50 > 0.001D) { - this.rotationYaw = (float)(Math.atan2(var50, var49) * 180.0D / Math.PI); + this.rotationYaw = (float) (Math.atan2(var50, var49) * 180.0D / Math.PI); if (this.field_70499_f) { @@ -426,7 +426,7 @@ public class CartEntity extends Entity } } - double var51 = (double)MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); + double var51 = (double) MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); if (var51 < -170.0D || var51 >= 170.0D) { @@ -444,7 +444,7 @@ public class CartEntity extends Entity { for (int var52 = 0; var52 < var15.size(); ++var52) { - Entity var17 = (Entity)var15.get(var52); + Entity var17 = (Entity) var15.get(var52); if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof CartEntity) { @@ -466,26 +466,26 @@ public class CartEntity extends Entity updateFuel(); } } - - void moveTowardsEntity(Entity entity) - { - //System.out.println("Moving towards entity"); - /*double distX = this.posX - entity.posX; - double distZ = this.posZ - entity.posZ; - //posY = posY + 0.1; - if (entity.posY > this.posY) - motionY += 0.1; - if (distX > 0.5 && distZ > 0.5) - { - motionX = -distX; - motionZ = -distZ; - }*/ - - double var15 = entity.posX; + void moveTowardsEntity (Entity entity) + { + //System.out.println("Moving towards entity"); + /*double distX = this.posX - entity.posX; + double distZ = this.posZ - entity.posZ; + //posY = posY + 0.1; + + if (entity.posY > this.posY) + motionY += 0.1; + if (distX > 0.5 && distZ > 0.5) + { + motionX = -distX; + motionZ = -distZ; + }*/ + + double var15 = entity.posX; double var19 = entity.posZ; - - if (this.calculateDistance(this.prevPosX, var15) > 1.5D || this.calculateDistance(this.prevPosZ, var19) > 1.5D) + + if (this.calculateDistance(this.prevPosX, var15) > 1.5D || this.calculateDistance(this.prevPosZ, var19) > 1.5D) { double var28 = this.prevPosX; double var30 = this.prevPosZ; @@ -529,12 +529,12 @@ public class CartEntity extends Entity this.motionZ = -var42;// * var26; } } - - /*if (entity.posY > this.posY) - motionY += 0.1;*/ + + /*if (entity.posY > this.posY) + motionY += 0.1;*/ } - - public double calculateDistance(double pos1, double pos2) + + public double calculateDistance (double pos1, double pos2) { double distance = Math.abs(pos1 - pos2); //0.0D; /*double absPos1 = Math.abs(pos1); @@ -557,7 +557,7 @@ public class CartEntity extends Entity } @SideOnly(Side.CLIENT) - public Vec3 func_70495_a(double par1, double par3, double par5, double par7) + public Vec3 func_70495_a (double par1, double par3, double par5, double par7) { int var9 = MathHelper.floor_double(par1); int var10 = MathHelper.floor_double(par3); @@ -572,8 +572,8 @@ public class CartEntity extends Entity return null; } - - public Vec3 func_70489_a(double par1, double par3, double par5) + + public Vec3 func_70489_a (double par1, double par3, double par5) { int var7 = MathHelper.floor_double(par1); int var8 = MathHelper.floor_double(par3); @@ -589,34 +589,34 @@ public class CartEntity extends Entity if (BlockRail.isRailBlock(var10)) { int var11 = 0; - par3 = (double)var8; + par3 = (double) var8; if (var11 >= 2 && var11 <= 5) { - par3 = (double)(var8 + 1); + par3 = (double) (var8 + 1); } int[][] var12 = matrix[var11]; double var13 = 0.0D; - double var15 = (double)var7 + 0.5D + (double)var12[0][0] * 0.5D; - double var17 = (double)var8 + 0.5D + (double)var12[0][1] * 0.5D; - double var19 = (double)var9 + 0.5D + (double)var12[0][2] * 0.5D; - double var21 = (double)var7 + 0.5D + (double)var12[1][0] * 0.5D; - double var23 = (double)var8 + 0.5D + (double)var12[1][1] * 0.5D; - double var25 = (double)var9 + 0.5D + (double)var12[1][2] * 0.5D; + double var15 = (double) var7 + 0.5D + (double) var12[0][0] * 0.5D; + double var17 = (double) var8 + 0.5D + (double) var12[0][1] * 0.5D; + double var19 = (double) var9 + 0.5D + (double) var12[0][2] * 0.5D; + double var21 = (double) var7 + 0.5D + (double) var12[1][0] * 0.5D; + double var23 = (double) var8 + 0.5D + (double) var12[1][1] * 0.5D; + double var25 = (double) var9 + 0.5D + (double) var12[1][2] * 0.5D; double var27 = var21 - var15; double var29 = (var23 - var17) * 2.0D; double var31 = var25 - var19; if (var27 == 0.0D) { - par1 = (double)var7 + 0.5D; - var13 = par5 - (double)var9; + par1 = (double) var7 + 0.5D; + var13 = par5 - (double) var9; } else if (var31 == 0.0D) { - par5 = (double)var9 + 0.5D; - var13 = par1 - (double)var7; + par5 = (double) var9 + 0.5D; + var13 = par1 - (double) var7; } else { @@ -651,7 +651,7 @@ public class CartEntity extends Entity * (abstract) Protected helper method to write subclass entity data to NBT. */ @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + protected void writeEntityToNBT (NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setInteger("Type", pullcartType); @@ -671,7 +671,7 @@ public class CartEntity extends Entity if (this.cargoItems[var3] != null) { NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); + var4.setByte("Slot", (byte) var3); this.cargoItems[var3].writeToNBT(var4); var2.appendTag(var4); } @@ -685,10 +685,10 @@ public class CartEntity extends Entity * (abstract) Protected helper method to read subclass entity data from NBT. */ @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + protected void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) { pullcartType = par1NBTTagCompound.getInteger("Type"); - + if (isPoweredCart()) { this.pushX = par1NBTTagCompound.getDouble("PushX"); @@ -710,7 +710,7 @@ public class CartEntity extends Entity for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + NBTTagCompound var4 = (NBTTagCompound) var2.tagAt(var3); int var5 = var4.getByte("Slot") & 255; if (var5 >= 0 && var5 < this.cargoItems.length) @@ -722,7 +722,7 @@ public class CartEntity extends Entity } @SideOnly(Side.CLIENT) - public float getShadowSize() + public float getShadowSize () { return 0.5F; } @@ -730,13 +730,14 @@ public class CartEntity extends Entity /** * Applies a velocity to each of the entities pushing them away from each other. Args: entity */ - public void applyEntityCollision(Entity par1Entity) + public void applyEntityCollision (Entity par1Entity) { if (!this.worldObj.isRemote) { if (par1Entity != this.riddenByEntity) { - if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && canBeRidden() && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) + if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && canBeRidden() + && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) { par1Entity.mountEntity(this); } @@ -747,7 +748,7 @@ public class CartEntity extends Entity if (var6 >= 9.999999747378752E-5D) { - var6 = (double)MathHelper.sqrt_double(var6); + var6 = (double) MathHelper.sqrt_double(var6); var2 /= var6; var4 /= var6; double var8 = 1.0D / var6; @@ -761,8 +762,8 @@ public class CartEntity extends Entity var4 *= var8; var2 *= 0.10000000149011612D; var4 *= 0.10000000149011612D; - var2 *= (double)(1.0F - this.entityCollisionReduction); - var4 *= (double)(1.0F - this.entityCollisionReduction); + var2 *= (double) (1.0F - this.entityCollisionReduction); + var4 *= (double) (1.0F - this.entityCollisionReduction); var2 *= 0.5D; var4 *= 0.5D; @@ -771,7 +772,9 @@ public class CartEntity extends Entity double var10 = par1Entity.posX - this.posX; double var12 = par1Entity.posZ - this.posZ; Vec3 var14 = this.worldObj.getWorldVec3Pool().getVecFromPool(var10, 0.0D, var12).normalize(); - Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, (double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); + Vec3 var15 = this.worldObj.getWorldVec3Pool() + .getVecFromPool((double) MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F), 0.0D, (double) MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F)) + .normalize(); double var16 = Math.abs(var14.dotProduct(var15)); if (var16 < 0.8D) @@ -782,7 +785,7 @@ public class CartEntity extends Entity double var18 = par1Entity.motionX + this.motionX; double var20 = par1Entity.motionZ + this.motionZ; - if (((CartEntity)par1Entity).isPoweredCart() && !isPoweredCart()) + if (((CartEntity) par1Entity).isPoweredCart() && !isPoweredCart()) { this.motionX *= 0.20000000298023224D; this.motionZ *= 0.20000000298023224D; @@ -790,7 +793,7 @@ public class CartEntity extends Entity par1Entity.motionX *= 0.949999988079071D; par1Entity.motionZ *= 0.949999988079071D; } - else if (!((CartEntity)par1Entity).isPoweredCart() && isPoweredCart()) + else if (!((CartEntity) par1Entity).isPoweredCart() && isPoweredCart()) { par1Entity.motionX *= 0.20000000298023224D; par1Entity.motionZ *= 0.20000000298023224D; @@ -823,7 +826,7 @@ public class CartEntity extends Entity /** * Returns the number of slots in the inventory. */ - public int getSizeInventory() + public int getSizeInventory () { return (pullcartType == 1 && getClass() == CartEntity.class ? 27 : 0); } @@ -831,7 +834,7 @@ public class CartEntity extends Entity /** * Returns the stack in slot i */ - public ItemStack getStackInSlot(int par1) + public ItemStack getStackInSlot (int par1) { return this.cargoItems[par1]; } @@ -840,7 +843,7 @@ public class CartEntity extends Entity * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a * new stack. */ - public ItemStack decrStackSize(int par1, int par2) + public ItemStack decrStackSize (int par1, int par2) { if (this.cargoItems[par1] != null) { @@ -874,7 +877,7 @@ public class CartEntity extends Entity * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - * like when you close a workbench GUI. */ - public ItemStack getStackInSlotOnClosing(int par1) + public ItemStack getStackInSlotOnClosing (int par1) { if (this.cargoItems[par1] != null) { @@ -891,7 +894,7 @@ public class CartEntity extends Entity /** * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). */ - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + public void setInventorySlotContents (int par1, ItemStack par2ItemStack) { this.cargoItems[par1] = par2ItemStack; @@ -904,7 +907,7 @@ public class CartEntity extends Entity /** * Returns the name of the inventory. */ - public String getInvName() + public String getInvName () { return "container.minecart"; } @@ -913,7 +916,7 @@ public class CartEntity extends Entity * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't * this more of a set than a get?* */ - public int getInventoryStackLimit() + public int getInventoryStackLimit () { return 64; } @@ -921,29 +924,31 @@ public class CartEntity extends Entity /** * Called when an the contents of an Inventory change, usually */ - public void onInventoryChanged() {} + public void onInventoryChanged () + { + } /** * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. */ - public boolean interact(EntityPlayer player) + public boolean interact (EntityPlayer player) { - if (player.isSneaking()) - { - if (entityFollowing == null) - { - entityFollowing = player; - //if (!worldObj.isRemote) - //player.addChatMessage("The cart is following you"); - } - else - { - entityFollowing = null; - //if (!worldObj.isRemote) - //player.addChatMessage("The cart has stopped following you"); - } - return true; - } + if (player.isSneaking()) + { + if (entityFollowing == null) + { + entityFollowing = player; + //if (!worldObj.isRemote) + //player.addChatMessage("The cart is following you"); + } + else + { + entityFollowing = null; + //if (!worldObj.isRemote) + //player.addChatMessage("The cart has stopped following you"); + } + return true; + } if (canBeRidden()) { if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player) @@ -971,7 +976,7 @@ public class CartEntity extends Entity { if (--var2.stackSize == 0) { - player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); + player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack) null); } this.fuel += 3600; @@ -985,18 +990,17 @@ public class CartEntity extends Entity } @SideOnly(Side.CLIENT) - /** * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, * posY, posZ, yaw, pitch */ - public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) + public void setPositionAndRotation2 (double par1, double par3, double par5, float par7, float par8, int par9) { this.minecartX = par1; this.minecartY = par3; this.minecartZ = par5; - this.minecartYaw = (double)par7; - this.minecartPitch = (double)par8; + this.minecartYaw = (double) par7; + this.minecartPitch = (double) par8; this.turnProgress = par9 + 2; this.motionX = this.velocityX; this.motionY = this.velocityY; @@ -1004,11 +1008,10 @@ public class CartEntity extends Entity } @SideOnly(Side.CLIENT) - /** * Sets the velocity to the args. Args: x, y, z */ - public void setVelocity(double par1, double par3, double par5) + public void setVelocity (double par1, double par3, double par5) { this.velocityX = this.motionX = par1; this.velocityY = this.motionY = par3; @@ -1018,7 +1021,7 @@ public class CartEntity extends Entity /** * Do not make give this method the name canInteractWith because it clashes with Container */ - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + public boolean isUseableByPlayer (EntityPlayer par1EntityPlayer) { return this.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D; } @@ -1026,7 +1029,7 @@ public class CartEntity extends Entity /** * Is this minecart powered (Fuel > 0) */ - public boolean isMinecartPowered() + public boolean isMinecartPowered () { return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; } @@ -1034,27 +1037,31 @@ public class CartEntity extends Entity /** * Set if this minecart is powered (Fuel > 0) */ - protected void setMinecartPowered(boolean par1) + protected void setMinecartPowered (boolean par1) { if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) | 1))); } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); + this.dataWatcher.updateObject(16, Byte.valueOf((byte) (this.dataWatcher.getWatchableObjectByte(16) & -2))); } } - public void openChest() {} + public void openChest () + { + } - public void closeChest() {} + public void closeChest () + { + } /** * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over * 40. */ - public void setDamage(int par1) + public void setDamage (int par1) { this.dataWatcher.updateObject(19, Integer.valueOf(par1)); } @@ -1063,27 +1070,27 @@ public class CartEntity extends Entity * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over * 40. */ - public int getDamage() + public int getDamage () { return this.dataWatcher.getWatchableObjectInt(19); } - public void func_70497_h(int par1) + public void func_70497_h (int par1) { this.dataWatcher.updateObject(17, Integer.valueOf(par1)); } - public int func_70496_j() + public int func_70496_j () { return this.dataWatcher.getWatchableObjectInt(17); } - public void func_70494_i(int par1) + public void func_70494_i (int par1) { this.dataWatcher.updateObject(18, Integer.valueOf(par1)); } - public int func_70493_k() + public int func_70493_k () { return this.dataWatcher.getWatchableObjectInt(18); } @@ -1091,9 +1098,9 @@ public class CartEntity extends Entity /** * Drops the cart as a item. The exact item dropped is defined by getItemDropped(). */ - public void dropCartAsItem() + public void dropCartAsItem () { - for(ItemStack item : getItemsDropped()) + for (ItemStack item : getItemsDropped()) { entityDropItem(item, 0); } @@ -1105,7 +1112,7 @@ public class CartEntity extends Entity * that is handled elsewhere. * @return A list of items dropped. */ - public List getItemsDropped() + public List getItemsDropped () { /*List items = new ArrayList(); items.add(new ItemStack(Item.minecartEmpty)); @@ -1120,7 +1127,7 @@ public class CartEntity extends Entity break; } return items;*/ - return new ArrayList(); + return new ArrayList(); } /** @@ -1130,9 +1137,9 @@ public class CartEntity extends Entity * but is not necessary the item the cart drops when destroyed. * @return An ItemStack that can be used to place the cart. */ - public ItemStack getCartItem() + public ItemStack getCartItem () { - return null; + return null; //return MinecartRegistry.getItemForCart(this); } @@ -1140,7 +1147,7 @@ public class CartEntity extends Entity * Returns true if this cart is self propelled. * @return True if powered. */ - public boolean isPoweredCart() + public boolean isPoweredCart () { return pullcartType == 2 && getClass() == CartEntity.class; } @@ -1151,7 +1158,7 @@ public class CartEntity extends Entity * and some carts without inventories may be storage carts. * @return True if this cart should be classified as a storage cart. */ - public boolean isStorageCart() + public boolean isStorageCart () { return pullcartType == 1 && getClass() == CartEntity.class; } @@ -1160,9 +1167,9 @@ public class CartEntity extends Entity * Returns true if this cart can be ridden by an Entity. * @return True if this cart can be ridden. */ - public boolean canBeRidden() + public boolean canBeRidden () { - if(pullcartType == 0 && getClass() == CartEntity.class) + if (pullcartType == 0 && getClass() == CartEntity.class) { return true; } @@ -1174,7 +1181,7 @@ public class CartEntity extends Entity * This function is mainly used to gracefully detach a minecart from a rail. * @return True if the minecart can use rails. */ - public boolean canUseRail() + public boolean canUseRail () { return false; } @@ -1184,7 +1191,7 @@ public class CartEntity extends Entity * This function is mainly used to gracefully detach a minecart from a rail. * @param use Whether the minecart can currently use rails. */ - public void setCanUseRail(boolean use) + public void setCanUseRail (boolean use) { canUseRail = use; } @@ -1193,7 +1200,7 @@ public class CartEntity extends Entity * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails. * @return True if this cart should call IRail.onMinecartPass(). */ - public boolean shouldDoRailFunctions() + public boolean shouldDoRailFunctions () { return true; } @@ -1202,16 +1209,16 @@ public class CartEntity extends Entity * Simply returns the minecartType variable. * @return minecartType */ - public int getCartType() + public int getCartType () { - return pullcartType; + return pullcartType; } /** * Carts should return their drag factor here * @return The drag rate. */ - protected double getDrag() + protected double getDrag () { return riddenByEntity != null ? defaultDragRidden : defaultDragEmpty; } @@ -1220,12 +1227,12 @@ public class CartEntity extends Entity * Moved to allow overrides. * This code applies drag and updates push forces. */ - protected void applyDragAndPushForces() + protected void applyDragAndPushForces () { - if(isPoweredCart()) + if (isPoweredCart()) { double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); - if(d27 > 0.01D) + if (d27 > 0.01D) { pushX /= d27; pushZ /= d27; @@ -1252,16 +1259,16 @@ public class CartEntity extends Entity * Moved to allow overrides. * This code updates push forces. */ - protected void updatePushForces() + protected void updatePushForces () { - if(isPoweredCart()) + if (isPoweredCart()) { double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ); - if(push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) + if (push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D) { pushX /= push; pushZ /= push; - if(pushX * motionX + pushZ * motionZ < 0.0D) + if (pushX * motionX + pushZ * motionZ < 0.0D) { pushX = 0.0D; pushZ = 0.0D; @@ -1279,35 +1286,39 @@ public class CartEntity extends Entity * Moved to allow overrides. * This code handles minecart movement and speed capping when not on a rail. */ - protected void moveMinecartOffRail(int i, int j, int k) + protected void moveMinecartOffRail (int i, int j, int k) { double d2 = getMaxSpeedGround(); - if(!onGround) + if (!onGround) { d2 = getMaxSpeedAirLateral(); } - if(motionX < -d2) motionX = -d2; - if(motionX > d2) motionX = d2; - if(motionZ < -d2) motionZ = -d2; - if(motionZ > d2) motionZ = d2; + if (motionX < -d2) + motionX = -d2; + if (motionX > d2) + motionX = d2; + if (motionZ < -d2) + motionZ = -d2; + if (motionZ > d2) + motionZ = d2; double moveY = motionY; - if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) + if (getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical()) { moveY = getMaxSpeedAirVertical(); - if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) + if (Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f) { moveY = 0.15f; motionY = moveY; } } - if(onGround) + if (onGround) { motionX *= 0.5D; motionY *= 0.5D; motionZ *= 0.5D; } moveEntity(motionX, moveY, motionZ); - if(!onGround) + if (!onGround) { motionX *= getDragAir(); motionY *= getDragAir(); @@ -1319,10 +1330,12 @@ public class CartEntity extends Entity * Moved to allow overrides. * This code applies fuel consumption. */ - protected void updateFuel() + protected void updateFuel () { - if (fuel > 0) fuel--; - if (fuel <= 0) pushX = pushZ = 0.0D; + if (fuel > 0) + fuel--; + if (fuel <= 0) + pushX = pushZ = 0.0D; setMinecartPowered(fuel > 0); } @@ -1330,7 +1343,7 @@ public class CartEntity extends Entity * Moved to allow overrides, This code handle slopes affecting velocity. * @param metadata The blocks position metadata */ - protected void adjustSlopeVelocities(int metadata) + protected void adjustSlopeVelocities (int metadata) { double acceleration = 0.0078125D; if (metadata == 2) @@ -1363,81 +1376,81 @@ public class CartEntity extends Entity * the carts current max speed. A normal rails max speed is 0.4. * @return Carts max speed. */ - public float getMaxSpeedRail() + public float getMaxSpeedRail () { return maxSpeedRail; } - public void setMaxSpeedRail(float value) + public void setMaxSpeedRail (float value) { maxSpeedRail = value; } - public float getMaxSpeedGround() + public float getMaxSpeedGround () { return maxSpeedGround; } - public void setMaxSpeedGround(float value) + public void setMaxSpeedGround (float value) { maxSpeedGround = value; } - public float getMaxSpeedAirLateral() + public float getMaxSpeedAirLateral () { return maxSpeedAirLateral; } - public void setMaxSpeedAirLateral(float value) + public void setMaxSpeedAirLateral (float value) { maxSpeedAirLateral = value; } - public float getMaxSpeedAirVertical() + public float getMaxSpeedAirVertical () { return maxSpeedAirVertical; } - public void setMaxSpeedAirVertical(float value) + public void setMaxSpeedAirVertical (float value) { maxSpeedAirVertical = value; } - public double getDragAir() + public double getDragAir () { return dragAir; } - public void setDragAir(double value) + public void setDragAir (double value) { dragAir = value; } - @Override - public void writeSpawnData (ByteArrayDataOutput data) - { - data.writeInt(pullcartType); - - } + @Override + public void writeSpawnData (ByteArrayDataOutput data) + { + data.writeInt(pullcartType); - @Override - public void readSpawnData (ByteArrayDataInput data) - { - pullcartType = data.readInt(); - - } + } - @Override - public boolean isInvNameLocalized () - { - // TODO Auto-generated method stub - return false; - } + @Override + public void readSpawnData (ByteArrayDataInput data) + { + pullcartType = data.readInt(); - @Override - public boolean isStackValidForSlot (int i, ItemStack itemstack) - { - // TODO Auto-generated method stub - return false; - } + } + + @Override + public boolean isInvNameLocalized () + { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isStackValidForSlot (int i, ItemStack itemstack) + { + // TODO Auto-generated method stub + return false; + } } diff --git a/mods/tinker/tconstruct/entity/Crystal.java b/mods/tinker/tconstruct/entity/Crystal.java index 0f3f3b8b..9b5ab8cc 100644 --- a/mods/tinker/tconstruct/entity/Crystal.java +++ b/mods/tinker/tconstruct/entity/Crystal.java @@ -7,10 +7,10 @@ import net.minecraft.world.World; public class Crystal extends EntityCreeper { - public Crystal(World par1World) - { - super(par1World); - texture = "/mods/tinker/textures/mob/crystalwater.png"; - } - + public Crystal(World par1World) + { + super(par1World); + texture = "/mods/tinker/textures/mob/crystalwater.png"; + } + } diff --git a/mods/tinker/tconstruct/entity/CrystalGuardian.java b/mods/tinker/tconstruct/entity/CrystalGuardian.java index e2625e8c..d0ba40b1 100644 --- a/mods/tinker/tconstruct/entity/CrystalGuardian.java +++ b/mods/tinker/tconstruct/entity/CrystalGuardian.java @@ -6,16 +6,16 @@ import net.minecraft.world.World; public class CrystalGuardian extends EntityLiving { - public CrystalGuardian(World par1World) - { - super(par1World); - this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; - } + public CrystalGuardian(World par1World) + { + super(par1World); + this.texture = "/mods/tinker/textures/mob/crystalguardamber.png"; + } - @Override - public int getMaxHealth () - { - return 100; - } + @Override + public int getMaxHealth () + { + return 100; + } } diff --git a/mods/tinker/tconstruct/entity/FakeBlockEntity.java b/mods/tinker/tconstruct/entity/FakeBlockEntity.java index 11e0dba5..113e4b4b 100644 --- a/mods/tinker/tconstruct/entity/FakeBlockEntity.java +++ b/mods/tinker/tconstruct/entity/FakeBlockEntity.java @@ -9,44 +9,43 @@ import com.google.common.io.ByteArrayDataOutput; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -public class FakeBlockEntity extends Entity - implements IEntityAdditionalSpawnData +public class FakeBlockEntity extends Entity implements IEntityAdditionalSpawnData { - public FakeBlockEntity(World world) - { - super(world); - preventEntitySpawning = true; - } - - @Override - protected void entityInit () - { - - } + public FakeBlockEntity(World world) + { + super(world); + preventEntitySpawning = true; + } - @Override - public void writeSpawnData (ByteArrayDataOutput data) - { - - } + @Override + protected void entityInit () + { - @Override - public void readSpawnData (ByteArrayDataInput data) - { - - } + } - @Override - protected void readEntityFromNBT (NBTTagCompound var1) - { - - } + @Override + public void writeSpawnData (ByteArrayDataOutput data) + { - @Override - protected void writeEntityToNBT (NBTTagCompound var1) - { - - } + } + + @Override + public void readSpawnData (ByteArrayDataInput data) + { + + } + + @Override + protected void readEntityFromNBT (NBTTagCompound var1) + { + + } + + @Override + protected void writeEntityToNBT (NBTTagCompound var1) + { + + } } diff --git a/mods/tinker/tconstruct/entity/GolemBase.java b/mods/tinker/tconstruct/entity/GolemBase.java index eccd4998..51867a46 100644 --- a/mods/tinker/tconstruct/entity/GolemBase.java +++ b/mods/tinker/tconstruct/entity/GolemBase.java @@ -283,12 +283,12 @@ public class GolemBase extends EntityCreature implements IInventory } } - public void teleport(double x, double y, double z) + public void teleport (double x, double y, double z) { this.setPosition(x, y, z); worldObj.playSoundAtEntity(this, "mob.endermen.portal", 0.5F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); } - + /* Other */ protected boolean canDespawn () { @@ -412,7 +412,7 @@ public class GolemBase extends EntityCreature implements IInventory { return true; } - + public void destroyCurrentEquippedItem () { worldObj.playSoundAtEntity(this, "random.break", 0.5F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); diff --git a/mods/tinker/tconstruct/entity/MetalSlime.java b/mods/tinker/tconstruct/entity/MetalSlime.java index b440a942..ec3199d9 100644 --- a/mods/tinker/tconstruct/entity/MetalSlime.java +++ b/mods/tinker/tconstruct/entity/MetalSlime.java @@ -10,102 +10,102 @@ import net.minecraft.world.World; public class MetalSlime extends BlueSlime { - public MetalSlime(World world) - { - super(world); - this.texture = "/mods/tinker/textures/mob/slimemetal.png"; - } + public MetalSlime(World world) + { + super(world); + this.texture = "/mods/tinker/textures/mob/slimemetal.png"; + } - public boolean attackEntityFrom (DamageSource damageSource, int damage) - { - if (!damageSource.isExplosion() && damageSource.isProjectile()) - return false; - return super.attackEntityFrom(damageSource, damage); - } + public boolean attackEntityFrom (DamageSource damageSource, int damage) + { + if (!damageSource.isExplosion() && damageSource.isProjectile()) + return false; + return super.attackEntityFrom(damageSource, damage); + } - public int getMaxHealth () - { - int i = this.getSlimeSize(); - if (i == 1) - return 4; - return (int) Math.min(i * i + 20, 100); - } + public int getMaxHealth () + { + int i = this.getSlimeSize(); + if (i == 1) + return 4; + return (int) Math.min(i * i + 20, 100); + } - public int getTotalArmorValue () - { - return super.getTotalArmorValue() + 12; - } + public int getTotalArmorValue () + { + return super.getTotalArmorValue() + 12; + } - public void setDead () - { - this.isDead = true; - } + public void setDead () + { + this.isDead = true; + } - /*protected void dropFewItems (boolean par1, int par2) - { - int j = this.getDropItemId(); + /*protected void dropFewItems (boolean par1, int par2) + { + int j = this.getDropItemId(); - if (j > 0) - { - int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); + if (j > 0) + { + int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); - if (par2 > 0) - { - k += this.rand.nextInt(par2 + 1); - } + if (par2 > 0) + { + k += this.rand.nextInt(par2 + 1); + } - for (int l = 0; l < k; ++l) - { - this.dropItem(j, 1); - } - } - }*/ - - protected void updateEntityActionState () - { - this.despawnEntity(); - EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + for (int l = 0; l < k; ++l) + { + this.dropItem(j, 1); + } + } + }*/ - if (entityplayer != null) - { - this.faceEntity(entityplayer, 10.0F, 20.0F); - } - else if (this.onGround && this.slimeJumpDelay == 1) - { - this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90; - if (rotationYaw > 360) - rotationYaw -= 360; - if (rotationYaw < 0) - rotationYaw += 360; - } + protected void updateEntityActionState () + { + this.despawnEntity(); + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - if (this.onGround && this.slimeJumpDelay-- <= 0) - { - this.slimeJumpDelay = this.getJumpDelay(); + if (entityplayer != null) + { + this.faceEntity(entityplayer, 10.0F, 20.0F); + } + else if (this.onGround && this.slimeJumpDelay == 1) + { + this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90; + if (rotationYaw > 360) + rotationYaw -= 360; + if (rotationYaw < 0) + rotationYaw += 360; + } - if (entityplayer != null) - { - this.slimeJumpDelay /= 3; - } + if (this.onGround && this.slimeJumpDelay-- <= 0) + { + this.slimeJumpDelay = this.getJumpDelay(); - this.isJumping = true; + if (entityplayer != null) + { + this.slimeJumpDelay /= 3; + } - if (this.makesSoundOnJump()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); - } + this.isJumping = true; - this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; - this.moveForward = (float) (1 * this.getSlimeSize()); - } - else - { - this.isJumping = false; + if (this.makesSoundOnJump()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } - if (this.onGround) - { - this.moveStrafing = this.moveForward = 0.0F; - } - } - } + this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float) (1 * this.getSlimeSize()); + } + else + { + this.isJumping = false; + + if (this.onGround) + { + this.moveStrafing = this.moveForward = 0.0F; + } + } + } } diff --git a/mods/tinker/tconstruct/entity/MiniGardy.java b/mods/tinker/tconstruct/entity/MiniGardy.java index 1e0f194f..17dc626c 100644 --- a/mods/tinker/tconstruct/entity/MiniGardy.java +++ b/mods/tinker/tconstruct/entity/MiniGardy.java @@ -18,6 +18,12 @@ public class MiniGardy extends GolemBase this.tasks.addTask(1, new GAIFellTree(this)); } + @Override + public void setupInventory () + { + inventory = new ItemStack[14]; + } + @SideOnly(Side.CLIENT) public float getShadowSize () //Opacity, not size { @@ -38,7 +44,7 @@ public class MiniGardy extends GolemBase { //this.worldObj.playSoundAtEntity(this, par1Str, par2, par3); this.worldObj.playSoundAtEntity(player, "random.pop", 0.3F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); - this.setCurrentItemOrArmor(0, null); + this.setCurrentItemOrArmor(0, null); } } return true; diff --git a/mods/tinker/tconstruct/entity/Skyla.java b/mods/tinker/tconstruct/entity/Skyla.java index 7a12c1ff..8556b070 100644 --- a/mods/tinker/tconstruct/entity/Skyla.java +++ b/mods/tinker/tconstruct/entity/Skyla.java @@ -7,26 +7,26 @@ import net.minecraft.world.World; public class Skyla extends EntityCreeper { - public Skyla(World par1World) - { - super(par1World); - //username = "Skyla"; - texture = "/mods/tinker/textures/mob/skyla.png"; - } + public Skyla(World par1World) + { + super(par1World); + //username = "Skyla"; + texture = "/mods/tinker/textures/mob/skyla.png"; + } - /*@Override - public void sendChatToPlayer (String var1) {} + /*@Override + public void sendChatToPlayer (String var1) {} - @Override - public boolean canCommandSenderUseCommand (int var1, String var2) - { - return false; - } + @Override + public boolean canCommandSenderUseCommand (int var1, String var2) + { + return false; + } + + @Override + public ChunkCoordinates getPlayerCoordinates () + { + return null; + }*/ - @Override - public ChunkCoordinates getPlayerCoordinates () - { - return null; - }*/ - } diff --git a/mods/tinker/tconstruct/entity/SlimeClone.java b/mods/tinker/tconstruct/entity/SlimeClone.java index b75cce94..01d59406 100644 --- a/mods/tinker/tconstruct/entity/SlimeClone.java +++ b/mods/tinker/tconstruct/entity/SlimeClone.java @@ -14,26 +14,26 @@ import com.google.common.io.ByteArrayDataOutput; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -public class SlimeClone extends GolemBase - implements IEntityAdditionalSpawnData +public class SlimeClone extends GolemBase implements IEntityAdditionalSpawnData { - public float sizeOffset; - public float sizeFactor; - public float sizeHeight; - public String username = ""; - public SlimeClone(World world) - { - super(world); - //this.texture = "/mob/char.png"; - } - - public SlimeClone(World world, String username) - { - this(world); - this.username = username; - } - - @Override + public float sizeOffset; + public float sizeFactor; + public float sizeHeight; + public String username = ""; + + public SlimeClone(World world) + { + super(world); + //this.texture = "/mob/char.png"; + } + + public SlimeClone(World world, String username) + { + this(world); + this.username = username; + } + + @Override public void initCreature () { maxHealth = 100; @@ -41,116 +41,115 @@ public class SlimeClone extends GolemBase baseAttack = 3; paused = false; } - - public void onUpdate () - { - if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) - { - this.isDead = true; - } - this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; - this.sizeHeight = this.sizeFactor; - boolean flag = this.onGround; - super.onUpdate(); - float i; + public void onUpdate () + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) + { + this.isDead = true; + } - if (this.onGround && !flag) - { - i = this.getSlimeSize(); + this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; + this.sizeHeight = this.sizeFactor; + boolean flag = this.onGround; + super.onUpdate(); + float i; - for (int j = 0; j < i * 8; ++j) - { - float f = this.rand.nextFloat() * (float) Math.PI * 2.0F; - float offset = this.rand.nextFloat() * 0.5F + 0.5F; - float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset; - float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset; - TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); - } + if (this.onGround && !flag) + { + i = this.getSlimeSize(); - if (this.makesSoundOnLand()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); - } + for (int j = 0; j < i * 8; ++j) + { + float f = this.rand.nextFloat() * (float) Math.PI * 2.0F; + float offset = this.rand.nextFloat() * 0.5F + 0.5F; + float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset; + float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset; + TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); + } - this.sizeOffset = -0.5F; - } - else if (!this.onGround && flag) - { - this.sizeOffset = 1.0F; - } + if (this.makesSoundOnLand()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } - this.func_70808_l(); + this.sizeOffset = -0.5F; + } + else if (!this.onGround && flag) + { + this.sizeOffset = 1.0F; + } - if (this.worldObj.isRemote) - { - i = this.getSlimeSize(); - this.setSize(0.6F * (float) i, 0.6F * (float) i); - } - } - - protected void func_70808_l () - { - this.sizeOffset *= 0.6F; - } - - protected String getJumpSound () - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } + this.func_70808_l(); - - protected void jump () - { - this.motionY = 0.05 * getSlimeSize() + 0.37; + if (this.worldObj.isRemote) + { + i = this.getSlimeSize(); + this.setSize(0.6F * (float) i, 0.6F * (float) i); + } + } - if (this.isPotionActive(Potion.jump)) - { - this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); - } + protected void func_70808_l () + { + this.sizeOffset *= 0.6F; + } - if (this.isSprinting()) - { - float f = this.rotationYaw * 0.017453292F; - this.motionX -= (double) (MathHelper.sin(f) * 0.2F); - this.motionZ += (double) (MathHelper.cos(f) * 0.2F); - } + protected String getJumpSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } - this.isAirBorne = true; - ForgeHooks.onLivingJump(this); - } - - protected void fall (float par1) - { - } + protected void jump () + { + this.motionY = 0.05 * getSlimeSize() + 0.37; - protected String getSlimeParticle () - { - return "blueslime"; - } - - public float getSlimeSize () - { - return 1.5f; - } + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } - /** - * Returns true if the slime makes a sound when it jumps (based upon the slime's size) - */ - protected boolean makesSoundOnJump () - { - return this.getSlimeSize() > 0; - } + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double) (MathHelper.sin(f) * 0.2F); + this.motionZ += (double) (MathHelper.cos(f) * 0.2F); + } - /** - * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) - */ - protected boolean makesSoundOnLand () - { - return this.getSlimeSize() > 2; - } - - public void writeEntityToNBT (NBTTagCompound tags) + this.isAirBorne = true; + ForgeHooks.onLivingJump(this); + } + + protected void fall (float par1) + { + } + + protected String getSlimeParticle () + { + return "blueslime"; + } + + public float getSlimeSize () + { + return 1.5f; + } + + /** + * Returns true if the slime makes a sound when it jumps (based upon the slime's size) + */ + protected boolean makesSoundOnJump () + { + return this.getSlimeSize() > 0; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + protected boolean makesSoundOnLand () + { + return this.getSlimeSize() > 2; + } + + public void writeEntityToNBT (NBTTagCompound tags) { super.writeEntityToNBT(tags); tags.setString("Username", username); @@ -161,8 +160,8 @@ public class SlimeClone extends GolemBase super.readEntityFromNBT(tags); username = tags.getString("Username"); } - - @Override + + @Override public void writeSpawnData (ByteArrayDataOutput data) { data.writeUTF(username); @@ -171,7 +170,7 @@ public class SlimeClone extends GolemBase @Override public void readSpawnData (ByteArrayDataInput data) { - username = data.readUTF(); - skinUrl = "http://skins.minecraft.net/MinecraftSkins/"+username+".png"; + username = data.readUTF(); + skinUrl = "http://skins.minecraft.net/MinecraftSkins/" + username + ".png"; } } diff --git a/mods/tinker/tconstruct/entity/ai/GAIAttackTarget.java b/mods/tinker/tconstruct/entity/ai/GAIAttackTarget.java index 4a10f814..f38afbc2 100644 --- a/mods/tinker/tconstruct/entity/ai/GAIAttackTarget.java +++ b/mods/tinker/tconstruct/entity/ai/GAIAttackTarget.java @@ -12,6 +12,7 @@ public class GAIAttackTarget extends GolemAIBase private float speed; private int counter; private boolean avoidsWater = true; + //public static String targetEntityRegex; public GAIAttackTarget(GolemBase doll) @@ -71,14 +72,14 @@ public class GAIAttackTarget extends GolemAIBase @Override public boolean continueExecuting () { - /* if (!golem.isEnable()) - { - return false; - } - if (golem.isStandbyMode() || golem.isRideonMode()) - { - return false; - }*/ + /* if (!golem.isEnable()) + { + return false; + } + if (golem.isStandbyMode() || golem.isRideonMode()) + { + return false; + }*/ if (this.pathfinder.noPath()) { return false; diff --git a/mods/tinker/tconstruct/entity/ai/GolemAIBase.java b/mods/tinker/tconstruct/entity/ai/GolemAIBase.java index 2913d729..6ab39db0 100644 --- a/mods/tinker/tconstruct/entity/ai/GolemAIBase.java +++ b/mods/tinker/tconstruct/entity/ai/GolemAIBase.java @@ -14,9 +14,9 @@ public class GolemAIBase extends EntityAIBase golem = entity; world = entity.worldObj; } - + @Override - public boolean shouldExecute() + public boolean shouldExecute () { return false; } diff --git a/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java b/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java index caa6bac0..b5fdaee7 100644 --- a/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java +++ b/mods/tinker/tconstruct/entity/projectile/ArrowEntity.java @@ -33,6 +33,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa public ItemStack returnStack; public float mass; public int baseDamage; + private float knockbackStrengthMod; public ArrowEntity(World par1World) { @@ -200,8 +201,8 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (!worldObj.isRemote) { - System.out.println("Speed: "+damageSpeed); - System.out.println("Damage: "+damageInflicted); + System.out.println("Speed: " + damageSpeed); + System.out.println("Damage: " + damageInflicted); } DamageSource damagesource = null; @@ -230,14 +231,15 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa entityliving.setArrowCountInEntity(entityliving.getArrowCountInEntity() + 1); } - if (this.knockbackStrength > 0) + if (this.knockbackStrength > 0 || this.knockbackStrengthMod > 0) { f3 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); if (f3 > 0.0F) { + float knockback = knockbackStrength + knockbackStrengthMod; movingobjectposition.entityHit.addVelocity(this.motionX * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3, 0.1D, this.motionZ - * (double) this.knockbackStrength * 0.6000000238418579D / (double) f3); + * (double) knockback * 0.6000000238418579D / (double) f3); } } @@ -390,7 +392,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (slotID >= 0) { living.setCurrentItemOrArmor(slotID, par1ItemStack); - living.func_96120_a(slotID, 1.0f); + living.func_96120_a(slotID, 2.0f); par1ItemStack.stackSize = 0; return true; } @@ -458,7 +460,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (living.getCurrentItemOrArmor(slotID) == null) { living.setCurrentItemOrArmor(slotID, par1ItemStack); - living.func_96120_a(slotID, 1.0f); + living.func_96120_a(slotID, 2.0f); } return 0; @@ -483,7 +485,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa if (stack == null) { living.setCurrentItemOrArmor(slotID, par1ItemStack); - living.func_96120_a(slotID, 1.0f); + living.func_96120_a(slotID, 2.0f); return par1ItemStack.stackSize; /*this.mainInventory[slotID] = new ItemStack(i, 0, par1ItemStack.getItemDamage()); @@ -516,7 +518,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa j -= l; stack.stackSize++; living.setCurrentItemOrArmor(slotID, stack); - living.func_96120_a(slotID, 1.0f); + living.func_96120_a(slotID, 2.0f); //this.mainInventory[slotID].stackSize += l; //this.mainInventory[slotID].animationsToGo = 5; return j; @@ -541,6 +543,11 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa return -1; } + public void setKnockbackModStrength (float par1) + { + this.knockbackStrengthMod = par1; + } + public void writeEntityToNBT (NBTTagCompound tags) { super.writeEntityToNBT(tags); diff --git a/mods/tinker/tconstruct/entity/projectile/DaggerEntity.java b/mods/tinker/tconstruct/entity/projectile/DaggerEntity.java index 053bbce9..090d030c 100644 --- a/mods/tinker/tconstruct/entity/projectile/DaggerEntity.java +++ b/mods/tinker/tconstruct/entity/projectile/DaggerEntity.java @@ -75,7 +75,7 @@ public class DaggerEntity extends RotatingBase worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (rand.nextFloat() * 0.2F + 0.9F)); arrowShake = 7; if (!worldObj.isRemote) - AbilityHelper.damageTool(returnStack, 1, owner, false); + AbilityHelper.damageTool(returnStack, 1, owner, false); } } diff --git a/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java b/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java index 4f297b53..0936e75c 100644 --- a/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java +++ b/mods/tinker/tconstruct/entity/projectile/LaunchedPotion.java @@ -54,22 +54,22 @@ public class LaunchedPotion extends EntityThrowable /** * Gets the amount of gravity to apply to the thrown entity with each tick. */ - protected float getGravityVelocity() + protected float getGravityVelocity () { return 0.05F; } - protected float func_70182_d() + protected float func_70182_d () { return 1.0F; } - protected float func_70183_g() + protected float func_70183_g () { return -10.0F; } - public void setPotionDamage(int par1) + public void setPotionDamage (int par1) { if (this.potionDamage == null) { @@ -82,7 +82,7 @@ public class LaunchedPotion extends EntityThrowable /** * Returns the damage value of the thrown potion that this EntityPotion represents. */ - public int getPotionDamage() + public int getPotionDamage () { if (this.potionDamage == null) { @@ -95,7 +95,7 @@ public class LaunchedPotion extends EntityThrowable /** * Called when this EntityThrowable hits a block or entity. */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) + protected void onImpact (MovingObjectPosition par1MovingObjectPosition) { if (!this.worldObj.isRemote) { @@ -112,7 +112,7 @@ public class LaunchedPotion extends EntityThrowable while (iterator.hasNext()) { - EntityLiving entityliving = (EntityLiving)iterator.next(); + EntityLiving entityliving = (EntityLiving) iterator.next(); double d0 = this.getDistanceSqToEntity(entityliving); if (d0 < 16.0D) @@ -128,7 +128,7 @@ public class LaunchedPotion extends EntityThrowable while (iterator1.hasNext()) { - PotionEffect potioneffect = (PotionEffect)iterator1.next(); + PotionEffect potioneffect = (PotionEffect) iterator1.next(); int i = potioneffect.getPotionID(); if (Potion.potionTypes[i].isInstant()) @@ -137,7 +137,7 @@ public class LaunchedPotion extends EntityThrowable } else { - int j = (int)(d1 * (double)potioneffect.getDuration() + 0.5D); + int j = (int) (d1 * (double) potioneffect.getDuration() + 0.5D); if (j > 20) { @@ -150,7 +150,7 @@ public class LaunchedPotion extends EntityThrowable } } - this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage()); + this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), this.getPotionDamage()); this.setDead(); } } @@ -158,7 +158,7 @@ public class LaunchedPotion extends EntityThrowable /** * (abstract) Protected helper method to read subclass entity data from NBT. */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); @@ -180,7 +180,7 @@ public class LaunchedPotion extends EntityThrowable /** * (abstract) Protected helper method to write subclass entity data to NBT. */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound) { super.writeEntityToNBT(par1NBTTagCompound); diff --git a/mods/tinker/tconstruct/entity/projectile/RotatingBase.java b/mods/tinker/tconstruct/entity/projectile/RotatingBase.java index 2f40d1f3..ad0227d2 100644 --- a/mods/tinker/tconstruct/entity/projectile/RotatingBase.java +++ b/mods/tinker/tconstruct/entity/projectile/RotatingBase.java @@ -18,8 +18,7 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -public class RotatingBase extends Entity - implements IEntityAdditionalSpawnData +public class RotatingBase extends Entity implements IEntityAdditionalSpawnData { public RotatingBase(World world) @@ -64,7 +63,7 @@ public class RotatingBase extends Entity motionY = -MathHelper.sin((rotationPitch / 180F) * 3.141593F - 0.2f); setArrowHeading(motionX, motionY, motionZ, f, f1); } - + /*public void setOnGround(boolean flag) { onGround = flag; @@ -77,7 +76,7 @@ public class RotatingBase extends Entity }*/ @Override - protected void entityInit() + protected void entityInit () { } @@ -302,7 +301,7 @@ public class RotatingBase extends Entity } } } - + /*public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { super.readEntityFromNBT(par1NBTTagCompound); @@ -384,10 +383,8 @@ public class RotatingBase extends Entity { return 0.0F; } - - - public ItemStack getEntityItem() + public ItemStack getEntityItem () { return returnStack; } @@ -413,7 +410,7 @@ public class RotatingBase extends Entity public EntityPlayer owner; protected int ticksInGround; protected int ticksInAir; - + @Override public void writeSpawnData (ByteArrayDataOutput data) { @@ -423,7 +420,7 @@ public class RotatingBase extends Entity data.writeInt(tags.getInteger("RenderHandle")); data.writeInt(tags.getInteger("RenderHead")); data.writeInt(tags.getInteger("RenderAccessory")); - + int effects = 0; if (tags.hasKey("Effect1")) effects++; @@ -438,21 +435,27 @@ public class RotatingBase extends Entity if (tags.hasKey("Effect6")) effects++; data.writeInt(effects); - + switch (effects) { - case 6: data.writeInt(tags.getInteger("Effect6")); - case 5: data.writeInt(tags.getInteger("Effect5")); - case 4: data.writeInt(tags.getInteger("Effect4")); - case 3: data.writeInt(tags.getInteger("Effect3")); - case 2: data.writeInt(tags.getInteger("Effect2")); - case 1: data.writeInt(tags.getInteger("Effect1")); + case 6: + data.writeInt(tags.getInteger("Effect6")); + case 5: + data.writeInt(tags.getInteger("Effect5")); + case 4: + data.writeInt(tags.getInteger("Effect4")); + case 3: + data.writeInt(tags.getInteger("Effect3")); + case 2: + data.writeInt(tags.getInteger("Effect2")); + case 1: + data.writeInt(tags.getInteger("Effect1")); } } @Override public void readSpawnData (ByteArrayDataInput data) - { + { returnStack = new ItemStack(data.readShort(), 1, 0); rotationYaw = data.readFloat(); NBTTagCompound compound = new NBTTagCompound(); @@ -462,12 +465,18 @@ public class RotatingBase extends Entity toolTag.setInteger("RenderAccessory", data.readInt()); switch (data.readInt()) { - case 6: toolTag.setInteger("Effect6", data.readInt()); - case 5: toolTag.setInteger("Effect5", data.readInt()); - case 4: toolTag.setInteger("Effect4", data.readInt()); - case 3: toolTag.setInteger("Effect3", data.readInt()); - case 2: toolTag.setInteger("Effect2", data.readInt()); - case 1: toolTag.setInteger("Effect1", data.readInt()); + case 6: + toolTag.setInteger("Effect6", data.readInt()); + case 5: + toolTag.setInteger("Effect5", data.readInt()); + case 4: + toolTag.setInteger("Effect4", data.readInt()); + case 3: + toolTag.setInteger("Effect3", data.readInt()); + case 2: + toolTag.setInteger("Effect2", data.readInt()); + case 1: + toolTag.setInteger("Effect1", data.readInt()); } compound.setCompoundTag("InfiTool", toolTag); returnStack.setTagCompound(compound); diff --git a/mods/tinker/tconstruct/inventory/ActiveSlot.java b/mods/tinker/tconstruct/inventory/ActiveSlot.java index 26fbf639..c6e5876f 100644 --- a/mods/tinker/tconstruct/inventory/ActiveSlot.java +++ b/mods/tinker/tconstruct/inventory/ActiveSlot.java @@ -13,13 +13,13 @@ public class ActiveSlot extends Slot super(iinventory, par2, par3, par4); active = flag; } - - public void setActive(boolean flag) + + public void setActive (boolean flag) { active = flag; } - public boolean getActive() + public boolean getActive () { return active; } diff --git a/mods/tinker/tconstruct/inventory/AggregatorContainer.java b/mods/tinker/tconstruct/inventory/AggregatorContainer.java index 8e8df416..32b6f393 100644 --- a/mods/tinker/tconstruct/inventory/AggregatorContainer.java +++ b/mods/tinker/tconstruct/inventory/AggregatorContainer.java @@ -21,7 +21,7 @@ public class AggregatorContainer extends Container this.addSlotToContainer(new Slot(logic, 0, 45, 36)); this.addSlotToContainer(new Slot(logic, 1, 80, 36)); this.addSlotToContainer(new Slot(logic, 2, 123, 36)); - + /* Player inventory */ for (int column = 0; column < 3; column++) { @@ -37,18 +37,17 @@ public class AggregatorContainer extends Container } } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return logic.isUseableByPlayer(entityplayer); } - + @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -69,7 +68,7 @@ public class AggregatorContainer extends Container if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { diff --git a/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java b/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java index 36545074..31ad1691 100644 --- a/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java +++ b/mods/tinker/tconstruct/inventory/ArmorExtendedContainer.java @@ -11,12 +11,12 @@ public class ArmorExtendedContainer extends ActiveContainer { public InventoryPlayer invPlayer; public ArmorExtended armor; - + public ArmorExtendedContainer(InventoryPlayer inventoryplayer, ArmorExtended armor) { invPlayer = inventoryplayer; this.armor = armor; - + this.addSlotToContainer(new Slot(armor, 0, 80, 17)); this.addSlotToContainer(new Slot(armor, 1, 80, 35)); this.addSlotToContainer(new Slot(armor, 2, 116, 17)); @@ -24,13 +24,13 @@ public class ArmorExtendedContainer extends ActiveContainer this.addSlotToContainer(new Slot(armor, 4, 152, 17)); this.addSlotToContainer(new Slot(armor, 5, 152, 35)); this.addSlotToContainer(new Slot(armor, 6, 152, 53)); - + /* Player inventory */ for (int playerArmor = 0; playerArmor < 4; ++playerArmor) { this.addSlotToContainer(new SlotArmorCopy(this, inventoryplayer, inventoryplayer.getSizeInventory() - 1 - playerArmor, 98, 8 + playerArmor * 18, playerArmor)); } - + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) @@ -43,17 +43,17 @@ public class ArmorExtendedContainer extends ActiveContainer { this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } - + } - + @Override - public boolean canInteractWith(EntityPlayer var1) + public boolean canInteractWith (EntityPlayer var1) { return true; } - + @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { return null; } diff --git a/mods/tinker/tconstruct/inventory/DrawbridgeContainer.java b/mods/tinker/tconstruct/inventory/DrawbridgeContainer.java index 864bc2a1..cbfb7c39 100644 --- a/mods/tinker/tconstruct/inventory/DrawbridgeContainer.java +++ b/mods/tinker/tconstruct/inventory/DrawbridgeContainer.java @@ -20,7 +20,7 @@ public class DrawbridgeContainer extends Container this.addSlotToContainer(new Slot(logic, 0, 80, 36)); this.addSlotToContainer(new Slot(logic, 1, 35, 36)); - + /* Player inventory */ for (int column = 0; column < 3; column++) { @@ -36,18 +36,17 @@ public class DrawbridgeContainer extends Container } } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return logic.isUseableByPlayer(entityplayer); } - + @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -68,7 +67,7 @@ public class DrawbridgeContainer extends Container if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { diff --git a/mods/tinker/tconstruct/inventory/FrypanContainer.java b/mods/tinker/tconstruct/inventory/FrypanContainer.java index 38591b99..a4a64fc5 100644 --- a/mods/tinker/tconstruct/inventory/FrypanContainer.java +++ b/mods/tinker/tconstruct/inventory/FrypanContainer.java @@ -19,32 +19,32 @@ public class FrypanContainer extends Container { logic = frypan; this.addSlotToContainer(new Slot(frypan, 1, 26, 45)); - for (int y = 0; y < 2; y++) - for (int x = 0; x < 4; x++) - this.addSlotToContainer(new Slot(frypan, 2 + x + y*4, 70 + x*18, 27 + y*18)); - + for (int y = 0; y < 2; y++) + for (int x = 0; x < 4; x++) + this.addSlotToContainer(new Slot(frypan, 2 + x + y * 4, 70 + x * 18, 27 + y * 18)); + /* Player inventory */ - for (int column = 0; column < 3; column++) + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); + this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } } @Override - public void detectAndSendChanges() + public void detectAndSendChanges () { super.detectAndSendChanges(); for (int i = 0; i < crafters.size(); i++) { - ICrafting icrafting = (ICrafting)crafters.get(i); + ICrafting icrafting = (ICrafting) crafters.get(i); if (progress != logic.progress) { icrafting.sendProgressBarUpdate(this, 0, logic.progress); @@ -64,7 +64,7 @@ public class FrypanContainer extends Container fuelGague = logic.fuelGague; } - public void updateProgressBar(int i, int j) + public void updateProgressBar (int i, int j) { if (i == 0) { @@ -81,15 +81,15 @@ public class FrypanContainer extends Container } @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return logic.isUseableByPlayer(entityplayer); } - - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -110,7 +110,7 @@ public class FrypanContainer extends Container if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { diff --git a/mods/tinker/tconstruct/inventory/KnapsackContainer.java b/mods/tinker/tconstruct/inventory/KnapsackContainer.java index 6f9c0981..6b0aa248 100644 --- a/mods/tinker/tconstruct/inventory/KnapsackContainer.java +++ b/mods/tinker/tconstruct/inventory/KnapsackContainer.java @@ -25,7 +25,7 @@ public class KnapsackContainer extends Container this.addSlotToContainer(new Slot(knapsack, row + column * 9, 8 + row * 18, 17 + column * 18)); } } - + /* Player inventory */ for (int column = 0; column < 3; column++) { @@ -41,18 +41,17 @@ public class KnapsackContainer extends Container } } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return backpack.isUseableByPlayer(entityplayer); } - + @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -73,7 +72,7 @@ public class KnapsackContainer extends Container if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { diff --git a/mods/tinker/tconstruct/inventory/PartCrafterChestContainer.java b/mods/tinker/tconstruct/inventory/PartCrafterChestContainer.java index e2e902fb..299004ca 100644 --- a/mods/tinker/tconstruct/inventory/PartCrafterChestContainer.java +++ b/mods/tinker/tconstruct/inventory/PartCrafterChestContainer.java @@ -10,60 +10,60 @@ import net.minecraft.item.ItemStack; public class PartCrafterChestContainer extends ActiveContainer { - protected PatternChestLogic patternLogic; - protected InventoryPlayer invPlayer; - protected PartCrafterLogic logic; - protected Slot[] input; - protected Slot[] inventory; - public boolean largeInventory; - - public PartCrafterChestContainer(InventoryPlayer inventoryplayer, PartCrafterLogic partLogic, PatternChestLogic pLogic) - { - logic = partLogic; - patternLogic = pLogic; - largeInventory = true; - - inventory = new Slot[] { new SlotPattern(partLogic, 0, 40, 27), new SlotPattern(partLogic, 1, 40, 45), new Slot(partLogic, 2, 58, 27), new Slot(partLogic, 3, 58, 45), - new SlotOnlyTake(partLogic, 4, 102, 27), new SlotOnlyTake(partLogic, 5, 120, 27), new SlotOnlyTake(partLogic, 6, 102, 45), new SlotOnlyTake(partLogic, 7, 120, 45) }; - for (int iter = 0; iter < inventory.length; iter ++) - this.addSlotToContainer(inventory[iter]); - - /* Holder inventory */ - for (int column = 0; column < 5; column++) + protected PatternChestLogic patternLogic; + protected InventoryPlayer invPlayer; + protected PartCrafterLogic logic; + protected Slot[] input; + protected Slot[] inventory; + public boolean largeInventory; + + public PartCrafterChestContainer(InventoryPlayer inventoryplayer, PartCrafterLogic partLogic, PatternChestLogic pLogic) + { + logic = partLogic; + patternLogic = pLogic; + largeInventory = true; + + inventory = new Slot[] { new SlotPattern(partLogic, 0, 40, 27), new SlotPattern(partLogic, 1, 40, 45), new Slot(partLogic, 2, 58, 27), new Slot(partLogic, 3, 58, 45), + new SlotOnlyTake(partLogic, 4, 102, 27), new SlotOnlyTake(partLogic, 5, 120, 27), new SlotOnlyTake(partLogic, 6, 102, 45), new SlotOnlyTake(partLogic, 7, 120, 45) }; + for (int iter = 0; iter < inventory.length; iter++) + this.addSlotToContainer(inventory[iter]); + + /* Holder inventory */ + for (int column = 0; column < 5; column++) { for (int row = 0; row < 6; row++) { - this.addSlotToContainer(new SlotPattern(pLogic, row + column * 6, -108 + row * 18, 30 + column * 18)); + this.addSlotToContainer(new SlotPattern(pLogic, row + column * 6, -108 + row * 18, 30 + column * 18)); } } - - /* Player inventory */ - for (int column = 0; column < 3; column++) + + /* Player inventory */ + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); + this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } - - } - - @Override - public boolean canInteractWith(EntityPlayer var1) - { - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + + } + + @Override + public boolean canInteractWith (EntityPlayer var1) { - ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + return true; + } + + @Override + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) + { + ItemStack stack = null; + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -72,7 +72,7 @@ public class PartCrafterChestContainer extends ActiveContainer if (slotID < logic.getSizeInventory()) { - if (!this.mergeItemStack(slotStack, logic.getSizeInventory()+patternLogic.getSizeInventory(), this.inventorySlots.size(), true)) + if (!this.mergeItemStack(slotStack, logic.getSizeInventory() + patternLogic.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } @@ -81,7 +81,7 @@ public class PartCrafterChestContainer extends ActiveContainer { if (slotStack.getItem() instanceof IPattern) { - if (!this.mergeItemStack(slotStack, 0, 2, false) && ! this.mergeItemStack(slotStack, 8, 38, false)) + if (!this.mergeItemStack(slotStack, 0, 2, false) && !this.mergeItemStack(slotStack, 8, 38, false)) return null; } else if (!this.mergeItemStack(slotStack, 2, 4, false)) @@ -90,12 +90,12 @@ public class PartCrafterChestContainer extends ActiveContainer if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); - logic.tryBuildPart(slotID); + slot.putStack((ItemStack) null); + logic.tryBuildPart(slotID); } slot.onSlotChanged(); } - + return stack; } } diff --git a/mods/tinker/tconstruct/inventory/PartCrafterContainer.java b/mods/tinker/tconstruct/inventory/PartCrafterContainer.java index d827275f..1dd8224e 100644 --- a/mods/tinker/tconstruct/inventory/PartCrafterContainer.java +++ b/mods/tinker/tconstruct/inventory/PartCrafterContainer.java @@ -10,50 +10,50 @@ import net.minecraft.item.ItemStack; public class PartCrafterContainer extends ActiveContainer { - protected InventoryPlayer invPlayer; - protected PartCrafterLogic logic; - protected Slot[] input; - protected Slot[] inventory; - public boolean largeInventory; - - public PartCrafterContainer(InventoryPlayer inventoryplayer, PartCrafterLogic partLogic) - { - invPlayer = inventoryplayer; - logic = partLogic; - largeInventory = false; - - inventory = new Slot[] { new SlotPattern(partLogic, 0, 40, 27), new SlotPattern(partLogic, 1, 40, 45), new Slot(partLogic, 2, 58, 27), new Slot(partLogic, 3, 58, 45), - new SlotOnlyTake(partLogic, 4, 102, 27), new SlotOnlyTake(partLogic, 5, 120, 27), new SlotOnlyTake(partLogic, 6, 102, 45), new SlotOnlyTake(partLogic, 7, 120, 45) }; - for (int iter = 0; iter < inventory.length; iter ++) - this.addSlotToContainer(inventory[iter]); - - /* Player inventory */ - for (int column = 0; column < 3; column++) + protected InventoryPlayer invPlayer; + protected PartCrafterLogic logic; + protected Slot[] input; + protected Slot[] inventory; + public boolean largeInventory; + + public PartCrafterContainer(InventoryPlayer inventoryplayer, PartCrafterLogic partLogic) + { + invPlayer = inventoryplayer; + logic = partLogic; + largeInventory = false; + + inventory = new Slot[] { new SlotPattern(partLogic, 0, 40, 27), new SlotPattern(partLogic, 1, 40, 45), new Slot(partLogic, 2, 58, 27), new Slot(partLogic, 3, 58, 45), + new SlotOnlyTake(partLogic, 4, 102, 27), new SlotOnlyTake(partLogic, 5, 120, 27), new SlotOnlyTake(partLogic, 6, 102, 45), new SlotOnlyTake(partLogic, 7, 120, 45) }; + for (int iter = 0; iter < inventory.length; iter++) + this.addSlotToContainer(inventory[iter]); + + /* Player inventory */ + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); + this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } - - } - - @Override - public boolean canInteractWith(EntityPlayer var1) - { - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + + } + + @Override + public boolean canInteractWith (EntityPlayer var1) { - ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + return true; + } + + @Override + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) + { + ItemStack stack = null; + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -80,8 +80,8 @@ public class PartCrafterContainer extends ActiveContainer if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); - logic.tryBuildPart(slotID); + slot.putStack((ItemStack) null); + logic.tryBuildPart(slotID); } slot.onSlotChanged(); } diff --git a/mods/tinker/tconstruct/inventory/PatternChestContainer.java b/mods/tinker/tconstruct/inventory/PatternChestContainer.java index 33888162..1e1b56f6 100644 --- a/mods/tinker/tconstruct/inventory/PatternChestContainer.java +++ b/mods/tinker/tconstruct/inventory/PatternChestContainer.java @@ -22,37 +22,36 @@ public class PatternChestContainer extends Container { for (int row = 0; row < 10; row++) { - this.addSlotToContainer(new SlotPattern(chest, row + column * 10, 8 + row * 18, 18 + column * 18)); + this.addSlotToContainer(new SlotPattern(chest, row + column * 10, 8 + row * 18, 18 + column * 18)); } } - + /* Player inventory */ - for (int column = 0; column < 3; column++) + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 17 + row * 18, 86 + column * 18)); + this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 17 + row * 18, 86 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(inventoryplayer, column, 17 + column * 18, 144)); + this.addSlotToContainer(new Slot(inventoryplayer, column, 17 + column * 18, 144)); } } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return logic.isUseableByPlayer(entityplayer); } - + @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { - ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + ItemStack stack = null; + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -73,7 +72,7 @@ public class PatternChestContainer extends Container if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { @@ -83,13 +82,13 @@ public class PatternChestContainer extends Container return stack; } - + @Override - protected boolean mergeItemStack(ItemStack stack, int inventorySize, int slotSize, boolean par4) + protected boolean mergeItemStack (ItemStack stack, int inventorySize, int slotSize, boolean par4) { - if (!(stack.getItem() instanceof IPattern)) - return false; - - return super.mergeItemStack(stack, inventorySize, slotSize, par4); + if (!(stack.getItem() instanceof IPattern)) + return false; + + return super.mergeItemStack(stack, inventorySize, slotSize, par4); } } diff --git a/mods/tinker/tconstruct/inventory/PatternShaperContainer.java b/mods/tinker/tconstruct/inventory/PatternShaperContainer.java index dee455e1..2b0b048b 100644 --- a/mods/tinker/tconstruct/inventory/PatternShaperContainer.java +++ b/mods/tinker/tconstruct/inventory/PatternShaperContainer.java @@ -9,11 +9,11 @@ import net.minecraft.item.ItemStack; public class PatternShaperContainer extends Container { - public StencilTableLogic logic; + public StencilTableLogic logic; public PatternShaperContainer(InventoryPlayer inventoryplayer, StencilTableLogic shaper) { - logic = shaper; + logic = shaper; this.addSlotToContainer(new Slot(shaper, 0, 48, 35)); this.addSlotToContainer(new SlotOnlyTake(shaper, 1, 106, 35)); /*for (int i = 0; i < 3; i++) @@ -25,17 +25,17 @@ public class PatternShaperContainer extends Container }*/ /* Player inventory */ - for (int column = 0; column < 3; column++) + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(inventoryplayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); + this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } } @@ -60,15 +60,15 @@ public class PatternShaperContainer extends Container }*/ @Override - public boolean canInteractWith(EntityPlayer entityplayer) + public boolean canInteractWith (EntityPlayer entityplayer) { return true; } @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { - return null; + return null; /*ItemStack stack = null; Slot slot = (Slot)this.inventorySlots.get(slotID); @@ -101,5 +101,5 @@ public class PatternShaperContainer extends Container return stack;*/ } - + } diff --git a/mods/tinker/tconstruct/inventory/SlotArmorCopy.java b/mods/tinker/tconstruct/inventory/SlotArmorCopy.java index 9cb425b9..14348f3c 100644 --- a/mods/tinker/tconstruct/inventory/SlotArmorCopy.java +++ b/mods/tinker/tconstruct/inventory/SlotArmorCopy.java @@ -33,7 +33,7 @@ public class SlotArmorCopy extends Slot * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case * of armor slots) */ - public int getSlotStackLimit() + public int getSlotStackLimit () { return 1; } @@ -41,18 +41,17 @@ public class SlotArmorCopy extends Slot /** * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ - public boolean isItemValid(ItemStack par1ItemStack) + public boolean isItemValid (ItemStack par1ItemStack) { Item item = (par1ItemStack == null ? null : par1ItemStack.getItem()); return item != null && item.isValidArmor(par1ItemStack, armorType); } @SideOnly(Side.CLIENT) - /** * Returns the icon index on items.png that is used as background image of the slot. */ - public Icon getBackgroundIconIndex() + public Icon getBackgroundIconIndex () { return ItemArmor.func_94602_b(this.armorType); } diff --git a/mods/tinker/tconstruct/inventory/SlotOnlyTake.java b/mods/tinker/tconstruct/inventory/SlotOnlyTake.java index 5d3e569a..246a0e3c 100644 --- a/mods/tinker/tconstruct/inventory/SlotOnlyTake.java +++ b/mods/tinker/tconstruct/inventory/SlotOnlyTake.java @@ -15,7 +15,7 @@ public class SlotOnlyTake extends Slot /** * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ - public boolean isItemValid(ItemStack stack) + public boolean isItemValid (ItemStack stack) { return false; } diff --git a/mods/tinker/tconstruct/inventory/SlotPartBuilder.java b/mods/tinker/tconstruct/inventory/SlotPartBuilder.java index 421cd31c..0ac4d993 100644 --- a/mods/tinker/tconstruct/inventory/SlotPartBuilder.java +++ b/mods/tinker/tconstruct/inventory/SlotPartBuilder.java @@ -7,13 +7,13 @@ import net.minecraft.item.ItemStack; public class SlotPartBuilder extends Slot { - public SlotPartBuilder(IInventory inv, int index, int posX, int posY) - { - super(inv, index, posX, posY); - } - - protected void onCrafting(ItemStack par1ItemStack, int par2) - { - - } + public SlotPartBuilder(IInventory inv, int index, int posX, int posY) + { + super(inv, index, posX, posY); + } + + protected void onCrafting (ItemStack par1ItemStack, int par2) + { + + } } diff --git a/mods/tinker/tconstruct/inventory/SlotPattern.java b/mods/tinker/tconstruct/inventory/SlotPattern.java index b3fb5061..53658ef3 100644 --- a/mods/tinker/tconstruct/inventory/SlotPattern.java +++ b/mods/tinker/tconstruct/inventory/SlotPattern.java @@ -15,7 +15,7 @@ public class SlotPattern extends Slot /** * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ - public boolean isItemValid(ItemStack stack) + public boolean isItemValid (ItemStack stack) { return stack.getItem() instanceof IPattern; } diff --git a/mods/tinker/tconstruct/inventory/SlotToolForge.java b/mods/tinker/tconstruct/inventory/SlotToolForge.java index 7be15c73..c49ecc08 100644 --- a/mods/tinker/tconstruct/inventory/SlotToolForge.java +++ b/mods/tinker/tconstruct/inventory/SlotToolForge.java @@ -18,6 +18,7 @@ public class SlotToolForge extends SlotTool { super(entityplayer, builder, par3, par4, par5); } + protected void onCrafting (ItemStack stack) { NBTTagCompound tags = stack.getTagCompound(); @@ -29,7 +30,7 @@ public class SlotToolForge extends SlotTool inventory.decrStackSize(i, 1); if (!player.worldObj.isRemote && full) //player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "sounds.little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); - player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0); + player.worldObj.playAuxSFX(1021, (int) player.posX, (int) player.posY, (int) player.posZ, 0); } } } diff --git a/mods/tinker/tconstruct/inventory/SmelteryContainer.java b/mods/tinker/tconstruct/inventory/SmelteryContainer.java index 86adf691..a2248fb9 100644 --- a/mods/tinker/tconstruct/inventory/SmelteryContainer.java +++ b/mods/tinker/tconstruct/inventory/SmelteryContainer.java @@ -220,15 +220,16 @@ public class SmelteryContainer extends ActiveContainer } } }*/ - + if (inputStack.isStackable() && startSlot >= logic.getSizeInventory()) { while (inputStack.stackSize > 0 && (!flag && slotPos < endSlot || flag && slotPos >= startSlot)) { - slot = (Slot)this.inventorySlots.get(slotPos); + slot = (Slot) this.inventorySlots.get(slotPos); slotStack = slot.getStack(); - if (slotStack != null && slotStack.itemID == inputStack.itemID && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(inputStack, slotStack)) + if (slotStack != null && slotStack.itemID == inputStack.itemID && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) + && ItemStack.areItemStackTagsEqual(inputStack, slotStack)) { int l = slotStack.stackSize + inputStack.stackSize; diff --git a/mods/tinker/tconstruct/inventory/ToolForgeContainer.java b/mods/tinker/tconstruct/inventory/ToolForgeContainer.java index 36baa1f6..dbdca0ad 100644 --- a/mods/tinker/tconstruct/inventory/ToolForgeContainer.java +++ b/mods/tinker/tconstruct/inventory/ToolForgeContainer.java @@ -15,9 +15,8 @@ public class ToolForgeContainer extends ToolStationContainer { super(inventoryplayer, logic); } - - public void initializeContainer(InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) + public void initializeContainer (InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) { invPlayer = inventoryplayer; this.logic = builderlogic; @@ -80,7 +79,7 @@ public class ToolForgeContainer extends ToolStationContainer for (int i = 1; i <= 4; i++) logic.decrStackSize(i, 1); if (!logic.worldObj.isRemote) - logic.worldObj.playAuxSFX(1021, (int)logic.xCoord, (int)logic.yCoord, (int)logic.zCoord, 0); + logic.worldObj.playAuxSFX(1021, (int) logic.xCoord, (int) logic.yCoord, (int) logic.zCoord, 0); } } } diff --git a/mods/tinker/tconstruct/inventory/ToolStationContainer.java b/mods/tinker/tconstruct/inventory/ToolStationContainer.java index 62bccc7e..02143168 100644 --- a/mods/tinker/tconstruct/inventory/ToolStationContainer.java +++ b/mods/tinker/tconstruct/inventory/ToolStationContainer.java @@ -13,29 +13,29 @@ import net.minecraft.nbt.NBTTagCompound; public class ToolStationContainer extends ActiveContainer { - public InventoryPlayer invPlayer; - public ToolStationLogic logic; - public Slot[] slots; - public SlotTool toolSlot; - public Random random = new Random(); - - public ToolStationContainer(InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) - { - initializeContainer(inventoryplayer, builderlogic); - } - - public void initializeContainer(InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) + public InventoryPlayer invPlayer; + public ToolStationLogic logic; + public Slot[] slots; + public SlotTool toolSlot; + public Random random = new Random(); + + public ToolStationContainer(InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) + { + initializeContainer(inventoryplayer, builderlogic); + } + + public void initializeContainer (InventoryPlayer inventoryplayer, ToolStationLogic builderlogic) { invPlayer = inventoryplayer; logic = builderlogic; - + toolSlot = new SlotTool(inventoryplayer.player, builderlogic, 0, 115, 38); this.addSlotToContainer(toolSlot); slots = new Slot[] { new Slot(builderlogic, 1, 57, 29), new Slot(builderlogic, 2, 39, 38), new Slot(builderlogic, 3, 57, 47) }; - - for (int iter = 0; iter < 3; iter ++) + + for (int iter = 0; iter < 3; iter++) this.addSlotToContainer(slots[iter]); - + /* Player inventory */ for (int column = 0; column < 3; column++) { @@ -50,46 +50,46 @@ public class ToolStationContainer extends ActiveContainer this.addSlotToContainer(new Slot(inventoryplayer, column, 8 + column * 18, 142)); } } - - //posX and posY must be the same length - public void resetSlots(int[] posX, int[] posY) - { - /* Station inventory */ - inventorySlots.clear(); - inventoryItemStacks.clear(); - this.addSlotToContainer(toolSlot); - for (int iter = 0; iter < 3; iter++) - { - slots[iter].xDisplayPosition = posX[iter]+1; - slots[iter].yDisplayPosition = posY[iter]+1; - addSlotToContainer(slots[iter]); - } - - /* Player inventory */ - for (int column = 0; column < 3; column++) + + //posX and posY must be the same length + public void resetSlots (int[] posX, int[] posY) + { + /* Station inventory */ + inventorySlots.clear(); + inventoryItemStacks.clear(); + this.addSlotToContainer(toolSlot); + for (int iter = 0; iter < 3; iter++) + { + slots[iter].xDisplayPosition = posX[iter] + 1; + slots[iter].yDisplayPosition = posY[iter] + 1; + addSlotToContainer(slots[iter]); + } + + /* Player inventory */ + for (int column = 0; column < 3; column++) { for (int row = 0; row < 9; row++) { - this.addSlotToContainer(new Slot(invPlayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); + this.addSlotToContainer(new Slot(invPlayer, row + column * 9 + 9, 8 + row * 18, 84 + column * 18)); } } for (int column = 0; column < 9; column++) { - this.addSlotToContainer(new Slot(invPlayer, column, 8 + column * 18, 142)); + this.addSlotToContainer(new Slot(invPlayer, column, 8 + column * 18, 142)); } - } - - @Override - public boolean canInteractWith(EntityPlayer var1) - { - return true; - } - - public ItemStack transferStackInSlot(EntityPlayer player, int slotID) + } + + @Override + public boolean canInteractWith (EntityPlayer var1) + { + return true; + } + + public ItemStack transferStackInSlot (EntityPlayer player, int slotID) { ItemStack stack = null; - Slot slot = (Slot)this.inventorySlots.get(slotID); + Slot slot = (Slot) this.inventorySlots.get(slotID); if (slot != null && slot.getHasStack()) { @@ -97,14 +97,14 @@ public class ToolStationContainer extends ActiveContainer stack = slotStack.copy(); if (slotID < logic.getSizeInventory()) { - if (slotID == 0) - { - if (!this.mergeCraftedStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true, player)) + if (slotID == 0) + { + if (!this.mergeCraftedStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true, player)) { return null; } - } - else if (!this.mergeItemStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true)) + } + else if (!this.mergeItemStack(slotStack, logic.getSizeInventory(), this.inventorySlots.size(), true)) { return null; } @@ -113,10 +113,10 @@ public class ToolStationContainer extends ActiveContainer { return null; } - + if (slotStack.stackSize == 0) { - slot.putStack((ItemStack)null); + slot.putStack((ItemStack) null); } else { @@ -126,25 +126,25 @@ public class ToolStationContainer extends ActiveContainer return stack; } - - protected void craftTool(ItemStack stack) + + protected void craftTool (ItemStack stack) { - NBTTagCompound tags = stack.getTagCompound(); - if (!tags.getCompoundTag("InfiTool").hasKey("Built")) - { - tags.getCompoundTag("InfiTool").setBoolean("Built", true); - for (int i = 2; i <= 3; i++) - logic.decrStackSize(i, 1); + NBTTagCompound tags = stack.getTagCompound(); + if (!tags.getCompoundTag("InfiTool").hasKey("Built")) + { + tags.getCompoundTag("InfiTool").setBoolean("Built", true); + for (int i = 2; i <= 3; i++) + logic.decrStackSize(i, 1); int amount = logic.getStackInSlot(1).getItem() instanceof ToolCore ? stack.stackSize : 1; logic.decrStackSize(1, amount); - logic.worldObj.playSoundEffect(logic.xCoord, logic.yCoord, logic.zCoord, "sounds.little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); - /*if (!player.worldObj.isRemote) - player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/ - } + logic.worldObj.playSoundEffect(logic.xCoord, logic.yCoord, logic.zCoord, "sounds.little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); + /*if (!player.worldObj.isRemote) + player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/ + } } - - protected boolean mergeCraftedStack(ItemStack stack, int slotsStart, int slotsTotal, boolean playerInventory, EntityPlayer player) + + protected boolean mergeCraftedStack (ItemStack stack, int slotsStart, int slotsTotal, boolean playerInventory, EntityPlayer player) { boolean failedToMerge = false; int slotIndex = slotsStart; @@ -208,12 +208,12 @@ public class ToolStationContainer extends ActiveContainer while (!playerInventory && slotIndex < slotsTotal || playerInventory && slotIndex >= slotsStart) { - otherInventorySlot = (Slot)this.inventorySlots.get(slotIndex); + otherInventorySlot = (Slot) this.inventorySlots.get(slotIndex); copyStack = otherInventorySlot.getStack(); if (copyStack == null) { - craftTool(stack); + craftTool(stack); otherInventorySlot.putStack(stack.copy()); otherInventorySlot.onSlotChanged(); stack.stackSize = 0; @@ -231,11 +231,11 @@ public class ToolStationContainer extends ActiveContainer } } } - + /*boolean emptySlots = ( ((Slot) inventorySlots.get(2)).getStack() == null && ((Slot) inventorySlots.get(3)).getStack() == null ); System.out.println("Empty slots"); if (!failedToMerge && emptySlots) - player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/ + player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0);*/ return failedToMerge; } diff --git a/mods/tinker/tconstruct/items/DiamondApple.java b/mods/tinker/tconstruct/items/DiamondApple.java index b3417bee..dd856f3e 100644 --- a/mods/tinker/tconstruct/items/DiamondApple.java +++ b/mods/tinker/tconstruct/items/DiamondApple.java @@ -13,10 +13,10 @@ import cpw.mods.fml.relauncher.SideOnly; public class DiamondApple extends ItemFood { - public Icon[] icons; - public String[] textureNames = new String[] { "apple_diamond" }; - public String[] itemNames = new String[] { "apple.diamond" }; - + public Icon[] icons; + public String[] textureNames = new String[] { "apple_diamond" }; + public String[] itemNames = new String[] { "apple.diamond" }; + public DiamondApple(int id) { super(id, 4, 2.0F, false); @@ -24,53 +24,53 @@ public class DiamondApple extends ItemFood setMaxDamage(0); this.setAlwaysEdible(); } - - protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote) - { - int duration = 0; - PotionEffect potion; - potion = player.getActivePotionEffect(Potion.resistance); - if (potion != null) - duration = potion.duration; - player.addPotionEffect(new PotionEffect(Potion.resistance.id, duration + 60*20, 0)); - - potion = player.getActivePotionEffect(Potion.digSpeed); - if (potion != null) - duration = potion.duration; - player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, duration + 60*20, 0)); - - potion = player.getActivePotionEffect(Potion.damageBoost); - if (potion != null) - duration = potion.duration; - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, duration + 60*20, 0)); - } + protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player) + { + if (!world.isRemote) + { + int duration = 0; + PotionEffect potion; + + potion = player.getActivePotionEffect(Potion.resistance); + if (potion != null) + duration = potion.duration; + player.addPotionEffect(new PotionEffect(Potion.resistance.id, duration + 60 * 20, 0)); + + potion = player.getActivePotionEffect(Potion.digSpeed); + if (potion != null) + duration = potion.duration; + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, duration + 60 * 20, 0)); + + potion = player.getActivePotionEffect(Potion.damageBoost); + if (potion != null) + duration = potion.duration; + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, duration + 60 * 20, 0)); + } } @SideOnly(Side.CLIENT) - @Override - public Icon getIconFromDamage(int meta) - { - return icons[meta]; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconRegister) + @Override + public Icon getIconFromDamage (int meta) { - this.icons = new Icon[textureNames.length]; + return icons[meta]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); } } /* Name override */ @Override - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { return (new StringBuilder()).append("item.food.").append(itemNames[itemstack.getItemDamage()]).toString(); } diff --git a/mods/tinker/tconstruct/items/FilledBucket.java b/mods/tinker/tconstruct/items/FilledBucket.java index 244e7a08..b9fbf56c 100644 --- a/mods/tinker/tconstruct/items/FilledBucket.java +++ b/mods/tinker/tconstruct/items/FilledBucket.java @@ -21,114 +21,114 @@ import cpw.mods.fml.relauncher.SideOnly; public class FilledBucket extends ItemBucket { - public FilledBucket(int id) - { - super(id, 0); - //setTextureFile(TContent.craftingTexture); - //setIconIndex(224); - setUnlocalizedName("tconstruct.bucket"); - setContainerItem(Item.bucketEmpty); + public FilledBucket(int id) + { + super(id, 0); + //setTextureFile(TContent.craftingTexture); + //setIconIndex(224); + setUnlocalizedName("tconstruct.bucket"); + setContainerItem(Item.bucketEmpty); this.setHasSubtypes(true); - } + } - public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) - { - float var4 = 1.0F; - double trueX = player.prevPosX + (player.posX - player.prevPosX) * (double) var4; - double trueY = player.prevPosY + (player.posY - player.prevPosY) * (double) var4 + 1.62D - (double) player.yOffset; - double trueZ = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) var4; - boolean wannabeFull = false; - MovingObjectPosition position = this.getMovingObjectPositionFromPlayer(world, player, wannabeFull); + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + float var4 = 1.0F; + double trueX = player.prevPosX + (player.posX - player.prevPosX) * (double) var4; + double trueY = player.prevPosY + (player.posY - player.prevPosY) * (double) var4 + 1.62D - (double) player.yOffset; + double trueZ = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) var4; + boolean wannabeFull = false; + MovingObjectPosition position = this.getMovingObjectPositionFromPlayer(world, player, wannabeFull); - if (position == null) - { - return stack; - } - else - { - /*FillBucketEvent event = new FillBucketEvent(player, stack, world, position); - if (MinecraftForge.EVENT_BUS.post(event)) - { - return stack; - } + if (position == null) + { + return stack; + } + else + { + /*FillBucketEvent event = new FillBucketEvent(player, stack, world, position); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return stack; + } - if (event.getResult() == Event.Result.ALLOW) - { - if (player.capabilities.isCreativeMode) - { - return stack; - } + if (event.getResult() == Event.Result.ALLOW) + { + if (player.capabilities.isCreativeMode) + { + return stack; + } - if (--stack.stackSize <= 0) - { - return event.result; - } + if (--stack.stackSize <= 0) + { + return event.result; + } - if (!player.inventory.addItemStackToInventory(event.result)) - { - player.dropPlayerItem(event.result); - } + if (!player.inventory.addItemStackToInventory(event.result)) + { + player.dropPlayerItem(event.result); + } - return stack; - }*/ + return stack; + }*/ - if (position.typeOfHit == EnumMovingObjectType.TILE) - { - int clickX = position.blockX; - int clickY = position.blockY; - int clickZ = position.blockZ; + if (position.typeOfHit == EnumMovingObjectType.TILE) + { + int clickX = position.blockX; + int clickY = position.blockY; + int clickZ = position.blockZ; - if (!world.canMineBlock(player, clickX, clickY, clickZ)) - { - return stack; - } + if (!world.canMineBlock(player, clickX, clickY, clickZ)) + { + return stack; + } - if (position.sideHit == 0) - { - --clickY; - } + if (position.sideHit == 0) + { + --clickY; + } - if (position.sideHit == 1) - { - ++clickY; - } + if (position.sideHit == 1) + { + ++clickY; + } - if (position.sideHit == 2) - { - --clickZ; - } + if (position.sideHit == 2) + { + --clickZ; + } - if (position.sideHit == 3) - { - ++clickZ; - } + if (position.sideHit == 3) + { + ++clickZ; + } - if (position.sideHit == 4) - { - --clickX; - } + if (position.sideHit == 4) + { + --clickX; + } - if (position.sideHit == 5) - { - ++clickX; - } + if (position.sideHit == 5) + { + ++clickX; + } - if (!player.canPlayerEdit(clickX, clickY, clickZ, position.sideHit, stack)) - { - return stack; - } + if (!player.canPlayerEdit(clickX, clickY, clickZ, position.sideHit, stack)) + { + return stack; + } - if (this.tryPlaceContainedLiquid(world, clickX, clickY, clickZ, stack.getItemDamage()) && !player.capabilities.isCreativeMode) - { - return new ItemStack(Item.bucketEmpty); - } - } + if (this.tryPlaceContainedLiquid(world, clickX, clickY, clickZ, stack.getItemDamage()) && !player.capabilities.isCreativeMode) + { + return new ItemStack(Item.bucketEmpty); + } + } - return stack; - } - } + return stack; + } + } - public boolean tryPlaceContainedLiquid(World world, int clickX, int clickY, int clickZ, int meta) + public boolean tryPlaceContainedLiquid (World world, int clickX, int clickY, int clickZ, int meta) { if (!world.isAirBlock(clickX, clickY, clickZ) && world.getBlockMaterial(clickX, clickY, clickZ).isSolid()) { @@ -136,49 +136,49 @@ public class FilledBucket extends ItemBucket } else { - world.setBlock(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID); - LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(clickX, clickY, clickZ); - logic.setLiquidType(meta); + world.setBlock(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID); + LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(clickX, clickY, clickZ); + logic.setLiquidType(meta); return true; } } - - @Override - public void getSubItems(int id, CreativeTabs tab, List list) + + @Override + public void getSubItems (int id, CreativeTabs tab, List list) { - for (int i = 0; i < icons.length; i++) - list.add(new ItemStack(id, 1, i)); + for (int i = 0; i < icons.length; i++) + list.add(new ItemStack(id, 1, i)); } - - public Icon[] icons; - - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) - { - return icons[meta]; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) + + public Icon[] icons; + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage (int meta) { - this.icons = new Icon[textureNames.length]; + return icons[meta]; + } + + @SideOnly(Side.CLIENT) + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:materials/bucket_"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:materials/bucket_" + textureNames[i]); } } - - public String getUnlocalizedName(ItemStack stack) - { - int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, materialNames.length); - return getUnlocalizedName() + "." +materialNames[arr]; - } - - public static final String[] materialNames = new String[] { - "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", "Glass", "Stone", "Villager", "Cow" }; - - public static final String[] textureNames = new String[] { - "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel", "glass", "stone", "emerald", "blood" }; + + public String getUnlocalizedName (ItemStack stack) + { + int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, materialNames.length); + return getUnlocalizedName() + "." + materialNames[arr]; + } + + public static final String[] materialNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", + "Glass", "Stone", "Villager", "Cow" }; + + public static final String[] textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel", + "glass", "stone", "emerald", "blood" }; } diff --git a/mods/tinker/tconstruct/items/GoldenHead.java b/mods/tinker/tconstruct/items/GoldenHead.java index 17462d22..720375d2 100644 --- a/mods/tinker/tconstruct/items/GoldenHead.java +++ b/mods/tinker/tconstruct/items/GoldenHead.java @@ -24,22 +24,21 @@ public class GoldenHead extends ItemFood } @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack par1ItemStack) + public boolean hasEffect (ItemStack par1ItemStack) { return par1ItemStack.getItemDamage() > 0; } @SideOnly(Side.CLIENT) - /** * Return an item rarity from EnumRarity */ - public EnumRarity getRarity(ItemStack par1ItemStack) + public EnumRarity getRarity (ItemStack par1ItemStack) { return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; } - protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + protected void onFoodEaten (ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (par1ItemStack.getItemDamage() > 0) { @@ -57,20 +56,17 @@ public class GoldenHead extends ItemFood } @SideOnly(Side.CLIENT) - /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) + public void getSubItems (int par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); } - - @SideOnly(Side.CLIENT) @Override - public void registerIcons(IconRegister iconRegister) + public void registerIcons (IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("tinker:skull_char_gold"); /*this.icons = new Icon[textureNames.length]; diff --git a/mods/tinker/tconstruct/items/Manual.java b/mods/tinker/tconstruct/items/Manual.java index 5bace2bf..448e9079 100644 --- a/mods/tinker/tconstruct/items/Manual.java +++ b/mods/tinker/tconstruct/items/Manual.java @@ -11,38 +11,39 @@ import cpw.mods.fml.relauncher.SideOnly; public class Manual extends CraftingItem { - static String[] name = new String[] { "beginner", "toolstation", "smeltery" }; - static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery" }; - public Manual(int id) - { - super(id, name, textureName, ""); - setUnlocalizedName("tconstruct.manual"); - } + static String[] name = new String[] { "beginner", "toolstation", "smeltery" }; + static String[] textureName = new String[] { "tinkerbook_diary", "tinkerbook_toolstation", "tinkerbook_smeltery" }; - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + public Manual(int id) { - player.openGui(TConstruct.instance, TConstruct.proxy.manualGuiID, world, 0, 0, 0); - /*Side side = FMLCommonHandler.instance().getEffectiveSide(); - if (side.isClient()) - FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(player.getCurrentEquippedItem(), getManualFromStack(stack)));*/ + super(id, name, textureName, ""); + setUnlocalizedName("tconstruct.manual"); + } + + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + player.openGui(TConstruct.instance, TConstruct.proxy.manualGuiID, world, 0, 0, 0); + /*Side side = FMLCommonHandler.instance().getEffectiveSide(); + if (side.isClient()) + FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(player.getCurrentEquippedItem(), getManualFromStack(stack)));*/ return stack; } - - @SideOnly(Side.CLIENT) - public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) - { - switch (stack.getItemDamage()) - { - case 0: - list.add("\u00a7oBy: Skyla"); - break; - case 1: - list.add("\u00a7oBy: Skyla"); - break; - case 2: - list.add("\u00a7oBy: Thruul M'gon"); - break; - } - } + + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + switch (stack.getItemDamage()) + { + case 0: + list.add("\u00a7oBy: Skyla"); + break; + case 1: + list.add("\u00a7oBy: Skyla"); + break; + case 2: + list.add("\u00a7oBy: Thruul M'gon"); + break; + } + } } diff --git a/mods/tinker/tconstruct/items/MaterialItem.java b/mods/tinker/tconstruct/items/MaterialItem.java index edfc9607..90995a3a 100644 --- a/mods/tinker/tconstruct/items/MaterialItem.java +++ b/mods/tinker/tconstruct/items/MaterialItem.java @@ -19,7 +19,7 @@ public class MaterialItem extends CraftingItem static String[] materialNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AluBrassIngot", "AlumiteIngot", "SteelIngot", "BlueSlimeCrystal", "ObsidianIngot", "IronNugget", "CopperNugget", "TinNugget", "AluminumNugget", "EssenceCrystal", "AluBrassNugget", "SilkyCloth", "SilkyJewel" }; - + static String[] craftingTextures = new String[] { "paperstack", "slimecrystal", "searedbrick", "cobaltingot", "arditeingot", "manyullyningot", "mossball", "lavacrystal", "necroticbone", "copperingot", "tiningot", "aluminumingot", "aluminumraw", "bronzeingot", "alubrassingot", "alumiteingot", "steelingot", "blueslimecrystal", "obsidianingot", "nugget_iron", "nugget_copper", "nugget_tin", "nugget_aluminum", "essencecrystal", "nugget_alubrass", "silkycloth", "silkyjewel" }; diff --git a/mods/tinker/tconstruct/items/OreBerries.java b/mods/tinker/tconstruct/items/OreBerries.java index b7b1bdb4..dd797c56 100644 --- a/mods/tinker/tconstruct/items/OreBerries.java +++ b/mods/tinker/tconstruct/items/OreBerries.java @@ -23,7 +23,7 @@ public class OreBerries extends CraftingItem { switch (stack.getItemDamage()) { - case 0: + case 0: list.add("Sweet Irony"); break; case 1: @@ -35,10 +35,10 @@ public class OreBerries extends CraftingItem case 3: list.add("Tin Man"); break; - case 4: + case 4: list.add("White Chocolate"); break; - case 5: + case 5: list.add("Tastes like Creeper"); break; } diff --git a/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java b/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java index 7a428379..35947c31 100644 --- a/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java +++ b/mods/tinker/tconstruct/items/RedstoneBallRepeaterItem.java @@ -24,7 +24,7 @@ public class RedstoneBallRepeaterItem extends Item * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return * True if something happen and false if it don't. This is for ITEMS, not BLOCKS */ - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + public boolean onItemUse (ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.getBlockId(par4, par5, par6) != Block.snow.blockID) { @@ -79,9 +79,9 @@ public class RedstoneBallRepeaterItem extends Item return true; } } - + @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister iconRegister) + public void registerIcons (IconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon("tinker:redstoneball"); } diff --git a/mods/tinker/tconstruct/items/SpecialFood.java b/mods/tinker/tconstruct/items/SpecialFood.java index fa6732b6..ec171dbc 100644 --- a/mods/tinker/tconstruct/items/SpecialFood.java +++ b/mods/tinker/tconstruct/items/SpecialFood.java @@ -16,22 +16,23 @@ import net.minecraft.world.World; public class SpecialFood extends ItemFood { - int[] hunger; - float[] saturation; - String[] unlocalizedNames; - String[] iconNames; - Icon[] icons; - public SpecialFood(int id, int[] hunger, float[] saturation, String[] textureNames, String[] iconNames) - { - super(id, 0, 0, false); - this.hunger = hunger; - this.saturation = saturation; - this.unlocalizedNames = textureNames; - this.iconNames = iconNames; - } + int[] hunger; + float[] saturation; + String[] unlocalizedNames; + String[] iconNames; + Icon[] icons; - @Override - public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) + public SpecialFood(int id, int[] hunger, float[] saturation, String[] textureNames, String[] iconNames) + { + super(id, 0, 0, false); + this.hunger = hunger; + this.saturation = saturation; + this.unlocalizedNames = textureNames; + this.iconNames = iconNames; + } + + @Override + public ItemStack onEaten (ItemStack stack, World world, EntityPlayer player) { stack.stackSize--; int damage = stack.getItemDamage(); @@ -40,34 +41,34 @@ public class SpecialFood extends ItemFood this.onFoodEaten(stack, world, player); return stack; } - - @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) - { - return icons[meta]; - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IconRegister iconRegister) + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage (int meta) { - this.icons = new Icon[iconNames.length]; + return icons[meta]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons (IconRegister iconRegister) + { + this.icons = new Icon[iconNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:"+iconNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:" + iconNames[i]); } } - - public String getUnlocalizedName(ItemStack stack) - { - int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length); - return getUnlocalizedName() + "." +unlocalizedNames[arr]; - } - public void getSubItems (int id, CreativeTabs tab, List list) - { - for (int i = 0; i < unlocalizedNames.length; i++) - list.add(new ItemStack(id, 1, i)); - } + public String getUnlocalizedName (ItemStack stack) + { + int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length); + return getUnlocalizedName() + "." + unlocalizedNames[arr]; + } + + public void getSubItems (int id, CreativeTabs tab, List list) + { + for (int i = 0; i < unlocalizedNames.length; i++) + list.add(new ItemStack(id, 1, i)); + } } diff --git a/mods/tinker/tconstruct/items/StrangeFood.java b/mods/tinker/tconstruct/items/StrangeFood.java index b45c550f..17f8da22 100644 --- a/mods/tinker/tconstruct/items/StrangeFood.java +++ b/mods/tinker/tconstruct/items/StrangeFood.java @@ -9,16 +9,16 @@ import cpw.mods.fml.relauncher.SideOnly; public class StrangeFood extends SpecialFood { - public StrangeFood(int id) - { - super(id, new int[] { 2 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" }); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) - { - list.add("\u00a7b\u00a7oIt smells terrible, but if you"); - list.add("\u00a7b\u00a7ohave nothing else to eat..."); - } + public StrangeFood(int id) + { + super(id, new int[] { 2 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" }); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + list.add("\u00a7b\u00a7oIt smells terrible, but if you"); + list.add("\u00a7b\u00a7ohave nothing else to eat..."); + } } diff --git a/mods/tinker/tconstruct/items/ToolPart.java b/mods/tinker/tconstruct/items/ToolPart.java index 14089b74..003eff2e 100644 --- a/mods/tinker/tconstruct/items/ToolPart.java +++ b/mods/tinker/tconstruct/items/ToolPart.java @@ -39,7 +39,7 @@ public class ToolPart extends CraftingItem implements IToolPart { for (int i = 0; i < 17; i++) list.add(new ItemStack(id, 1, i)); - + if (TContent.thaumcraftAvailable) list.add(new ItemStack(id, 1, 31)); } diff --git a/mods/tinker/tconstruct/items/ToolPartHidden.java b/mods/tinker/tconstruct/items/ToolPartHidden.java index a3320196..3e81aa68 100644 --- a/mods/tinker/tconstruct/items/ToolPartHidden.java +++ b/mods/tinker/tconstruct/items/ToolPartHidden.java @@ -14,6 +14,6 @@ public class ToolPartHidden extends ToolPart public void getSubItems (int id, CreativeTabs tab, List list) { - + } } diff --git a/mods/tinker/tconstruct/items/armor/Glove.java b/mods/tinker/tconstruct/items/armor/Glove.java index 324fc096..3305e7a9 100644 --- a/mods/tinker/tconstruct/items/armor/Glove.java +++ b/mods/tinker/tconstruct/items/armor/Glove.java @@ -6,15 +6,15 @@ import net.minecraft.item.Item; public class Glove extends Item { - public Glove(int par1) - { - super(par1); - this.setCreativeTab(TConstructRegistry.materialTab); - } + public Glove(int par1) + { + super(par1); + this.setCreativeTab(TConstructRegistry.materialTab); + } - @Override - public void registerIcons (IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("tinker:armor/dirthand"); - } + @Override + public void registerIcons (IconRegister iconRegister) + { + itemIcon = iconRegister.registerIcon("tinker:armor/dirthand"); + } } diff --git a/mods/tinker/tconstruct/items/armor/HeartCanister.java b/mods/tinker/tconstruct/items/armor/HeartCanister.java index 0e4c6eeb..55fff44f 100644 --- a/mods/tinker/tconstruct/items/armor/HeartCanister.java +++ b/mods/tinker/tconstruct/items/armor/HeartCanister.java @@ -15,56 +15,56 @@ import cpw.mods.fml.relauncher.SideOnly; public class HeartCanister extends CraftingItem { - public HeartCanister(int id) - { - super(id, new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, ""); - this.setMaxStackSize(10); - } + public HeartCanister(int id) + { + super(id, new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, ""); + this.setMaxStackSize(10); + } - @Override - public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote && stack.getItemDamage() == 2) - { - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); - if (stats != null) - { - ArmorExtended armor = stats.armor; - ItemStack slotStack = armor.getStackInSlot(6); - if (slotStack == null)// || slotStack.getItem() == this) - { - armor.setInventorySlotContents(6, new ItemStack(this, 1, 2)); - stack.stackSize--; - } - else if (slotStack.getItem() == this && slotStack.stackSize < this.maxStackSize) - { - slotStack.stackSize++; - stack.stackSize--; - } - armor.recalculateHealth(player, stats); - } - } - return stack; - } + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + if (!world.isRemote && stack.getItemDamage() == 2) + { + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + if (stats != null) + { + ArmorExtended armor = stats.armor; + ItemStack slotStack = armor.getStackInSlot(6); + if (slotStack == null)// || slotStack.getItem() == this) + { + armor.setInventorySlotContents(6, new ItemStack(this, 1, 2)); + stack.stackSize--; + } + else if (slotStack.getItem() == this && slotStack.stackSize < this.maxStackSize) + { + slotStack.stackSize++; + stack.stackSize--; + } + armor.recalculateHealth(player, stats); + } + } + return stack; + } - @Override - @SideOnly(Side.CLIENT) - public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) - { - switch (stack.getItemDamage()) - { - case 0: - list.add("Crafting Item"); - break; - case 1: - list.add("Crafting Item"); - list.add("Part of low-level Heart Canisters"); - break; - case 2: - list.add("Accessory"); - list.add("Permanent health increase"); - break; - } - } + @Override + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + switch (stack.getItemDamage()) + { + case 0: + list.add("Crafting Item"); + break; + case 1: + list.add("Crafting Item"); + list.add("Part of low-level Heart Canisters"); + break; + case 2: + list.add("Accessory"); + list.add("Permanent health increase"); + break; + } + } } diff --git a/mods/tinker/tconstruct/items/armor/TArmorBase.java b/mods/tinker/tconstruct/items/armor/TArmorBase.java index e98c7c90..0f388f73 100644 --- a/mods/tinker/tconstruct/items/armor/TArmorBase.java +++ b/mods/tinker/tconstruct/items/armor/TArmorBase.java @@ -19,13 +19,14 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class TArmorBase extends ItemArmor - //implements ISpecialArmor +//implements ISpecialArmor { Icon[] icons; String[] iconNames = { "wood_boots" }; + //static Minecraft mc = Minecraft.getMinecraft(); //private ModelBiped modelArmor; - + public TArmorBase(int id, int armorSlot) { super(id, EnumArmorMaterial.CLOTH, 0, armorSlot); @@ -37,12 +38,12 @@ public class TArmorBase extends ItemArmor //this.modelArmor = new ModelBiped(0.75F); //this.setCreativeTab(TConstructRegistry.toolTab); } - - public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) + + public void onArmorTickUpdate (World world, EntityPlayer player, ItemStack itemStack) { } - + /** * Called by RenderBiped and RenderPlayer to determine the armor texture that * should be use for the currently equiped item. @@ -58,11 +59,11 @@ public class TArmorBase extends ItemArmor */ @Override @SideOnly(Side.CLIENT) - public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) + public String getArmorTexture (ItemStack stack, Entity entity, int slot, int layer) { return "/mods/tinker/textures/armor/wood_1.png"; } - + /** * Override this method to have an item handle its own armor rendering. * @@ -74,33 +75,33 @@ public class TArmorBase extends ItemArmor */ @Override @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLiving par1EntityLiving, ItemStack itemStack, int armorSlot) + public ModelBiped getArmorModel (EntityLiving par1EntityLiving, ItemStack itemStack, int armorSlot) { return null; } - + @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() + public boolean requiresMultipleRenderPasses () { return false; } - + @SideOnly(Side.CLIENT) @Override - public Icon getIconFromDamage(int meta) + public Icon getIconFromDamage (int meta) { return icons[0]; } - + @SideOnly(Side.CLIENT) @Override - public void registerIcons(IconRegister iconRegister) + public void registerIcons (IconRegister iconRegister) { this.icons = new Icon[iconNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.registerIcon("tinker:armor/"+iconNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:armor/" + iconNames[i]); } } diff --git a/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java b/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java index f1162327..acd65b49 100644 --- a/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/CraftedSoilItemBlock.java @@ -11,10 +11,7 @@ import net.minecraft.util.MathHelper; public class CraftedSoilItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil" - }; + public static final String blockType[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil" }; public CraftedSoilItemBlock(int id) { @@ -23,17 +20,17 @@ public class CraftedSoilItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("CraftedSoil.").append(blockType[pos]).toString(); } - + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) diff --git a/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java b/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java index 50341f91..d5b6368d 100644 --- a/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java +++ b/mods/tinker/tconstruct/items/blocks/GlassBlockItem.java @@ -11,10 +11,7 @@ import net.minecraft.util.MathHelper; public class GlassBlockItem extends ItemBlock { - public static final String blockType[] = - { - "glass.pure", "glass.soul", "glass.soul.pure" - }; + public static final String blockType[] = { "glass.pure", "glass.soul", "glass.soul.pure" }; public GlassBlockItem(int id) { @@ -23,14 +20,14 @@ public class GlassBlockItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java b/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java index c88b31fc..ef7ee6b4 100644 --- a/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java +++ b/mods/tinker/tconstruct/items/blocks/GlassPaneItem.java @@ -11,10 +11,7 @@ import net.minecraft.util.MathHelper; public class GlassPaneItem extends ItemBlock { - public static final String blockType[] = - { - "glass.pure", "glass.soul", "glass.soul.pure" - }; + public static final String blockType[] = { "glass.pure", "glass.soul", "glass.soul.pure" }; public GlassPaneItem(int id) { @@ -23,14 +20,14 @@ public class GlassPaneItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.").append(blockType[pos]).append(".pane").toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/GravelOreItem.java b/mods/tinker/tconstruct/items/blocks/GravelOreItem.java index 57cae413..882a97c9 100644 --- a/mods/tinker/tconstruct/items/blocks/GravelOreItem.java +++ b/mods/tinker/tconstruct/items/blocks/GravelOreItem.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class GravelOreItem extends ItemBlock { - public static final String blockType[] = - { - "iron", "gold", "copper", "tin", "aluminum", "cobalt" - }; + public static final String blockType[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" }; public GravelOreItem(int id) { @@ -18,14 +15,14 @@ public class GravelOreItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.ore.gravel.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/LavaTankItemBlock.java b/mods/tinker/tconstruct/items/blocks/LavaTankItemBlock.java index 8619f53a..c5737f2a 100644 --- a/mods/tinker/tconstruct/items/blocks/LavaTankItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/LavaTankItemBlock.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class LavaTankItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Tank", "Gague", "Window" - }; + public static final String blockType[] = { "Tank", "Gague", "Window" }; public LavaTankItemBlock(int id) { @@ -18,14 +15,14 @@ public class LavaTankItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("LavaTank.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java b/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java index 13d4f20c..0c0aa256 100644 --- a/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java +++ b/mods/tinker/tconstruct/items/blocks/LightCrystalItem.java @@ -6,11 +6,8 @@ import net.minecraft.util.MathHelper; public class LightCrystalItem extends ItemBlock { - public static final String blockType[] = - { - "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", - "PatternShaper", "PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" - }; + public static final String blockType[] = { "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper", + "PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" }; public LightCrystalItem(int id) { @@ -19,7 +16,7 @@ public class LightCrystalItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } diff --git a/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java b/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java index 911f5e5d..eededab8 100644 --- a/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/LiquidItemBlock.java @@ -10,8 +10,8 @@ import net.minecraft.util.MathHelper; public class LiquidItemBlock extends ItemBlock { - public static final String blockType[] = - { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", "Glass", "Stone", "Villager", "Cow" }; + public static final String blockType[] = { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "AluBrass", "Manyullyn", "Alumite", "Obsidian", "Steel", "Glass", "Stone", + "Villager", "Cow" }; public LiquidItemBlock(int id) { @@ -20,22 +20,21 @@ public class LiquidItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } @SideOnly(Side.CLIENT) - public Icon getIconFromDamage(int meta) + public Icon getIconFromDamage (int meta) { int arr = MathHelper.clamp_int(meta, 0, blockType.length); return TContent.liquidMetalStill.getIcon(1, arr); } - - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("LiquidMetal.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/MetalItemBlock.java b/mods/tinker/tconstruct/items/blocks/MetalItemBlock.java index 54e94bfd..9055e26a 100644 --- a/mods/tinker/tconstruct/items/blocks/MetalItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/MetalItemBlock.java @@ -9,10 +9,7 @@ import net.minecraft.util.MathHelper; public class MetalItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Tin", "Aluminum", "AlBrass", "Alumite", "Steel" - }; + public static final String blockType[] = { "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Tin", "Aluminum", "AlBrass", "Alumite", "Steel" }; public MetalItemBlock(int id) { @@ -21,17 +18,17 @@ public class MetalItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("StorageMetals.").append(blockType[pos]).toString(); } - + @Override public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { diff --git a/mods/tinker/tconstruct/items/blocks/MetalOreItemBlock.java b/mods/tinker/tconstruct/items/blocks/MetalOreItemBlock.java index 19189492..deab03a1 100644 --- a/mods/tinker/tconstruct/items/blocks/MetalOreItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/MetalOreItemBlock.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class MetalOreItemBlock extends ItemBlock { - public static final String blockType[] = - { - "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" - }; + public static final String blockType[] = { "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" }; public MetalOreItemBlock(int id) { @@ -18,14 +15,14 @@ public class MetalOreItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("MetalOre.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java b/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java index c19354da..c2a96a4d 100644 --- a/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java +++ b/mods/tinker/tconstruct/items/blocks/MultiBrickFancyItem.java @@ -11,8 +11,8 @@ import net.minecraft.util.MathHelper; public class MultiBrickFancyItem extends ItemBlock { - static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", - "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", "stone", "stone.road" }; + static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", + "stone", "stone.road" }; public MultiBrickFancyItem(int id) { @@ -21,17 +21,17 @@ public class MultiBrickFancyItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.fancybrick.").append(blockType[pos]).toString(); } - + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) diff --git a/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java b/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java index 263769bb..0616529c 100644 --- a/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java +++ b/mods/tinker/tconstruct/items/blocks/MultiBrickItem.java @@ -11,8 +11,8 @@ import net.minecraft.util.MathHelper; public class MultiBrickItem extends ItemBlock { - static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", - "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", "stone.road", "stone.refined.road" }; + static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot", + "stone.road", "stone.refined.road" }; public MultiBrickItem(int id) { @@ -21,17 +21,17 @@ public class MultiBrickItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.brick.").append(blockType[pos]).toString(); } - + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) diff --git a/mods/tinker/tconstruct/items/blocks/OreberryBushItem.java b/mods/tinker/tconstruct/items/blocks/OreberryBushItem.java index 499c329e..b83d58ed 100644 --- a/mods/tinker/tconstruct/items/blocks/OreberryBushItem.java +++ b/mods/tinker/tconstruct/items/blocks/OreberryBushItem.java @@ -17,26 +17,27 @@ import cpw.mods.fml.relauncher.SideOnly; public class OreberryBushItem extends ItemBlock { public int blockID; + public OreberryBushItem(int id) { super(id); - blockID = id+256; + blockID = id + 256; setHasSubtypes(true); } - + @Override - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta % 4; } - + /* Place bushes on dirt, grass, or other bushes only */ - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) + @Override + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) { if (side != 1) return false; - + else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) { Block block = Block.blocksList[world.getBlockId(x, y, z)]; @@ -59,24 +60,21 @@ public class OreberryBushItem extends ItemBlock /* Block name in inventory */ @Override - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.oreberry.").append(blockType[pos]).toString(); } - public static final String blockType[] = - { - "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", - "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" - }; - + + public static final String blockType[] = { "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" }; + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { switch (stack.getItemDamage() % 4) { - case 0: + case 0: list.add("Sweet Irony"); break; case 1: diff --git a/mods/tinker/tconstruct/items/blocks/OreberryBushSecondItem.java b/mods/tinker/tconstruct/items/blocks/OreberryBushSecondItem.java index 0f4f92d0..8411c25c 100644 --- a/mods/tinker/tconstruct/items/blocks/OreberryBushSecondItem.java +++ b/mods/tinker/tconstruct/items/blocks/OreberryBushSecondItem.java @@ -17,30 +17,31 @@ import cpw.mods.fml.relauncher.SideOnly; public class OreberryBushSecondItem extends ItemBlock { public int blockID; + public OreberryBushSecondItem(int id) { super(id); - blockID = id+256; + blockID = id + 256; setHasSubtypes(true); } - + @Override - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta % 4; } - + /* Place bushes on dirt, grass, or other bushes only */ - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + @Override + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (side != 1) return false; - + int meta = stack.getItemDamage(); - if (meta % 4 != 1 && world.getFullBlockLightValue(x, y+1, z) >= 13) + if (meta % 4 != 1 && world.getFullBlockLightValue(x, y + 1, z) >= 13) return false; - + else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) { Block block = Block.blocksList[world.getBlockId(x, y, z)]; @@ -63,27 +64,24 @@ public class OreberryBushSecondItem extends ItemBlock /* Block name in inventory */ @Override - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.oreberry.").append(blockType[pos]).toString(); } - public static final String blockType[] = - { - "aluminum", "essence", "", "", "aluminum", "essence", "", "", - "aluminum", "essence", "", "", "aluminum", "essence", "", "" - }; - + + public static final String blockType[] = { "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "" }; + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { switch (stack.getItemDamage() % 4) { - case 0: + case 0: list.add("White Chocolate"); break; - case 1: + case 1: list.add("Tastes like Creeper"); break; } diff --git a/mods/tinker/tconstruct/items/blocks/RedstoneMachineItem.java b/mods/tinker/tconstruct/items/blocks/RedstoneMachineItem.java index e68e7035..8b05d87f 100644 --- a/mods/tinker/tconstruct/items/blocks/RedstoneMachineItem.java +++ b/mods/tinker/tconstruct/items/blocks/RedstoneMachineItem.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class RedstoneMachineItem extends ItemBlock { - public static final String blockType[] = - { - "drawbridge", "firestarter" - }; + public static final String blockType[] = { "drawbridge", "firestarter" }; public RedstoneMachineItem(int id) { @@ -18,14 +15,14 @@ public class RedstoneMachineItem extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("block.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/SearedTableItemBlock.java b/mods/tinker/tconstruct/items/blocks/SearedTableItemBlock.java index 4f411c0d..92b941a6 100644 --- a/mods/tinker/tconstruct/items/blocks/SearedTableItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/SearedTableItemBlock.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class SearedTableItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Table", "Faucet", "Basin" - }; + public static final String blockType[] = { "Table", "Faucet", "Basin" }; public SearedTableItemBlock(int id) { @@ -18,14 +15,14 @@ public class SearedTableItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("SearedBlock.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/SmelteryItemBlock.java b/mods/tinker/tconstruct/items/blocks/SmelteryItemBlock.java index c3e87dde..d6b1ed38 100644 --- a/mods/tinker/tconstruct/items/blocks/SmelteryItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/SmelteryItemBlock.java @@ -6,10 +6,7 @@ import net.minecraft.util.MathHelper; public class SmelteryItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Controller", "Drain", "Brick", "Furnace", "Stone", "Cobblestone", "Paver", "Brick.Cracked", "Road", "Brick.Fancy", "Brick.Square" - }; + public static final String blockType[] = { "Controller", "Drain", "Brick", "Furnace", "Stone", "Cobblestone", "Paver", "Brick.Cracked", "Road", "Brick.Fancy", "Brick.Square" }; public SmelteryItemBlock(int id) { @@ -18,14 +15,14 @@ public class SmelteryItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("Smeltery.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/blocks/ToolStationItemBlock.java b/mods/tinker/tconstruct/items/blocks/ToolStationItemBlock.java index cfaa9ebb..a5f100e2 100644 --- a/mods/tinker/tconstruct/items/blocks/ToolStationItemBlock.java +++ b/mods/tinker/tconstruct/items/blocks/ToolStationItemBlock.java @@ -6,11 +6,8 @@ import net.minecraft.util.MathHelper; public class ToolStationItemBlock extends ItemBlock { - public static final String blockType[] = - { - "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", - "PatternShaper", "PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" - }; + public static final String blockType[] = { "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper", + "PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" }; public ToolStationItemBlock(int id) { @@ -19,15 +16,15 @@ public class ToolStationItemBlock extends ItemBlock setHasSubtypes(true); } - public int getMetadata(int meta) + public int getMetadata (int meta) { return meta; } @Override - public String getUnlocalizedName(ItemStack itemstack) + public String getUnlocalizedName (ItemStack itemstack) { - int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length-1); + int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1); return (new StringBuilder()).append("ToolStation.").append(blockType[pos]).toString(); } } diff --git a/mods/tinker/tconstruct/items/tools/Arrow.java b/mods/tinker/tconstruct/items/tools/Arrow.java index 0546133b..19cf96ef 100644 --- a/mods/tinker/tconstruct/items/tools/Arrow.java +++ b/mods/tinker/tconstruct/items/tools/Arrow.java @@ -49,12 +49,13 @@ public class Arrow extends ToolCore { return "_arrow_effect"; } + @Override public String getDefaultFolder () { return "arrow"; } - + @Override public void registerPartPaths (int index, String[] location) { @@ -83,9 +84,9 @@ public class Arrow extends ToolCore @Override public String[] toolCategories () { - return new String[] {"ammo"}; + return new String[] { "ammo" }; } - + @Override public void getSubItems (int id, CreativeTabs tab, List list) { @@ -106,14 +107,15 @@ public class Arrow extends ToolCore tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true); list.add(tool); } - + //Random arrow accessory = getAccessoryItem(); accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, random.nextInt(4)) : null; extra = getExtraItem(); extraStack = extra != null ? new ItemStack(extra, 1, 0) : null; - tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, random.nextInt(18)), new ItemStack(getHandleItem(), 1, random.nextInt(18)), accessoryStack, extraStack, "Random Streamer"); - + tool = ToolBuilder.instance + .buildTool(new ItemStack(getHeadItem(), 1, random.nextInt(18)), new ItemStack(getHandleItem(), 1, random.nextInt(18)), accessoryStack, extraStack, "Random Streamer"); + if (tool == null) { System.out.println("Creative builder failed tool for Vanilla style" + this.getToolName()); @@ -148,12 +150,12 @@ public class Arrow extends ToolCore list.add(tool); } } - - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) { return false; } - + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) diff --git a/mods/tinker/tconstruct/items/tools/BattleSign.java b/mods/tinker/tconstruct/items/tools/BattleSign.java index 398174c4..4affd84e 100644 --- a/mods/tinker/tconstruct/items/tools/BattleSign.java +++ b/mods/tinker/tconstruct/items/tools/BattleSign.java @@ -8,25 +8,25 @@ import cpw.mods.fml.relauncher.SideOnly; public class BattleSign extends Weapon { - public BattleSign(int itemID) - { - super(itemID, 1); - this.setUnlocalizedName("InfiTool.Battlesign"); - } - - /*public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + public BattleSign(int itemID) { - if (!player.isSneaking()) - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + super(itemID, 1); + this.setUnlocalizedName("InfiTool.Battlesign"); + } + + /*public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + if (!player.isSneaking()) + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return stack; }*/ - - public String getToolName () - { - return "Battlesign"; - } - - /*public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + + public String getToolName () + { + return "Battlesign"; + } + + /*public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par7 == 0 || !player.isSneaking()) { @@ -96,64 +96,64 @@ public class BattleSign extends Weapon } }*/ - @Override - public Item getHeadItem () - { - return TContent.signHead; - } + @Override + public Item getHeadItem () + { + return TContent.signHead; + } - @Override - public Item getAccessoryItem () - { - return null; - } - - @SideOnly(Side.CLIENT) + @Override + public Item getAccessoryItem () + { + return null; + } + + @SideOnly(Side.CLIENT) @Override public int getRenderPasses (int metadata) { return 8; } - + @Override - public int getPartAmount() + public int getPartAmount () { return 2; } - - @Override - public void registerPartPaths (int index, String[] location) - { - headStrings.put(index, location[0]); - brokenPartStrings.put(index, location[1]); - handleStrings.put(index, location[2]); - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_battlesign_head"; - case 1: - return "_battlesign_head_broken"; - case 2: - return "_battlesign_handle"; - default: - return ""; - } - } - @Override - public String getEffectSuffix () - { - return "_battlesign_effect"; - } + @Override + public void registerPartPaths (int index, String[] location) + { + headStrings.put(index, location[0]); + brokenPartStrings.put(index, location[1]); + handleStrings.put(index, location[2]); + } - @Override - public String getDefaultFolder () - { - return "battlesign"; - } + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_battlesign_head"; + case 1: + return "_battlesign_head_broken"; + case 2: + return "_battlesign_handle"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_battlesign_effect"; + } + + @Override + public String getDefaultFolder () + { + return "battlesign"; + } } diff --git a/mods/tinker/tconstruct/items/tools/Battleaxe.java b/mods/tinker/tconstruct/items/tools/Battleaxe.java index 003b4e7c..52e8d778 100644 --- a/mods/tinker/tconstruct/items/tools/Battleaxe.java +++ b/mods/tinker/tconstruct/items/tools/Battleaxe.java @@ -154,7 +154,7 @@ public class Battleaxe extends HarvestTool } /* Battleaxe Specific */ - + @Override public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) { @@ -173,7 +173,7 @@ public class Battleaxe extends HarvestTool //player.rotationYaw += 1; //if (player.onGround) //{ - player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); //} return stack; } @@ -187,10 +187,10 @@ public class Battleaxe extends HarvestTool int boost = time / 100; if (boost > 2) boost = 2; - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, time*4, boost)); - player.addPotionEffect(new PotionEffect(Potion.jump.id, time*4, boost)); - player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, time*4, 0)); - player.addPotionEffect(new PotionEffect(Potion.hunger.id, time*2, 0)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, time * 4, boost)); + player.addPotionEffect(new PotionEffect(Potion.jump.id, time * 4, boost)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, time * 4, 0)); + player.addPotionEffect(new PotionEffect(Potion.hunger.id, time * 2, 0)); if (time > 5 && player.onGround) { player.addExhaustion(0.2F); diff --git a/mods/tinker/tconstruct/items/tools/Broadsword.java b/mods/tinker/tconstruct/items/tools/Broadsword.java index 3e961836..1b71d737 100644 --- a/mods/tinker/tconstruct/items/tools/Broadsword.java +++ b/mods/tinker/tconstruct/items/tools/Broadsword.java @@ -12,61 +12,61 @@ import cpw.mods.fml.relauncher.SideOnly; public class Broadsword extends Weapon { - public Broadsword(int itemID) - { - super(itemID, 4); - this.setUnlocalizedName("InfiTool.Broadsword"); - } + public Broadsword(int itemID) + { + super(itemID, 4); + this.setUnlocalizedName("InfiTool.Broadsword"); + } - @Override - public Item getHeadItem () - { - return TContent.swordBlade; - } + @Override + public Item getHeadItem () + { + return TContent.swordBlade; + } - @Override - public Item getAccessoryItem () - { - return TContent.wideGuard; - } - - public float getDurabilityModifier () - { - return 1.2f; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_sword_blade"; - case 1: - return "_sword_blade_broken"; - case 2: - return "_sword_handle"; - case 3: - return "_sword_accessory"; - default: - return ""; - } - } + @Override + public Item getAccessoryItem () + { + return TContent.wideGuard; + } - @Override - public String getEffectSuffix () - { - return "_sword_effect"; - } + public float getDurabilityModifier () + { + return 1.2f; + } - @Override - public String getDefaultFolder () - { - return "broadsword"; - } - - /*@Override - @SideOnly(Side.CLIENT) + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_sword_blade"; + case 1: + return "_sword_blade_broken"; + case 2: + return "_sword_handle"; + case 3: + return "_sword_accessory"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_sword_effect"; + } + + @Override + public String getDefaultFolder () + { + return "broadsword"; + } + + /*@Override + @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) { super.onUpdate(stack, world, entity, par4, par5); diff --git a/mods/tinker/tconstruct/items/tools/Chisel.java b/mods/tinker/tconstruct/items/tools/Chisel.java index fb6759ce..86044fd4 100644 --- a/mods/tinker/tconstruct/items/tools/Chisel.java +++ b/mods/tinker/tconstruct/items/tools/Chisel.java @@ -121,7 +121,7 @@ public class Chisel extends ToolCore return itemstack; } - + @Override @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) diff --git a/mods/tinker/tconstruct/items/tools/Cleaver.java b/mods/tinker/tconstruct/items/tools/Cleaver.java index 8073f366..06c04652 100644 --- a/mods/tinker/tconstruct/items/tools/Cleaver.java +++ b/mods/tinker/tconstruct/items/tools/Cleaver.java @@ -45,7 +45,7 @@ public class Cleaver extends Weapon { return TContent.toughRod; } - + @Override public int durabilityTypeAccessory () { @@ -128,13 +128,13 @@ public class Cleaver extends Weapon if (AbilityHelper.onLeftClickEntity(stack, player, entity, this)) { entity.hurtResistantTime += 7; - + if (entity instanceof EntityLiving) { EntityLiving living = (EntityLiving) entity; if (living.getHealth() <= 0) { - + } } //if (entity.getHealth() <= 0) diff --git a/mods/tinker/tconstruct/items/tools/Cutlass.java b/mods/tinker/tconstruct/items/tools/Cutlass.java index 5e61a1bc..4295989c 100644 --- a/mods/tinker/tconstruct/items/tools/Cutlass.java +++ b/mods/tinker/tconstruct/items/tools/Cutlass.java @@ -9,62 +9,62 @@ import net.minecraft.item.Item; public class Cutlass extends Weapon { - public Cutlass(int itemID) - { - super(itemID, 4); - this.setUnlocalizedName("InfiTool.Cutlass"); - } + public Cutlass(int itemID) + { + super(itemID, 4); + this.setUnlocalizedName("InfiTool.Cutlass"); + } - @Override - public Item getHeadItem () - { - return TContent.swordBlade; - } + @Override + public Item getHeadItem () + { + return TContent.swordBlade; + } - @Override - public Item getAccessoryItem () - { - return TContent.fullGuard; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_cutlass_blade"; - case 1: - return "_cutlass_blade_broken"; - case 2: - return "_cutlass_handle"; - case 3: - return "_cutlass_guard"; - default: - return ""; - } - } + @Override + public Item getAccessoryItem () + { + return TContent.fullGuard; + } - @Override - public String getEffectSuffix () - { - return "_cutlass_effect"; - } + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_cutlass_blade"; + case 1: + return "_cutlass_blade_broken"; + case 2: + return "_cutlass_handle"; + case 3: + return "_cutlass_guard"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_cutlass_effect"; + } + + @Override + public String getDefaultFolder () + { + return "cutlass"; + } - @Override - public String getDefaultFolder () - { - return "cutlass"; - } - @Override public int durabilityTypeAccessory () { return 1; } - + public void getSubItems (int id, CreativeTabs tab, List list) { - + } } diff --git a/mods/tinker/tconstruct/items/tools/Dagger.java b/mods/tinker/tconstruct/items/tools/Dagger.java index 65458781..2f0ce83f 100644 --- a/mods/tinker/tconstruct/items/tools/Dagger.java +++ b/mods/tinker/tconstruct/items/tools/Dagger.java @@ -44,14 +44,14 @@ public class Dagger extends Weapon itemstack.stackSize--; return itemstack; } - + @Override - public String[] toolCategories() + public String[] toolCategories () { return new String[] { "weapon", "melee", "throwing" }; } - - public EnumAction getItemUseAction(ItemStack par1ItemStack) + + public EnumAction getItemUseAction (ItemStack par1ItemStack) { return EnumAction.bow; } diff --git a/mods/tinker/tconstruct/items/tools/Excavator.java b/mods/tinker/tconstruct/items/tools/Excavator.java index 2466d30f..8136a3c7 100644 --- a/mods/tinker/tconstruct/items/tools/Excavator.java +++ b/mods/tinker/tconstruct/items/tools/Excavator.java @@ -242,7 +242,7 @@ public class Excavator extends HarvestTool { if (!stack.hasTagCompound()) return 1.0f; - + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); if (tags.getBoolean("Broken")) return 0.1f; @@ -259,13 +259,13 @@ public class Excavator extends HarvestTool mineSpeed += tags.getInteger("MiningSpeed2"); heads++; } - + if (tags.hasKey("MiningSpeedHandle")) { mineSpeed += tags.getInteger("MiningSpeedHandle"); heads++; } - + if (tags.hasKey("MiningSpeedExtra")) { mineSpeed += tags.getInteger("MiningSpeedExtra"); diff --git a/mods/tinker/tconstruct/items/tools/FryingPan.java b/mods/tinker/tconstruct/items/tools/FryingPan.java index da84e0b4..9c5bac98 100644 --- a/mods/tinker/tconstruct/items/tools/FryingPan.java +++ b/mods/tinker/tconstruct/items/tools/FryingPan.java @@ -40,12 +40,12 @@ public class FryingPan extends Weapon public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity mob) { if (mob.canAttackWithItem() && !mob.func_85031_j(player) && mob.hurtResistantTime < 14) - AbilityHelper.onLeftClickEntity(stack, player, mob, this); + AbilityHelper.onLeftClickEntity(stack, player, mob, this); return true; } @Override - public void onEntityDamaged(World world, EntityLiving player, Entity entity) + public void onEntityDamaged (World world, EntityLiving player, Entity entity) { world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "sounds.frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); } @@ -54,26 +54,26 @@ public class FryingPan extends Weapon { return "Frying Pan"; } - + public void getSubItems (int id, CreativeTabs tab, List list) { - super.getSubItems(id, tab, list); - - Item accessory = getAccessoryItem(); + super.getSubItems(id, tab, list); + + Item accessory = getAccessoryItem(); ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, 2), new ItemStack(getHandleItem(), 1, 16), null, "Bane of Pigs"); - + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); tags.setInteger("Modifiers", 0); - tags.setInteger("Attack", Integer.MAX_VALUE/100); - tags.setInteger("TotalDurability", Integer.MAX_VALUE/100); - tags.setInteger("BaseDurability", Integer.MAX_VALUE/100); - tags.setInteger("MiningSpeed", Integer.MAX_VALUE/100); - - int[] keyPair = new int[] { Integer.MAX_VALUE/100, 0, 0 }; - tags.setIntArray("Blaze", keyPair); - tags.setInteger("Necrotic", Integer.MAX_VALUE/100); - tags.setInteger("Effect1", 7); - + tags.setInteger("Attack", Integer.MAX_VALUE / 100); + tags.setInteger("TotalDurability", Integer.MAX_VALUE / 100); + tags.setInteger("BaseDurability", Integer.MAX_VALUE / 100); + tags.setInteger("MiningSpeed", Integer.MAX_VALUE / 100); + + int[] keyPair = new int[] { Integer.MAX_VALUE / 100, 0, 0 }; + tags.setIntArray("Blaze", keyPair); + tags.setInteger("Necrotic", Integer.MAX_VALUE / 100); + tags.setInteger("Effect1", 7); + tags.setBoolean("Built", true); list.add(tool); } diff --git a/mods/tinker/tconstruct/items/tools/Hatchet.java b/mods/tinker/tconstruct/items/tools/Hatchet.java index e1e9d2b3..03519f88 100644 --- a/mods/tinker/tconstruct/items/tools/Hatchet.java +++ b/mods/tinker/tconstruct/items/tools/Hatchet.java @@ -14,94 +14,94 @@ import cpw.mods.fml.relauncher.SideOnly; public class Hatchet extends HarvestTool { - public Hatchet(int itemID) - { - super(itemID, 3); - this.setUnlocalizedName("InfiTool.Axe"); - } - - @Override - protected Material[] getEffectiveMaterials () - { - return materials; - } + public Hatchet(int itemID) + { + super(itemID, 3); + this.setUnlocalizedName("InfiTool.Axe"); + } - @Override - protected String getHarvestType () - { - return "axe"; - } + @Override + protected Material[] getEffectiveMaterials () + { + return materials; + } - @Override - public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving player) - { - Block block = Block.blocksList[bID]; - if (block != null && block.blockMaterial == Material.leaves) - return false; + @Override + protected String getHarvestType () + { + return "axe"; + } - return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random); - } + @Override + public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving player) + { + Block block = Block.blocksList[bID]; + if (block != null && block.blockMaterial == Material.leaves) + return false; - static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin }; + return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random); + } - @Override - public Item getHeadItem () - { - return TContent.hatchetHead; - } + static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin }; - @Override - public Item getAccessoryItem () - { - return null; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderPasses (int metadata) - { - return 8; - } - - @Override - public int getPartAmount() - { - return 2; - } - - @Override - public void registerPartPaths (int index, String[] location) - { - headStrings.put(index, location[0]); - brokenPartStrings.put(index, location[1]); - handleStrings.put(index, location[2]); - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_axe_head"; - case 1: - return "_axe_head_broken"; - case 2: - return "_axe_handle"; - default: - return ""; - } - } + @Override + public Item getHeadItem () + { + return TContent.hatchetHead; + } - @Override - public String getEffectSuffix () - { - return "_axe_effect"; - } + @Override + public Item getAccessoryItem () + { + return null; + } - @Override - public String getDefaultFolder () - { - return "axe"; - } + @SideOnly(Side.CLIENT) + @Override + public int getRenderPasses (int metadata) + { + return 8; + } + + @Override + public int getPartAmount () + { + return 2; + } + + @Override + public void registerPartPaths (int index, String[] location) + { + headStrings.put(index, location[0]); + brokenPartStrings.put(index, location[1]); + handleStrings.put(index, location[2]); + } + + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_axe_head"; + case 1: + return "_axe_head_broken"; + case 2: + return "_axe_handle"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_axe_effect"; + } + + @Override + public String getDefaultFolder () + { + return "axe"; + } } diff --git a/mods/tinker/tconstruct/items/tools/Longsword.java b/mods/tinker/tconstruct/items/tools/Longsword.java index c120798b..27108e40 100644 --- a/mods/tinker/tconstruct/items/tools/Longsword.java +++ b/mods/tinker/tconstruct/items/tools/Longsword.java @@ -70,7 +70,7 @@ public class Longsword extends Weapon { player.addExhaustion(0.2F); player.setSprinting(true); - + float increase = (float) (0.02 * time + 0.2); if (increase > 0.56f) increase = 0.56f; diff --git a/mods/tinker/tconstruct/items/tools/Mattock.java b/mods/tinker/tconstruct/items/tools/Mattock.java index 0b0851c7..cc451f11 100644 --- a/mods/tinker/tconstruct/items/tools/Mattock.java +++ b/mods/tinker/tconstruct/items/tools/Mattock.java @@ -12,95 +12,95 @@ import net.minecraft.world.World; public class Mattock extends DualHarvestTool { - public Mattock(int itemID) - { - super(itemID, 3); - this.setUnlocalizedName("InfiTool.Mattock"); - } - - @Override - protected Material[] getEffectiveMaterials () - { - return axeMaterials; - } - - @Override - protected Material[] getEffectiveSecondaryMaterials () - { - return shovelMaterials; - } - - @Override - protected String getHarvestType () - { - return "axe"; - } - - @Override - protected String getSecondHarvestType () - { - return "shovel"; - } - - static Material[] axeMaterials = { Material.wood, Material.cactus, Material.pumpkin, Material.plants, Material.vine }; - static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay }; - - @Override - public Item getHeadItem () - { - return TContent.hatchetHead; - } - - @Override - public Item getAccessoryItem () - { - return TContent.shovelHead; - } - - public int durabilityTypeAccessory () - { - return 2; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_mattock_head"; - case 1: - return "_mattock_head_broken"; - case 2: - return "_mattock_handle"; - case 3: - return "_mattock_back"; - default: - return ""; - } - } - - @Override - public String getEffectSuffix () - { - return "_mattock_effect"; - } - - @Override - public String getDefaultFolder () - { - return "mattock"; - } - - /* Mattock specific */ - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + public Mattock(int itemID) { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - if (tags.getBoolean("Broken")) - return false; - + super(itemID, 3); + this.setUnlocalizedName("InfiTool.Mattock"); + } + + @Override + protected Material[] getEffectiveMaterials () + { + return axeMaterials; + } + + @Override + protected Material[] getEffectiveSecondaryMaterials () + { + return shovelMaterials; + } + + @Override + protected String getHarvestType () + { + return "axe"; + } + + @Override + protected String getSecondHarvestType () + { + return "shovel"; + } + + static Material[] axeMaterials = { Material.wood, Material.cactus, Material.pumpkin, Material.plants, Material.vine }; + static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay }; + + @Override + public Item getHeadItem () + { + return TContent.hatchetHead; + } + + @Override + public Item getAccessoryItem () + { + return TContent.shovelHead; + } + + public int durabilityTypeAccessory () + { + return 2; + } + + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_mattock_head"; + case 1: + return "_mattock_head_broken"; + case 2: + return "_mattock_handle"; + case 3: + return "_mattock_back"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_mattock_effect"; + } + + @Override + public String getDefaultFolder () + { + return "mattock"; + } + + /* Mattock specific */ + + @Override + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return false; + return AbilityHelper.hoeGround(stack, player, world, x, y, z, side, random); } } \ No newline at end of file diff --git a/mods/tinker/tconstruct/items/tools/Pickaxe.java b/mods/tinker/tconstruct/items/tools/Pickaxe.java index 437e6ffe..53c36ced 100644 --- a/mods/tinker/tconstruct/items/tools/Pickaxe.java +++ b/mods/tinker/tconstruct/items/tools/Pickaxe.java @@ -7,65 +7,65 @@ import net.minecraft.item.Item; public class Pickaxe extends HarvestTool { - public Pickaxe(int itemID) - { - super(itemID, 1); - this.setUnlocalizedName("InfiTool.Pickaxe"); - } - - @Override - protected String getHarvestType() - { - return "pickaxe"; - } + public Pickaxe(int itemID) + { + super(itemID, 1); + this.setUnlocalizedName("InfiTool.Pickaxe"); + } - @Override - protected Material[] getEffectiveMaterials() - { - return materials; - } + @Override + protected String getHarvestType () + { + return "pickaxe"; + } - static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits }; + @Override + protected Material[] getEffectiveMaterials () + { + return materials; + } - @Override - public Item getHeadItem () - { - return TContent.pickaxeHead; - } + static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil, Material.circuits }; - @Override - public Item getAccessoryItem () - { - return TContent.binding; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_pickaxe_head"; - case 1: - return "_pickaxe_head_broken"; - case 2: - return "_pickaxe_handle"; - case 3: - return "_pickaxe_accessory"; - default: - return ""; - } - } + @Override + public Item getHeadItem () + { + return TContent.pickaxeHead; + } - @Override - public String getEffectSuffix () - { - return "_pickaxe_effect"; - } + @Override + public Item getAccessoryItem () + { + return TContent.binding; + } - @Override - public String getDefaultFolder () - { - return "pickaxe"; - } + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_pickaxe_head"; + case 1: + return "_pickaxe_head_broken"; + case 2: + return "_pickaxe_handle"; + case 3: + return "_pickaxe_accessory"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_pickaxe_effect"; + } + + @Override + public String getDefaultFolder () + { + return "pickaxe"; + } } diff --git a/mods/tinker/tconstruct/items/tools/Rapier.java b/mods/tinker/tconstruct/items/tools/Rapier.java index 5b18b26e..bdb35f05 100644 --- a/mods/tinker/tconstruct/items/tools/Rapier.java +++ b/mods/tinker/tconstruct/items/tools/Rapier.java @@ -14,107 +14,107 @@ import net.minecraft.world.World; public class Rapier extends Weapon { - public Rapier(int itemID) - { - super(itemID, 2); - this.setUnlocalizedName("InfiTool.Rapier"); - } + public Rapier(int itemID) + { + super(itemID, 2); + this.setUnlocalizedName("InfiTool.Rapier"); + } - public EnumAction getItemUseAction (ItemStack par1ItemStack) - { - return EnumAction.none; - } + public EnumAction getItemUseAction (ItemStack par1ItemStack) + { + return EnumAction.none; + } - public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) - { - if (player.onGround) - { - player.addExhaustion(0.1f); - player.motionY += 0.32; + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + if (player.onGround) + { + player.addExhaustion(0.1f); + player.motionY += 0.32; float f = 0.5F; player.motionX = (double) (MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); player.motionZ = (double) (-MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f); - } - return stack; - } + } + return stack; + } - @Override - public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player) - { - //AbilityHelper.hitEntity(stack, mob, player, damageVsEntity); - //AbilityHelper.knockbackEntity(mob, 0.8f); - mob.motionY *= 0.8; - if (mob.hurtResistantTime > 18) - mob.hurtResistantTime -= 5; - return true; - } + @Override + public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player) + { + //AbilityHelper.hitEntity(stack, mob, player, damageVsEntity); + //AbilityHelper.knockbackEntity(mob, 0.8f); + mob.motionY *= 0.8; + if (mob.hurtResistantTime > 18) + mob.hurtResistantTime -= 5; + return true; + } - @Override - public float getDurabilityModifier () - { - return 0.7f; - } - - @Override - public float getDamageModifier () + @Override + public float getDurabilityModifier () + { + return 0.7f; + } + + @Override + public float getDamageModifier () { return 0.8f; } - /*public float chargeAttack () - { - return 1.0f; - }*/ - - public boolean pierceArmor () - { - return true; - } - - @Override - public Item getHeadItem () - { - return TContent.swordBlade; - } - - @Override - public Item getAccessoryItem () - { - return TContent.crossbar; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_rapier_blade"; - case 1: - return "_rapier_blade_broken"; - case 2: - return "_rapier_handle"; - case 3: - return "_rapier_accessory"; - default: - return ""; - } - } - - @Override - public String getEffectSuffix () - { - return "_rapier_effect"; - } - - @Override - public String getDefaultFolder () - { - return "rapier"; - } - - protected Material[] getEffectiveMaterials() + /*public float chargeAttack () { - return none; + return 1.0f; + }*/ + + public boolean pierceArmor () + { + return true; + } + + @Override + public Item getHeadItem () + { + return TContent.swordBlade; + } + + @Override + public Item getAccessoryItem () + { + return TContent.crossbar; + } + + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_rapier_blade"; + case 1: + return "_rapier_blade_broken"; + case 2: + return "_rapier_handle"; + case 3: + return "_rapier_accessory"; + default: + return ""; + } + } + + @Override + public String getEffectSuffix () + { + return "_rapier_effect"; + } + + @Override + public String getDefaultFolder () + { + return "rapier"; + } + + protected Material[] getEffectiveMaterials () + { + return none; } } diff --git a/mods/tinker/tconstruct/items/tools/Scythe.java b/mods/tinker/tconstruct/items/tools/Scythe.java index 5467fdbe..97f3ab68 100644 --- a/mods/tinker/tconstruct/items/tools/Scythe.java +++ b/mods/tinker/tconstruct/items/tools/Scythe.java @@ -21,87 +21,87 @@ import cpw.mods.fml.relauncher.SideOnly; public class Scythe extends Weapon { - public Scythe(int itemID) - { - super(itemID, 4); - this.setUnlocalizedName("InfiTool.Scythe"); - } - - /*@Override - protected String getHarvestType() - { - return "sword"; - }*/ + public Scythe(int itemID) + { + super(itemID, 4); + this.setUnlocalizedName("InfiTool.Scythe"); + } - @Override - protected Material[] getEffectiveMaterials() - { - return materials; - } + /*@Override + protected String getHarvestType() + { + return "sword"; + }*/ - static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.vine, Material.leaves }; + @Override + protected Material[] getEffectiveMaterials () + { + return materials; + } + + static Material[] materials = new Material[] { Material.web, Material.cactus, Material.pumpkin, Material.plants, Material.vine, Material.leaves }; + + @Override + public Item getHeadItem () + { + return TContent.scytheBlade; + } - @Override - public Item getHeadItem () - { - return TContent.scytheBlade; - } - @Override public Item getHandleItem () { return TContent.toughRod; } - @Override - public Item getAccessoryItem () - { - return TContent.toughBinding; - } + @Override + public Item getAccessoryItem () + { + return TContent.toughBinding; + } - @Override - public Item getExtraItem () - { - return TContent.toughRod; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderPasses (int metadata) - { - return 10; - } - - @Override - public int getPartAmount() - { - return 4; - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_scythe_head"; - case 1: - return "_scythe_head_broken"; - case 2: - return "_scythe_handle"; - case 3: - return "_scythe_binding"; - case 4: - return "_scythe_accessory"; - default: - return ""; - } - } - - public float getDurabilityModifier () - { - return 3.0f; - } + @Override + public Item getExtraItem () + { + return TContent.toughRod; + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderPasses (int metadata) + { + return 10; + } + + @Override + public int getPartAmount () + { + return 4; + } + + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_scythe_head"; + case 1: + return "_scythe_head_broken"; + case 2: + return "_scythe_handle"; + case 3: + return "_scythe_binding"; + case 4: + return "_scythe_accessory"; + default: + return ""; + } + } + + public float getDurabilityModifier () + { + return 3.0f; + } @Override public float getRepairCost () @@ -109,45 +109,45 @@ public class Scythe extends Weapon return 4.0f; } - @Override - public String getEffectSuffix () - { - return "_scythe_effect"; - } + @Override + public String getEffectSuffix () + { + return "_scythe_effect"; + } - @Override - public String getDefaultFolder () - { - return "scythe"; - } - - @Override - public int durabilityTypeAccessory () - { - return 1; - } + @Override + public String getDefaultFolder () + { + return "scythe"; + } - @Override - public int durabilityTypeExtra () - { - return 1; - } + @Override + public int durabilityTypeAccessory () + { + return 1; + } + + @Override + public int durabilityTypeExtra () + { + return 1; + } @Override public float getDamageModifier () { return 0.75f; } - - @Override - public String[] toolCategories() + + @Override + public String[] toolCategories () { return new String[] { "weapon", "melee", "harvest" }; } - - /* Scythe Specific */ - - @Override + + /* Scythe Specific */ + + @Override public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) { World world = player.worldObj; @@ -198,10 +198,9 @@ public class Scythe extends Weapon } } if (!world.isRemote) - world.playAuxSFX(2001, x, y, z, blockID + (meta << 12)); + world.playAuxSFX(2001, x, y, z, blockID + (meta << 12)); return super.onBlockStartBreak(stack, x, y, z, player); } - public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) { @@ -213,5 +212,5 @@ public class Scythe extends Weapon } return true; } - + } diff --git a/mods/tinker/tconstruct/items/tools/Shortbow.java b/mods/tinker/tconstruct/items/tools/Shortbow.java index d8e7f07a..af7f78a7 100644 --- a/mods/tinker/tconstruct/items/tools/Shortbow.java +++ b/mods/tinker/tconstruct/items/tools/Shortbow.java @@ -58,7 +58,7 @@ public class Shortbow extends BowBase { return TContent.toolRod; } - + @Override public Item getHandleItem () { @@ -93,7 +93,7 @@ public class Shortbow extends BowBase } } } - + @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) @@ -178,14 +178,17 @@ public class Shortbow extends BowBase } } } - + public String getBowstringName (int type) { switch (type) { - case 0: return ""; - case 1: return "\u00A7bEnchanted"; - default: return ""; + case 0: + return ""; + case 1: + return "\u00A7bEnchanted"; + default: + return ""; } //return TConstructRegistry.getMaterial(type).ability(); } diff --git a/mods/tinker/tconstruct/items/tools/Shovel.java b/mods/tinker/tconstruct/items/tools/Shovel.java index 57e8acac..8dae4c44 100644 --- a/mods/tinker/tconstruct/items/tools/Shovel.java +++ b/mods/tinker/tconstruct/items/tools/Shovel.java @@ -9,123 +9,123 @@ import cpw.mods.fml.relauncher.SideOnly; public class Shovel extends HarvestTool { - public Shovel(int itemID) - { - super(itemID, 2); - this.setUnlocalizedName("InfiTool.Shovel"); - } - - @Override - protected Material[] getEffectiveMaterials() - { - return materials; - } + public Shovel(int itemID) + { + super(itemID, 2); + this.setUnlocalizedName("InfiTool.Shovel"); + } - @Override - protected String getHarvestType() - { - return "shovel"; - } - - static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; + @Override + protected Material[] getEffectiveMaterials () + { + return materials; + } - @Override - public Item getHeadItem () - { - return TContent.shovelHead; - } + @Override + protected String getHarvestType () + { + return "shovel"; + } - @Override - public Item getAccessoryItem () - { - return null; - } - - @SideOnly(Side.CLIENT) - @Override - public int getRenderPasses (int metadata) - { - return 8; - } - - @Override - public int getPartAmount() - { - return 2; - } - - @Override - public void registerPartPaths (int index, String[] location) - { - headStrings.put(index, location[0]); - brokenPartStrings.put(index, location[1]); - handleStrings.put(index, location[2]); - } - - @Override - public String getIconSuffix (int partType) - { - switch (partType) - { - case 0: - return "_shovel_head"; - case 1: - return "_shovel_head_broken"; - case 2: - return "_shovel_handle"; - default: - return ""; - } - } + static Material[] materials = { Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay }; - @Override - public String getEffectSuffix () - { - return "_shovel_effect"; - } + @Override + public Item getHeadItem () + { + return TContent.shovelHead; + } - @Override - public String getDefaultFolder () - { - return "shovel"; - } - - /*@Override - public Icon getIcon (ItemStack stack, int renderPass) - { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + @Override + public Item getAccessoryItem () + { + return null; + } - if (renderPass == 0) // Handle - { - return (handleIcons.get(tags.getInteger("RenderHandle"))); - } + @SideOnly(Side.CLIENT) + @Override + public int getRenderPasses (int metadata) + { + return 8; + } - if (renderPass == 1) // Head - { - if (tags.getBoolean("Broken")) - return (brokenHeadIcons.get(tags.getInteger("RenderHead"))); - else - return (headIcons.get(tags.getInteger("RenderHead"))); - } + @Override + public int getPartAmount () + { + return 2; + } - if (renderPass == 2) - { - if (tags.hasKey("Effect1")) - return (effectIcons.get(tags.getInteger("Effect1"))); - } + @Override + public void registerPartPaths (int index, String[] location) + { + headStrings.put(index, location[0]); + brokenPartStrings.put(index, location[1]); + handleStrings.put(index, location[2]); + } - if (renderPass == 3) - { - if (tags.hasKey("Effect2")) - return (effectIcons.get(tags.getInteger("Effect2"))); - } + @Override + public String getIconSuffix (int partType) + { + switch (partType) + { + case 0: + return "_shovel_head"; + case 1: + return "_shovel_head_broken"; + case 2: + return "_shovel_handle"; + default: + return ""; + } + } - if (renderPass == 4) - { - if (tags.hasKey("Effect3")) - return (effectIcons.get(tags.getInteger("Effect3"))); - } + @Override + public String getEffectSuffix () + { + return "_shovel_effect"; + } - return TProxyClient.blankSprite; - }*/ + @Override + public String getDefaultFolder () + { + return "shovel"; + } + + /*@Override + public Icon getIcon (ItemStack stack, int renderPass) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + + if (renderPass == 0) // Handle + { + return (handleIcons.get(tags.getInteger("RenderHandle"))); + } + + if (renderPass == 1) // Head + { + if (tags.getBoolean("Broken")) + return (brokenHeadIcons.get(tags.getInteger("RenderHead"))); + else + return (headIcons.get(tags.getInteger("RenderHead"))); + } + + if (renderPass == 2) + { + if (tags.hasKey("Effect1")) + return (effectIcons.get(tags.getInteger("Effect1"))); + } + + if (renderPass == 3) + { + if (tags.hasKey("Effect2")) + return (effectIcons.get(tags.getInteger("Effect2"))); + } + + if (renderPass == 4) + { + if (tags.hasKey("Effect3")) + return (effectIcons.get(tags.getInteger("Effect3"))); + } + + return TProxyClient.blankSprite; + }*/ } diff --git a/mods/tinker/tconstruct/library/ActiveToolMod.java b/mods/tinker/tconstruct/library/ActiveToolMod.java index 8c292a44..41d44849 100644 --- a/mods/tinker/tconstruct/library/ActiveToolMod.java +++ b/mods/tinker/tconstruct/library/ActiveToolMod.java @@ -10,50 +10,50 @@ import net.minecraft.world.World; public class ActiveToolMod { - /* Updating */ - public void updateTool (ToolCore tool, ItemStack stack, World world, Entity entity) - { - - } - - /* Harvesting */ + /* Updating */ + public void updateTool (ToolCore tool, ItemStack stack, World world, Entity entity) + { + + } + + /* Harvesting */ public boolean beforeBlockBreak (ToolCore tool, ItemStack stack, int x, int y, int z, EntityLiving entity) { - return false; + return false; } - - public boolean afterBlockBreak() //Unfinished, not called + + public boolean afterBlockBreak () //Unfinished, not called { - return false; + return false; } - + /* Attacking */ - - public int baseAttackDamage(int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + + public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) { - return 0; + return 0; } - + //Calculated after sprinting and enchant bonuses - public float knockback(float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + public float knockback (float modKnockback, float currentKnockback, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) { - return 0f; + return 0f; } - - public int attackDamage(int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) + + public int attackDamage (int modDamage, int currentDamage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) { - return 0; + return 0; } - - public void lateAttackEntity() //Unfinished, not called + + public void lateAttackEntity () //Unfinished, not called { - + } - + /* Damage tool */ - public boolean damageTool(ItemStack stack, int damage, EntityLiving entity) + public boolean damageTool (ItemStack stack, int damage, EntityLiving entity) { - return false; + return false; } public boolean doesCriticalHit (ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLiving player, Entity entity) diff --git a/mods/tinker/tconstruct/library/TConstructRegistry.java b/mods/tinker/tconstruct/library/TConstructRegistry.java index 85b87395..8588f047 100644 --- a/mods/tinker/tconstruct/library/TConstructRegistry.java +++ b/mods/tinker/tconstruct/library/TConstructRegistry.java @@ -21,14 +21,14 @@ import net.minecraft.item.ItemStack; public class TConstructRegistry { public static TConstructRegistry instance = new TConstructRegistry(); - + /* Creative tabs */ public static TabTools toolTab; public static TabTools materialTab; public static TabTools blockTab; - + /* Items */ - + /** A directory of crafting items and tools used by the mod. * * Tools: @@ -47,37 +47,37 @@ public class TConstructRegistry * bowstring, fletching, arrowhead */ public static HashMap itemDirectory = new HashMap(); - + /** Adds an item to the directory * * @param name Associates the name with the stack * @param itemstack The stack to add to the directory */ - - public static void addItemToDirectory(String name, Item itemstack) + + public static void addItemToDirectory (String name, Item itemstack) { Item add = itemDirectory.get(name); if (add != null) - System.out.println("[TCon API] "+name+" is already present in the Item directory"); - + System.out.println("[TCon API] " + name + " is already present in the Item directory"); + itemDirectory.put(name, itemstack); } - + /** Retrieves an itemstack from the directory * * @param name The name of the item to get * @return Item associated with the name, or null if not present. */ - - public static Item getItem(String name) + + public static Item getItem (String name) { Item ret = itemDirectory.get(name); if (ret == null) - System.out.println("[TCon API] Could not find "+name+" in the Item directory"); - + System.out.println("[TCon API] Could not find " + name + " in the Item directory"); + return ret; } - + /** A directory of ItemStacks. Contains mostly crafting items * * Materials: @@ -93,45 +93,46 @@ public class TConstructRegistry * knifeBlade, chiselHead, toughRod, toughBinding, largePlate, broadAxeHead, scytheHead, excavatorHead, largeBlade, hammerHead, fullGuard, bowstring */ static HashMap itemstackDirectory = new HashMap(); - + /** Adds an itemstack to the directory * * @param name Associates the name with the stack * @param itemstack The stack to add to the directory */ - - public static void addItemStackToDirectory(String name, ItemStack itemstack) + + public static void addItemStackToDirectory (String name, ItemStack itemstack) { ItemStack add = itemstackDirectory.get(name); if (add != null) - System.out.println("[TCon API] "+name+" is already present in the ItemStack directory"); - + System.out.println("[TCon API] " + name + " is already present in the ItemStack directory"); + itemstackDirectory.put(name, itemstack); } - + /** Retrieves an itemstack from the directory * * @param name The name of the item to get * @return Item associated with the name, or null if not present. */ - - public static ItemStack getItemStack(String name) + + public static ItemStack getItemStack (String name) { ItemStack ret = itemstackDirectory.get(name); if (ret == null) - System.out.println("[TCon API] Could not find "+name+" in the ItemStack directory"); - + System.out.println("[TCon API] Could not find " + name + " in the ItemStack directory"); + return ret; } + public static ArrayList tools = new ArrayList(20); - + //Parts - + /** List: Item ID, metadata, material ID * ItemStack: Output. Ex: Cactus Binding */ public static HashMap patternPartMapping = new HashMap(); - + /** Maps an item and a material ID to an output part * * @param patternID ID to check against @@ -139,31 +140,31 @@ public class TConstructRegistry * @param materialID Material that goes with the item * @param output The resulting part */ - public static void addPartMapping(int patternID, int patternMeta, int materialID, ItemStack output) + public static void addPartMapping (int patternID, int patternMeta, int materialID, ItemStack output) { patternPartMapping.put(Arrays.asList(patternID, patternMeta, materialID), output); } - - public static ItemStack getPartMapping(int itemID, int metadata, int materialID) + + public static ItemStack getPartMapping (int itemID, int metadata, int materialID) { ItemStack stack = patternPartMapping.get(Arrays.asList(itemID, metadata, materialID)); if (stack != null) return stack.copy(); return null; } - + //Tools - + /** Internal tool mapping, used for adding textures * * @param tool */ - + public static void addToolMapping (ToolCore tool) { tools.add(tool); } - + /** Internal tool mapping, used for adding textures * * @return List of tools @@ -173,7 +174,7 @@ public class TConstructRegistry { return tools; } - + /** Registers a tool to its crafting parts. * If an output is registered multiple times the parts are added to the recipe's input list * Valid part amounts are 1, 2, and 4. Part counts of 1 and 2 assume a Tool Rod as a handle. @@ -183,19 +184,19 @@ public class TConstructRegistry * @param output The ToolCore to craft * @param parts Pieces to make the tool with */ - public static void addToolRecipe(ToolCore output, Item... parts) + public static void addToolRecipe (ToolCore output, Item... parts) { ToolBuilder tb = ToolBuilder.instance; if (parts.length < 1 || parts.length > 4 || parts.length == 3) System.out.println("[TCon API] Wrong amount of items to craft into a tool"); - - tb.addToolRecipe(output, parts); + + tb.addToolRecipe(output, parts); } //Materials public static HashMap toolMaterials = new HashMap(40); public static HashMap toolMaterialStrings = new HashMap(40); - + /** Adds a tool material to the registry * * @param materialID Unique ID, stored for each part @@ -210,8 +211,8 @@ public class TConstructRegistry * @param stonebound Amount of Stonebound to put on the tool. Negative numbers are Spiny. */ - public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, - float stonebound, String style, String ability) + public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound, + String style, String ability) { ToolMaterial mat = toolMaterials.get(materialID); if (mat == null) @@ -223,7 +224,7 @@ public class TConstructRegistry else throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName); } - + /** Adds a tool material to the registry * * @param materialID Unique ID, stored for each part @@ -252,15 +253,15 @@ public class TConstructRegistry else throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName); } - + /** Adds a tool material to the registry * * @param materialID Unique ID, stored for each part * @exception materialID must be unique * @param material Complete tool material to add. Uses the name in the material for lookup purposes. */ - - public static void addtoolMaterial(int materialID, ToolMaterial material) + + public static void addtoolMaterial (int materialID, ToolMaterial material) { ToolMaterial mat = toolMaterials.get(materialID); if (mat == null) @@ -271,7 +272,7 @@ public class TConstructRegistry else throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName); } - + /** Looks up a tool material by ID * * @param key The ID to look up @@ -282,7 +283,7 @@ public class TConstructRegistry { return (toolMaterials.get(key)); } - + /** Looks up a tool material by name * * @param key the name to look up @@ -293,11 +294,11 @@ public class TConstructRegistry { return (toolMaterialStrings.get(key)); } - + //Bow materials public static HashMap bowMaterials = new HashMap(40); - - public static void addBowMaterial(int materialID, int durability, int drawSpeed, float speedMax) + + public static void addBowMaterial (int materialID, int durability, int drawSpeed, float speedMax) { BowMaterial mat = bowMaterials.get(materialID); if (mat == null) @@ -308,20 +309,20 @@ public class TConstructRegistry else throw new IllegalArgumentException("[TCon API] Bow Material ID " + materialID + " is already occupied"); } - - public static boolean validBowMaterial(int materialID) + + public static boolean validBowMaterial (int materialID) { return bowMaterials.containsKey(materialID); } - - public static BowMaterial getBowMaterial(int materialID) + + public static BowMaterial getBowMaterial (int materialID) { return bowMaterials.get(materialID); } - + public static HashMap arrowMaterials = new HashMap(40); - - public static void addArrowMaterial(int materialID, float mass, float breakChance, float accuracy) + + public static void addArrowMaterial (int materialID, float mass, float breakChance, float accuracy) { ArrowMaterial mat = arrowMaterials.get(materialID); if (mat == null) @@ -332,39 +333,39 @@ public class TConstructRegistry else throw new IllegalArgumentException("[TCon API] Arrow Material ID " + materialID + " is already occupied"); } - - public static boolean validArrowMaterial(int materialID) + + public static boolean validArrowMaterial (int materialID) { return arrowMaterials.containsKey(materialID); } - - public static ArrowMaterial getArrowMaterial(int materialID) + + public static ArrowMaterial getArrowMaterial (int materialID) { return arrowMaterials.get(materialID); } //Custom materials - bowstrings, fletching, etc public static ArrayList customMaterials = new ArrayList(); - - public static void addCustomMaterial(CustomMaterial mat) + + public static void addCustomMaterial (CustomMaterial mat) { if (mat != null) customMaterials.add(mat); } - - public static void addBowstringMaterial(int materialID, int value, ItemStack input, ItemStack craftingMaterial, float durability, float drawSpeed, float flightSpeed) + + public static void addBowstringMaterial (int materialID, int value, ItemStack input, ItemStack craftingMaterial, float durability, float drawSpeed, float flightSpeed) { BowstringMaterial mat = new BowstringMaterial(materialID, value, input, craftingMaterial, durability, drawSpeed, flightSpeed); customMaterials.add(mat); } - - public static void addFletchingMaterial(int materialID, int value, ItemStack input, ItemStack craftingMaterial, float accuracy, float breakChance, float mass) + + public static void addFletchingMaterial (int materialID, int value, ItemStack input, ItemStack craftingMaterial, float accuracy, float breakChance, float mass) { FletchingMaterial mat = new FletchingMaterial(materialID, value, input, craftingMaterial, accuracy, breakChance, mass); customMaterials.add(mat); } - - public static CustomMaterial getCustomMaterial(int materialID, Class clazz) + + public static CustomMaterial getCustomMaterial (int materialID, Class clazz) { for (CustomMaterial mat : customMaterials) { @@ -373,8 +374,8 @@ public class TConstructRegistry } return null; } - - public static CustomMaterial getCustomMaterial(ItemStack input, Class clazz) + + public static CustomMaterial getCustomMaterial (ItemStack input, Class clazz) { for (CustomMaterial mat : customMaterials) { @@ -383,7 +384,7 @@ public class TConstructRegistry } return null; } - + /*public static CustomMaterial getCustomMaterial(ItemStack input, ItemStack pattern) { for (CustomMaterial mat : customMaterials) @@ -393,7 +394,7 @@ public class TConstructRegistry } return null; }*/ - + /*public static ItemStack craftBowString(ItemStack stack) { if (stack.stackSize < 3) @@ -461,7 +462,7 @@ public class TConstructRegistry return null; } } - + public static Detailing getChiselDetailing () { return instance.chiselDetailing(); @@ -484,11 +485,12 @@ public class TConstructRegistry } public static ArrayList activeModifiers = new ArrayList(); - public static void registerActiveToolMod(ActiveToolMod mod) + + public static void registerActiveToolMod (ActiveToolMod mod) { - activeModifiers.add(mod); + activeModifiers.add(mod); } - + /* Used to determine how blocks are laid out in the drawbridge * 0: Metadata has to match * 1: Metadata has no meaning @@ -664,12 +666,12 @@ public class TConstructRegistry drawbridgeState[Block.railActivator.blockID] = 4; drawbridgeState[Block.dropper.blockID] = 3; } - + static { initializeDrawbridgeState(); } - + /** Default Material Index * 0: Wood * 1: Stone diff --git a/mods/tinker/tconstruct/library/blocks/InventoryBlock.java b/mods/tinker/tconstruct/library/blocks/InventoryBlock.java index ca33d477..7a96f64b 100644 --- a/mods/tinker/tconstruct/library/blocks/InventoryBlock.java +++ b/mods/tinker/tconstruct/library/blocks/InventoryBlock.java @@ -27,11 +27,16 @@ public abstract class InventoryBlock extends BlockContainer } /* Logic backend */ - public TileEntity createNewTileEntity (World var1) - { return null; } - public abstract TileEntity createTileEntity(World world, int metadata); - public abstract Integer getGui(World world, int x, int y, int z, EntityPlayer entityplayer); - public abstract Object getModInstance(); + public TileEntity createNewTileEntity (World var1) + { + return null; + } + + public abstract TileEntity createTileEntity (World world, int metadata); + + public abstract Integer getGui (World world, int x, int y, int z, EntityPlayer entityplayer); + + public abstract Object getModInstance (); @Override public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) @@ -104,9 +109,8 @@ public abstract class InventoryBlock extends BlockContainer } /* Placement */ - - public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) + public int onBlockPlaced (World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int meta) { TileEntity logic = world.getBlockTileEntity(x, y, z); if (logic instanceof IFacingLogic) diff --git a/mods/tinker/tconstruct/library/blocks/InventoryLogic.java b/mods/tinker/tconstruct/library/blocks/InventoryLogic.java index 3f345680..d83a565a 100644 --- a/mods/tinker/tconstruct/library/blocks/InventoryLogic.java +++ b/mods/tinker/tconstruct/library/blocks/InventoryLogic.java @@ -15,49 +15,48 @@ import net.minecraft.world.World; * Abstract to avoid instantiation */ -public abstract class InventoryLogic extends TileEntity - implements IInventory +public abstract class InventoryLogic extends TileEntity implements IInventory { - protected ItemStack[] inventory; - protected String invName; - - public InventoryLogic(int invSize) - { - inventory = new ItemStack[invSize]; - } - - /* Inventory management */ - - @Override - public ItemStack getStackInSlot(int slot) + protected ItemStack[] inventory; + protected String invName; + + public InventoryLogic(int invSize) + { + inventory = new ItemStack[invSize]; + } + + /* Inventory management */ + + @Override + public ItemStack getStackInSlot (int slot) { return inventory[slot]; } - - public boolean isStackInSlot(int slot) + + public boolean isStackInSlot (int slot) { - return inventory[slot] != null; + return inventory[slot] != null; } - + @Override - public int getSizeInventory() + public int getSizeInventory () { return inventory.length; } - - @Override - public int getInventoryStackLimit () - { - return 64; - } - - public boolean canDropInventorySlot(int slot) - { - return true; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) + + @Override + public int getInventoryStackLimit () + { + return 64; + } + + public boolean canDropInventorySlot (int slot) + { + return true; + } + + @Override + public void setInventorySlotContents (int slot, ItemStack itemstack) { inventory[slot] = itemstack; if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) @@ -65,9 +64,9 @@ public abstract class InventoryLogic extends TileEntity itemstack.stackSize = getInventoryStackLimit(); } } - - @Override - public ItemStack decrStackSize(int slot, int quantity) + + @Override + public ItemStack decrStackSize (int slot, int quantity) { if (inventory[slot] != null) { @@ -89,24 +88,24 @@ public abstract class InventoryLogic extends TileEntity return null; } } - - /* Supporting methods */ - @Override - public boolean isUseableByPlayer(EntityPlayer entityplayer) + + /* Supporting methods */ + @Override + public boolean isUseableByPlayer (EntityPlayer entityplayer) { if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this) return false; - + else - return entityplayer.getDistance((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64D; - + return entityplayer.getDistance((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D; + } - - public abstract Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z); - - /* NBT */ - @Override - public void readFromNBT(NBTTagCompound tags) + + public abstract Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z); + + /* NBT */ + @Override + public void readFromNBT (NBTTagCompound tags) { super.readFromNBT(tags); this.invName = tags.getString("InvName"); @@ -114,7 +113,7 @@ public abstract class InventoryLogic extends TileEntity inventory = new ItemStack[getSizeInventory()]; for (int iter = 0; iter < nbttaglist.tagCount(); iter++) { - NBTTagCompound tagList = (NBTTagCompound)nbttaglist.tagAt(iter); + NBTTagCompound tagList = (NBTTagCompound) nbttaglist.tagAt(iter); byte slotID = tagList.getByte("Slot"); if (slotID >= 0 && slotID < inventory.length) { @@ -123,8 +122,8 @@ public abstract class InventoryLogic extends TileEntity } } - @Override - public void writeToNBT(NBTTagCompound tags) + @Override + public void writeToNBT (NBTTagCompound tags) { super.writeToNBT(tags); if (invName != null) @@ -135,7 +134,7 @@ public abstract class InventoryLogic extends TileEntity if (inventory[iter] != null) { NBTTagCompound tagList = new NBTTagCompound(); - tagList.setByte("Slot", (byte)iter); + tagList.setByte("Slot", (byte) iter); inventory[iter].writeToNBT(tagList); nbttaglist.appendTag(tagList); } @@ -143,32 +142,41 @@ public abstract class InventoryLogic extends TileEntity tags.setTag("Items", nbttaglist); } - - /* Default implementations of hardly used methods */ - public ItemStack getStackInSlotOnClosing (int slot) { return null; } - public void openChest () {} - public void closeChest () {} - - protected abstract String getDefaultName(); - - public String getInvName() + + /* Default implementations of hardly used methods */ + public ItemStack getStackInSlotOnClosing (int slot) + { + return null; + } + + public void openChest () + { + } + + public void closeChest () + { + } + + protected abstract String getDefaultName (); + + public String getInvName () { return this.isInvNameLocalized() ? this.invName : getDefaultName(); } - public boolean isInvNameLocalized() + public boolean isInvNameLocalized () { return this.invName != null && this.invName.length() > 0; } - @Override - public boolean isStackValidForSlot (int slot, ItemStack itemstack) - { - if (slot < getSizeInventory()) - { - if (inventory[slot] == null || itemstack.stackSize + inventory[slot].stackSize <= getInventoryStackLimit()) - return true; - } - return false; - } + @Override + public boolean isStackValidForSlot (int slot, ItemStack itemstack) + { + if (slot < getSizeInventory()) + { + if (inventory[slot] == null || itemstack.stackSize + inventory[slot].stackSize <= getInventoryStackLimit()) + return true; + } + return false; + } } diff --git a/mods/tinker/tconstruct/library/crafting/AlloyMix.java b/mods/tinker/tconstruct/library/crafting/AlloyMix.java index 3aa6da69..a7bc1580 100644 --- a/mods/tinker/tconstruct/library/crafting/AlloyMix.java +++ b/mods/tinker/tconstruct/library/crafting/AlloyMix.java @@ -8,86 +8,86 @@ import net.minecraftforge.liquids.LiquidStack; public class AlloyMix { - public final LiquidStack result; - public final List mixers; + public final LiquidStack result; + public final List mixers; - public AlloyMix(LiquidStack output, List inputs) - { - result = output; - mixers = inputs; - } + public AlloyMix(LiquidStack output, List inputs) + { + result = output; + mixers = inputs; + } - /*public boolean matches(List liquids) - { - ArrayList list = new ArrayList(mixers); - return false; - }*/ + /*public boolean matches(List liquids) + { + ArrayList list = new ArrayList(mixers); + return false; + }*/ - public LiquidStack mix (ArrayList liquids) - { - ArrayList copyMix = new ArrayList(mixers); - ArrayList effectiveAmount = new ArrayList(); + public LiquidStack mix (ArrayList liquids) + { + ArrayList copyMix = new ArrayList(mixers); + ArrayList effectiveAmount = new ArrayList(); - for (int i = 0; i < liquids.size(); i++) - { - LiquidStack liquid = liquids.get(i); - Iterator iter = copyMix.iterator(); - while (iter.hasNext()) - { - LiquidStack mixer = (LiquidStack) iter.next(); - if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) - { - int eAmt = liquid.amount / mixer.amount; - effectiveAmount.add(eAmt); - copyMix.remove(mixer); - //inputs.add(liquid); - break; - } - } - } - //} + for (int i = 0; i < liquids.size(); i++) + { + LiquidStack liquid = liquids.get(i); + Iterator iter = copyMix.iterator(); + while (iter.hasNext()) + { + LiquidStack mixer = (LiquidStack) iter.next(); + if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) + { + int eAmt = liquid.amount / mixer.amount; + effectiveAmount.add(eAmt); + copyMix.remove(mixer); + //inputs.add(liquid); + break; + } + } + } + //} - if (copyMix.size() > 0) - return null; + if (copyMix.size() > 0) + return null; - //Remove old liquids - int low = getLowestAmount(effectiveAmount); - ArrayList copyMix2 = new ArrayList(mixers); + //Remove old liquids + int low = getLowestAmount(effectiveAmount); + ArrayList copyMix2 = new ArrayList(mixers); - for (int i = 0; i < liquids.size(); i++) - { - LiquidStack liquid = liquids.get(i); - Iterator iter = copyMix2.iterator(); - while (iter.hasNext()) - { - LiquidStack mixer = (LiquidStack) iter.next(); - if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) - { - int eAmt = low * mixer.amount; - liquid.amount -= eAmt; - if (liquid.amount <= 0) - { - liquids.remove(liquid); - i--; - } - copyMix2.remove(mixer); - break; - } - } - } + for (int i = 0; i < liquids.size(); i++) + { + LiquidStack liquid = liquids.get(i); + Iterator iter = copyMix2.iterator(); + while (iter.hasNext()) + { + LiquidStack mixer = (LiquidStack) iter.next(); + if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) + { + int eAmt = low * mixer.amount; + liquid.amount -= eAmt; + if (liquid.amount <= 0) + { + liquids.remove(liquid); + i--; + } + copyMix2.remove(mixer); + break; + } + } + } - return new LiquidStack(result.itemID, result.amount * low, result.itemMeta); - } + return new LiquidStack(result.itemID, result.amount * low, result.itemMeta); + } - int getLowestAmount (ArrayList list) - { - int frist = (Integer) list.get(0); //FRIST!!! - for (int i = 1; i < list.size(); i++) - { - int compare = (Integer) list.get(i); - if (frist > compare) - frist = compare; - } - return frist; - } + int getLowestAmount (ArrayList list) + { + int frist = (Integer) list.get(0); //FRIST!!! + for (int i = 1; i < list.size(); i++) + { + int compare = (Integer) list.get(i); + if (frist > compare) + frist = compare; + } + return frist; + } } diff --git a/mods/tinker/tconstruct/library/crafting/CastingRecipe.java b/mods/tinker/tconstruct/library/crafting/CastingRecipe.java index 2d50ccf2..b3dcfea8 100644 --- a/mods/tinker/tconstruct/library/crafting/CastingRecipe.java +++ b/mods/tinker/tconstruct/library/crafting/CastingRecipe.java @@ -5,33 +5,34 @@ import net.minecraftforge.liquids.LiquidStack; public class CastingRecipe { - public ItemStack output; - public LiquidStack castingMetal; - public ItemStack cast; - public boolean consumeCast; - public int coolTime; - - public CastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay) - { - castingMetal = metal; - this.cast = cast; - output = replacement; - consumeCast = consume; - coolTime = delay; - } - - public boolean matches(LiquidStack metal, ItemStack inputCast) - { - if (castingMetal.isLiquidEqual(metal) && ( (cast != null && cast.getItemDamage() == Short.MAX_VALUE && inputCast.getItem() == cast.getItem()) || ItemStack.areItemStacksEqual(this.cast, inputCast) )) - { - return true; - } - else - return false; - } - - public ItemStack getResult() - { - return output.copy(); - } + public ItemStack output; + public LiquidStack castingMetal; + public ItemStack cast; + public boolean consumeCast; + public int coolTime; + + public CastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay) + { + castingMetal = metal; + this.cast = cast; + output = replacement; + consumeCast = consume; + coolTime = delay; + } + + public boolean matches (LiquidStack metal, ItemStack inputCast) + { + if (castingMetal.isLiquidEqual(metal) + && ((cast != null && cast.getItemDamage() == Short.MAX_VALUE && inputCast.getItem() == cast.getItem()) || ItemStack.areItemStacksEqual(this.cast, inputCast))) + { + return true; + } + else + return false; + } + + public ItemStack getResult () + { + return output.copy(); + } } \ No newline at end of file diff --git a/mods/tinker/tconstruct/library/crafting/DryingRackRecipes.java b/mods/tinker/tconstruct/library/crafting/DryingRackRecipes.java index 3491f17b..14658211 100644 --- a/mods/tinker/tconstruct/library/crafting/DryingRackRecipes.java +++ b/mods/tinker/tconstruct/library/crafting/DryingRackRecipes.java @@ -9,12 +9,12 @@ import net.minecraft.item.ItemStack; public class DryingRackRecipes { public static ArrayList recipes = new ArrayList(); - - public static void addDryingRecipe(Object input, int time, Object output) + + public static void addDryingRecipe (Object input, int time, Object output) { ItemStack inputItem = null; ItemStack outputItem = null; - + if (input instanceof ItemStack) inputItem = (ItemStack) input; else if (input instanceof Item) @@ -22,8 +22,8 @@ public class DryingRackRecipes else if (input instanceof Block) inputItem = new ItemStack((Block) input, 1, 0); else - throw new RuntimeException("Drying recipe input is invalid!"); - + throw new RuntimeException("Drying recipe input is invalid!"); + if (output instanceof ItemStack) outputItem = (ItemStack) output; else if (output instanceof Item) @@ -32,50 +32,51 @@ public class DryingRackRecipes outputItem = new ItemStack((Block) output, 1, 0); else throw new RuntimeException("Drying recipe output is invalid!"); - + recipes.add(new DryingRecipe(inputItem, time, outputItem)); } - - public static int getDryingTime(ItemStack input) + + public static int getDryingTime (ItemStack input) { for (DryingRecipe r : recipes) { if (r.matches(input)) return r.time; } - + return -1; } - - public static ItemStack getDryingResult(ItemStack input) + + public static ItemStack getDryingResult (ItemStack input) { for (DryingRecipe r : recipes) { if (r.matches(input)) return r.getResult(); } - + return null; } - + static class DryingRecipe { public final int time; public final ItemStack input; public final ItemStack result; + DryingRecipe(ItemStack input, int time, ItemStack result) { this.time = time; this.input = input; this.result = result; } - - public boolean matches(ItemStack input) + + public boolean matches (ItemStack input) { return ItemStack.areItemStacksEqual(this.input, input); } - - public ItemStack getResult() + + public ItemStack getResult () { return result.copy(); } diff --git a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java index 53d9bca3..2024cd9e 100644 --- a/mods/tinker/tconstruct/library/crafting/LiquidCasting.java +++ b/mods/tinker/tconstruct/library/crafting/LiquidCasting.java @@ -49,8 +49,8 @@ public class LiquidCasting { addCastingRecipe(output, metal, null, false, delay); } - - public void addCustomCastingRecipe(CastingRecipe recipe) + + public void addCustomCastingRecipe (CastingRecipe recipe) { casts.add(recipe); } @@ -80,9 +80,9 @@ public class LiquidCasting } return null; } - - //Getter for public viewing - public ArrayList getCastingRecipes() + + //Getter for public viewing + public ArrayList getCastingRecipes () { return casts; } diff --git a/mods/tinker/tconstruct/library/crafting/PatternBuilder.java b/mods/tinker/tconstruct/library/crafting/PatternBuilder.java index dc5f5df9..c73e51c3 100644 --- a/mods/tinker/tconstruct/library/crafting/PatternBuilder.java +++ b/mods/tinker/tconstruct/library/crafting/PatternBuilder.java @@ -18,168 +18,168 @@ import net.minecraftforge.event.Event.Result; public class PatternBuilder { - public static PatternBuilder instance = new PatternBuilder(); - //Map items to their parts with a hashmap - public List materials = new ArrayList(); - public HashMap materialSets = new HashMap(); + public static PatternBuilder instance = new PatternBuilder(); + //Map items to their parts with a hashmap + public List materials = new ArrayList(); + public HashMap materialSets = new HashMap(); - //We could use IRecipe if it wasn't tied to InventoryCrafting - public List toolPatterns = new ArrayList(); + //We could use IRecipe if it wasn't tied to InventoryCrafting + public List toolPatterns = new ArrayList(); - /* Register methods */ - public void registerMaterial (ItemStack material, int value, String key) - { - materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); - } + /* Register methods */ + public void registerMaterial (ItemStack material, int value, String key) + { + materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); + } - public void registerMaterialSet (String key, ItemStack shard, ItemStack rod, int materialID) - { - materialSets.put(key, new MaterialSet(shard, rod, materialID)); - materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); - } + public void registerMaterialSet (String key, ItemStack shard, ItemStack rod, int materialID) + { + materialSets.put(key, new MaterialSet(shard, rod, materialID)); + materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); + } - public void registerFullMaterial (ItemStack material, int value, String key, ItemStack shard, ItemStack rod, int materialID) - { - materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); - materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); - materialSets.put(key, new MaterialSet(shard, rod, materialID)); - } + public void registerFullMaterial (ItemStack material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); + materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); + materialSets.put(key, new MaterialSet(shard, rod, materialID)); + } - public void addToolPattern (IPattern item) - { - toolPatterns.add(item); - } + public void addToolPattern (IPattern item) + { + toolPatterns.add(item); + } - /* Build tool parts from patterns */ - public ItemStack[] getToolPart (ItemStack material, ItemStack pattern, ItemStack otherPattern) - { - if (material != null && pattern != null) - { - PartBuilderEvent.NormalPart event = new PartBuilderEvent.NormalPart(material, pattern, otherPattern); - MinecraftForge.EVENT_BUS.post(event); - - if (event.getResult() == Result.ALLOW) - { - return event.getResultStacks(); - } - else if (event.getResult() == Result.DENY) - { - return null; - } - - ItemKey key = getItemKey(material); - if (key != null) - { - MaterialSet mat = (MaterialSet) materialSets.get(key.key); - ItemStack toolPart = getMatchingPattern(pattern, material, mat); + /* Build tool parts from patterns */ + public ItemStack[] getToolPart (ItemStack material, ItemStack pattern, ItemStack otherPattern) + { + if (material != null && pattern != null) + { + PartBuilderEvent.NormalPart event = new PartBuilderEvent.NormalPart(material, pattern, otherPattern); + MinecraftForge.EVENT_BUS.post(event); - if (toolPart != null) - { - int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern); - int totalMaterial = key.value * material.stackSize; + if (event.getResult() == Result.ALLOW) + { + return event.getResultStacks(); + } + else if (event.getResult() == Result.DENY) + { + return null; + } - if (totalMaterial < patternValue) // Not enough material - return null; + ItemKey key = getItemKey(material); + if (key != null) + { + MaterialSet mat = (MaterialSet) materialSets.get(key.key); + ItemStack toolPart = getMatchingPattern(pattern, material, mat); - else if (patternValue == key.value) //Material only - return new ItemStack[] { toolPart, null }; + if (toolPart != null) + { + int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern); + int totalMaterial = key.value * material.stackSize; - else - { - if (patternValue % 2 == 1) - { - return new ItemStack[] { toolPart, mat.shard.copy() }; //Material + shard - } - else - return new ItemStack[] { toolPart, null }; - } - /*if ( patternValue < totalMaterial ) - { - if (otherPattern != null) - { - int otherValue = ((IPattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage()); - if (patternValue + otherValue <= key.value) - { - ItemStack otherPart = getMatchingPattern(otherPattern, mat); - return new ItemStack[] { toolPart, otherPart }; //Material + Material - } - } - } - - else if ( patternValue == key.value ) - return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), null }; //Material only - - else - return null; //Not a valid match*/ - } - } - } - return null; - } + if (totalMaterial < patternValue) // Not enough material + return null; - public int getPartID (ItemStack material) - { - if (material != null) - { - ItemKey key = getItemKey(material); - if (key != null) - { - MaterialSet set = (MaterialSet) materialSets.get(key.key); - return set.materialID; - } - } - return Short.MAX_VALUE; - } + else if (patternValue == key.value) //Material only + return new ItemStack[] { toolPart, null }; - public int getPartValue (ItemStack material) - { - if (material != null) - { - ItemKey key = getItemKey(material); - if (key != null) - return key.value; - - for (CustomMaterial mat : TConstructRegistry.customMaterials) - { - if (material.isItemEqual(mat.input)) - return mat.value; - } - } - return 0; - } + else + { + if (patternValue % 2 == 1) + { + return new ItemStack[] { toolPart, mat.shard.copy() }; //Material + shard + } + else + return new ItemStack[] { toolPart, null }; + } + /*if ( patternValue < totalMaterial ) + { + if (otherPattern != null) + { + int otherValue = ((IPattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage()); + if (patternValue + otherValue <= key.value) + { + ItemStack otherPart = getMatchingPattern(otherPattern, mat); + return new ItemStack[] { toolPart, otherPart }; //Material + Material + } + } + } + + else if ( patternValue == key.value ) + return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), null }; //Material only + + else + return null; //Not a valid match*/ + } + } + } + return null; + } - public ItemKey getItemKey (ItemStack material) - { - Item mat = material.getItem(); - int damage = material.getItemDamage(); - for (ItemKey ik : materials) - { - if (mat == ik.item && (ik.damage == Short.MAX_VALUE || damage == ik.damage)) - return ik; - } - return null; - } + public int getPartID (ItemStack material) + { + if (material != null) + { + ItemKey key = getItemKey(material); + if (key != null) + { + MaterialSet set = (MaterialSet) materialSets.get(key.key); + return set.materialID; + } + } + return Short.MAX_VALUE; + } - public ItemStack getMatchingPattern (ItemStack stack, ItemStack input, MaterialSet set) - { - Item item = stack.getItem(); - for (IPattern pattern : toolPatterns) - { - if (pattern == item) - return pattern.getPatternOutput(stack, input, set); - } - return null; - } - - public ItemStack getShardFromSet(String materialset) - { - MaterialSet set = (MaterialSet) materialSets.get(materialset); - if (set != null) - return set.shard.copy(); - return null; - } - - public ItemStack getRodFromSet(String materialset) + public int getPartValue (ItemStack material) + { + if (material != null) + { + ItemKey key = getItemKey(material); + if (key != null) + return key.value; + + for (CustomMaterial mat : TConstructRegistry.customMaterials) + { + if (material.isItemEqual(mat.input)) + return mat.value; + } + } + return 0; + } + + public ItemKey getItemKey (ItemStack material) + { + Item mat = material.getItem(); + int damage = material.getItemDamage(); + for (ItemKey ik : materials) + { + if (mat == ik.item && (ik.damage == Short.MAX_VALUE || damage == ik.damage)) + return ik; + } + return null; + } + + public ItemStack getMatchingPattern (ItemStack stack, ItemStack input, MaterialSet set) + { + Item item = stack.getItem(); + for (IPattern pattern : toolPatterns) + { + if (pattern == item) + return pattern.getPatternOutput(stack, input, set); + } + return null; + } + + public ItemStack getShardFromSet (String materialset) + { + MaterialSet set = (MaterialSet) materialSets.get(materialset); + if (set != null) + return set.shard.copy(); + return null; + } + + public ItemStack getRodFromSet (String materialset) { MaterialSet set = (MaterialSet) materialSets.get(materialset); if (set != null) @@ -187,65 +187,65 @@ public class PatternBuilder return null; } - //Small data classes. I would prefer the struct from C#, but we do what we can. - public class ItemKey - { - public final Item item; - public final int damage; - public final int value; - public final String key; + //Small data classes. I would prefer the struct from C#, but we do what we can. + public class ItemKey + { + public final Item item; + public final int damage; + public final int value; + public final String key; - public ItemKey(Item i, int d, int v, String s) - { - item = i; - damage = d; - value = v; - key = s; - } - } + public ItemKey(Item i, int d, int v, String s) + { + item = i; + damage = d; + value = v; + key = s; + } + } - public class MaterialSet - { - public final ItemStack shard; - public final ItemStack rod; - public final int materialID; + public class MaterialSet + { + public final ItemStack shard; + public final ItemStack rod; + public final int materialID; - public MaterialSet(ItemStack s, ItemStack r, int id) - { - shard = s; - rod = r; - materialID = id; - } - } + public MaterialSet(ItemStack s, ItemStack r, int id) + { + shard = s; + rod = r; + materialID = id; + } + } - //Helper Methods - public void registerMaterial (Block material, int value, String key) - { - registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); - } + //Helper Methods + public void registerMaterial (Block material, int value, String key) + { + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); + } - public void registerMaterial (Item material, int value, String key) - { - registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); - } + public void registerMaterial (Item material, int value, String key) + { + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); + } - public void registerFullMaterial (Block material, int value, String key, ItemStack shard, ItemStack rod, int materialID) - { - registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); - } + public void registerFullMaterial (Block material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); + } - public void registerFullMaterial (Item material, int value, String key, ItemStack shard, ItemStack rod, int materialID) - { - registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); - } + public void registerFullMaterial (Item material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); + } - /*public void registerFullMaterial (Block material, int value, String key, int materialID) - { - registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); - } + /*public void registerFullMaterial (Block material, int value, String key, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + } - public void registerFullMaterial (Item material, int value, String key, int materialID) - { - registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); - }*/ + public void registerFullMaterial (Item material, int value, String key, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + }*/ } \ No newline at end of file diff --git a/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java b/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java index ab45ab30..d57f8dbc 100644 --- a/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java +++ b/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java @@ -18,9 +18,9 @@ public class ShapelessToolRecipe extends ShapelessRecipes { super(par1ItemStack, par2List); } - + @Override - public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) + public boolean matches (InventoryCrafting par1InventoryCrafting, World par2World) { ArrayList arraylist = new ArrayList(this.recipeItems); @@ -37,7 +37,7 @@ public class ShapelessToolRecipe extends ShapelessRecipes while (iterator.hasNext()) { - ItemStack itemstack1 = (ItemStack)iterator.next(); + ItemStack itemstack1 = (ItemStack) iterator.next(); //System.out.println("Rawr! "+itemstack1.getItemDamage()); if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage())) diff --git a/mods/tinker/tconstruct/library/crafting/Smeltery.java b/mods/tinker/tconstruct/library/crafting/Smeltery.java index 508338fb..e7fc321b 100644 --- a/mods/tinker/tconstruct/library/crafting/Smeltery.java +++ b/mods/tinker/tconstruct/library/crafting/Smeltery.java @@ -21,46 +21,46 @@ public class Smeltery /** Adds mappings between an itemstack and an output liquid * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); - * - * @param stack The itemstack to liquify - * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary - * @param output The result of the process in liquid form - */ - public static void addMelting(ItemStack stack, int temperature, LiquidStack output) + * + * @param stack The itemstack to liquify + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form + */ + public static void addMelting (ItemStack stack, int temperature, LiquidStack output) { - addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, output); + addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, output); } - - /** Adds mappings between a block and its liquid - * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); - * - * @param blockID The ID of the block to liquify and render - * @param metadata The metadata of the block to liquify and render - * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary - * @param output The result of the process in liquid form - */ - public static void addMelting(Block block, int metadata, int temperature, LiquidStack output) + + /** Adds mappings between a block and its liquid + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); + * + * @param blockID The ID of the block to liquify and render + * @param metadata The metadata of the block to liquify and render + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form + */ + public static void addMelting (Block block, int metadata, int temperature, LiquidStack output) { - addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, output); + addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, output); } - + /** Adds mappings between an input and its liquid. * Renders with the given input's block ID and metadata * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); - * - * @param input The item to liquify - * @param blockID The ID of the block to render - * @param metadata The metadata of the block to render - * @param temperature How hot the block should be before liquifying - * @param liquid The result of the process - */ - public static void addMelting(ItemStack input, int blockID, int metadata, int temperature, LiquidStack liquid) + * + * @param input The item to liquify + * @param blockID The ID of the block to render + * @param metadata The metadata of the block to render + * @param temperature How hot the block should be before liquifying + * @param liquid The result of the process + */ + public static void addMelting (ItemStack input, int blockID, int metadata, int temperature, LiquidStack liquid) { instance.smeltingList.put(Arrays.asList(input.itemID, input.getItemDamage()), liquid); instance.temperatureList.put(Arrays.asList(input.itemID, input.getItemDamage()), temperature); instance.renderIndex.put(Arrays.asList(input.itemID, input.getItemDamage()), new ItemStack(blockID, input.stackSize, metadata)); } - + /** Adds an alloy mixing recipe. * Example: Smeltery.addAlloyMixing(new LiquidStack(bronzeID, 2, 0), new LiquidStack(copperID, 3, 0), new LiquidStack(tinID, 1, 0)); * The example mixes 3 copper with 1 tin to make 2 bronze @@ -68,38 +68,38 @@ public class Smeltery * @param result The output of the combination of mixers. The quantity is used for amount of a successful mix * @param mixers the liquids to be mixed. Quantities are used as ratios */ - public static void addAlloyMixing(LiquidStack result, LiquidStack... mixers) + public static void addAlloyMixing (LiquidStack result, LiquidStack... mixers) { - ArrayList inputs = new ArrayList(); - for (LiquidStack liquid : mixers) - inputs.add(liquid); - - instance.alloys.add(new AlloyMix(result, inputs)); + ArrayList inputs = new ArrayList(); + for (LiquidStack liquid : mixers) + inputs.add(liquid); + + instance.alloys.add(new AlloyMix(result, inputs)); } - + /** * Used to get the resulting temperature from a source ItemStack * @param item The Source ItemStack * @return The result temperature */ - public static Integer getLiquifyTemperature(ItemStack item) + public static Integer getLiquifyTemperature (ItemStack item) { if (item == null) return 20; - + Integer temp = instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage())); if (temp == null) - return 20; + return 20; else - return temp; + return temp; } - + /** * Used to get the resulting temperature from a source Block * @param item The Source ItemStack * @return The result ItemStack */ - public static Integer getLiquifyTemperature(int blockID, int metadata) + public static Integer getLiquifyTemperature (int blockID, int metadata) { return instance.temperatureList.get(Arrays.asList(blockID, metadata)); } @@ -109,63 +109,63 @@ public class Smeltery * @param item The Source ItemStack * @return The result ItemStack */ - public static LiquidStack getSmelteryResult(ItemStack item) + public static LiquidStack getSmelteryResult (ItemStack item) { if (item == null) return null; - + LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); if (stack == null) - return null; + return null; return stack.copy(); } - + /** * Used to get the resulting ItemStack from a source Block * @param item The Source ItemStack * @return The result ItemStack */ - public static LiquidStack getSmelteryResult(int blockID, int metadata) + public static LiquidStack getSmelteryResult (int blockID, int metadata) { - LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(blockID, metadata)); - if (stack == null) - return null; - return stack.copy(); + LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(blockID, metadata)); + if (stack == null) + return null; + return stack.copy(); } - - public static ItemStack getRenderIndex(ItemStack input) + + public static ItemStack getRenderIndex (ItemStack input) { - return instance.renderIndex.get(Arrays.asList(input.itemID, input.getItemDamage())); + return instance.renderIndex.get(Arrays.asList(input.itemID, input.getItemDamage())); } - - public static ArrayList mixMetals(ArrayList moltenMetal) + + public static ArrayList mixMetals (ArrayList moltenMetal) { - ArrayList liquids = new ArrayList(); - for (AlloyMix alloy : instance.alloys) - { - LiquidStack liquid = alloy.mix(moltenMetal); - if (liquid != null) - liquids.add(liquid); - } - return liquids; + ArrayList liquids = new ArrayList(); + for (AlloyMix alloy : instance.alloys) + { + LiquidStack liquid = alloy.mix(moltenMetal); + if (liquid != null) + liquids.add(liquid); + } + return liquids; } - - public static HashMap, LiquidStack> getSmeltingList() + + public static HashMap, LiquidStack> getSmeltingList () { return instance.smeltingList; } - - public static HashMap, Integer> getTemperatureList() + + public static HashMap, Integer> getTemperatureList () { return instance.temperatureList; } - - public static HashMap, ItemStack> getRenderIndex() + + public static HashMap, ItemStack> getRenderIndex () { return instance.renderIndex; } - - public static ArrayList getAlloyList() + + public static ArrayList getAlloyList () { return instance.alloys; } diff --git a/mods/tinker/tconstruct/library/crafting/ToolBuilder.java b/mods/tinker/tconstruct/library/crafting/ToolBuilder.java index 0a705c6f..e3837ff1 100644 --- a/mods/tinker/tconstruct/library/crafting/ToolBuilder.java +++ b/mods/tinker/tconstruct/library/crafting/ToolBuilder.java @@ -60,7 +60,7 @@ public class ToolBuilder instance.recipeList.put(output.getToolName(), recipe); } } - + public static void addNormalToolRecipe (ToolCore output, Item head, Item handle, Item accessory, Item extra) { ToolRecipe recipe = instance.recipeList.get(output.getToolName()); @@ -78,12 +78,12 @@ public class ToolBuilder instance.recipeList.put(output.getToolName(), recipe); } } - - public static void addCustomToolRecipe(ToolRecipe recipe) + + public static void addCustomToolRecipe (ToolRecipe recipe) { instance.combos.add(recipe); } - + public static void addToolRecipe (ToolCore output, Item... items) { if (items.length == 2) @@ -167,7 +167,7 @@ public class ToolBuilder item = getMatchingRecipe(headStack.getItem(), handleStack.getItem(), accessoryStack.getItem(), null); } } - + //System.out.println("Valid: "+item); if (item == null) @@ -233,7 +233,7 @@ public class ToolBuilder if (handles > 0) { - modifier *= (0.5+handles*0.5); + modifier *= (0.5 + handles * 0.5); modifier /= handles; } @@ -308,10 +308,10 @@ public class ToolBuilder compound.setCompoundTag("display", new NBTTagCompound()); compound.getCompoundTag("display").setString("Name", "\u00A7f" + name); } - - ToolCraftEvent.NormalTool event = new ToolCraftEvent.NormalTool(item, compound, new ToolMaterial[] {headMat, handleMat, accessoryMat, extraMat}); + + ToolCraftEvent.NormalTool event = new ToolCraftEvent.NormalTool(item, compound, new ToolMaterial[] { headMat, handleMat, accessoryMat, extraMat }); MinecraftForge.EVENT_BUS.post(event); - + if (event.getResult() == Result.DEFAULT) { tool.setTagCompound(compound); diff --git a/mods/tinker/tconstruct/library/crafting/ToolRecipe.java b/mods/tinker/tconstruct/library/crafting/ToolRecipe.java index 649a0566..db4da178 100644 --- a/mods/tinker/tconstruct/library/crafting/ToolRecipe.java +++ b/mods/tinker/tconstruct/library/crafting/ToolRecipe.java @@ -12,27 +12,27 @@ import net.minecraft.item.Item; public class ToolRecipe { - LinkedList headList = new LinkedList(); - LinkedList handleList = new LinkedList(); - LinkedList accessoryList = new LinkedList(); - LinkedList extraList = new LinkedList(); - ToolCore result; - Item toolRod = TConstructRegistry.getItem("toolRod"); + LinkedList headList = new LinkedList(); + LinkedList handleList = new LinkedList(); + LinkedList accessoryList = new LinkedList(); + LinkedList extraList = new LinkedList(); + ToolCore result; + Item toolRod = TConstructRegistry.getItem("toolRod"); - /*public ToolRecipe(Item head, ToolCore tool) - { - this(head, TContent.toolRod, null, null, tool); - }*/ + /*public ToolRecipe(Item head, ToolCore tool) + { + this(head, TContent.toolRod, null, null, tool); + }*/ public ToolRecipe(Item head, Item handle, ToolCore tool) { this(head, handle, null, null, tool); } - public ToolRecipe(Item head, Item handle, Item accessory, ToolCore tool) - { - this(head, handle, accessory, null, tool); - } + public ToolRecipe(Item head, Item handle, Item accessory, ToolCore tool) + { + this(head, handle, accessory, null, tool); + } public ToolRecipe(Item head, Item handle, Item accessory, Item extra, ToolCore tool) { @@ -44,87 +44,87 @@ public class ToolRecipe this.extraList.add(extra); result = tool; } - - public void addHeadItem(Item head) - { - this.headList.add(head); - } - - public void addHandleItem(Item head) - { - this.handleList.add(head); - } - - public void addAccessoryItem(Item head) - { - this.accessoryList.add(head); - } - - public void addExtraItem(Item head) - { - this.extraList.add(head); - } - public boolean validHead (Item input) - { - for (Item part : headList) - { - if (part == input) - return true; - } - return false; - } + public void addHeadItem (Item head) + { + this.headList.add(head); + } - public boolean validHandle (Item input) - { - for (Item part : handleList) - { - if (part == input) - return true; - if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) - return true; - } - return false; - } + public void addHandleItem (Item head) + { + this.handleList.add(head); + } - public boolean validAccessory (Item input) - { - if (input == null) - { - if (accessoryList.size() < 1) - return true; - return false; - } - for (Item part : accessoryList) - { - if (part == input) - return true; + public void addAccessoryItem (Item head) + { + this.accessoryList.add(head); + } + + public void addExtraItem (Item head) + { + this.extraList.add(head); + } + + public boolean validHead (Item input) + { + for (Item part : headList) + { + if (part == input) + return true; + } + return false; + } + + public boolean validHandle (Item input) + { + for (Item part : handleList) + { + if (part == input) + return true; if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) return true; - } - return false; - } - - public boolean validExtra (Item input) - { - if (input == null) - { - if (extraList.size() < 1) - return true; - return false; - } - for (Item part : extraList) - { - if (part == input) - return true; + } + return false; + } + + public boolean validAccessory (Item input) + { + if (input == null) + { + if (accessoryList.size() < 1) + return true; + return false; + } + for (Item part : accessoryList) + { + if (part == input) + return true; if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) return true; - } - return false; - } + } + return false; + } - public ToolCore getType () - { - return result; - } + public boolean validExtra (Item input) + { + if (input == null) + { + if (extraList.size() < 1) + return true; + return false; + } + for (Item part : extraList) + { + if (part == input) + return true; + if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) + return true; + } + return false; + } + + public ToolCore getType () + { + return result; + } } diff --git a/mods/tinker/tconstruct/library/event/PartBuilderEvent.java b/mods/tinker/tconstruct/library/event/PartBuilderEvent.java index b854c77e..0ef113fc 100644 --- a/mods/tinker/tconstruct/library/event/PartBuilderEvent.java +++ b/mods/tinker/tconstruct/library/event/PartBuilderEvent.java @@ -16,14 +16,14 @@ public class PartBuilderEvent extends Event public final ItemStack pattern; public final ItemStack otherPattern; protected ItemStack[] resultStacks; - + public PartBuilderEvent(ItemStack material, ItemStack pattern, ItemStack otherPattern) { this.material = material; this.pattern = pattern; this.otherPattern = otherPattern; } - + @HasResult public static class NormalPart extends PartBuilderEvent { @@ -31,7 +31,7 @@ public class PartBuilderEvent extends Event { super(material, pattern, otherPattern); } - + /** Fires before other processing is done * * Result is significant: @@ -39,14 +39,14 @@ public class PartBuilderEvent extends Event * ALLOW: Uses resultStack instead * DENY: Stops part crafting altogether */ - - public void overrideResult(ItemStack[] result) + + public void overrideResult (ItemStack[] result) { resultStacks = result; this.setResult(Result.ALLOW); } - - public ItemStack[] getResultStacks() + + public ItemStack[] getResultStacks () { return resultStacks; } diff --git a/mods/tinker/tconstruct/library/event/ToolCraftEvent.java b/mods/tinker/tconstruct/library/event/ToolCraftEvent.java index eeaa8c51..58483eb8 100644 --- a/mods/tinker/tconstruct/library/event/ToolCraftEvent.java +++ b/mods/tinker/tconstruct/library/event/ToolCraftEvent.java @@ -16,14 +16,14 @@ public class ToolCraftEvent extends Event public final NBTTagCompound toolTag; public final ToolMaterial[] materials; protected ItemStack resultStack; - + public ToolCraftEvent(ToolCore tool, NBTTagCompound toolTag, ToolMaterial[] materials) { this.tool = tool; this.toolTag = toolTag; this.materials = materials; } - + @HasResult public static class NormalTool extends ToolCraftEvent { @@ -31,7 +31,7 @@ public class ToolCraftEvent extends Event { super(tool, toolTag, materials); } - + /** Fires just before the tool is put together * * Result is significant: @@ -39,14 +39,14 @@ public class ToolCraftEvent extends Event * ALLOW: Uses resultStack instead * DENY: Stops tool crafting altogether */ - - public void overrideResult(ItemStack result) + + public void overrideResult (ItemStack result) { resultStack = result; this.setResult(Result.ALLOW); } - - public ItemStack getResultStack() + + public ItemStack getResultStack () { return resultStack; } diff --git a/mods/tinker/tconstruct/library/tools/AbilityHelper.java b/mods/tinker/tconstruct/library/tools/AbilityHelper.java index 004410ca..38d6f3d1 100644 --- a/mods/tinker/tconstruct/library/tools/AbilityHelper.java +++ b/mods/tinker/tconstruct/library/tools/AbilityHelper.java @@ -142,7 +142,7 @@ public class AbilityHelper { boolean criticalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null && entity instanceof EntityLiving; - + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) { if (mod.doesCriticalHit(tool, tags, toolTags, stack, player, entity)) @@ -390,7 +390,7 @@ public class AbilityHelper int durability = tags.getInteger("Damage"); float shoddy = tags.getFloat("Shoddy"); - + float mineSpeed = tags.getInteger("MiningSpeed"); int heads = 1; if (tags.hasKey("MiningSpeed2")) @@ -398,13 +398,13 @@ public class AbilityHelper mineSpeed += tags.getInteger("MiningSpeed2"); heads++; } - + if (tags.hasKey("MiningSpeedHandle")) { mineSpeed += tags.getInteger("MiningSpeedHandle"); heads++; } - + if (tags.hasKey("MiningSpeedExtra")) { mineSpeed += tags.getInteger("MiningSpeedExtra"); @@ -414,7 +414,6 @@ public class AbilityHelper float stonebound = tags.getFloat("Shoddy"); float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; trueSpeed += bonusLog; - /*mineSpeed += shoddy * durability / 100f; mineSpeed /= 15;*/ diff --git a/mods/tinker/tconstruct/library/tools/ArrowMaterial.java b/mods/tinker/tconstruct/library/tools/ArrowMaterial.java index c55f6505..257423cb 100644 --- a/mods/tinker/tconstruct/library/tools/ArrowMaterial.java +++ b/mods/tinker/tconstruct/library/tools/ArrowMaterial.java @@ -5,7 +5,7 @@ public class ArrowMaterial public final float mass; public final float breakChance; public final float accuracy; - + public ArrowMaterial(float weight, float breakChance, float accuracy) { this.mass = weight; diff --git a/mods/tinker/tconstruct/library/tools/BowBase.java b/mods/tinker/tconstruct/library/tools/BowBase.java index 15042586..f2d30a74 100644 --- a/mods/tinker/tconstruct/library/tools/BowBase.java +++ b/mods/tinker/tconstruct/library/tools/BowBase.java @@ -86,7 +86,7 @@ public abstract class BowBase extends ToolCore EntityArrow arrowEntity = null; //if (tinkerArrow != null) - if (slotID != 1 && (arrowID == -1 || slotID < arrowID)) + if (slotID != -1 && (arrowID == -1 || slotID < arrowID)) { ItemStack arrowStack = tinkerArrow.copy(); arrowStack.stackSize = 1; @@ -111,6 +111,10 @@ public abstract class BowBase extends ToolCore int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, stack); + if (slotID != -1 && (arrowID == -1 || slotID < arrowID)) + ((ArrowEntity) arrowEntity).setKnockbackModStrength(toolTag.getFloat("Knockback")); + //var10 += toolTag.getFloat("Knockback"); + if (var10 > 0) { arrowEntity.setKnockbackStrength(var10); @@ -139,7 +143,7 @@ public abstract class BowBase extends ToolCore else { //if (tinkerArrow != null) - if (slotID != 1 && (arrowID == -1 || slotID < arrowID)) + if (slotID != -1 && (arrowID == -1 || slotID < arrowID)) { player.inventory.consumeInventoryItem(TContent.arrow.itemID); } @@ -216,8 +220,8 @@ public abstract class BowBase extends ToolCore return stack; } - - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) { return false; } diff --git a/mods/tinker/tconstruct/library/tools/BowMaterial.java b/mods/tinker/tconstruct/library/tools/BowMaterial.java index d134b2c9..c36f8e06 100644 --- a/mods/tinker/tconstruct/library/tools/BowMaterial.java +++ b/mods/tinker/tconstruct/library/tools/BowMaterial.java @@ -5,7 +5,7 @@ public class BowMaterial public final int durability; public final int drawspeed; public final float flightSpeedMax; - + public BowMaterial(int durability, int drawspeed, float attack) { this.durability = durability; diff --git a/mods/tinker/tconstruct/library/tools/BowstringMaterial.java b/mods/tinker/tconstruct/library/tools/BowstringMaterial.java index 39054f13..be8c7374 100644 --- a/mods/tinker/tconstruct/library/tools/BowstringMaterial.java +++ b/mods/tinker/tconstruct/library/tools/BowstringMaterial.java @@ -7,7 +7,7 @@ public class BowstringMaterial extends CustomMaterial public final float durabilityModifier; public final float drawspeedModifier; public final float flightSpeedModifier; - + public BowstringMaterial(int materialID, int value, ItemStack input, ItemStack craftingItem, float durability, float drawspeed, float flightspeed) { super(materialID, value, input, craftingItem); diff --git a/mods/tinker/tconstruct/library/tools/CustomMaterial.java b/mods/tinker/tconstruct/library/tools/CustomMaterial.java index c1f12d0d..a99963dd 100644 --- a/mods/tinker/tconstruct/library/tools/CustomMaterial.java +++ b/mods/tinker/tconstruct/library/tools/CustomMaterial.java @@ -8,7 +8,7 @@ public abstract class CustomMaterial public final int value; public final ItemStack input; public final ItemStack craftingItem; - + public CustomMaterial(int materialID, int value, ItemStack input, ItemStack craftingItem) { this.materialID = materialID; @@ -16,7 +16,7 @@ public abstract class CustomMaterial this.input = input; this.craftingItem = craftingItem; } - + /*public boolean matches(ItemStack input, ItemStack pattern) { if (ItemStack.areItemStacksEqual(this.input, input) && ItemStack.areItemStacksEqual(this.craftingPattern, pattern)) diff --git a/mods/tinker/tconstruct/library/tools/DualHarvestTool.java b/mods/tinker/tconstruct/library/tools/DualHarvestTool.java index 0da62ba4..a847320b 100644 --- a/mods/tinker/tconstruct/library/tools/DualHarvestTool.java +++ b/mods/tinker/tconstruct/library/tools/DualHarvestTool.java @@ -14,119 +14,119 @@ import net.minecraftforge.common.MinecraftForge; public abstract class DualHarvestTool extends HarvestTool { - public DualHarvestTool(int itemID, int baseDamage) - { - super(itemID, baseDamage); - } + public DualHarvestTool(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } - @Override - public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) - { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - World world = player.worldObj; - int bID = player.worldObj.getBlockId(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block block = Block.blocksList[bID]; - if (block == null || bID < 1) - return false; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + World world = player.worldObj; + int bID = player.worldObj.getBlockId(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block block = Block.blocksList[bID]; + if (block == null || bID < 1) + return false; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); - if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) - { - boolean cancelHarvest = false; - for (ActiveToolMod mod : TConstructRegistry.activeModifiers) - { - if (mod.beforeBlockBreak(this, stack, x, y, z, player)) - cancelHarvest = true; - } + if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) + { + boolean cancelHarvest = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.beforeBlockBreak(this, stack, x, y, z, player)) + cancelHarvest = true; + } - return cancelHarvest; - } - else - { - if (!player.capabilities.isCreativeMode) - onBlockDestroyed(stack, world, bID, x, y, z, player); - world.setBlockToAir(x, y, z); - if (!world.isRemote) - world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); - return true; - } - } + return cancelHarvest; + } + else + { + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + world.setBlockToAir(x, y, z); + if (!world.isRemote) + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); + return true; + } + } - @Override - public float getStrVsBlock (ItemStack stack, Block block, int meta) - { + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - if (tags.getBoolean("Broken")) - return 0.1f; + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return 0.1f; - Material[] materials = getEffectiveMaterials(); - for (int i = 0; i < materials.length; i++) - { - if (materials[i] == block.blockMaterial) - { - float speed = tags.getInteger("MiningSpeed"); - speed /= 100f; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int durability = tags.getInteger("Damage"); + Material[] materials = getEffectiveMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); - float shoddy = tags.getFloat("Shoddy"); - speed += shoddy * durability / 100f; + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; - if (hlvl <= tags.getInteger("HarvestLevel")) - return speed; - return 0.1f; - } - } - materials = getEffectiveSecondaryMaterials(); - for (int i = 0; i < materials.length; i++) - { - if (materials[i] == block.blockMaterial) - { - float speed = tags.getInteger("MiningSpeed2"); - speed /= 100f; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int durability = tags.getInteger("Damage"); + if (hlvl <= tags.getInteger("HarvestLevel")) + return speed; + return 0.1f; + } + } + materials = getEffectiveSecondaryMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed2"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); - float shoddy = tags.getFloat("Shoddy"); - speed += shoddy * durability / 100f; + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; - if (hlvl <= tags.getInteger("HarvestLevel2")) - return speed; - return 0.1f; - } - } - return super.getStrVsBlock(stack, block, meta); - } + if (hlvl <= tags.getInteger("HarvestLevel2")) + return speed; + return 0.1f; + } + } + return super.getStrVsBlock(stack, block, meta); + } - public boolean canHarvestBlock (Block block) - { - if (block.blockMaterial.isToolNotRequired()) - { - return true; - } - for (Material m : getEffectiveMaterials()) - { - if (m == block.blockMaterial) - return true; - } - for (Material m : getEffectiveSecondaryMaterials()) - { - if (m == block.blockMaterial) - return true; - } - return false; - } + public boolean canHarvestBlock (Block block) + { + if (block.blockMaterial.isToolNotRequired()) + { + return true; + } + for (Material m : getEffectiveMaterials()) + { + if (m == block.blockMaterial) + return true; + } + for (Material m : getEffectiveSecondaryMaterials()) + { + if (m == block.blockMaterial) + return true; + } + return false; + } - @Override - public String[] toolCategories () - { - return new String[] { "harvest", "dualharvest" }; - } + @Override + public String[] toolCategories () + { + return new String[] { "harvest", "dualharvest" }; + } - protected abstract Material[] getEffectiveSecondaryMaterials (); + protected abstract Material[] getEffectiveSecondaryMaterials (); - protected abstract String getSecondHarvestType (); + protected abstract String getSecondHarvestType (); } diff --git a/mods/tinker/tconstruct/library/tools/FletchingMaterial.java b/mods/tinker/tconstruct/library/tools/FletchingMaterial.java index 077e3fbc..999a293b 100644 --- a/mods/tinker/tconstruct/library/tools/FletchingMaterial.java +++ b/mods/tinker/tconstruct/library/tools/FletchingMaterial.java @@ -7,6 +7,7 @@ public class FletchingMaterial extends CustomMaterial public final float accuracy; public final float breakChance; public final float mass; + public FletchingMaterial(int materialID, int value, ItemStack input, ItemStack craftingItem, float accuracy, float breakChance, float mass) { super(materialID, value, input, craftingItem); diff --git a/mods/tinker/tconstruct/library/tools/HarvestTool.java b/mods/tinker/tconstruct/library/tools/HarvestTool.java index 9379d6e8..7c7c97cf 100644 --- a/mods/tinker/tconstruct/library/tools/HarvestTool.java +++ b/mods/tinker/tconstruct/library/tools/HarvestTool.java @@ -14,115 +14,115 @@ import net.minecraftforge.common.MinecraftForge; public abstract class HarvestTool extends ToolCore { - public HarvestTool(int itemID, int baseDamage) - { - super(itemID, baseDamage); - } + public HarvestTool(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } - @Override - public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) - { - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - World world = player.worldObj; - int bID = player.worldObj.getBlockId(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block block = Block.blocksList[bID]; - if (block == null || bID < 1) - return false; - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + World world = player.worldObj; + int bID = player.worldObj.getBlockId(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block block = Block.blocksList[bID]; + if (block == null || bID < 1) + return false; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - if (hlvl <= tags.getInteger("HarvestLevel")) - { - boolean cancelHarvest = false; - for (ActiveToolMod mod : TConstructRegistry.activeModifiers) - { - if (mod.beforeBlockBreak(this, stack, x, y, z, player)) - cancelHarvest = true; - } - return cancelHarvest; - } - else - { - world.setBlockToAir(x, y, z); - if (!player.capabilities.isCreativeMode) - onBlockDestroyed(stack, world, bID, x, y, z, player); - if (!world.isRemote) - world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); - return true; - } - } + if (hlvl <= tags.getInteger("HarvestLevel")) + { + boolean cancelHarvest = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.beforeBlockBreak(this, stack, x, y, z, player)) + cancelHarvest = true; + } + return cancelHarvest; + } + else + { + world.setBlockToAir(x, y, z); + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + if (!world.isRemote) + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); + return true; + } + } - @Override - public float getStrVsBlock (ItemStack stack, Block block, int meta) - { + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { if (!stack.hasTagCompound()) - return 1.0f; - - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - if (tags.getBoolean("Broken")) - return 0.1f; + return 1.0f; - Material[] materials = getEffectiveMaterials(); - for (int i = 0; i < materials.length; i++) - { - if (materials[i] == block.blockMaterial) - { - float mineSpeed = tags.getInteger("MiningSpeed"); - int heads = 1; - if (tags.hasKey("MiningSpeed2")) - { - mineSpeed += tags.getInteger("MiningSpeed2"); - heads++; - } - - if (tags.hasKey("MiningSpeedHandle")) - { - mineSpeed += tags.getInteger("MiningSpeedHandle"); - heads++; - } - - if (tags.hasKey("MiningSpeedExtra")) - { - mineSpeed += tags.getInteger("MiningSpeedExtra"); - heads++; - } - float trueSpeed = mineSpeed / (heads * 100f); - int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - int durability = tags.getInteger("Damage"); + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return 0.1f; - float stonebound = tags.getFloat("Shoddy"); - float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; - trueSpeed += bonusLog; + Material[] materials = getEffectiveMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float mineSpeed = tags.getInteger("MiningSpeed"); + int heads = 1; + if (tags.hasKey("MiningSpeed2")) + { + mineSpeed += tags.getInteger("MiningSpeed2"); + heads++; + } - if (hlvl <= tags.getInteger("HarvestLevel")) - return trueSpeed; - return 0.1f; - } - } - return super.getStrVsBlock(stack, block, meta); - } + if (tags.hasKey("MiningSpeedHandle")) + { + mineSpeed += tags.getInteger("MiningSpeedHandle"); + heads++; + } - public boolean canHarvestBlock (Block block) - { - if (block.blockMaterial.isToolNotRequired()) - { - return true; - } - for (Material m : getEffectiveMaterials()) - { - if (m == block.blockMaterial) - return true; - } - return false; - } + if (tags.hasKey("MiningSpeedExtra")) + { + mineSpeed += tags.getInteger("MiningSpeedExtra"); + heads++; + } + float trueSpeed = mineSpeed / (heads * 100f); + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); - @Override - public String[] toolCategories () - { - return new String[] { "harvest" }; - } + float stonebound = tags.getFloat("Shoddy"); + float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; + trueSpeed += bonusLog; - protected abstract Material[] getEffectiveMaterials (); + if (hlvl <= tags.getInteger("HarvestLevel")) + return trueSpeed; + return 0.1f; + } + } + return super.getStrVsBlock(stack, block, meta); + } - protected abstract String getHarvestType (); + public boolean canHarvestBlock (Block block) + { + if (block.blockMaterial.isToolNotRequired()) + { + return true; + } + for (Material m : getEffectiveMaterials()) + { + if (m == block.blockMaterial) + return true; + } + return false; + } + + @Override + public String[] toolCategories () + { + return new String[] { "harvest" }; + } + + protected abstract Material[] getEffectiveMaterials (); + + protected abstract String getHarvestType (); } diff --git a/mods/tinker/tconstruct/library/tools/ToolCore.java b/mods/tinker/tconstruct/library/tools/ToolCore.java index 48b400fb..dbd3bf76 100644 --- a/mods/tinker/tconstruct/library/tools/ToolCore.java +++ b/mods/tinker/tconstruct/library/tools/ToolCore.java @@ -158,11 +158,10 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox if (location.length > 4) extraStrings.put(index, location[4]); } - public void registerAlternatePartPaths (int index, String[] location) { - + } public void registerEffectPath (int index, String location) diff --git a/mods/tinker/tconstruct/library/tools/ToolMaterial.java b/mods/tinker/tconstruct/library/tools/ToolMaterial.java index fc51a9a9..c10ad6f5 100644 --- a/mods/tinker/tconstruct/library/tools/ToolMaterial.java +++ b/mods/tinker/tconstruct/library/tools/ToolMaterial.java @@ -1,28 +1,29 @@ package mods.tinker.tconstruct.library.tools; + /* * Dynamic substitute for an enum. It carries a lot of information */ public class ToolMaterial -{ +{ //mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name - - public final String materialName; - public final String displayName; - public final int harvestLevel; - public final int durability; - public final int miningspeed; // <-- divided by 100 - public final int attack; - public final float handleModifier; - public final int reinforced; - public final float stonebound; - public final String tipStyle; - public final String ability; + + public final String materialName; + public final String displayName; + public final int harvestLevel; + public final int durability; + public final int miningspeed; // <-- divided by 100 + public final int attack; + public final float handleModifier; + public final int reinforced; + public final float stonebound; + public final String tipStyle; + public final String ability; public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability) { this(name, name + " ", level, durability, speed, damage, handle, reinforced, stonebound, style, ability); } - + public ToolMaterial(String name, String displayName, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability) { this.materialName = name; @@ -37,54 +38,54 @@ public class ToolMaterial this.tipStyle = style; this.ability = ability; } - - public String name() + + public String name () { - return materialName; + return materialName; } - - public int durability() + + public int durability () { return this.durability; } - - public int toolSpeed() + + public int toolSpeed () { return this.miningspeed; } - - public int attack() + + public int attack () { return this.attack; } - - public int harvestLevel() + + public int harvestLevel () { return this.harvestLevel; } - - public float handleDurability() + + public float handleDurability () { - return this.handleModifier; + return this.handleModifier; } - - public int reinforced() + + public int reinforced () { return this.reinforced; } - - public float shoddy() + + public float shoddy () { - return this.stonebound; + return this.stonebound; } - - public String style() + + public String style () { - return this.tipStyle; + return this.tipStyle; } - - public String ability() + + public String ability () { - return this.ability; + return this.ability; } } diff --git a/mods/tinker/tconstruct/library/tools/ToolMod.java b/mods/tinker/tconstruct/library/tools/ToolMod.java index 0053dacf..31dbc356 100644 --- a/mods/tinker/tconstruct/library/tools/ToolMod.java +++ b/mods/tinker/tconstruct/library/tools/ToolMod.java @@ -11,97 +11,97 @@ import net.minecraft.nbt.NBTTagCompound; public abstract class ToolMod { - public final String key; - public final List stacks; - public final int effectIndex; - public static Random random = new Random(); + public final String key; + public final List stacks; + public final int effectIndex; + public static Random random = new Random(); - public ToolMod(ItemStack[] items, int effect, String dataKey) - { - //recipeItems = items; - List itemstacks = new ArrayList(); - for (int iter = 0; iter < items.length; iter++) - itemstacks.add(items[iter]); - stacks = itemstacks; - effectIndex = effect; - key = dataKey; - } + public ToolMod(ItemStack[] items, int effect, String dataKey) + { + //recipeItems = items; + List itemstacks = new ArrayList(); + for (int iter = 0; iter < items.length; iter++) + itemstacks.add(items[iter]); + stacks = itemstacks; + effectIndex = effect; + key = dataKey; + } - /** Checks to see if the inputs match the stored items - * Note: Works like ShapelessRecipes - * - * @param input The ItemStacks to compare against - * @param tool Item to modify, used for restrictions - * @return Whether the recipe matches the input - */ - public boolean matches (ItemStack[] input, ItemStack tool) - { - if (!canModify(tool, input)) - return false; + /** Checks to see if the inputs match the stored items + * Note: Works like ShapelessRecipes + * + * @param input The ItemStacks to compare against + * @param tool Item to modify, used for restrictions + * @return Whether the recipe matches the input + */ + public boolean matches (ItemStack[] input, ItemStack tool) + { + if (!canModify(tool, input)) + return false; - ArrayList list = new ArrayList(this.stacks); + ArrayList list = new ArrayList(this.stacks); - for (int iter = 0; iter < input.length; ++iter) - { - ItemStack craftingStack = input[iter]; + for (int iter = 0; iter < input.length; ++iter) + { + ItemStack craftingStack = input[iter]; - if (craftingStack != null) - { - boolean canCraft = false; - Iterator iterate = list.iterator(); + if (craftingStack != null) + { + boolean canCraft = false; + Iterator iterate = list.iterator(); - while (iterate.hasNext()) - { - ItemStack removeStack = (ItemStack) iterate.next(); + while (iterate.hasNext()) + { + ItemStack removeStack = (ItemStack) iterate.next(); - if (craftingStack.itemID == removeStack.itemID && (removeStack.getItemDamage() == Short.MAX_VALUE || craftingStack.getItemDamage() == removeStack.getItemDamage())) - { - canCraft = true; - list.remove(removeStack); - break; - } - } + if (craftingStack.itemID == removeStack.itemID && (removeStack.getItemDamage() == Short.MAX_VALUE || craftingStack.getItemDamage() == removeStack.getItemDamage())) + { + canCraft = true; + list.remove(removeStack); + break; + } + } - if (!canCraft) - { - return false; - } - } - } + if (!canCraft) + { + return false; + } + } + } - return list.isEmpty(); - } + return list.isEmpty(); + } - /** - * - * @param tool Tool to compare against - * @return Whether the tool can be modified - */ + /** + * + * @param tool Tool to compare against + * @return Whether the tool can be modified + */ - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - return tags.getInteger("Modifiers") > 0; - } + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + return tags.getInteger("Modifiers") > 0; + } - /** Modifies the tool. Adds nbttags, changes existing ones, ticks down modification counter, etc - * - * @param input ItemStacks to pull info from - * @param tool The tool to modify - */ - public abstract void modify (ItemStack[] input, ItemStack tool); + /** Modifies the tool. Adds nbttags, changes existing ones, ticks down modification counter, etc + * + * @param input ItemStacks to pull info from + * @param tool The tool to modify + */ + public abstract void modify (ItemStack[] input, ItemStack tool); - public void addMatchingEffect (ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey("Effect6") || tags.hasKey(key)) - return; - - else if (tags.hasKey("Effect5")) + public void addMatchingEffect (ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey("Effect6") || tags.hasKey(key)) + return; + + else if (tags.hasKey("Effect5")) { tags.setInteger("Effect6", effectIndex); } - else if (tags.hasKey("Effect4")) + else if (tags.hasKey("Effect4")) { tags.setInteger("Effect5", effectIndex); } @@ -109,101 +109,101 @@ public abstract class ToolMod { tags.setInteger("Effect4", effectIndex); } - else if (tags.hasKey("Effect2")) - { - tags.setInteger("Effect3", effectIndex); - } - else if (tags.hasKey("Effect1")) - { - tags.setInteger("Effect2", effectIndex); - } - else - { - tags.setInteger("Effect1", effectIndex); - } - } + else if (tags.hasKey("Effect2")) + { + tags.setInteger("Effect3", effectIndex); + } + else if (tags.hasKey("Effect1")) + { + tags.setInteger("Effect2", effectIndex); + } + else + { + tags.setInteger("Effect1", effectIndex); + } + } - protected int addModifierTip (ItemStack tool, String modifierTip) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int tipNum = 0; - while (true) - { - tipNum++; - String tip = "Tooltip" + tipNum; - if (!tags.hasKey(tip)) - { - tags.setString(tip, ""); - String modTip = "ModifierTip" + tipNum; - tags.setString(modTip, modifierTip); - return tipNum; - } - } - } - - protected int addToolTip (ItemStack tool, String tooltip, String modifierTip) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int tipNum = 0; - while (true) - { - tipNum++; - String tip = "Tooltip" + tipNum; - if (!tags.hasKey(tip)) - { - tags.setString(tip, tooltip); - String modTip = "ModifierTip" + tipNum; - tags.setString(modTip, modifierTip); - return tipNum; - } - else - { - String tag = tags.getString(tip); - if (tag.contains(tooltip)) - { - tags.setString(tip, getProperName(tooltip, tag)); - String modTip = "ModifierTip" + tipNum; - tag = tags.getString(modTip); - tags.setString(modTip, getProperName(modifierTip, tag)); - return tipNum; - } - } - } - } - - protected String getProperName(String tooltip, String tag) - { - if (tag.equals(tooltip)) - return tooltip + " II"; + protected int addModifierTip (ItemStack tool, String modifierTip) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int tipNum = 0; + while (true) + { + tipNum++; + String tip = "Tooltip" + tipNum; + if (!tags.hasKey(tip)) + { + tags.setString(tip, ""); + String modTip = "ModifierTip" + tipNum; + tags.setString(modTip, modifierTip); + return tipNum; + } + } + } + + protected int addToolTip (ItemStack tool, String tooltip, String modifierTip) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int tipNum = 0; + while (true) + { + tipNum++; + String tip = "Tooltip" + tipNum; + if (!tags.hasKey(tip)) + { + tags.setString(tip, tooltip); + String modTip = "ModifierTip" + tipNum; + tags.setString(modTip, modifierTip); + return tipNum; + } + else + { + String tag = tags.getString(tip); + if (tag.contains(tooltip)) + { + tags.setString(tip, getProperName(tooltip, tag)); + String modTip = "ModifierTip" + tipNum; + tag = tags.getString(modTip); + tags.setString(modTip, getProperName(modifierTip, tag)); + return tipNum; + } + } + } + } + + protected String getProperName (String tooltip, String tag) + { + if (tag.equals(tooltip)) + return tooltip + " II"; if (tag.equals(tooltip + " II")) return tooltip + " III"; - + if (tag.equals(tooltip + " III")) return tooltip + " IV"; - + if (tag.equals(tooltip + " IV")) return tooltip + " V"; - + if (tag.equals(tooltip + " V")) return tooltip + " VI"; - + if (tag.equals(tooltip + " VI")) return tooltip + " VII"; - + if (tag.equals(tooltip + " VII")) return tooltip + " VIII"; - + if (tag.equals(tooltip + " VIII")) return tooltip + " IX"; - + if (tag.equals(tooltip + " IX")) return tooltip + " X"; - - return tooltip + " X+"; - } - - public boolean validType(ToolCore tool) + + return tooltip + " X+"; + } + + public boolean validType (ToolCore tool) { return true; } diff --git a/mods/tinker/tconstruct/library/tools/Weapon.java b/mods/tinker/tconstruct/library/tools/Weapon.java index 437122f4..0caa3cad 100644 --- a/mods/tinker/tconstruct/library/tools/Weapon.java +++ b/mods/tinker/tconstruct/library/tools/Weapon.java @@ -14,41 +14,41 @@ import net.minecraft.world.World; public abstract class Weapon extends ToolCore { - public Weapon(int itemID, int baseDamage) - { - super(itemID, baseDamage); - } - - protected float baseSpeed() - { - return 1.5f; - } - - protected float effectiveSpeed() - { - return 15f; - } - - @Override - public float getStrVsBlock(ItemStack stack, Block block, int meta) - { - if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) - return 0.1f; - - for (int i = 0; i < web.length; i++) - { - if (web[i] == block.blockMaterial ) - { - return effectiveSpeed(); - } - } - return baseSpeed(); - } - - /** + public Weapon(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } + + protected float baseSpeed () + { + return 1.5f; + } + + protected float effectiveSpeed () + { + return 15f; + } + + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { + if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) + return 0.1f; + + for (int i = 0; i < web.length; i++) + { + if (web[i] == block.blockMaterial) + { + return effectiveSpeed(); + } + } + return baseSpeed(); + } + + /** * returns the action that specifies what animation to play when the items is being used */ - public EnumAction getItemUseAction(ItemStack par1ItemStack) + public EnumAction getItemUseAction (ItemStack par1ItemStack) { return EnumAction.block; } @@ -56,7 +56,7 @@ public abstract class Weapon extends ToolCore /** * How long it takes to use or consume an item */ - public int getMaxItemUseDuration(ItemStack par1ItemStack) + public int getMaxItemUseDuration (ItemStack par1ItemStack) { return 72000; } @@ -64,35 +64,35 @@ public abstract class Weapon extends ToolCore /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); return stack; } - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) { return false; } - + /** * Returns if the item (tool) can harvest results from the block type. */ - public boolean canHarvestBlock(Block block) + public boolean canHarvestBlock (Block block) { - for (int i = 0; i < web.length; i++) - { - if (block.blockMaterial == web[i]) - return true; - } + for (int i = 0; i < web.length; i++) + { + if (block.blockMaterial == web[i]) + return true; + } return super.canHarvestBlock(block); } - protected Material[] getEffectiveMaterials() + protected Material[] getEffectiveMaterials () { - return web; + return web; } - + @Override @SideOnly(Side.CLIENT) public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) @@ -109,20 +109,20 @@ public abstract class Weapon extends ToolCore } } } - + /*@Override public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) { TContent.modL.midStreamModify(stack); return super.onLeftClickEntity(stack, player, entity); }*/ - + @Override - public String[] toolCategories() + public String[] toolCategories () { return new String[] { "weapon", "melee" }; } - - public static Material[] web = new Material[] { Material.web }; + + public static Material[] web = new Material[] { Material.web }; public static Material[] none = new Material[0]; } diff --git a/mods/tinker/tconstruct/library/util/CoordTuple.java b/mods/tinker/tconstruct/library/util/CoordTuple.java index 5996e6b0..d8495caf 100644 --- a/mods/tinker/tconstruct/library/util/CoordTuple.java +++ b/mods/tinker/tconstruct/library/util/CoordTuple.java @@ -22,15 +22,15 @@ public class CoordTuple } @Override - public boolean equals(Object obj) + public boolean equals (Object obj) { if (obj == null) return false; - - if(getClass() == obj.getClass()) + + if (getClass() == obj.getClass()) { - CoordTuple coord = (CoordTuple)obj; - if(this.x == coord.x && this.y == coord.y && this.z == coord.z) + CoordTuple coord = (CoordTuple) obj; + if (this.x == coord.x && this.y == coord.y && this.z == coord.z) return true; } return false; diff --git a/mods/tinker/tconstruct/library/util/IActiveLogic.java b/mods/tinker/tconstruct/library/util/IActiveLogic.java index 29b19052..44ba962c 100644 --- a/mods/tinker/tconstruct/library/util/IActiveLogic.java +++ b/mods/tinker/tconstruct/library/util/IActiveLogic.java @@ -2,6 +2,7 @@ package mods.tinker.tconstruct.library.util; public interface IActiveLogic { - public boolean getActive(); - public void setActive(boolean flag); + public boolean getActive (); + + public void setActive (boolean flag); } \ No newline at end of file diff --git a/mods/tinker/tconstruct/library/util/IFacingLogic.java b/mods/tinker/tconstruct/library/util/IFacingLogic.java index bace279d..19461283 100644 --- a/mods/tinker/tconstruct/library/util/IFacingLogic.java +++ b/mods/tinker/tconstruct/library/util/IFacingLogic.java @@ -5,8 +5,11 @@ import net.minecraftforge.common.ForgeDirection; public interface IFacingLogic { - public byte getRenderDirection(); - public ForgeDirection getForgeDirection(); - public void setDirection(int side); - public void setDirection(float yaw, float pitch, EntityLiving player); + public byte getRenderDirection (); + + public ForgeDirection getForgeDirection (); + + public void setDirection (int side); + + public void setDirection (float yaw, float pitch, EntityLiving player); } \ No newline at end of file diff --git a/mods/tinker/tconstruct/library/util/IMasterLogic.java b/mods/tinker/tconstruct/library/util/IMasterLogic.java index e6a553c8..65d5e48a 100644 --- a/mods/tinker/tconstruct/library/util/IMasterLogic.java +++ b/mods/tinker/tconstruct/library/util/IMasterLogic.java @@ -2,5 +2,5 @@ package mods.tinker.tconstruct.library.util; public interface IMasterLogic { - public void notifyChange(int x, int y, int z); + public void notifyChange (int x, int y, int z); } diff --git a/mods/tinker/tconstruct/library/util/IPattern.java b/mods/tinker/tconstruct/library/util/IPattern.java index 5540984f..6c6c274a 100644 --- a/mods/tinker/tconstruct/library/util/IPattern.java +++ b/mods/tinker/tconstruct/library/util/IPattern.java @@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack; public interface IPattern { - public int getPatternCost (ItemStack pattern); - public ItemStack getPatternOutput(ItemStack pattern, ItemStack input, MaterialSet set); + public int getPatternCost (ItemStack pattern); + + public ItemStack getPatternOutput (ItemStack pattern, ItemStack input, MaterialSet set); } diff --git a/mods/tinker/tconstruct/library/util/IServantLogic.java b/mods/tinker/tconstruct/library/util/IServantLogic.java index 2d353c1e..6219d3b2 100644 --- a/mods/tinker/tconstruct/library/util/IServantLogic.java +++ b/mods/tinker/tconstruct/library/util/IServantLogic.java @@ -2,8 +2,11 @@ package mods.tinker.tconstruct.library.util; public interface IServantLogic { - public CoordTuple getMasterPosition (); - public void notifyMasterOfChange(); - public boolean verifyMaster(int x, int y, int z); - public boolean setMaster(int x, int y, int z); + public CoordTuple getMasterPosition (); + + public void notifyMasterOfChange (); + + public boolean verifyMaster (int x, int y, int z); + + public boolean setMaster (int x, int y, int z); } diff --git a/mods/tinker/tconstruct/library/util/IToolPart.java b/mods/tinker/tconstruct/library/util/IToolPart.java index 1c13f93d..23d45791 100644 --- a/mods/tinker/tconstruct/library/util/IToolPart.java +++ b/mods/tinker/tconstruct/library/util/IToolPart.java @@ -9,5 +9,5 @@ public interface IToolPart * @param stack This item * @return Proper material ID. -1 for invalid */ - public int getMaterialID(ItemStack stack); + public int getMaterialID (ItemStack stack); } diff --git a/mods/tinker/tconstruct/library/util/TabTools.java b/mods/tinker/tconstruct/library/util/TabTools.java index e78f2b81..51a8588b 100644 --- a/mods/tinker/tconstruct/library/util/TabTools.java +++ b/mods/tinker/tconstruct/library/util/TabTools.java @@ -5,20 +5,20 @@ import net.minecraft.item.ItemStack; public class TabTools extends CreativeTabs { - ItemStack display; - - public TabTools(String label) - { - super(label); - } - - public void init(ItemStack stack) - { - display = stack; - } - - public ItemStack getIconItemStack() + ItemStack display; + + public TabTools(String label) { - return display; + super(label); + } + + public void init (ItemStack stack) + { + display = stack; + } + + public ItemStack getIconItemStack () + { + return display; } } \ No newline at end of file diff --git a/mods/tinker/tconstruct/library/util/ValueCoordTuple.java b/mods/tinker/tconstruct/library/util/ValueCoordTuple.java index dd5bf4cc..004f7b0e 100644 --- a/mods/tinker/tconstruct/library/util/ValueCoordTuple.java +++ b/mods/tinker/tconstruct/library/util/ValueCoordTuple.java @@ -22,15 +22,15 @@ public class ValueCoordTuple } @Override - public boolean equals(Object obj) + public boolean equals (Object obj) { if (obj == null) return false; - - if(getClass() == obj.getClass()) + + if (getClass() == obj.getClass()) { - ValueCoordTuple coord = (ValueCoordTuple)obj; - if(this.dim == coord.dim && this.x == coord.x && this.z == coord.z) + ValueCoordTuple coord = (ValueCoordTuple) obj; + if (this.dim == coord.dim && this.x == coord.x && this.z == coord.z) return true; } return false; diff --git a/mods/tinker/tconstruct/modifiers/ModAttack.java b/mods/tinker/tconstruct/modifiers/ModAttack.java index 9cfa24df..b52d547b 100644 --- a/mods/tinker/tconstruct/modifiers/ModAttack.java +++ b/mods/tinker/tconstruct/modifiers/ModAttack.java @@ -10,116 +10,114 @@ import net.minecraft.nbt.NBTTagCompound; public class ModAttack extends ToolMod { - String tooltipName; - int increase; - int max = 72; - String guiType; + String tooltipName; + int increase; + int max = 72; + String guiType; - public ModAttack(String type, ItemStack[] items, int effect, int inc) - { - super(items, effect, "ModAttack"); - tooltipName = "\u00a7fSharpness"; - guiType = type; - increase = inc; - } + public ModAttack(String type, ItemStack[] items, int effect, int inc) + { + super(items, effect, "ModAttack"); + tooltipName = "\u00a7fSharpness"; + guiType = type; + increase = inc; + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { ToolCore toolItem = (ToolCore) tool.getItem(); if (!validType(toolItem)) return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0; - int keyPair[] = tags.getIntArray(key); - if (keyPair[0] + increase <= keyPair[1]) - return true; + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.hasKey(key)) + return tags.getInteger("Modifiers") > 0; - - else if (keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; + int keyPair[] = tags.getIntArray(key); + if (keyPair[0] + increase <= keyPair[1]) + return true; - else - return false; - } + else if (keyPair[0] == keyPair[1]) + return tags.getInteger("Modifiers") > 0; + + else + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey(key)) + { + int amount = 24; + ToolCore toolItem = (ToolCore) tool.getItem(); + if (toolItem.pierceArmor() || !nerfType(toolItem)) + amount = 36; + + int[] keyPair = tags.getIntArray(key); + + int leftToBoost = amount - (keyPair[0] % amount); + if (increase >= leftToBoost) + { + int attack = tags.getInteger("Attack"); + attack += 1; + tags.setInteger("Attack", attack); + } + + if (keyPair[0] % max == 0) + { + keyPair[0] += increase; + keyPair[1] += max; + tags.setIntArray(key, keyPair); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + } + else + { + keyPair[0] += increase; + tags.setIntArray(key, keyPair); + } + updateModTag(tool, keyPair); + + } + else + { + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + String modName = "\u00a7f" + guiType + " (" + increase + "/" + max + ")"; + int tooltipIndex = addToolTip(tool, tooltipName, modName); + int[] keyPair = new int[] { increase, max, tooltipIndex }; + tags.setIntArray(key, keyPair); - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - { - int amount = 24; - ToolCore toolItem = (ToolCore) tool.getItem(); - if (toolItem.pierceArmor() || !nerfType(toolItem)) - amount = 36; - - int[] keyPair = tags.getIntArray(key); - - int leftToBoost = amount - (keyPair[0] % amount); - if (increase >= leftToBoost) - { - int attack = tags.getInteger("Attack"); - attack += 1; - tags.setInteger("Attack", attack); - } - - if (keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - - - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00a7f"+guiType+" ("+increase+"/"+max+")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - int[] keyPair = new int[] { increase, max, tooltipIndex }; - tags.setIntArray(key, keyPair); - int attack = tags.getInteger("Attack"); attack += 1; tags.setInteger("Attack", attack); - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip"+keys[2]; - String modName = "\u00a7f"+guiType+" ("+keys[0]+"/"+keys[1]+")"; - tags.setString(tip, modName); - } - - public boolean validType(ToolCore tool) + } + } + + void updateModTag (ItemStack tool, int[] keys) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + String tip = "ModifierTip" + keys[2]; + String modName = "\u00a7f" + guiType + " (" + keys[0] + "/" + keys[1] + ")"; + tags.setString(tip, modName); + } + + public boolean validType (ToolCore tool) { return true; /*List list = Arrays.asList(tool.toolCategories()); return list.contains("melee") || list.contains("harvest") || list.contains("ammo");*/ } - - public boolean nerfType(ToolCore tool) - { - List list = Arrays.asList(tool.toolCategories()); - return list.contains("throwing") || list.contains("ammo"); - } + + public boolean nerfType (ToolCore tool) + { + List list = Arrays.asList(tool.toolCategories()); + return list.contains("throwing") || list.contains("ammo"); + } } diff --git a/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java b/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java index dc8ab60d..46008293 100644 --- a/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java +++ b/mods/tinker/tconstruct/modifiers/ModAutoSmelt.java @@ -10,7 +10,7 @@ public class ModAutoSmelt extends ModBoolean { super(items, effect, tag, c, tip); } - + @Override protected boolean canModify (ItemStack tool, ItemStack[] input) { diff --git a/mods/tinker/tconstruct/modifiers/ModBlaze.java b/mods/tinker/tconstruct/modifiers/ModBlaze.java index 372efee7..01521a66 100644 --- a/mods/tinker/tconstruct/modifiers/ModBlaze.java +++ b/mods/tinker/tconstruct/modifiers/ModBlaze.java @@ -10,91 +10,90 @@ import net.minecraft.nbt.NBTTagCompound; public class ModBlaze extends ToolMod { - String tooltipName; - int increase; - int max; + String tooltipName; + int increase; + int max; - public ModBlaze(ItemStack[] items, int effect, int inc) - { - super(items, effect, "Blaze"); - tooltipName = "\u00a76Fiery"; - increase = inc; - max = 25; - } + public ModBlaze(ItemStack[] items, int effect, int inc) + { + super(items, effect, "Blaze"); + tooltipName = "\u00a76Fiery"; + increase = inc; + max = 25; + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - ToolCore toolItem = (ToolCore) tool.getItem(); + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + ToolCore toolItem = (ToolCore) tool.getItem(); if (!validType(toolItem)) return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0; - int keyPair[] = tags.getIntArray(key); - if (keyPair[0] + increase <= keyPair[1]) - return true; + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.hasKey(key)) + return tags.getInteger("Modifiers") > 0; - - else if (keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; + int keyPair[] = tags.getIntArray(key); + if (keyPair[0] + increase <= keyPair[1]) + return true; - else - return false; - } + else if (keyPair[0] == keyPair[1]) + return tags.getInteger("Modifiers") > 0; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - { - int[] keyPair = tags.getIntArray(key); - if (keyPair[0] == max) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00a76Blaze ("+increase+"/"+max+")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - int[] keyPair = new int[] { increase, max, tooltipIndex }; - tags.setIntArray(key, keyPair); - } - - int fiery = tags.getInteger("Fiery"); - fiery += (increase); - tags.setInteger("Fiery", fiery); - - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip"+keys[2]; - String modName = "\u00a76Blaze ("+keys[0]+"/"+keys[1]+")"; - tags.setString(tip, modName); - } - - public boolean validType(ToolCore tool) + else + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey(key)) + { + int[] keyPair = tags.getIntArray(key); + if (keyPair[0] == max) + { + keyPair[0] += increase; + keyPair[1] += max; + tags.setIntArray(key, keyPair); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + } + else + { + keyPair[0] += increase; + tags.setIntArray(key, keyPair); + } + updateModTag(tool, keyPair); + } + else + { + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + String modName = "\u00a76Blaze (" + increase + "/" + max + ")"; + int tooltipIndex = addToolTip(tool, tooltipName, modName); + int[] keyPair = new int[] { increase, max, tooltipIndex }; + tags.setIntArray(key, keyPair); + } + + int fiery = tags.getInteger("Fiery"); + fiery += (increase); + tags.setInteger("Fiery", fiery); + + } + + void updateModTag (ItemStack tool, int[] keys) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + String tip = "ModifierTip" + keys[2]; + String modName = "\u00a76Blaze (" + keys[0] + "/" + keys[1] + ")"; + tags.setString(tip, modName); + } + + public boolean validType (ToolCore tool) { List list = Arrays.asList(tool.toolCategories()); return list.contains("melee") || list.contains("ammo"); diff --git a/mods/tinker/tconstruct/modifiers/ModBoolean.java b/mods/tinker/tconstruct/modifiers/ModBoolean.java index 57e89e74..02d78281 100644 --- a/mods/tinker/tconstruct/modifiers/ModBoolean.java +++ b/mods/tinker/tconstruct/modifiers/ModBoolean.java @@ -8,35 +8,35 @@ import net.minecraft.nbt.NBTTagCompound; public class ModBoolean extends ToolMod { - String color; - String tooltipName; - - public ModBoolean(ItemStack[] items, int effect, String tag, String c, String tip) - { - super(items, effect, tag); - color = c; - tooltipName = tip; - } - - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key); //Will fail if the modifier is false or the tag doesn't exist - } + String color; + String tooltipName; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - tags.setBoolean(key, true); - //System.out.println("Key: "+key+" "+tags.getBoolean(key)); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - - addToolTip(tool, color+tooltipName, color+key); - } + public ModBoolean(ItemStack[] items, int effect, String tag, String c, String tip) + { + super(items, effect, tag); + color = c; + tooltipName = tip; + } + + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + return tags.getInteger("Modifiers") > 0 && !tags.getBoolean(key); //Will fail if the modifier is false or the tag doesn't exist + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + tags.setBoolean(key, true); + //System.out.println("Key: "+key+" "+tags.getBoolean(key)); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + + addToolTip(tool, color + tooltipName, color + key); + } } diff --git a/mods/tinker/tconstruct/modifiers/ModButtertouch.java b/mods/tinker/tconstruct/modifiers/ModButtertouch.java index 4bd069d2..45291370 100644 --- a/mods/tinker/tconstruct/modifiers/ModButtertouch.java +++ b/mods/tinker/tconstruct/modifiers/ModButtertouch.java @@ -43,23 +43,23 @@ public class ModButtertouch extends ModBoolean NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); tags.setBoolean(key, true); addEnchantment(tool, Enchantment.silkTouch, 1); - + int modifiers = tags.getInteger("Modifiers"); modifiers -= 1; tags.setInteger("Modifiers", modifiers); - + int attack = tags.getInteger("Attack"); attack -= 3; if (attack < 0) attack = 0; tags.setInteger("Attack", attack); - + int miningSpeed = tags.getInteger("MiningSpeed"); miningSpeed -= 300; if (miningSpeed < 0) miningSpeed = 0; tags.setInteger("MiningSpeed", miningSpeed); - + if (tags.hasKey("MiningSpeed2")) { int miningSpeed2 = tags.getInteger("MiningSpeed2"); @@ -69,7 +69,7 @@ public class ModButtertouch extends ModBoolean tags.setInteger("MiningSpeed2", miningSpeed2); } - addToolTip(tool, color+tooltipName, color+key); + addToolTip(tool, color + tooltipName, color + key); } public void addEnchantment (ItemStack tool, Enchantment enchant, int level) diff --git a/mods/tinker/tconstruct/modifiers/ModDurability.java b/mods/tinker/tconstruct/modifiers/ModDurability.java index 1bdf9413..022e829f 100644 --- a/mods/tinker/tconstruct/modifiers/ModDurability.java +++ b/mods/tinker/tconstruct/modifiers/ModDurability.java @@ -8,62 +8,62 @@ import net.minecraft.nbt.NBTTagCompound; public class ModDurability extends ToolMod { - String tooltipName; - String color; - int durability; - float modifier; - int miningLevel; - - public ModDurability(ItemStack[] items, int effect, int dur, float mod, int level, String k, String tip, String c) - { - super(items, effect, k); - durability = dur; - modifier = mod; - miningLevel = level; - tooltipName = tip; - color = c; - } - - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - return false; - return super.canModify(tool, input); - } + String tooltipName; + String color; + int durability; + float modifier; + int miningLevel; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - - int base = tags.getInteger("BaseDurability"); - int bonus = tags.getInteger("BonusDurability"); - float modDur = tags.getFloat("ModDurability"); - - bonus += durability; - modDur += modifier; - - int total = (int) ((base + bonus) * (modDur+1f)); - if (total <= 0) - total = 1; - - tags.setInteger("TotalDurability", total); - tags.setInteger("BonusDurability", bonus); - tags.setFloat("ModDurability", modDur); - - int mLevel = tags.getInteger("HarvestLevel"); - if (mLevel < miningLevel) - tags.setInteger("HarvestLevel", miningLevel); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - - tags.setBoolean(key, true); - String modTip = color+key; - addToolTip(tool, tooltipName, modTip); - } + public ModDurability(ItemStack[] items, int effect, int dur, float mod, int level, String k, String tip, String c) + { + super(items, effect, k); + durability = dur; + modifier = mod; + miningLevel = level; + tooltipName = tip; + color = c; + } + + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey(key)) + return false; + return super.canModify(tool, input); + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + + int base = tags.getInteger("BaseDurability"); + int bonus = tags.getInteger("BonusDurability"); + float modDur = tags.getFloat("ModDurability"); + + bonus += durability; + modDur += modifier; + + int total = (int) ((base + bonus) * (modDur + 1f)); + if (total <= 0) + total = 1; + + tags.setInteger("TotalDurability", total); + tags.setInteger("BonusDurability", bonus); + tags.setFloat("ModDurability", modDur); + + int mLevel = tags.getInteger("HarvestLevel"); + if (mLevel < miningLevel) + tags.setInteger("HarvestLevel", miningLevel); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + + tags.setBoolean(key, true); + String modTip = color + key; + addToolTip(tool, tooltipName, modTip); + } } diff --git a/mods/tinker/tconstruct/modifiers/ModElectric.java b/mods/tinker/tconstruct/modifiers/ModElectric.java index fde69766..a1839278 100644 --- a/mods/tinker/tconstruct/modifiers/ModElectric.java +++ b/mods/tinker/tconstruct/modifiers/ModElectric.java @@ -11,76 +11,76 @@ import net.minecraft.nbt.NBTTagCompound; /* IC2 support */ public class ModElectric extends ModBoolean -{ - public ArrayList circuits = new ArrayList(); - public ArrayList batteries = new ArrayList(); - - public ModElectric() - { - super(new ItemStack[0], 9, "Electric", "\u00a7e", ""); - } - - @Override - public boolean matches (ItemStack[] input, ItemStack tool) - { - if (input[0] == null || input[1] == null) - return false; - - boolean circuit = false; - boolean battery = false; - - for (ItemStack stack : circuits) - { - if (stack.isItemEqual(input[0]) || stack.isItemEqual(input[1])) - circuit = true; - } - - for (ItemStack stack : batteries) - { - if (stack.itemID == input[0].itemID && input[0].getItem() instanceof IElectricItem) - { - battery = true; - } - if (stack.itemID == input[1].itemID && input[1].getItem() instanceof IElectricItem) +{ + public ArrayList circuits = new ArrayList(); + public ArrayList batteries = new ArrayList(); + + public ModElectric() + { + super(new ItemStack[0], 9, "Electric", "\u00a7e", ""); + } + + @Override + public boolean matches (ItemStack[] input, ItemStack tool) + { + if (input[0] == null || input[1] == null) + return false; + + boolean circuit = false; + boolean battery = false; + + for (ItemStack stack : circuits) + { + if (stack.isItemEqual(input[0]) || stack.isItemEqual(input[1])) + circuit = true; + } + + for (ItemStack stack : batteries) + { + if (stack.itemID == input[0].itemID && input[0].getItem() instanceof IElectricItem) { battery = true; } - } - return circuit && battery && canModify(tool, input); - } - - /*@Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0; + if (stack.itemID == input[1].itemID && input[1].getItem() instanceof IElectricItem) + { + battery = true; + } + } + return circuit && battery && canModify(tool, input); + } - return false; - }*/ - - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound(); - - if (!tags.hasKey(key)) - { - tags.setBoolean(key, true); - - int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers"); - modifiers -= 1; - tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers); - int charge = 0; - if (input[0].getItem() instanceof IElectricItem && input[0].hasTagCompound()) - charge = input[0].getTagCompound().getInteger("charge"); + /*@Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.hasKey(key)) + return tags.getInteger("Modifiers") > 0; + + return false; + }*/ + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound(); + + if (!tags.hasKey(key)) + { + tags.setBoolean(key, true); + + int modifiers = tags.getCompoundTag("InfiTool").getInteger("Modifiers"); + modifiers -= 1; + tags.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers); + int charge = 0; + if (input[0].getItem() instanceof IElectricItem && input[0].hasTagCompound()) + charge = input[0].getTagCompound().getInteger("charge"); if (input[1].getItem() instanceof IElectricItem && input[1].hasTagCompound()) charge = input[1].getTagCompound().getInteger("charge"); - tags.setInteger("charge", charge); - tags.setInteger(key, 1); - addModifierTip(tool, "\u00a7eElectric"); - ToolCore toolcore = (ToolCore) tool.getItem(); - tool.setItemDamage(1 + (toolcore.getMaxCharge(tool) - charge) * (tool.getMaxDamage() - 1) / toolcore.getMaxCharge(tool)); - } - } + tags.setInteger("charge", charge); + tags.setInteger(key, 1); + addModifierTip(tool, "\u00a7eElectric"); + ToolCore toolcore = (ToolCore) tool.getItem(); + tool.setItemDamage(1 + (toolcore.getMaxCharge(tool) - charge) * (tool.getMaxDamage() - 1) / toolcore.getMaxCharge(tool)); + } + } } diff --git a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java index 16f9f67a..afe8c210 100644 --- a/mods/tinker/tconstruct/modifiers/ModExtraModifier.java +++ b/mods/tinker/tconstruct/modifiers/ModExtraModifier.java @@ -33,6 +33,8 @@ public class ModExtraModifier extends ToolMod modifiers += 1; tags.setInteger("Modifiers", modifiers); } - - public void addMatchingEffect (ItemStack tool) {} + + public void addMatchingEffect (ItemStack tool) + { + } } diff --git a/mods/tinker/tconstruct/modifiers/ModInteger.java b/mods/tinker/tconstruct/modifiers/ModInteger.java index 2d1fccb5..16182942 100644 --- a/mods/tinker/tconstruct/modifiers/ModInteger.java +++ b/mods/tinker/tconstruct/modifiers/ModInteger.java @@ -8,48 +8,48 @@ import net.minecraft.nbt.NBTTagCompound; public class ModInteger extends ToolMod { - String color; - String tooltipName; - int initialIncrease; - int secondaryIncrease; - - public ModInteger(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip) - { - super(items, effect, dataKey); - initialIncrease = secondaryIncrease = increase; - color = c; - tooltipName = tip; - } - - public ModInteger(ItemStack[] items, int effect, String dataKey, int increase1, int increase2, String c, String tip) - { - super(items, effect, dataKey); - initialIncrease = increase1; - secondaryIncrease = increase2; - color = c; - tooltipName = tip; - } + String color; + String tooltipName; + int initialIncrease; + int secondaryIncrease; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - { - int increase = tags.getInteger(key); - increase += secondaryIncrease; - tags.setInteger(key, increase); - } - else - { - tags.setInteger(key, initialIncrease); - } - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); + public ModInteger(ItemStack[] items, int effect, String dataKey, int increase, String c, String tip) + { + super(items, effect, dataKey); + initialIncrease = secondaryIncrease = increase; + color = c; + tooltipName = tip; + } - addToolTip(tool, color+tooltipName, color+key); - } + public ModInteger(ItemStack[] items, int effect, String dataKey, int increase1, int increase2, String c, String tip) + { + super(items, effect, dataKey); + initialIncrease = increase1; + secondaryIncrease = increase2; + color = c; + tooltipName = tip; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey(key)) + { + int increase = tags.getInteger(key); + increase += secondaryIncrease; + tags.setInteger(key, increase); + } + else + { + tags.setInteger(key, initialIncrease); + } + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + + addToolTip(tool, color + tooltipName, color + key); + } } diff --git a/mods/tinker/tconstruct/modifiers/ModLapis.java b/mods/tinker/tconstruct/modifiers/ModLapis.java index 4bac944e..83c820c7 100644 --- a/mods/tinker/tconstruct/modifiers/ModLapis.java +++ b/mods/tinker/tconstruct/modifiers/ModLapis.java @@ -33,12 +33,12 @@ public class ModLapis extends ToolMod ToolCore toolItem = (ToolCore) tool.getItem(); if (!validType(toolItem)) return false; - + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - + if (tags.getBoolean("Silk Touch")) return false; - + if (!tags.hasKey(key)) return tags.getInteger("Modifiers") > 0; @@ -200,8 +200,8 @@ public class ModLapis extends ToolMod String modName = "\u00a79Lapis (" + keys[0] + "/" + max + ")"; tags.setString(tip, modName); } - - public boolean validType(ToolCore tool) + + public boolean validType (ToolCore tool) { List list = Arrays.asList(tool.toolCategories()); return list.contains("weapon") || list.contains("harvest"); diff --git a/mods/tinker/tconstruct/modifiers/ModPiston.java b/mods/tinker/tconstruct/modifiers/ModPiston.java index ee91aa77..d1f4c293 100644 --- a/mods/tinker/tconstruct/modifiers/ModPiston.java +++ b/mods/tinker/tconstruct/modifiers/ModPiston.java @@ -10,91 +10,90 @@ import net.minecraft.nbt.NBTTagCompound; public class ModPiston extends ToolMod { - String tooltipName; - int increase; - int max; + String tooltipName; + int increase; + int max; - public ModPiston(ItemStack[] items, int effect, int inc) - { - super(items, effect, "Piston"); - tooltipName = "\u00a77Knockback"; - increase = inc; - max = 10; - } + public ModPiston(ItemStack[] items, int effect, int inc) + { + super(items, effect, "Piston"); + tooltipName = "\u00a77Knockback"; + increase = inc; + max = 10; + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - ToolCore toolItem = (ToolCore) tool.getItem(); - if (!validType(toolItem)) - return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0; + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + ToolCore toolItem = (ToolCore) tool.getItem(); + if (!validType(toolItem)) + return false; - int keyPair[] = tags.getIntArray(key); - if (keyPair[0] + increase <= keyPair[1]) - return true; + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.hasKey(key)) + return tags.getInteger("Modifiers") > 0; - - else if (keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; + int keyPair[] = tags.getIntArray(key); + if (keyPair[0] + increase <= keyPair[1]) + return true; - else - return false; - } + else if (keyPair[0] == keyPair[1]) + return tags.getInteger("Modifiers") > 0; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.hasKey(key)) - { - int[] keyPair = tags.getIntArray(key); - if (keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00a74Knockback ("+increase+"/"+max+")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - int[] keyPair = new int[] { increase, max, tooltipIndex }; - tags.setIntArray(key, keyPair); - } - - float knockback = tags.getFloat("Knockback"); - - knockback += 0.1 * increase; + else + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey(key)) + { + int[] keyPair = tags.getIntArray(key); + if (keyPair[0] % max == 0) + { + keyPair[0] += increase; + keyPair[1] += max; + tags.setIntArray(key, keyPair); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + } + else + { + keyPair[0] += increase; + tags.setIntArray(key, keyPair); + } + updateModTag(tool, keyPair); + } + else + { + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + String modName = "\u00a74Knockback (" + increase + "/" + max + ")"; + int tooltipIndex = addToolTip(tool, tooltipName, modName); + int[] keyPair = new int[] { increase, max, tooltipIndex }; + tags.setIntArray(key, keyPair); + } + + float knockback = tags.getFloat("Knockback"); + + knockback += 0.1 * increase; tags.setFloat("Knockback", knockback); - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip"+keys[2]; - String modName = "\u00a77Knockback ("+keys[0]+"/"+keys[1]+")"; - tags.setString(tip, modName); - } - - public boolean validType(ToolCore tool) + } + + void updateModTag (ItemStack tool, int[] keys) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + String tip = "ModifierTip" + keys[2]; + String modName = "\u00a77Knockback (" + keys[0] + "/" + keys[1] + ")"; + tags.setString(tip, modName); + } + + public boolean validType (ToolCore tool) { List list = Arrays.asList(tool.toolCategories()); return list.contains("weapon"); diff --git a/mods/tinker/tconstruct/modifiers/ModPotion.java b/mods/tinker/tconstruct/modifiers/ModPotion.java index 7ade0994..a29c63ed 100644 --- a/mods/tinker/tconstruct/modifiers/ModPotion.java +++ b/mods/tinker/tconstruct/modifiers/ModPotion.java @@ -12,7 +12,7 @@ public class ModPotion extends ToolMod { super(new ItemStack[] { new ItemStack(Item.potion, 1, Short.MAX_VALUE) }, 0, ""); } - + protected boolean canModify (ItemStack tool, ItemStack[] input) { NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); @@ -26,7 +26,7 @@ public class ModPotion extends ToolMod @Override public void modify (ItemStack[] input, ItemStack tool) { - + } } diff --git a/mods/tinker/tconstruct/modifiers/ModRedstone.java b/mods/tinker/tconstruct/modifiers/ModRedstone.java index 7ee4723c..95165e02 100644 --- a/mods/tinker/tconstruct/modifiers/ModRedstone.java +++ b/mods/tinker/tconstruct/modifiers/ModRedstone.java @@ -10,106 +10,105 @@ import net.minecraft.nbt.NBTTagCompound; public class ModRedstone extends ToolMod { - String tooltipName; - int increase; - int max; + String tooltipName; + int increase; + int max; - public ModRedstone(ItemStack[] items, int effect, int inc) - { - super(items, effect, "Redstone"); - tooltipName = "\u00a74Haste"; - increase = inc; - max = 50; - } + public ModRedstone(ItemStack[] items, int effect, int inc) + { + super(items, effect, "Redstone"); + tooltipName = "\u00a74Haste"; + increase = inc; + max = 50; + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - ToolCore toolItem = (ToolCore) tool.getItem(); - if (!validType(toolItem)) - return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (!tags.hasKey(key)) - return tags.getInteger("Modifiers") > 0; + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + ToolCore toolItem = (ToolCore) tool.getItem(); + if (!validType(toolItem)) + return false; - int keyPair[] = tags.getIntArray(key); - if (keyPair[0] + increase <= keyPair[1]) - return true; + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (!tags.hasKey(key)) + return tags.getInteger("Modifiers") > 0; - - else if (keyPair[0] == keyPair[1]) - return tags.getInteger("Modifiers") > 0; + int keyPair[] = tags.getIntArray(key); + if (keyPair[0] + increase <= keyPair[1]) + return true; - else - return false; - } + else if (keyPair[0] == keyPair[1]) + return tags.getInteger("Modifiers") > 0; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - int[] keyPair; - if (tags.hasKey(key)) - { - keyPair = tags.getIntArray(key); - if (keyPair[0] % max == 0) - { - keyPair[0] += increase; - keyPair[1] += max; - tags.setIntArray(key, keyPair); - - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - } - else - { - keyPair[0] += increase; - tags.setIntArray(key, keyPair); - } - updateModTag(tool, keyPair); - } - else - { - int modifiers = tags.getInteger("Modifiers"); - modifiers -= 1; - tags.setInteger("Modifiers", modifiers); - String modName = "\u00a74Redstone ("+increase+"/"+max+")"; - int tooltipIndex = addToolTip(tool, tooltipName, modName); - keyPair = new int[] { increase, max, tooltipIndex }; - tags.setIntArray(key, keyPair); - } - - int miningSpeed = tags.getInteger("MiningSpeed"); - miningSpeed += (increase*8); - tags.setInteger("MiningSpeed", miningSpeed); - - if (tags.hasKey("MiningSpeed2")) - { - int miningSpeed2 = tags.getInteger("MiningSpeed2"); - miningSpeed2 += (increase*8); - tags.setInteger("MiningSpeed2", miningSpeed2); - } - - if (tags.hasKey("DrawSpeed")) - { - //int drawSpeed = tags.getInteger("DrawSpeed"); + else + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int[] keyPair; + if (tags.hasKey(key)) + { + keyPair = tags.getIntArray(key); + if (keyPair[0] % max == 0) + { + keyPair[0] += increase; + keyPair[1] += max; + tags.setIntArray(key, keyPair); + + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + } + else + { + keyPair[0] += increase; + tags.setIntArray(key, keyPair); + } + updateModTag(tool, keyPair); + } + else + { + int modifiers = tags.getInteger("Modifiers"); + modifiers -= 1; + tags.setInteger("Modifiers", modifiers); + String modName = "\u00a74Redstone (" + increase + "/" + max + ")"; + int tooltipIndex = addToolTip(tool, tooltipName, modName); + keyPair = new int[] { increase, max, tooltipIndex }; + tags.setIntArray(key, keyPair); + } + + int miningSpeed = tags.getInteger("MiningSpeed"); + miningSpeed += (increase * 8); + tags.setInteger("MiningSpeed", miningSpeed); + + if (tags.hasKey("MiningSpeed2")) + { + int miningSpeed2 = tags.getInteger("MiningSpeed2"); + miningSpeed2 += (increase * 8); + tags.setInteger("MiningSpeed2", miningSpeed2); + } + + if (tags.hasKey("DrawSpeed")) + { + //int drawSpeed = tags.getInteger("DrawSpeed"); int baseDrawSpeed = tags.getInteger("BaseDrawSpeed"); - int drawSpeed = (int) (baseDrawSpeed - (0.1f * baseDrawSpeed * (keyPair[0] / 50f) )); + int drawSpeed = (int) (baseDrawSpeed - (0.1f * baseDrawSpeed * (keyPair[0] / 50f))); tags.setInteger("DrawSpeed", drawSpeed); - } - } - - void updateModTag(ItemStack tool, int[] keys) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - String tip = "ModifierTip"+keys[2]; - String modName = "\u00a74Redstone ("+keys[0]+"/"+keys[1]+")"; - tags.setString(tip, modName); - } - - public boolean validType(ToolCore tool) + } + } + + void updateModTag (ItemStack tool, int[] keys) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + String tip = "ModifierTip" + keys[2]; + String modName = "\u00a74Redstone (" + keys[0] + "/" + keys[1] + ")"; + tags.setString(tip, modName); + } + + public boolean validType (ToolCore tool) { List list = Arrays.asList(tool.toolCategories()); return list.contains("harvest") || list.contains("utility") || list.contains("bow"); diff --git a/mods/tinker/tconstruct/modifiers/ModReinforced.java b/mods/tinker/tconstruct/modifiers/ModReinforced.java index 5a7c2749..d365665f 100644 --- a/mods/tinker/tconstruct/modifiers/ModReinforced.java +++ b/mods/tinker/tconstruct/modifiers/ModReinforced.java @@ -25,18 +25,18 @@ public class ModReinforced extends ModInteger { tags.setInteger(key, initialIncrease); } - + int modifiers = tags.getInteger("Modifiers"); modifiers -= 1; tags.setInteger("Modifiers", modifiers); - + int reinforced = tags.getInteger("Unbreaking"); reinforced += 1; tags.setInteger("Unbreaking", reinforced); - - addToolTip(tool, color+tooltipName, color+key); + + addToolTip(tool, color + tooltipName, color + key); } - + protected int addToolTip (ItemStack tool, String tooltip, String modifierTip) { NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); diff --git a/mods/tinker/tconstruct/modifiers/ModRepair.java b/mods/tinker/tconstruct/modifiers/ModRepair.java index 52a05c93..ec636d71 100644 --- a/mods/tinker/tconstruct/modifiers/ModRepair.java +++ b/mods/tinker/tconstruct/modifiers/ModRepair.java @@ -12,87 +12,89 @@ import net.minecraft.nbt.NBTTagCompound; public class ModRepair extends ToolMod { - public ModRepair() - { - super(new ItemStack[0], 0, ""); - } - - @Override - public boolean matches (ItemStack[] input, ItemStack tool) - { - return canModify(tool, input); - } + public ModRepair() + { + super(new ItemStack[0], 0, ""); + } - @Override - protected boolean canModify (ItemStack tool, ItemStack[] input) - { - if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack - return false; - - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - if (tags.getInteger("Damage") > 0) - { - int headID = tags.getInteger("Head"); - int matID = -1; - if (input [0] != null) - matID = PatternBuilder.instance.getPartID(input[0]); - else - matID = PatternBuilder.instance.getPartID(input[1]); - - if (matID == headID) - return true; - } - return false; - } + @Override + public boolean matches (ItemStack[] input, ItemStack tool) + { + return canModify(tool, input); + } + + @Override + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack + return false; + + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getInteger("Damage") > 0) + { + int headID = tags.getInteger("Head"); + int matID = -1; + if (input[0] != null) + matID = PatternBuilder.instance.getPartID(input[0]); + else + matID = PatternBuilder.instance.getPartID(input[1]); + + if (matID == headID) + return true; + } + return false; + } + + @Override + public void modify (ItemStack[] input, ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + tags.setBoolean("Broken", false); + int damage = tags.getInteger("Damage"); + int dur = tags.getInteger("BaseDurability"); + + int materialValue = 0; + if (input[0] != null) + materialValue = PatternBuilder.instance.getPartValue(input[0]); + else + materialValue = PatternBuilder.instance.getPartValue(input[1]); + + int increase = (int) (50 + (dur * 0.4f * materialValue)); + //System.out.println("Increase: "+increase); + + int modifiers = tags.getInteger("Modifiers"); + float mods = 1.0f; + if (modifiers == 2) + mods = 0.8f; + else if (modifiers == 1) + mods = 0.6f; + else if (modifiers == 0) + mods = 0.4f; + + increase *= mods; - @Override - public void modify (ItemStack[] input, ItemStack tool) - { - NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); - tags.setBoolean("Broken", false); - int damage = tags.getInteger("Damage"); - int dur = tags.getInteger("BaseDurability"); - - int materialValue = 0; - if (input [0] != null) - materialValue = PatternBuilder.instance.getPartValue(input[0]); - else - materialValue = PatternBuilder.instance.getPartValue(input[1]); - - int increase = (int) (50 + (dur * 0.4f * materialValue)); - //System.out.println("Increase: "+increase); - - int modifiers = tags.getInteger("Modifiers"); - float mods = 1.0f; - if (modifiers == 2) - mods = 0.8f; - else if (modifiers == 1) - mods = 0.6f; - else if (modifiers == 0) - mods = 0.4f; - - increase *= mods; - int repair = tags.getInteger("RepairCount"); repair += 1; tags.setInteger("RepairCount", repair); - + float repairCount = (100 - repair) / 100f; if (repairCount < 0.5f) repairCount = 0.5f; increase *= repairCount; increase /= ((ToolCore) tool.getItem()).getRepairCost(); - - damage -= increase; - if (damage < 0) - damage = 0; - tags.setInteger("Damage", damage); - - AbilityHelper.damageTool(tool, 0, null, true); - //tool.setItemDamage(damage * 100 / dur); - - } - - @Override - public void addMatchingEffect (ItemStack tool) {} + + damage -= increase; + if (damage < 0) + damage = 0; + tags.setInteger("Damage", damage); + + AbilityHelper.damageTool(tool, 0, null, true); + //tool.setItemDamage(damage * 100 / dur); + + } + + @Override + public void addMatchingEffect (ItemStack tool) + { + } } diff --git a/mods/tinker/tconstruct/plugins/minefactoryreloaded/MineFactoryReloaded.java b/mods/tinker/tconstruct/plugins/minefactoryreloaded/MineFactoryReloaded.java index 52dc1351..ddc72c40 100644 --- a/mods/tinker/tconstruct/plugins/minefactoryreloaded/MineFactoryReloaded.java +++ b/mods/tinker/tconstruct/plugins/minefactoryreloaded/MineFactoryReloaded.java @@ -13,42 +13,41 @@ import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; - @Mod(modid = "TConstruct|CompatMineFactoryReloaded", name = "TConstruct Compat: MFR", version = "0.1", dependencies = "after:MineFactoryReloaded;after:TConstruct") @NetworkMod(clientSideRequired = false, serverSideRequired = false) public class MineFactoryReloaded { - @Init - public static void load(FMLInitializationEvent ev) - { - if(!Loader.isModLoaded("MineFactoryReloaded")) - { - FMLLog.warning("MineFactoryReloaded missing - TConstruct Compat: MFR not loading."); - return; - } - try - { - FMLLog.fine("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry."); - - FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerry.blockID, TContent.oreBerries.itemID, 0)); - FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerrySecond.blockID, TContent.oreBerries.itemID, 4)); - - // A note: in 1.6, this method of registering grindables will no longer exist, once MFR moves to a more universal way of gathering drops. - FarmingRegistry.registerGrindable(new GrindableStandard(BlueSlime.class, new ItemStack(TContent.strangeFood))); - //FarmingRegistry.registerGrindable(new GrindableStandard(Crystal.class, new ItemStack(Item.gunpowder))); - //FarmingRegistry.registerGrindable(new GrindableStandard(MetalSlime.class, new ItemStack(TContent.strangeFood))); - //FarmingRegistry.registerGrindable(new GrindableStandard(NitroCreeper.class, new ItemStack(Item.gunpowder))); - //FarmingRegistry.registerGrindable(new GrindableStandard(Skyla.class, new ItemStack(Item.gunpowder))); - - /* - * Perhaps TC ores should be registered as drops from the MFR Laser Drill here, but I don't know which things would be suitable for that. - * Syntax: FarmingRegistry.registerLaserOre(int weight, ItemStack droppedStack)); - * Currently used weights are from about 50 (emerald) to 175 (coal). - */ - } - catch(Exception e) - { - e.printStackTrace(); - } - } + @Init + public static void load (FMLInitializationEvent ev) + { + if (!Loader.isModLoaded("MineFactoryReloaded")) + { + FMLLog.warning("MineFactoryReloaded missing - TConstruct Compat: MFR not loading."); + return; + } + try + { + FMLLog.fine("MineFactoryReloaded detected. Registering TConstruct farmables/grindables with MFR's Farming Registry."); + + FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerry.blockID, TContent.oreBerries.itemID, 0)); + FarmingRegistry.registerHarvestable(new HarvestableOreBerry(TContent.oreBerrySecond.blockID, TContent.oreBerries.itemID, 4)); + + // A note: in 1.6, this method of registering grindables will no longer exist, once MFR moves to a more universal way of gathering drops. + FarmingRegistry.registerGrindable(new GrindableStandard(BlueSlime.class, new ItemStack(TContent.strangeFood))); + //FarmingRegistry.registerGrindable(new GrindableStandard(Crystal.class, new ItemStack(Item.gunpowder))); + //FarmingRegistry.registerGrindable(new GrindableStandard(MetalSlime.class, new ItemStack(TContent.strangeFood))); + //FarmingRegistry.registerGrindable(new GrindableStandard(NitroCreeper.class, new ItemStack(Item.gunpowder))); + //FarmingRegistry.registerGrindable(new GrindableStandard(Skyla.class, new ItemStack(Item.gunpowder))); + + /* + * Perhaps TC ores should be registered as drops from the MFR Laser Drill here, but I don't know which things would be suitable for that. + * Syntax: FarmingRegistry.registerLaserOre(int weight, ItemStack droppedStack)); + * Currently used weights are from about 50 (emerald) to 175 (coal). + */ + } + catch (Exception e) + { + e.printStackTrace(); + } + } } \ No newline at end of file diff --git a/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java b/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java index 76f66ac4..10cb56ca 100644 --- a/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java +++ b/mods/tinker/tconstruct/plugins/minefactoryreloaded/grindables/GrindableStandard.java @@ -13,41 +13,41 @@ import powercrystals.minefactoryreloaded.api.MobDrop; public class GrindableStandard implements IFactoryGrindable { - private Class _grindableClass; - private List _drops; - - public GrindableStandard(Class entityToGrind, MobDrop[] dropStacks) - { - _grindableClass = entityToGrind; - _drops = new ArrayList(); - for(MobDrop d : dropStacks) - { - _drops.add(d); - } - } - - public GrindableStandard(Class entityToGrind, ItemStack dropStack) - { - _grindableClass = entityToGrind; - _drops = new ArrayList(); - _drops.add(new MobDrop(10, dropStack)); - } - - public GrindableStandard(Class entityToGrind) - { - _grindableClass = entityToGrind; - _drops = new ArrayList(); - } - - @Override - public Class getGrindableEntity() - { - return _grindableClass; - } - - @Override - public List grind(World world, EntityLiving entity, Random random) - { - return _drops; - } + private Class _grindableClass; + private List _drops; + + public GrindableStandard(Class entityToGrind, MobDrop[] dropStacks) + { + _grindableClass = entityToGrind; + _drops = new ArrayList(); + for (MobDrop d : dropStacks) + { + _drops.add(d); + } + } + + public GrindableStandard(Class entityToGrind, ItemStack dropStack) + { + _grindableClass = entityToGrind; + _drops = new ArrayList(); + _drops.add(new MobDrop(10, dropStack)); + } + + public GrindableStandard(Class entityToGrind) + { + _grindableClass = entityToGrind; + _drops = new ArrayList(); + } + + @Override + public Class getGrindableEntity () + { + return _grindableClass; + } + + @Override + public List grind (World world, EntityLiving entity, Random random) + { + return _drops; + } } diff --git a/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java b/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java index baa97b88..27f487f9 100644 --- a/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java +++ b/mods/tinker/tconstruct/plugins/minefactoryreloaded/harvestables/HarvestableOreBerry.java @@ -13,56 +13,56 @@ import powercrystals.minefactoryreloaded.api.IFactoryHarvestable; public class HarvestableOreBerry implements IFactoryHarvestable { - private int _sourceBlockId; - private int _berryItemId; - private int _metaOffset; - - public HarvestableOreBerry(int sourceBlockId, int berryItemId, int metaOffset) - { - _sourceBlockId = sourceBlockId; - _berryItemId = berryItemId; - _metaOffset = metaOffset; - } - - @Override - public int getPlantId() - { - return _sourceBlockId; - } - - @Override - public HarvestType getHarvestType() - { - return HarvestType.Column; - } - - @Override - public boolean breakBlock() - { - return false; - } - - @Override - public boolean canBeHarvested(World world, Map harvesterSettings, int x, int y, int z) - { - return world.getBlockMetadata(x, y, z) >= 12; - } - - @Override - public List getDrops(World world, Random rand, Map harvesterSettings, int x, int y, int z) - { - ItemStack[] returnItems = {new ItemStack(_berryItemId, 1, world.getBlockMetadata(x, y, z) % 4 + _metaOffset)}; - return Arrays.asList(returnItems); - } - - @Override - public void preHarvest(World world, int x, int y, int z) - { - } - - @Override - public void postHarvest(World world, int x, int y, int z) - { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x,y,z) - 4, 2); - } + private int _sourceBlockId; + private int _berryItemId; + private int _metaOffset; + + public HarvestableOreBerry(int sourceBlockId, int berryItemId, int metaOffset) + { + _sourceBlockId = sourceBlockId; + _berryItemId = berryItemId; + _metaOffset = metaOffset; + } + + @Override + public int getPlantId () + { + return _sourceBlockId; + } + + @Override + public HarvestType getHarvestType () + { + return HarvestType.Column; + } + + @Override + public boolean breakBlock () + { + return false; + } + + @Override + public boolean canBeHarvested (World world, Map harvesterSettings, int x, int y, int z) + { + return world.getBlockMetadata(x, y, z) >= 12; + } + + @Override + public List getDrops (World world, Random rand, Map harvesterSettings, int x, int y, int z) + { + ItemStack[] returnItems = { new ItemStack(_berryItemId, 1, world.getBlockMetadata(x, y, z) % 4 + _metaOffset) }; + return Arrays.asList(returnItems); + } + + @Override + public void preHarvest (World world, int x, int y, int z) + { + } + + @Override + public void postHarvest (World world, int x, int y, int z) + { + world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) - 4, 2); + } } diff --git a/mods/tinker/tconstruct/skill/Jump.java b/mods/tinker/tconstruct/skill/Jump.java index 7ee2a684..49513333 100644 --- a/mods/tinker/tconstruct/skill/Jump.java +++ b/mods/tinker/tconstruct/skill/Jump.java @@ -6,29 +6,29 @@ import net.minecraft.world.World; public class Jump extends Skill { - @Override - public String getTextureFile (int guiscale) - { - /*if (guiscale == 2) - return "/mods/tinker/textures/skill/Jump32x.png"; - if (guiscale == 3) - return "/mods/tinker/textures/skill/Jump48x.png"; - - return "/mods/tinker/textures/skill/Jump16x.png";*/ - return "/mods/tinker/textures/skill/Jump48x.png"; - } + @Override + public String getTextureFile (int guiscale) + { + /*if (guiscale == 2) + return "/mods/tinker/textures/skill/Jump32x.png"; + if (guiscale == 3) + return "/mods/tinker/textures/skill/Jump48x.png"; + + return "/mods/tinker/textures/skill/Jump16x.png";*/ + return "/mods/tinker/textures/skill/Jump48x.png"; + } - @Override - public String getSkillName () - { - return "Jump"; - } + @Override + public String getSkillName () + { + return "Jump"; + } - @Override - public void activate (Entity entity, World world) - { - if (entity.onGround) - entity.motionY = 0.8f; - } + @Override + public void activate (Entity entity, World world) + { + if (entity.onGround) + entity.motionY = 0.8f; + } } diff --git a/mods/tinker/tconstruct/skill/Skill.java b/mods/tinker/tconstruct/skill/Skill.java index 604484a3..81008657 100644 --- a/mods/tinker/tconstruct/skill/Skill.java +++ b/mods/tinker/tconstruct/skill/Skill.java @@ -12,64 +12,70 @@ import net.minecraft.world.World; */ public abstract class Skill -{ - public int skillID; - boolean active = true; - public abstract String getTextureFile(int guiscale); - public abstract String getSkillName(); - public abstract void activate(Entity entity, World world); - public void rightClickActivate(Entity entity, World world) {}; - - public int chargeTime() //Ticks - { - return 0; - } - - public boolean canEntityUseSkill(Entity entity) - { - return true; - } - - public int getSkillCost() - { - return 0; - } - - public void setActive(boolean flag) - { - this.active = flag; - } - - public boolean getActive() - { - return active; - } - - public Skill copy() throws InstantiationException, IllegalAccessException +{ + public int skillID; + boolean active = true; + + public abstract String getTextureFile (int guiscale); + + public abstract String getSkillName (); + + public abstract void activate (Entity entity, World world); + + public void rightClickActivate (Entity entity, World world) { - Skill skill = this.getClass().newInstance(); - skill.setSkillID(this.skillID); + }; + + public int chargeTime () //Ticks + { + return 0; + } + + public boolean canEntityUseSkill (Entity entity) + { + return true; + } + + public int getSkillCost () + { + return 0; + } + + public void setActive (boolean flag) + { + this.active = flag; + } + + public boolean getActive () + { + return active; + } + + public Skill copy () throws InstantiationException, IllegalAccessException + { + Skill skill = this.getClass().newInstance(); + skill.setSkillID(this.skillID); return skill; } - - public void setSkillID(int i) - { - skillID = i; - } - - public int getSkillID () - { - return skillID; - } - - /* Save/Load */ + + public void setSkillID (int i) + { + skillID = i; + } + + public int getSkillID () + { + return skillID; + } + + /* Save/Load */ public void saveToNBT (NBTTagCompound tag) { - + } public void readFromNBT (NBTTagCompound tag) { - + } } diff --git a/mods/tinker/tconstruct/skill/SkillRegistry.java b/mods/tinker/tconstruct/skill/SkillRegistry.java index 14c8ff5b..21085b6f 100644 --- a/mods/tinker/tconstruct/skill/SkillRegistry.java +++ b/mods/tinker/tconstruct/skill/SkillRegistry.java @@ -2,22 +2,21 @@ package mods.tinker.tconstruct.skill; import java.util.HashMap; - public class SkillRegistry { public static HashMap skills = new HashMap(); - + static int skillID = 0; public static HashMap skillMapping = new HashMap(); //Simplifies network transmission - - public static void registerSkill(String name, Skill skill) + + public static void registerSkill (String name, Skill skill) { - skills.put(name, skill); - skillMapping.put(getNextAvailableID(), skill); + skills.put(name, skill); + skillMapping.put(getNextAvailableID(), skill); } - static Integer getNextAvailableID () - { - return skillID++; - } + static Integer getNextAvailableID () + { + return skillID++; + } } diff --git a/mods/tinker/tconstruct/skill/WallBuilding.java b/mods/tinker/tconstruct/skill/WallBuilding.java index e1850aeb..4b25cf61 100644 --- a/mods/tinker/tconstruct/skill/WallBuilding.java +++ b/mods/tinker/tconstruct/skill/WallBuilding.java @@ -14,121 +14,121 @@ import net.minecraftforge.common.ForgeDirection; public class WallBuilding extends Skill { - @Override - public String getTextureFile (int guiscale) - { - if (guiscale == 2) - return "/mods/tinker/textures/skill/Wall32x.png"; - if (guiscale == 3) - return "/mods/tinker/textures/skill/Wall48x.png"; + @Override + public String getTextureFile (int guiscale) + { + if (guiscale == 2) + return "/mods/tinker/textures/skill/Wall32x.png"; + if (guiscale == 3) + return "/mods/tinker/textures/skill/Wall48x.png"; - return "/mods/tinker/textures/skill/Wall16x.png"; - } + return "/mods/tinker/textures/skill/Wall16x.png"; + } - @Override - public String getSkillName () - { - return "Wall Building"; - } + @Override + public String getSkillName () + { + return "Wall Building"; + } - @Override - public void activate (Entity entity, World world) - { - this.active = !active; - } + @Override + public void activate (Entity entity, World world) + { + this.active = !active; + } - @Override - public void rightClickActivate (Entity entity, World world) - { - if (!world.isRemote && active) - { - if (entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer) entity; - ItemStack stack = player.getCurrentEquippedItem(); - if (stack != null && stack.getItem() instanceof ItemBlock) - { - MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, entity, true, 6); + @Override + public void rightClickActivate (Entity entity, World world) + { + if (!world.isRemote && active) + { + if (entity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) entity; + ItemStack stack = player.getCurrentEquippedItem(); + if (stack != null && stack.getItem() instanceof ItemBlock) + { + MovingObjectPosition mop = AbilityHelper.raytraceFromEntity(world, entity, true, 6); - if (mop != null) - { - int xPos = mop.blockX; - int yPos = mop.blockY; - int zPos = mop.blockZ; - /*ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit); - switch (sideHit) - { - case UP: - yPos += 1; - break; - case DOWN: - yPos -= 1; - break; - case NORTH: - zPos -= 1; - break; - case SOUTH: - zPos += 1; - break; - case EAST: - xPos += 1; - break; - case WEST: - xPos -= 1; - break; - default: - break; - }*/ + if (mop != null) + { + int xPos = mop.blockX; + int yPos = mop.blockY; + int zPos = mop.blockZ; + /*ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit); + switch (sideHit) + { + case UP: + yPos += 1; + break; + case DOWN: + yPos -= 1; + break; + case NORTH: + zPos -= 1; + break; + case SOUTH: + zPos += 1; + break; + case EAST: + xPos += 1; + break; + case WEST: + xPos -= 1; + break; + default: + break; + }*/ - int facing = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - int xMin = 0; - int xMax = 0; - int zMin = 0; - int zMax = 0; - if (facing % 2 == 0) - { - xMin = -1; - xMax = 1; - } - else - { - zMin = -1; - zMax = 1; - } + int facing = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int xMin = 0; + int xMax = 0; + int zMin = 0; + int zMax = 0; + if (facing % 2 == 0) + { + xMin = -1; + xMax = 1; + } + else + { + zMin = -1; + zMax = 1; + } - for (int y = -1; y <= 1; y++) - { - for (int x = xMin; x <= xMax; x++) - { - for (int z = zMin; z <= zMax; z++) - { - stack.getItem().onItemUse(stack, player, world, xPos + x, yPos + y, zPos + z, mop.sideHit, 0, 0, 0); - if (stack.stackSize < 1) - { - player.inventory.setInventorySlotContents(player.inventory.currentItem, null); - break; - } - //world.setBlock(xPos + x, yPos + y, zPos + z, Block.whiteStone.blockID); - } - } - } - //entity.worldObj.setBlock(xPos, yPos, zPos, Block.stone.blockID, 0, 3); - world.playAuxSFX(2001, xPos, yPos, zPos, Block.stone.blockID + (0 << 12)); - } - } - } - /*for (int x = -2; x <= 2; x++) - { - for (int y = -1; y <= 1; y++) - { - //for (int z = -2; z <= 2; z++) - { - world.setBlock((int) Math.floor(entity.posX) + x, (int) Math.floor(entity.posY) + y, (int) Math.floor(entity.posZ) + 2, Block.whiteStone.blockID); - } - } - } - world.playAuxSFX(2001, (int) entity.posX, (int) entity.posY, (int) entity.posZ, Block.stone.blockID + (0 << 12));*/ - } - } + for (int y = -1; y <= 1; y++) + { + for (int x = xMin; x <= xMax; x++) + { + for (int z = zMin; z <= zMax; z++) + { + stack.getItem().onItemUse(stack, player, world, xPos + x, yPos + y, zPos + z, mop.sideHit, 0, 0, 0); + if (stack.stackSize < 1) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + break; + } + //world.setBlock(xPos + x, yPos + y, zPos + z, Block.whiteStone.blockID); + } + } + } + //entity.worldObj.setBlock(xPos, yPos, zPos, Block.stone.blockID, 0, 3); + world.playAuxSFX(2001, xPos, yPos, zPos, Block.stone.blockID + (0 << 12)); + } + } + } + /*for (int x = -2; x <= 2; x++) + { + for (int y = -1; y <= 1; y++) + { + //for (int z = -2; z <= 2; z++) + { + world.setBlock((int) Math.floor(entity.posX) + x, (int) Math.floor(entity.posY) + y, (int) Math.floor(entity.posZ) + 2, Block.whiteStone.blockID); + } + } + } + world.playAuxSFX(2001, (int) entity.posX, (int) entity.posY, (int) entity.posZ, Block.stone.blockID + (0 << 12));*/ + } + } } diff --git a/mods/tinker/tconstruct/util/PHConstruct.java b/mods/tinker/tconstruct/util/PHConstruct.java index dea200ab..c6b0e31e 100644 --- a/mods/tinker/tconstruct/util/PHConstruct.java +++ b/mods/tinker/tconstruct/util/PHConstruct.java @@ -49,7 +49,7 @@ public class PHConstruct keepHunger = config.get("Difficulty Changes", "Keep hunger on death", true).getBoolean(true); keepLevels = config.get("Difficulty Changes", "Keep levels on death", true).getBoolean(true); beginnerBook = config.get("Difficulty Changes", "Spawn beginner book", true).getBoolean(true); - + superfunWorld = config.get("Superfun", "All the world is Superfun", false).getBoolean(false); /*disableWoodTools = config.get("Difficulty Changes", "Disable vanilla wooden tools", false).getBoolean(false); @@ -79,21 +79,21 @@ public class PHConstruct metalBlock = config.getBlock("Metal Storage", 1478).getInt(1478); metalFlowing = config.getBlock("Liquid Metal Flowing", 1479).getInt(1479); metalStill = config.getBlock("Liquid Metal Still", 1480).getInt(1480); - + multiBrick = config.getBlock("Multi Brick", 1481).getInt(1481); stoneTorch = config.getBlock("Stone Torch", 1484).getInt(1484); oreBerry = config.getBlock("Ore Berry One", 1485).getInt(1485); oreBerrySecond = config.getBlock("Ore Berry Two", 1486).getInt(1486); - + oreGravel = config.getBlock("Ores Gravel", 1488).getInt(1488); - speedBlock = config.getBlock("Speed Block", 1489).getInt(1489); + speedBlock = config.getBlock("Speed Block", 1489).getInt(1489); landmine = config.getBlock("Landmine", 1470).getInt(1470); barricade = config.getBlock("Barricade", 1469).getInt(1469); toolForge = config.getBlock("Tool Forge", 1468).getInt(1468); multiBrickFancy = config.getBlock("Multi Brick Fancy", 1467).getInt(1467); - + aggregator = config.getBlock("Aggregator", 3221).getInt(3221); lightCrystalBase = config.getBlock("Light Crystal", 3222).getInt(3222); glass = config.getBlock("Clear Glass", 3223).getInt(3223); @@ -171,7 +171,7 @@ public class PHConstruct excavator = config.getItem("Tools", "Excavator", 14069).getInt(14069); hammer = config.getItem("Tools", "Hammer", 14070).getInt(14070); battleaxe = config.getItem("Tools", "Battleaxe", 14071).getInt(14071); - + cutlass = config.getItem("Tools", "Cutlass", 14072).getInt(14072); arrow = config.getItem("Tools", "Arrow", 14073).getInt(14073); @@ -179,7 +179,7 @@ public class PHConstruct uselessItem = config.getItem("Patterns and Misc", "Title Icon", 14102).getInt(14102); slimefood = config.getItem("Patterns and Misc", "Strange Food", 14103).getInt(14103); oreChunks = config.getItem("Patterns and Misc", "Ore Chunks", 14104).getInt(14104); - + heartCanister = config.getItem("Equipables", "Heart Canister", 14105).getInt(14105); heavyHelmet = config.getItem("Equipables", "Heavy Helmet", 14106).getInt(14106); diamondApple = config.getItem("Patterns and Misc", "Jeweled Apple", 14107).getInt(14107); @@ -232,44 +232,44 @@ public class PHConstruct tinuDensity = config.get("Worldgen", "Tin Underground Density", 2).getInt(2); aluminumuDensity = config.get("Worldgen", "Aluminum Underground Density", 3).getInt(3); netherDensity = config.get("Worldgen", "Nether Ores Density", 8).getInt(8); - + copperuMinY = config.get("Worldgen", "Copper Underground Min Y", 20).getInt(20); copperuMaxY = config.get("Worldgen", "Copper Underground Max Y", 60).getInt(60); tinuMinY = config.get("Worldgen", "Tin Underground Min Y", 0).getInt(0); tinuMaxY = config.get("Worldgen", "Tin Underground Max Y", 40).getInt(40); aluminumuMinY = config.get("Worldgen", "Aluminum Underground Min Y", 0).getInt(0); aluminumuMaxY = config.get("Worldgen", "Aluminum Underground Max Y", 64).getInt(64); - + ironsRarity = config.get("Worldgen", "Iron Surface Rarity", 400).getInt(400); goldsRarity = config.get("Worldgen", "Gold Surface Rarity", 900).getInt(900); coppersRarity = config.get("Worldgen", "Copper Surface Rarity", 100).getInt(100); tinsRarity = config.get("Worldgen", "Tin Surface Rarity", 100).getInt(100); aluminumsRarity = config.get("Worldgen", "Aluminum Surface Rarity", 50).getInt(50); cobaltsRarity = config.get("Worldgen", "Cobalt Surface Rarity", 2000).getInt(2000); - + ironBushDensity = config.get("Worldgen", "Iron Bush Density", 1).getInt(1); goldBushDensity = config.get("Worldgen", "Gold Bush Density", 1).getInt(1); copperBushDensity = config.get("Worldgen", "Copper Bush Density", 2).getInt(2); tinBushDensity = config.get("Worldgen", "Tin Bush Density", 2).getInt(2); aluminumBushDensity = config.get("Worldgen", "Aluminum Bush Density", 2).getInt(2); silverBushDensity = config.get("Worldgen", "Silver Bush Density", 1).getInt(1); - + ironBushRarity = config.get("Worldgen", "Iron Bush Rarity", 5).getInt(5); goldBushRarity = config.get("Worldgen", "Gold Bush Rarity", 8).getInt(8); copperBushRarity = config.get("Worldgen", "Copper Bush Rarity", 3).getInt(3); tinBushRarity = config.get("Worldgen", "Tin Bush Rarity", 3).getInt(3); aluminumBushRarity = config.get("Worldgen", "Aluminum Bush Rarity", 2).getInt(2); essenceBushRarity = config.get("Worldgen", "Essence Bush Rarity", 6).getInt(6); - + copperBushMinY = config.get("Worldgen", "Copper Bush Min Y", 20).getInt(20); copperBushMaxY = config.get("Worldgen", "Copper Bush Max Y", 60).getInt(60); tinBushMinY = config.get("Worldgen", "Tin Bush Min Y", 0).getInt(0); tinBushMaxY = config.get("Worldgen", "Tin Bush Max Y", 40).getInt(40); aluminumBushMinY = config.get("Worldgen", "Aluminum Bush Min Y", 0).getInt(0); aluminumBushMaxY = config.get("Worldgen", "Aluminum Bush Max Y", 60).getInt(60); - + seaLevel = config.get("general", "Sea level", 64).getInt(64); - + enableHealthRegen = config.get("Ultra Hardcore Changes", "Passive Health Regen", true).getBoolean(true); //Check goldAppleRecipe = config.get("Ultra Hardcore Changes", "Change Crafting Recipes", false).getBoolean(false); //Check dropPlayerHeads = config.get("Ultra Hardcore Changes", "Players drop heads on death", false).getBoolean(false); //Check @@ -280,8 +280,8 @@ public class PHConstruct /* Save the configuration file */ config.save(); - - File gt = new File(location+"/GregTech"); + + File gt = new File(location + "/GregTech"); if (gt.exists()) { File gtDyn = new File(location + "/GregTech/DynamicConfig.cfg"); @@ -303,14 +303,14 @@ public class PHConstruct public static int oreSlag; public static int oreGravel; public static int metalBlock; - + public static int redstoneMachine; public static int dryingRack; public static int golemCore; public static int golemHead; public static int golemPedestal; - + //Crops public static int oreBerry; public static int oreBerrySecond; @@ -319,7 +319,7 @@ public class PHConstruct //Traps public static int landmine; public static int barricade; - + //InfiBlocks public static int speedBlock; public static int glass; @@ -327,7 +327,7 @@ public class PHConstruct public static int stainedGlass; public static int stainedGlassClear; public static int stainedGlassClearPane; - + //Crystalline public static int aggregator; public static int lightCrystalBase; @@ -377,14 +377,14 @@ public class PHConstruct public static int shortbow; public static int potionLauncher; public static int mattock; - + public static int lumberaxe; public static int scythe; public static int cleaver; public static int excavator; public static int hammer; public static int battleaxe; - + public static int chisel; public static int arrow; @@ -404,7 +404,7 @@ public class PHConstruct public static int frypanHead; public static int signHead; public static int chiselHead; - + public static int scytheBlade; public static int lumberHead; public static int largeSwordBlade; @@ -415,11 +415,11 @@ public class PHConstruct public static int toughBinding; public static int toughRod; public static int largePlate; - + public static int bowstring; public static int arrowhead; public static int fletching; - + //Wearables public static int heavyHelmet; public static int heavyChestplate; @@ -427,7 +427,7 @@ public class PHConstruct public static int heavyBoots; public static int glove; public static int knapsack; - + public static int heartCanister; //Ore values @@ -435,63 +435,63 @@ public class PHConstruct public static boolean generateTin; public static boolean generateAluminum; public static boolean generateNetherOres; - + public static boolean generateIronSurface; public static boolean generateGoldSurface; public static boolean generateCopperSurface; public static boolean generateTinSurface; public static boolean generateAluminumSurface; public static boolean generateCobaltSurface; - + public static boolean generateIronBush; public static boolean generateGoldBush; public static boolean generateCopperBush; public static boolean generateTinBush; public static boolean generateAluminumBush; public static boolean generateEssenceBush; - + public static boolean addToVillages; - + public static int copperuDensity; public static int tinuDensity; public static int aluminumuDensity; public static int netherDensity; - + public static int ironsRarity; public static int goldsRarity; public static int coppersRarity; public static int tinsRarity; public static int aluminumsRarity; public static int cobaltsRarity; - + public static int ironBushDensity; public static int goldBushDensity; public static int copperBushDensity; public static int tinBushDensity; public static int aluminumBushDensity; public static int silverBushDensity; - + public static int ironBushRarity; public static int goldBushRarity; public static int copperBushRarity; public static int tinBushRarity; public static int aluminumBushRarity; public static int essenceBushRarity; - + public static int copperuMinY; public static int copperuMaxY; public static int tinuMinY; - public static int tinuMaxY; + public static int tinuMaxY; public static int aluminumuMinY; public static int aluminumuMaxY; - + public static int copperBushMinY; public static int copperBushMaxY; public static int tinBushMinY; - public static int tinBushMaxY; + public static int tinBushMaxY; public static int aluminumBushMinY; public static int aluminumBushMaxY; - + public static int seaLevel; //Mobs @@ -514,10 +514,10 @@ public class PHConstruct public static boolean enableTStone; public static boolean enableTCactus; public static boolean enableTBone; - + public static boolean craftMetalTools; public static boolean vanillaMetalBlocks; - + //Ultra Hardcore modifiers public static boolean enableHealthRegen; public static boolean goldAppleRecipe; @@ -527,11 +527,11 @@ public class PHConstruct public static int worldBorderSize; public static boolean freePatterns; public static int goldHead; - + //Superfun public static boolean superfunWorld; public static boolean beginnerBook; - + public static boolean gregtech; public static boolean lavaFortuneInteraction; } \ No newline at end of file diff --git a/mods/tinker/tconstruct/util/RecipeRemover.java b/mods/tinker/tconstruct/util/RecipeRemover.java index 44462850..57133883 100644 --- a/mods/tinker/tconstruct/util/RecipeRemover.java +++ b/mods/tinker/tconstruct/util/RecipeRemover.java @@ -10,32 +10,32 @@ import net.minecraft.item.crafting.ShapelessRecipes; public class RecipeRemover { - public static void removeShapedRecipes(List removelist) - { - for (ItemStack stack : removelist) - removeShapedRecipe(stack); - } - - public static void removeShapedRecipe (ItemStack resultItem) - { - List recipes = CraftingManager.getInstance().getRecipeList(); - for (int i = 0; i < recipes.size(); i++) - { - IRecipe tmpRecipe = recipes.get(i); - if (tmpRecipe instanceof ShapedRecipes) - { - ShapedRecipes recipe = (ShapedRecipes) tmpRecipe; - ItemStack recipeResult = recipe.getRecipeOutput(); + public static void removeShapedRecipes (List removelist) + { + for (ItemStack stack : removelist) + removeShapedRecipe(stack); + } - if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) - { - recipes.remove(i--); - } - } - } - } - - public static void removeShapelessRecipe (ItemStack resultItem) + public static void removeShapedRecipe (ItemStack resultItem) + { + List recipes = CraftingManager.getInstance().getRecipeList(); + for (int i = 0; i < recipes.size(); i++) + { + IRecipe tmpRecipe = recipes.get(i); + if (tmpRecipe instanceof ShapedRecipes) + { + ShapedRecipes recipe = (ShapedRecipes) tmpRecipe; + ItemStack recipeResult = recipe.getRecipeOutput(); + + if (ItemStack.areItemStacksEqual(resultItem, recipeResult)) + { + recipes.remove(i--); + } + } + } + } + + public static void removeShapelessRecipe (ItemStack resultItem) { List recipes = CraftingManager.getInstance().getRecipeList(); for (int i = 0; i < recipes.size(); i++) diff --git a/mods/tinker/tconstruct/util/TCraftingHandler.java b/mods/tinker/tconstruct/util/TCraftingHandler.java index 6675a81d..af371b80 100644 --- a/mods/tinker/tconstruct/util/TCraftingHandler.java +++ b/mods/tinker/tconstruct/util/TCraftingHandler.java @@ -21,22 +21,22 @@ public class TCraftingHandler implements ICraftingHandler int itemID = item.getItem().itemID; if (itemID == TContent.toolStationWood.blockID) { - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct"); if (!tags.getBoolean("materialManual") || !stats.materialManual) { - stats.materialManual = true; + stats.materialManual = true; tags.setBoolean("materialManual", true); AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 1)); } } if (itemID == TContent.smeltery.blockID || itemID == TContent.lavaTank.blockID) { - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); NBTTagCompound tags = player.getEntityData().getCompoundTag("TConstruct"); if (!tags.getBoolean("smelteryManual") || !stats.smelteryManual) { - stats.smelteryManual = true; + stats.smelteryManual = true; tags.setBoolean("smelteryManual", true); AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TContent.manualBook, 1, 2)); } diff --git a/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java b/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java index bf1c3225..7e7f2fd0 100644 --- a/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java +++ b/mods/tinker/tconstruct/util/TDispenserBehaviorSpawnEgg.java @@ -13,17 +13,17 @@ public class TDispenserBehaviorSpawnEgg extends BehaviorDefaultDispenseItem /** * Dispense the specified stack, play the dispense sound and spawn particles. */ - public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) + public ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack) { EnumFacing enumfacing = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); - double d0 = par1IBlockSource.getX() + (double)enumfacing.getFrontOffsetX(); - double d1 = (double)((float)par1IBlockSource.getYInt() + 0.2F); - double d2 = par1IBlockSource.getZ() + (double)enumfacing.getFrontOffsetZ(); + double d0 = par1IBlockSource.getX() + (double) enumfacing.getFrontOffsetX(); + double d1 = (double) ((float) par1IBlockSource.getYInt() + 0.2F); + double d2 = par1IBlockSource.getZ() + (double) enumfacing.getFrontOffsetZ(); EntityLiving entity = TitleIcon.activateSpawnEgg(par2ItemStack, par1IBlockSource.getWorld(), d0, d1, d2, 0); if (par2ItemStack.hasDisplayName()) { - ((EntityLiving)entity).func_94058_c(par2ItemStack.getDisplayName()); + ((EntityLiving) entity).func_94058_c(par2ItemStack.getDisplayName()); } par2ItemStack.splitStack(1); diff --git a/mods/tinker/tconstruct/util/TEventHandler.java b/mods/tinker/tconstruct/util/TEventHandler.java index 3d57a153..ab9de6bd 100644 --- a/mods/tinker/tconstruct/util/TEventHandler.java +++ b/mods/tinker/tconstruct/util/TEventHandler.java @@ -110,7 +110,7 @@ public class TEventHandler toolTag.setFloat("FlightSpeed", flightSpeed); } } - + if (event.tool == TContent.arrow) { ArrowMaterial head = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Head")); @@ -122,7 +122,7 @@ public class TEventHandler float mass = head.mass / 5f + shaft.mass + fletching.mass; float shatter = (head.breakChance + shaft.breakChance + fletching.breakChance) / 4f; float accuracy = (head.accuracy + shaft.accuracy + fletching.accuracy) / 3; - + ItemStack arrow = new ItemStack(event.tool, 4); toolTag.setInteger("TotalDurability", 0); toolTag.setFloat("Mass", mass); @@ -145,7 +145,7 @@ public class TEventHandler event.overrideResult(new ItemStack[] { result, null }); } } - + if (event.pattern.getItem() == TContent.woodPattern && event.pattern.getItemDamage() == 24) { ItemStack result = craftFletching(event.material); @@ -155,20 +155,20 @@ public class TEventHandler } } } - - public static ItemStack craftBowString(ItemStack stack) + + public static ItemStack craftBowString (ItemStack stack) { if (stack.stackSize < 3) return null; - + BowstringMaterial mat = (BowstringMaterial) TConstructRegistry.getCustomMaterial(stack, BowstringMaterial.class); if (mat != null) return mat.craftingItem.copy(); return null; } - - public static ItemStack craftFletching(ItemStack stack) - { + + public static ItemStack craftFletching (ItemStack stack) + { FletchingMaterial mat = (FletchingMaterial) TConstructRegistry.getCustomMaterial(stack, FletchingMaterial.class); if (mat != null) return mat.craftingItem.copy(); diff --git a/mods/tinker/tconstruct/util/player/ArmorExtended.java b/mods/tinker/tconstruct/util/player/ArmorExtended.java index 44eb91ad..c9dabc19 100644 --- a/mods/tinker/tconstruct/util/player/ArmorExtended.java +++ b/mods/tinker/tconstruct/util/player/ArmorExtended.java @@ -16,8 +16,8 @@ public class ArmorExtended implements IInventory { public ItemStack[] inventory = new ItemStack[7]; public WeakReference parent; - - public void init(EntityPlayer player) + + public void init (EntityPlayer player) { parent = new WeakReference(player); } @@ -57,7 +57,7 @@ public class ArmorExtended implements IInventory inventory[slot] = null; } EntityPlayer player = parent.get(); - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); recalculateHealth(player, stats); return split; } @@ -82,9 +82,9 @@ public class ArmorExtended implements IInventory { itemstack.stackSize = getInventoryStackLimit(); } - - EntityPlayer player = parent.get(); - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + + EntityPlayer player = parent.get(); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); recalculateHealth(player, stats); } @@ -109,17 +109,17 @@ public class ArmorExtended implements IInventory @Override public void onInventoryChanged () { - EntityPlayer player = parent.get(); - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); - //recalculateSkills(player, stats); + EntityPlayer player = parent.get(); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + //recalculateSkills(player, stats); recalculateHealth(player, stats); - + if (inventory[2] == null && stats.knapsack != null) { stats.knapsack.unequipItems(); } } - + /*public void recalculateSkills(EntityPlayer player, TPlayerStats stats) { if (inventory[1] != null && inventory[1].getItem() == TContent.glove) @@ -144,19 +144,19 @@ public class ArmorExtended implements IInventory } } }*/ - - public void recalculateHealth(EntityPlayer player, TPlayerStats stats) + + public void recalculateHealth (EntityPlayer player, TPlayerStats stats) { - if (inventory[6] != null && inventory[6].getItem() == TContent.heartCanister) + if (inventory[6] != null && inventory[6].getItem() == TContent.heartCanister) { - ItemStack stack = inventory[6]; - int meta = stack.getItemDamage(); - if (meta == 2) - { - int bonusHP = stack.stackSize * 2; - stats.bonusHealth = bonusHP; - player.maxHealth = 20 + bonusHP; - } + ItemStack stack = inventory[6]; + int meta = stack.getItemDamage(); + if (meta == 2) + { + int bonusHP = stack.stackSize * 2; + stats.bonusHealth = bonusHP; + player.maxHealth = 20 + bonusHP; + } } else if (parent != null && parent.get() != null) { @@ -183,7 +183,7 @@ public class ArmorExtended implements IInventory { return false; } - + /* Save/Load */ public void saveToNBT (EntityPlayer entityplayer) { @@ -232,6 +232,6 @@ public class ArmorExtended implements IInventory player.dropPlayerItemWithRandomChoice(this.inventory[i], true); this.inventory[i] = null; } - } + } } } diff --git a/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java b/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java index 9489e16c..02619721 100644 --- a/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java +++ b/mods/tinker/tconstruct/util/player/ArmorExtendedClient.java @@ -7,9 +7,9 @@ import net.minecraft.entity.player.EntityPlayer; public class ArmorExtendedClient extends ArmorExtended { - /*public void recalculateSkills(EntityPlayer player, TPlayerStats stats) + /*public void recalculateSkills(EntityPlayer player, TPlayerStats stats) { - System.out.println("Client skills"); + System.out.println("Client skills"); if (inventory[1] != null && inventory[1].getItem() == TContent.glove) { if (TProxyClient.skillList.size() < 1) diff --git a/mods/tinker/tconstruct/util/player/KnapsackInventory.java b/mods/tinker/tconstruct/util/player/KnapsackInventory.java index 5b223d44..25a8385c 100644 --- a/mods/tinker/tconstruct/util/player/KnapsackInventory.java +++ b/mods/tinker/tconstruct/util/player/KnapsackInventory.java @@ -14,42 +14,42 @@ public class KnapsackInventory implements IInventory { public ItemStack[] inventory = new ItemStack[27]; public WeakReference parent; - - public void init(EntityPlayer player) + + public void init (EntityPlayer player) { parent = new WeakReference(player); } - + @Override - public ItemStack getStackInSlot(int slot) + public ItemStack getStackInSlot (int slot) { return inventory[slot]; } - - public boolean isStackInSlot(int slot) + + public boolean isStackInSlot (int slot) { return inventory[slot] != null; } - + @Override - public int getSizeInventory() + public int getSizeInventory () { return inventory.length; } - + @Override public int getInventoryStackLimit () { return 64; } - - public boolean canDropInventorySlot(int slot) + + public boolean canDropInventorySlot (int slot) { return true; } - + @Override - public void setInventorySlotContents(int slot, ItemStack itemstack) + public void setInventorySlotContents (int slot, ItemStack itemstack) { inventory[slot] = itemstack; if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) @@ -57,9 +57,9 @@ public class KnapsackInventory implements IInventory itemstack.stackSize = getInventoryStackLimit(); } } - + @Override - public ItemStack decrStackSize(int slot, int quantity) + public ItemStack decrStackSize (int slot, int quantity) { if (inventory[slot] != null) { @@ -97,13 +97,21 @@ public class KnapsackInventory implements IInventory @Override public void onInventoryChanged () { - + } + public ItemStack getStackInSlotOnClosing (int slot) + { + return null; + } - public ItemStack getStackInSlotOnClosing (int slot) { return null; } - public void openChest () {} - public void closeChest () {} + public void openChest () + { + } + + public void closeChest () + { + } @Override public boolean isStackValidForSlot (int i, ItemStack itemstack) @@ -116,7 +124,7 @@ public class KnapsackInventory implements IInventory { return true; } - + /* Save/Load */ public void saveToNBT (EntityPlayer entityplayer) { @@ -167,7 +175,7 @@ public class KnapsackInventory implements IInventory } } } - + public void unequipItems () { EntityPlayer player = parent.get(); @@ -180,7 +188,7 @@ public class KnapsackInventory implements IInventory } } } - + void dropItemEntity (Entity dropper, ItemStack dropStack) { EntityItem entityitem = new EntityItem(dropper.worldObj, dropper.posX, dropper.posY, dropper.posZ, dropStack); diff --git a/mods/tinker/tconstruct/util/player/TFoodStats.java b/mods/tinker/tconstruct/util/player/TFoodStats.java index 9c51de37..036fbecb 100644 --- a/mods/tinker/tconstruct/util/player/TFoodStats.java +++ b/mods/tinker/tconstruct/util/player/TFoodStats.java @@ -27,16 +27,16 @@ public class TFoodStats extends FoodStats /** * Args: int foodLevel, float foodSaturationModifier */ - public void addStats(int par1, float par2) + public void addStats (int par1, float par2) { this.foodLevel = Math.min(par1 + this.foodLevel, 20); - this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)par1 * par2 * 2.0F, (float)this.foodLevel); + this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float) par1 * par2 * 2.0F, (float) this.foodLevel); } /** * Eat some food. */ - public void addStats(ItemFood par1ItemFood) + public void addStats (ItemFood par1ItemFood) { this.addStats(par1ItemFood.getHealAmount(), par1ItemFood.getSaturationModifier()); } @@ -44,7 +44,7 @@ public class TFoodStats extends FoodStats /** * Handles the food game logic. */ - public void onUpdate(EntityPlayer player) + public void onUpdate (EntityPlayer player) { int difficulty = player.worldObj.difficultySetting; this.prevFoodLevel = this.foodLevel; @@ -63,7 +63,7 @@ public class TFoodStats extends FoodStats } } - if (this.foodLevel >= 12 + 2*difficulty && player.shouldHeal() && PHConstruct.enableHealthRegen) + if (this.foodLevel >= 12 + 2 * difficulty && player.shouldHeal() && PHConstruct.enableHealthRegen) { ++this.foodTimer; @@ -92,8 +92,8 @@ public class TFoodStats extends FoodStats this.foodTimer = 0; } } - - public void readStats(FoodStats stats) + + public void readStats (FoodStats stats) { this.foodLevel = stats.foodLevel; @@ -111,7 +111,7 @@ public class TFoodStats extends FoodStats /** * Reads food stats from an NBT object. */ - public void readNBT(NBTTagCompound par1NBTTagCompound) + public void readNBT (NBTTagCompound par1NBTTagCompound) { if (par1NBTTagCompound.hasKey("foodLevel")) { @@ -125,7 +125,7 @@ public class TFoodStats extends FoodStats /** * Writes food stats to an NBT object. */ - public void writeNBT(NBTTagCompound par1NBTTagCompound) + public void writeNBT (NBTTagCompound par1NBTTagCompound) { par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); @@ -136,13 +136,13 @@ public class TFoodStats extends FoodStats /** * Get the player's food level. */ - public int getFoodLevel() + public int getFoodLevel () { return this.foodLevel; } @SideOnly(Side.CLIENT) - public int getPrevFoodLevel() + public int getPrevFoodLevel () { return this.prevFoodLevel; } @@ -150,7 +150,7 @@ public class TFoodStats extends FoodStats /** * If foodLevel is not max. */ - public boolean needFood() + public boolean needFood () { return this.foodLevel < 20; } @@ -158,7 +158,7 @@ public class TFoodStats extends FoodStats /** * adds input to foodExhaustionLevel to a max of 40 */ - public void addExhaustion(float par1) + public void addExhaustion (float par1) { this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + par1, 40.0F); } @@ -166,19 +166,19 @@ public class TFoodStats extends FoodStats /** * Get the player's food saturation level. */ - public float getSaturationLevel() + public float getSaturationLevel () { return this.foodSaturationLevel; } @SideOnly(Side.CLIENT) - public void setFoodLevel(int par1) + public void setFoodLevel (int par1) { this.foodLevel = par1; } @SideOnly(Side.CLIENT) - public void setFoodSaturationLevel(float par1) + public void setFoodSaturationLevel (float par1) { this.foodSaturationLevel = par1; } diff --git a/mods/tinker/tconstruct/util/player/TPlayerStats.java b/mods/tinker/tconstruct/util/player/TPlayerStats.java index 92f19b7f..24ddf21f 100644 --- a/mods/tinker/tconstruct/util/player/TPlayerStats.java +++ b/mods/tinker/tconstruct/util/player/TPlayerStats.java @@ -8,15 +8,15 @@ import net.minecraft.entity.player.EntityPlayer; public class TPlayerStats { - public WeakReference player; - public int level; - public int levelHealth; - public int bonusHealth; - public int hunger; - public boolean beginnerManual; - public boolean materialManual; - public boolean smelteryManual; - public ArmorExtended armor; - public KnapsackInventory knapsack; - public List skillList; + public WeakReference player; + public int level; + public int levelHealth; + public int bonusHealth; + public int hunger; + public boolean beginnerManual; + public boolean materialManual; + public boolean smelteryManual; + public ArmorExtended armor; + public KnapsackInventory knapsack; + public List skillList; } diff --git a/mods/tinker/tconstruct/worldgen/OverworldProvider.java b/mods/tinker/tconstruct/worldgen/OverworldProvider.java index b3a0d489..38515ec0 100644 --- a/mods/tinker/tconstruct/worldgen/OverworldProvider.java +++ b/mods/tinker/tconstruct/worldgen/OverworldProvider.java @@ -11,18 +11,18 @@ public class OverworldProvider extends WorldProvider { return "Overworld"; } - - public boolean getWorldHasVoidParticles() + + public boolean getWorldHasVoidParticles () { if (PHConstruct.voidFog) return false; return this.terrainType.hasVoidParticles(this.hasNoSky); } - - public float calculateCelestialAngle(long worldtime, float par3) + + public float calculateCelestialAngle (long worldtime, float par3) { int timeOfDay = 18000; - float f1 = ((float)timeOfDay + par3) / 24000.0F - 0.25F; + float f1 = ((float) timeOfDay + par3) / 24000.0F - 0.25F; if (f1 < 0.0F) { @@ -35,11 +35,11 @@ public class OverworldProvider extends WorldProvider } float f2 = f1; - f1 = 1.0F - (float)((Math.cos((double)f1 * Math.PI) + 1.0D) / 2.0D); + f1 = 1.0F - (float) ((Math.cos((double) f1 * Math.PI) + 1.0D) / 2.0D); f1 = f2 + (f1 - f2) / 3.0F; return f1; } - + /*public float calculateCelestialAngle(long worldtime, float par3) { int timeOfDay = (int)(worldtime % 43200L); diff --git a/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java b/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java index 16e7f4a4..260fa3f3 100644 --- a/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java +++ b/mods/tinker/tconstruct/worldgen/TBaseWorldGenerator.java @@ -37,7 +37,7 @@ public class TBaseWorldGenerator implements IWorldGenerator public void generate (Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { initializeChunkData(chunkX, chunkZ, world.provider.dimensionId); - + if (world.provider.isHellWorld) { generateNether(random, chunkX * 16, chunkZ * 16, world); @@ -59,8 +59,8 @@ public class TBaseWorldGenerator implements IWorldGenerator generateChunkBorder(random, chunkX * 16, chunkZ * 16, world); } } - - void initializeChunkData(int chunkX, int chunkZ, int worldID) + + void initializeChunkData (int chunkX, int chunkZ, int worldID) { ValueCoordTuple coord = new ValueCoordTuple(worldID, chunkX, chunkZ); TheftValueTracker.crystallinity.put(coord, 0); diff --git a/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java b/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java index b6b072ce..7d9efae9 100644 --- a/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java +++ b/mods/tinker/tconstruct/worldgen/TerrainGenEventHandler.java @@ -27,7 +27,7 @@ public class TerrainGenEventHandler private static ImmutableCollection EXTRA_ORE_BIOMES = ImmutableList.of(extremeHills, extremeHillsEdge); @ForgeSubscribe - public void onDecorateEvent(Decorate e) + public void onDecorateEvent (Decorate e) { // Trigger just before sand pass one--which comes just after vanilla ore generation. if (e.type != SAND) diff --git a/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java b/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java index 57686682..28f54295 100644 --- a/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java +++ b/mods/tinker/tconstruct/worldgen/village/ComponentSmeltery.java @@ -66,7 +66,7 @@ public class ComponentSmeltery extends ComponentVillage this.placeBlockAtCurrentPosition(world, TContent.searedBlock.blockID, 2, 1, 1, 4, sbb); this.placeBlockAtCurrentPosition(world, TContent.searedBlock.blockID, 0, 7, 1, 2, sbb); this.placeBlockAtCurrentPosition(world, TContent.searedBlock.blockID, 2, 7, 1, 4, sbb); - + for (int l = 1; l < 6; ++l) { for (int i1 = 0; i1 < 9; ++i1) @@ -75,7 +75,7 @@ public class ComponentSmeltery extends ComponentVillage this.fillCurrentPositionBlocksDownwards(world, Block.stoneBrick.blockID, 0, i1, -1, l, sbb); } } - + for (int l = 0; l < 7; ++l) { for (int i1 = 1; i1 < 8; ++i1) @@ -86,16 +86,20 @@ public class ComponentSmeltery extends ComponentVillage } return true; } - - int remapDirection(int direction) + + int remapDirection (int direction) { - System.out.println("Direction: "+direction); + System.out.println("Direction: " + direction); switch (direction) { - case 0: return 2; - case 1: return 3; - case 2: return 1; - case 3: return 0; + case 0: + return 2; + case 1: + return 3; + case 2: + return 1; + case 3: + return 0; } System.out.println("This shouldn't happen"); return -1; diff --git a/mods/tinker/tconstruct/worldgen/village/ComponentToolWorkshop.java b/mods/tinker/tconstruct/worldgen/village/ComponentToolWorkshop.java index c8420897..1139c2c5 100644 --- a/mods/tinker/tconstruct/worldgen/village/ComponentToolWorkshop.java +++ b/mods/tinker/tconstruct/worldgen/village/ComponentToolWorkshop.java @@ -15,163 +15,163 @@ import net.minecraft.world.gen.structure.StructureComponent; public class ComponentToolWorkshop extends ComponentVillage { - private int averageGroundLevel = -1; + private int averageGroundLevel = -1; - public ComponentToolWorkshop(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) - { - super(par1ComponentVillageStartPiece, par2); - this.coordBaseMode = par5; - this.boundingBox = par4StructureBoundingBox; - } + public ComponentToolWorkshop(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) + { + super(par1ComponentVillageStartPiece, par2); + this.coordBaseMode = par5; + this.boundingBox = par4StructureBoundingBox; + } - public static ComponentToolWorkshop buildComponent (ComponentVillageStartPiece villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) - { - StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4); - return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentToolWorkshop(villagePiece, p5, random, - structureboundingbox, p4) : null; - } + public static ComponentToolWorkshop buildComponent (ComponentVillageStartPiece villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) + { + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 7, 6, 7, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentToolWorkshop(villagePiece, p5, random, + structureboundingbox, p4) : null; + } - /** - * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at - * the end, it adds Fences... - */ - public boolean addComponentParts (World world, Random random, StructureBoundingBox sbb) - { - if (this.averageGroundLevel < 0) - { - this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); + /** + * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at + * the end, it adds Fences... + */ + public boolean addComponentParts (World world, Random random, StructureBoundingBox sbb) + { + if (this.averageGroundLevel < 0) + { + this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); - if (this.averageGroundLevel < 0) - { - return true; - } + if (this.averageGroundLevel < 0) + { + return true; + } - this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + 4, 0); - } + this.boundingBox.offset(0, this.averageGroundLevel - this.boundingBox.maxY + 4, 0); + } - /** - * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int - * maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) - */ + /** + * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int + * maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) + */ - this.fillWithBlocks(world, sbb, 0, 0, 0, 6, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); //Base - this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Block.fence.blockID, Block.fence.blockID, false); - this.fillWithBlocks(world, sbb, 1, 0, 1, 5, 0, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 2, 0, 2, 4, 0, 4, Block.cloth.blockID, Block.cloth.blockID, false); + this.fillWithBlocks(world, sbb, 0, 0, 0, 6, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); //Base + this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Block.fence.blockID, Block.fence.blockID, false); + this.fillWithBlocks(world, sbb, 1, 0, 1, 5, 0, 5, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 2, 0, 2, 4, 0, 4, Block.cloth.blockID, Block.cloth.blockID, false); - //this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Block.wood.blockID, Block.wood.blockID, false); + //this.fillWithBlocks(world, sbb, 0, 5, 0, 6, 5, 6, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); //Edges - this.fillWithBlocks(world, sbb, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 6, 1, 0, 6, 4, 0, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 6, 1, 6, 6, 4, 6, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); //Edges + this.fillWithBlocks(world, sbb, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 6, 1, 0, 6, 4, 0, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 6, 1, 6, 6, 4, 6, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 0, 1, 1, 0, 1, 5, Block.planks.blockID, Block.planks.blockID, false); //Walls - this.fillWithBlocks(world, sbb, 1, 1, 0, 5, 1, 0, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 6, 1, 1, 6, 1, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 1, 1, 6, 5, 1, 6, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 0, 1, 1, 0, 1, 5, Block.planks.blockID, Block.planks.blockID, false); //Walls + this.fillWithBlocks(world, sbb, 1, 1, 0, 5, 1, 0, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 6, 1, 1, 6, 1, 5, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 1, 1, 6, 5, 1, 6, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 0, 3, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 1, 3, 0, 5, 3, 0, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 6, 3, 1, 6, 3, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 1, 3, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 0, 3, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 1, 3, 0, 5, 3, 0, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 6, 3, 1, 6, 3, 5, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 1, 3, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 0, 4, 1, 0, 4, 5, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 1, 4, 0, 5, 4, 0, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 6, 4, 1, 6, 4, 5, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 1, 4, 6, 5, 4, 6, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 0, 4, 1, 0, 4, 5, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 1, 4, 0, 5, 4, 0, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 6, 4, 1, 6, 4, 5, Block.wood.blockID, Block.wood.blockID, false); + this.fillWithBlocks(world, sbb, 1, 4, 6, 5, 4, 6, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 1, 1, 1, 5, 5, 5, 0, 0, false); - this.fillWithBlocks(world, sbb, 1, 4, 1, 5, 4, 5, Block.planks.blockID, Block.planks.blockID, false); + this.fillWithBlocks(world, sbb, 1, 1, 1, 5, 5, 5, 0, 0, false); + this.fillWithBlocks(world, sbb, 1, 4, 1, 5, 4, 5, Block.planks.blockID, Block.planks.blockID, false); - //world, blockID, metadata, x, y, z, bounds - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 1, 2, 0, sbb);//Glass and door - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 2, 2, 0, sbb); - this.placeDoorAtCurrentPosition(world, sbb, random, 3, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 4, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 5, 2, 0, sbb); + //world, blockID, metadata, x, y, z, bounds + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 1, 2, 0, sbb);//Glass and door + this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 2, 2, 0, sbb); + this.placeDoorAtCurrentPosition(world, sbb, random, 3, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); + this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 4, 2, 0, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 5, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 1, 2, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 3, 2, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 2, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 5, 2, 6, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 1, 2, 6, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 6, sbb); + this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 3, 2, 6, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 2, 6, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 5, 2, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 1, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 0, 2, 3, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 4, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 5, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 1, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 0, 2, 3, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 4, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 0, 2, 5, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 1, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 6, 2, 3, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 4, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 5, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 1, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 0, 6, 2, 3, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 4, sbb); + this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 6, 2, 5, sbb); - int i = this.getMetadataWithOffset(Block.ladder.blockID, 3); //Ladders - this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 1, 5, sbb); - this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 2, 5, sbb); - this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 3, 5, sbb); - this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 4, 5, sbb); + int i = this.getMetadataWithOffset(Block.ladder.blockID, 3); //Ladders + this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 1, 5, sbb); + this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 2, 5, sbb); + this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 3, 5, sbb); + this.placeBlockAtCurrentPosition(world, Block.ladder.blockID, i, 3, 4, 5, sbb); - this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 0, 1, 1, 1, sbb); //Inside - this.generateStructurePatternChestContents(world, sbb, random, 1, 1, 2, TContent.tinkerHousePatterns.getItems(random), TContent.tinkerHousePatterns.getCount(random)); - //this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 5, 1, 1, 2, sbb); - this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 1, 1, 1, 3, sbb); - this.placeBlockAtCurrentPosition(world, Block.workbench.blockID, 0, 1, 1, 4, sbb); - this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 10, 1, 1, 5, sbb); + this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 0, 1, 1, 1, sbb); //Inside + this.generateStructurePatternChestContents(world, sbb, random, 1, 1, 2, TContent.tinkerHousePatterns.getItems(random), TContent.tinkerHousePatterns.getCount(random)); + //this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 5, 1, 1, 2, sbb); + this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 1, 1, 1, 3, sbb); + this.placeBlockAtCurrentPosition(world, Block.workbench.blockID, 0, 1, 1, 4, sbb); + this.placeBlockAtCurrentPosition(world, TContent.toolStationWood.blockID, 10, 1, 1, 5, sbb); - //ChestGenHooks info = ChestGenHooks.getInfo("TinkerHouse"); + //ChestGenHooks info = ChestGenHooks.getInfo("TinkerHouse"); - this.generateStructureChestContents(world, sbb, random, 4, 1, 5, TContent.tinkerHouseChest.getItems(random), TContent.tinkerHouseChest.getCount(random)); - //this.placeBlockAtCurrentPosition(world, Block.chest.blockID, i, 4, 1, 5, sbb); - i = this.getMetadataWithOffset(Block.pistonBase.blockID, 3); - this.placeBlockAtCurrentPosition(world, Block.pistonBase.blockID, i, 5, 1, 5, sbb); + this.generateStructureChestContents(world, sbb, random, 4, 1, 5, TContent.tinkerHouseChest.getItems(random), TContent.tinkerHouseChest.getCount(random)); + //this.placeBlockAtCurrentPosition(world, Block.chest.blockID, i, 4, 1, 5, sbb); + i = this.getMetadataWithOffset(Block.pistonBase.blockID, 3); + this.placeBlockAtCurrentPosition(world, Block.pistonBase.blockID, i, 5, 1, 5, sbb); - for (int l = 0; l < 6; ++l) - { - for (int i1 = 0; i1 < 9; ++i1) - { - this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); - this.fillCurrentPositionBlocksDownwards(world, Block.cobblestone.blockID, 0, i1, -1, l, sbb); - } - } - this.spawnVillagers(world, sbb, 3, 1, 3, 1); + for (int l = 0; l < 6; ++l) + { + for (int i1 = 0; i1 < 9; ++i1) + { + this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); + this.fillCurrentPositionBlocksDownwards(world, Block.cobblestone.blockID, 0, i1, -1, l, sbb); + } + } + this.spawnVillagers(world, sbb, 3, 1, 3, 1); - return true; - } + return true; + } - protected boolean generateStructurePatternChestContents (World world, StructureBoundingBox par2StructureBoundingBox, Random random, int x, int y, int z, - WeightedRandomChestContent[] content, int par8) - { - int posX = this.getXWithOffset(x, z); - int posY = this.getYWithOffset(y); - int posZ = this.getZWithOffset(x, z); + protected boolean generateStructurePatternChestContents (World world, StructureBoundingBox par2StructureBoundingBox, Random random, int x, int y, int z, WeightedRandomChestContent[] content, + int par8) + { + int posX = this.getXWithOffset(x, z); + int posY = this.getYWithOffset(y); + int posZ = this.getZWithOffset(x, z); - if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Block.chest.blockID) - { - world.setBlock(posX, posY, posZ, TContent.toolStationWood.blockID, 5, 2); - PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(posX, posY, posZ); + if (par2StructureBoundingBox.isVecInside(posX, posY, posZ) && world.getBlockId(posX, posY, posZ) != Block.chest.blockID) + { + world.setBlock(posX, posY, posZ, TContent.toolStationWood.blockID, 5, 2); + PatternChestLogic logic = (PatternChestLogic) world.getBlockTileEntity(posX, posY, posZ); - if (logic != null) - { - WeightedRandomChestContent.generateChestContents(random, content, logic, par8); - } + if (logic != null) + { + WeightedRandomChestContent.generateChestContents(random, content, logic, par8); + } - return true; - } - else - { - return false; - } - } + return true; + } + else + { + return false; + } + } - /** - * Returns the villager type to spawn in this component, based on the number of villagers already spawned. - */ - protected int getVillagerType (int par1) - { - return 78943; - } + /** + * Returns the villager type to spawn in this component, based on the number of villagers already spawned. + */ + protected int getVillagerType (int par1) + { + return 78943; + } } diff --git a/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java b/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java index 701e418a..2313f450 100644 --- a/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java +++ b/mods/tinker/tconstruct/worldgen/village/VillageToolStationHandler.java @@ -25,7 +25,7 @@ public class VillageToolStationHandler implements IVillageCreationHandler @Override public Object buildComponent (StructureVillagePieceWeight villagePiece, ComponentVillageStartPiece startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { - return ComponentToolWorkshop.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5); + return ComponentToolWorkshop.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5); } } diff --git a/mods/tinker/textures/items/arrow/blueslime_arrow_head.png b/mods/tinker/textures/items/arrow/blueslime_arrow_head.png index 87919ce2..a643f863 100644 Binary files a/mods/tinker/textures/items/arrow/blueslime_arrow_head.png and b/mods/tinker/textures/items/arrow/blueslime_arrow_head.png differ diff --git a/mods/tinker/textures/items/arrow/blueslime_arrow_shaft.png b/mods/tinker/textures/items/arrow/blueslime_arrow_shaft.png index 5af6f3f4..077d3ed3 100644 Binary files a/mods/tinker/textures/items/arrow/blueslime_arrow_shaft.png and b/mods/tinker/textures/items/arrow/blueslime_arrow_shaft.png differ diff --git a/mods/tinker/textures/items/arrow/steel_arrow_head.png b/mods/tinker/textures/items/arrow/steel_arrow_head.png index 31c37090..03d3177e 100644 Binary files a/mods/tinker/textures/items/arrow/steel_arrow_head.png and b/mods/tinker/textures/items/arrow/steel_arrow_head.png differ diff --git a/mods/tinker/textures/items/arrow/steel_arrow_shaft.png b/mods/tinker/textures/items/arrow/steel_arrow_shaft.png index 06742952..3fe4da06 100644 Binary files a/mods/tinker/textures/items/arrow/steel_arrow_shaft.png and b/mods/tinker/textures/items/arrow/steel_arrow_shaft.png differ diff --git a/test/XinStick.java b/test/XinStick.java index bb9a86b2..5d96eaf4 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -18,42 +18,42 @@ import net.minecraft.world.World; public class XinStick extends Item { - public XinStick(int id) - { - super(id); - setCreativeTab(CreativeTabs.tabMisc); - } - - public Icon getIconFromDamage(int par1) + public XinStick(int id) { - return Item.arrow.getIconFromDamage(par1); + super(id); + setCreativeTab(CreativeTabs.tabMisc); } - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - //if (!world.isRemote) - //MinecraftServer.getServer().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) player, -7); - //player.travelToDimension(-7); - clearInventoryExeptHotbar(player); - MiniGardy entity = new MiniGardy(world); - entity.setOwner(player); - //entity.username = "NekoGloop"; - spawnEntity(player.posX, player.posY+1, player.posZ, entity, world, player); - //healPlayer(player); - //removeChunk(world, player.posX, player.posZ); - return stack; - } - - public void clearInventoryExeptHotbar(EntityPlayer player) - { - for (int i = 9; i < 36; i++) - player.inventory.mainInventory[i] = null; - } - - /*public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + public Icon getIconFromDamage (int par1) { - EntityLightningBolt entity = new EntityLightningBolt(world, x, y, z); + return Item.arrow.getIconFromDamage(par1); + } + + @Override + public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) + { + //if (!world.isRemote) + //MinecraftServer.getServer().getConfigurationManager().transferPlayerToDimension((EntityPlayerMP) player, -7); + //player.travelToDimension(-7); + //clearInventoryExeptHotbar(player); + MiniGardy entity = new MiniGardy(world); + entity.setOwner(player); + //entity.username = "NekoGloop"; + spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player); + //healPlayer(player); + //removeChunk(world, player.posX, player.posZ); + return stack; + } + + public void clearInventoryExeptHotbar (EntityPlayer player) + { + for (int i = 9; i < 36; i++) + player.inventory.mainInventory[i] = null; + } + + /*public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + EntityLightningBolt entity = new EntityLightningBolt(world, x, y, z); world.spawnEntityInWorld(entity); entity = new EntityLightningBolt(world, x-3, y+4, z-3); world.spawnEntityInWorld(entity); @@ -65,44 +65,44 @@ public class XinStick extends Item world.spawnEntityInWorld(entity); return false; }*/ - - public static void healPlayer(EntityPlayer player) - { - player.setEntityHealth(50); - } - public static void spawnItem (double x, double y, double z, ItemStack stack, World world) - { - if (!world.isRemote) - { - EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); - world.spawnEntityInWorld(entityitem); - } - } + public static void healPlayer (EntityPlayer player) + { + player.setEntityHealth(50); + } - public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player) - { - if (!world.isRemote) - { - entity.setPosition(x, y, z); - entity.setAngles(player.cameraYaw, player.cameraYaw); - //((BlueSlime) entity).setSlimeSize(8); - ((EntityLiving) entity).initCreature(); - world.spawnEntityInWorld(entity); - } - } + public static void spawnItem (double x, double y, double z, ItemStack stack, World world) + { + if (!world.isRemote) + { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); + world.spawnEntityInWorld(entityitem); + } + } - public void removeChunk (World world, double dx, double dz) - { - for (int x = 0; x < 16; x++) - { - for (int z = 0; z < 16; z++) - { - for (int y = 0; y < 128; y++) - { - world.setBlock((int) (x + dx), y, (int) (z + dz), 0, 0, 3); - } - } - } - } + public static void spawnEntity (double x, double y, double z, Entity entity, World world, EntityPlayer player) + { + if (!world.isRemote) + { + entity.setPosition(x, y, z); + entity.setAngles(player.cameraYaw, player.cameraYaw); + //((BlueSlime) entity).setSlimeSize(8); + ((EntityLiving) entity).initCreature(); + world.spawnEntityInWorld(entity); + } + } + + public void removeChunk (World world, double dx, double dz) + { + for (int x = 0; x < 16; x++) + { + for (int z = 0; z < 16; z++) + { + for (int y = 0; y < 128; y++) + { + world.setBlock((int) (x + dx), y, (int) (z + dz), 0, 0, 3); + } + } + } + } }