diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 8b9f8c2c879..804009a4a14 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -59,10 +59,10 @@ public class TConstruct //The name of the enum is accompanied by numbers because I have no idea what will happen if another mod will try to add the same enum, just to be safe //public static EnumCreatureType creatureTypePlayer = EnumHelper.addCreatureType("PLAYER_5821443", EntityPlayer.class, 0, Material.air, true); - + //The packet pipeline public static final PacketPipeline packetPipeline = new PacketPipeline(); - + public TConstruct() { LoggerConfig fml = new LoggerConfig(FMLCommonHandler.instance().getFMLLogger().getName(), Level.ALL, true); @@ -88,7 +88,7 @@ public TConstruct() @EventHandler public void preInit (FMLPreInitializationEvent event) { - + PHConstruct.initProps(event.getSuggestedConfigurationFile()); TConstructRegistry.materialTab = new TabTools("TConstructMaterials"); TConstructRegistry.toolTab = new TabTools("TConstructTools"); @@ -99,7 +99,7 @@ public void preInit (FMLPreInitializationEvent event) chiselDetailing = new Detailing(); content = new TContent(); - + recipes = new TRecipes(); events = new TEventHandler(); @@ -141,10 +141,10 @@ public void preInit (FMLPreInitializationEvent event) playerTracker = new TPlayerHandler(); //GameRegistry.registerPlayerTracker(playerTracker); FMLCommonHandler.instance().bus().register(playerTracker); - + if (event.getSide() == Side.CLIENT) { - FMLCommonHandler.instance().bus().register(new TControls()); + FMLCommonHandler.instance().bus().register(new TControls()); } PluginController.getController().preInit(); @@ -153,14 +153,14 @@ public void preInit (FMLPreInitializationEvent event) @EventHandler public void init (FMLInitializationEvent event) { - packetPipeline.initalise(); + packetPipeline.initalise(); if (event.getSide() == Side.CLIENT) { //MinecraftForge.EVENT_BUS.register(new EventCloakRender()); } DimensionBlacklist.getBadBimensions(); - GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool,2), 2); + GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool, 2), 2); PluginController.getController().init(); diff --git a/src/main/java/tconstruct/achievements/TAchievements.java b/src/main/java/tconstruct/achievements/TAchievements.java index e3ff42762e9..6537def65a8 100644 --- a/src/main/java/tconstruct/achievements/TAchievements.java +++ b/src/main/java/tconstruct/achievements/TAchievements.java @@ -5,24 +5,27 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.AchievementPage; -public class TAchievements { - - //Add achievements in here before the load executes(end of TC's init event) - public static HashMap achievements = new HashMap(); - - //Warning: Will be null until after the init stage - public static AchievementPage achievementPage = null; - - public static void init(){ - Achievement[] achs = new Achievement[achievements.values().size()]; - - for(int i = 0; i < achs.length; i++){ - achs[i] = (Achievement)achievements.values().toArray()[i]; - } - - achievementPage = new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achs); - - AchievementPage.registerAchievementPage(achievementPage); - } - +public class TAchievements +{ + + //Add achievements in here before the load executes(end of TC's init event) + public static HashMap achievements = new HashMap(); + + //Warning: Will be null until after the init stage + public static AchievementPage achievementPage = null; + + public static void init () + { + Achievement[] achs = new Achievement[achievements.values().size()]; + + for (int i = 0; i < achs.length; i++) + { + achs[i] = (Achievement) achievements.values().toArray()[i]; + } + + achievementPage = new AchievementPage(StatCollector.translateToLocal("tconstruct.achievementPage.name"), achs); + + AchievementPage.registerAchievementPage(achievementPage); + } + } diff --git a/src/main/java/tconstruct/blocks/BlockFalling.java b/src/main/java/tconstruct/blocks/BlockFalling.java index 50060b8e210..9da954ae64b 100644 --- a/src/main/java/tconstruct/blocks/BlockFalling.java +++ b/src/main/java/tconstruct/blocks/BlockFalling.java @@ -24,17 +24,17 @@ public BlockFalling(Material p_i45405_1_) super(p_i45405_1_); } - public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) + public void onBlockAdded (World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, this.tickRate(p_149726_1_)); } - public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) + public void onNeighborBlockChange (World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) { p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, this.tickRate(p_149695_1_)); } - public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + public void updateTick (World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) { if (!p_149674_1_.isRemote) { @@ -42,7 +42,7 @@ public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int } } - private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_) + private void func_149830_m (World p_149830_1_, int p_149830_2_, int p_149830_3_, int p_149830_4_) { if (func_149831_e(p_149830_1_, p_149830_2_, p_149830_3_ - 1, p_149830_4_) && p_149830_3_ >= 0) { @@ -74,14 +74,16 @@ private void func_149830_m(World p_149830_1_, int p_149830_2_, int p_149830_3_, } } - protected void func_149829_a(EntityFallingBlock p_149829_1_) {} + protected void func_149829_a (EntityFallingBlock p_149829_1_) + { + } - public int tickRate(World p_149738_1_) + public int tickRate (World p_149738_1_) { return 2; } - public static boolean func_149831_e(World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_) + public static boolean func_149831_e (World p_149831_0_, int p_149831_1_, int p_149831_2_, int p_149831_3_) { Block block = p_149831_0_.getBlock(p_149831_1_, p_149831_2_, p_149831_3_); @@ -98,9 +100,11 @@ else if (block == Blocks.fire) //TODO: King, take a look here when doing liquids! //Material material = block.blockMaterial; //return material == Material.water ? true : material == Material.lava; - return false; + return false; } } - public void func_149828_a(World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) {} + public void func_149828_a (World p_149828_1_, int p_149828_2_, int p_149828_3_, int p_149828_4_, int p_149828_5_) + { + } } \ No newline at end of file diff --git a/src/main/java/tconstruct/blocks/BlockLandmine.java b/src/main/java/tconstruct/blocks/BlockLandmine.java index 13fea6b06f2..b284e4ab888 100644 --- a/src/main/java/tconstruct/blocks/BlockLandmine.java +++ b/src/main/java/tconstruct/blocks/BlockLandmine.java @@ -458,10 +458,10 @@ private boolean hasItems (World par1World, int par2, int par3, int par4) return false; } } - + public static enum Sensitivity { - everything, mobs, players; + everything, mobs, players; } protected int getMineState (World par1World, int par2, int par3, int par4) diff --git a/src/main/java/tconstruct/blocks/BloodBlock.java b/src/main/java/tconstruct/blocks/BloodBlock.java index 986ce82714a..59e9b58eebc 100644 --- a/src/main/java/tconstruct/blocks/BloodBlock.java +++ b/src/main/java/tconstruct/blocks/BloodBlock.java @@ -15,13 +15,13 @@ public BloodBlock(Fluid fluid, Material material, String texture) { super(fluid, material, texture); } - + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) { if (entity instanceof EntityLivingBase) { - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20*15, 0)); - ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20*5, 1)); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20 * 15, 0)); + ((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 20 * 5, 1)); } } } diff --git a/src/main/java/tconstruct/blocks/ConveyorBase.java b/src/main/java/tconstruct/blocks/ConveyorBase.java index c2a0702b997..e146da3dd0d 100644 --- a/src/main/java/tconstruct/blocks/ConveyorBase.java +++ b/src/main/java/tconstruct/blocks/ConveyorBase.java @@ -101,11 +101,11 @@ public void onBlockPlacedBy (World world, int x, int y, int z, EntityLivingBase world.setBlockMetadataWithNotify(x, y, z, face | meta, 2); } - public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) + public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) { if (side == 1) return false; - return super. shouldSideBeRendered(world, x, y, z, side); + return super.shouldSideBeRendered(world, x, y, z, side); } public IIcon[] icons; diff --git a/src/main/java/tconstruct/blocks/CraftingStationBlock.java b/src/main/java/tconstruct/blocks/CraftingStationBlock.java index 5199b2d3e91..9710e5974b2 100644 --- a/src/main/java/tconstruct/blocks/CraftingStationBlock.java +++ b/src/main/java/tconstruct/blocks/CraftingStationBlock.java @@ -101,10 +101,11 @@ public void getSubBlocks (Item id, CreativeTabs tab, List list) } } - @Override - public TileEntity createNewTileEntity(World arg0, int arg1) { - return new CraftingStationLogic(); - } + @Override + public TileEntity createNewTileEntity (World arg0, int arg1) + { + return new CraftingStationLogic(); + } @Override public TileEntity func_149915_a (World arg0, int arg1) diff --git a/src/main/java/tconstruct/blocks/GlassBlockConnected.java b/src/main/java/tconstruct/blocks/GlassBlockConnected.java index bf83a7ab9e0..8670cb383dc 100644 --- a/src/main/java/tconstruct/blocks/GlassBlockConnected.java +++ b/src/main/java/tconstruct/blocks/GlassBlockConnected.java @@ -585,10 +585,10 @@ else if (isOpenRight) } @Override - 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) { Block b = par1IBlockAccess.getBlock(par2, par3, par4); - return b == (Block) this ? false : super. shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + return b == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); } @Override diff --git a/src/main/java/tconstruct/blocks/GlassBlockStained.java b/src/main/java/tconstruct/blocks/GlassBlockStained.java index 155f01d7de7..0916bfe7ab3 100644 --- a/src/main/java/tconstruct/blocks/GlassBlockStained.java +++ b/src/main/java/tconstruct/blocks/GlassBlockStained.java @@ -31,10 +31,10 @@ public boolean isOpaqueCube () } @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) + public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) { Block block = world.getBlock(x, y, z); - return block == this ? false : super. shouldSideBeRendered(world, x, y, z, side); + return block == this ? false : super.shouldSideBeRendered(world, x, y, z, side); } @Override diff --git a/src/main/java/tconstruct/blocks/GlassPaneConnected.java b/src/main/java/tconstruct/blocks/GlassPaneConnected.java index 0c170761e56..4ed6078d11b 100644 --- a/src/main/java/tconstruct/blocks/GlassPaneConnected.java +++ b/src/main/java/tconstruct/blocks/GlassPaneConnected.java @@ -37,8 +37,8 @@ public IIcon getIcon (IBlockAccess par1IBlockAccess, int par2, int par3, int par { if (par5 == 0 || par5 == 1) { - return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15] - : par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15] : getSideTextureIndex(); + return par1IBlockAccess.getBlock(par2, par3 - 1, par4) == this && par5 == 0 ? icons[15] : par1IBlockAccess.getBlock(par2, par3 + 1, par4) == this && par5 == 1 ? icons[15] + : getSideTextureIndex(); } else { diff --git a/src/main/java/tconstruct/blocks/GlueBlock.java b/src/main/java/tconstruct/blocks/GlueBlock.java index b047cc6cff8..bdcbb5a1960 100644 --- a/src/main/java/tconstruct/blocks/GlueBlock.java +++ b/src/main/java/tconstruct/blocks/GlueBlock.java @@ -10,11 +10,12 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -public class GlueBlock extends TConstructBlock { +public class GlueBlock extends TConstructBlock +{ public GlueBlock() { - super(Material.ground, 4.0f, new String[]{"glue"}); + super(Material.ground, 4.0f, new String[] { "glue" }); } @Override @@ -23,19 +24,26 @@ public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity.motionX *= 0.1; entity.motionZ *= 0.1; - if (entity instanceof EntityLivingBase) { - EntityLivingBase lvb = (EntityLivingBase)entity; + if (entity instanceof EntityLivingBase) + { + EntityLivingBase lvb = (EntityLivingBase) entity; // Well you'd feel ill too standing on glue... - if (lvb.isPotionActive(Potion.hunger)) { + if (lvb.isPotionActive(Potion.hunger)) + { lvb.getActivePotionEffect(Potion.hunger).duration = 20; - } else { + } + else + { lvb.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 20, 4)); } // Glue is sticky stuff - if (lvb.isPotionActive(Potion.moveSlowdown)) { + if (lvb.isPotionActive(Potion.moveSlowdown)) + { lvb.getActivePotionEffect(Potion.moveSlowdown).duration = 30; - } else { + } + else + { lvb.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 30, 4)); } } diff --git a/src/main/java/tconstruct/blocks/GlueFluid.java b/src/main/java/tconstruct/blocks/GlueFluid.java index e7db488deac..3fb0c60f7d7 100644 --- a/src/main/java/tconstruct/blocks/GlueFluid.java +++ b/src/main/java/tconstruct/blocks/GlueFluid.java @@ -13,7 +13,8 @@ import net.minecraftforge.fluids.BlockFluidFinite; import net.minecraftforge.fluids.Fluid; -public class GlueFluid extends BlockFluidFinite { +public class GlueFluid extends BlockFluidFinite +{ IIcon stillIcon; IIcon flowIcon; @@ -41,23 +42,31 @@ public IIcon getIcon (int side, int meta) } @Override - public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) { + public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity) + { entity.motionX *= 0.1; entity.motionZ *= 0.1; - if (entity instanceof EntityLivingBase) { - EntityLivingBase lvb = (EntityLivingBase)entity; + if (entity instanceof EntityLivingBase) + { + EntityLivingBase lvb = (EntityLivingBase) entity; // Well you'd feel ill too standing in glue... - if (lvb.isPotionActive(Potion.hunger)) { + if (lvb.isPotionActive(Potion.hunger)) + { lvb.getActivePotionEffect(Potion.hunger).duration = 20; - } else { + } + else + { lvb.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 20, 4)); } // Glue is sticky stuff - if (lvb.isPotionActive(Potion.moveSlowdown)) { + if (lvb.isPotionActive(Potion.moveSlowdown)) + { lvb.getActivePotionEffect(Potion.moveSlowdown).duration = 30; - } else { + } + else + { lvb.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 30, 4)); } } diff --git a/src/main/java/tconstruct/blocks/LavaTankBlock.java b/src/main/java/tconstruct/blocks/LavaTankBlock.java index b4f51bfdd31..e8783acba9f 100644 --- a/src/main/java/tconstruct/blocks/LavaTankBlock.java +++ b/src/main/java/tconstruct/blocks/LavaTankBlock.java @@ -95,7 +95,7 @@ public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, in //if (side == 0 && world.getBlockMetadata(x, y, z) == 0) //return super. shouldSideBeRendered(world, x, y, z, side); Block b = world.getBlock(x, y, z); - return b == (Block)this ? false : super. shouldSideBeRendered(world, x, y, z, side); + return b == (Block) this ? false : super.shouldSideBeRendered(world, x, y, z, side); //return true; } diff --git a/src/main/java/tconstruct/blocks/MeatBlock.java b/src/main/java/tconstruct/blocks/MeatBlock.java index c57d3d0a7e5..fd52a9d7c1d 100644 --- a/src/main/java/tconstruct/blocks/MeatBlock.java +++ b/src/main/java/tconstruct/blocks/MeatBlock.java @@ -172,17 +172,17 @@ public void getSubBlocks (Item b, CreativeTabs par2CreativeTabs, List par3List) par3List.add(new ItemStack(b, 1, i)); } -// @Override -// public boolean canSustainLeaves (World world, int x, int y, int z) -// { -// return true; -// } -// -// @Override -// public boolean isWood (World world, int x, int y, int z) -// { -// return true; -// } + // @Override + // public boolean canSustainLeaves (World world, int x, int y, int z) + // { + // return true; + // } + // + // @Override + // public boolean isWood (World world, int x, int y, int z) + // { + // return true; + // } public boolean isBeaconBase (World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { diff --git a/src/main/java/tconstruct/blocks/MultiBrick.java b/src/main/java/tconstruct/blocks/MultiBrick.java index 3610ed41a1a..f8d66e4dd6d 100644 --- a/src/main/java/tconstruct/blocks/MultiBrick.java +++ b/src/main/java/tconstruct/blocks/MultiBrick.java @@ -110,6 +110,7 @@ public void onEntityCollidedWithBlock (World world, int x, int y, int z, Entity entity.fallDistance = 0; } } + //TODO getCollisionBoundingBoxFromPool @Override public AxisAlignedBB getCollisionBoundingBoxFromPool (World world, int x, int y, int z) diff --git a/src/main/java/tconstruct/blocks/MultiBrickFancy.java b/src/main/java/tconstruct/blocks/MultiBrickFancy.java index c09b69c5fd1..de6b0ffa421 100644 --- a/src/main/java/tconstruct/blocks/MultiBrickFancy.java +++ b/src/main/java/tconstruct/blocks/MultiBrickFancy.java @@ -22,6 +22,7 @@ public MultiBrickFancy() { super(Material.rock, 3f, blockTextures); } + //TODO getBlockHardness @Override public float getBlockHardness (World world, int x, int y, int z) diff --git a/src/main/java/tconstruct/blocks/OreberryBush.java b/src/main/java/tconstruct/blocks/OreberryBush.java index 812ec7563d1..81ff39acb1b 100644 --- a/src/main/java/tconstruct/blocks/OreberryBush.java +++ b/src/main/java/tconstruct/blocks/OreberryBush.java @@ -326,9 +326,9 @@ public EnumPlantType getPlantType (IBlockAccess world, int x, int y, int z) { return EnumPlantType.Cave; } - + @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean p_150122_1_) + public void setGraphicsLevel (boolean p_150122_1_) { this.field_150121_P = p_150122_1_; this.field_150127_b = (p_150122_1_ ? 0 : 1); diff --git a/src/main/java/tconstruct/blocks/OreberryBushEssence.java b/src/main/java/tconstruct/blocks/OreberryBushEssence.java index 3d212bdeb67..3ab911f9142 100644 --- a/src/main/java/tconstruct/blocks/OreberryBushEssence.java +++ b/src/main/java/tconstruct/blocks/OreberryBushEssence.java @@ -30,7 +30,7 @@ public void updateTick (World world, int x, int y, int z, Random random1) { if (meta < 12) { - world.setBlock(x, y, z,(Block) this, meta + 4, 3); + world.setBlock(x, y, z, (Block) this, meta + 4, 3); } } /*else if (meta < 8) diff --git a/src/main/java/tconstruct/blocks/PaneBase.java b/src/main/java/tconstruct/blocks/PaneBase.java index f3d598a88ee..cf0f542fb8b 100644 --- a/src/main/java/tconstruct/blocks/PaneBase.java +++ b/src/main/java/tconstruct/blocks/PaneBase.java @@ -34,12 +34,13 @@ public PaneBase(Material material, String folder, String[] blockTextures) this.folder = folder; } - public final boolean canPaneConnectToBlock(Block p_150098_1_) + public final boolean canPaneConnectToBlock (Block p_150098_1_) { - return p_150098_1_.func_149730_j() || p_150098_1_ == this || p_150098_1_ == Blocks.glass || p_150098_1_ == Blocks.stained_glass || p_150098_1_ == Blocks.stained_glass_pane || p_150098_1_ instanceof BlockPane; + return p_150098_1_.func_149730_j() || p_150098_1_ == this || p_150098_1_ == Blocks.glass || p_150098_1_ == Blocks.stained_glass || p_150098_1_ == Blocks.stained_glass_pane + || p_150098_1_ instanceof BlockPane; } - - public boolean canConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) + + public boolean canConnectTo (IBlockAccess world, int x, int y, int z, ForgeDirection dir) { return canPaneConnectToBlock(world.getBlock(x, y, z)) || world.isSideSolid(x, y, z, dir.getOpposite(), false); } @@ -94,7 +95,7 @@ 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) { Block b = iblockaccess.getBlock(i, j, k); if (b instanceof PaneBase || b instanceof BlockPane) @@ -103,7 +104,7 @@ public boolean shouldSideBeRendered (IBlockAccess iblockaccess, int i, int j, i } else { - return super. shouldSideBeRendered(iblockaccess, i, j, k, l); + return super.shouldSideBeRendered(iblockaccess, i, j, k, l); } } diff --git a/src/main/java/tconstruct/blocks/SearedBlock.java b/src/main/java/tconstruct/blocks/SearedBlock.java index 5f22082dc5d..ef0b0265b48 100644 --- a/src/main/java/tconstruct/blocks/SearedBlock.java +++ b/src/main/java/tconstruct/blocks/SearedBlock.java @@ -43,7 +43,6 @@ public SearedBlock(String texture) this.texturePrefix = texture; } - @Override public TileEntity createTileEntity (World world, int metadata) { @@ -168,7 +167,7 @@ boolean activateCastingBasin (World world, int x, int y, int z, EntityPlayer pla } else if (logic.isStackInSlot(0)) { - MinecraftForge.EVENT_BUS.post(new SmelteryEvent.ItemRemovedFromCasting(logic, x, y, z, logic.getStackInSlot(0), player)); + MinecraftForge.EVENT_BUS.post(new SmelteryEvent.ItemRemovedFromCasting(logic, x, y, z, logic.getStackInSlot(0), player)); ItemStack stack = logic.decrStackSize(0, 1); if (stack != null) addItemToInventory(player, world, x, y, z, stack); diff --git a/src/main/java/tconstruct/blocks/SlimeExplosive.java b/src/main/java/tconstruct/blocks/SlimeExplosive.java index efdfdec158c..b6ad7aa5a01 100644 --- a/src/main/java/tconstruct/blocks/SlimeExplosive.java +++ b/src/main/java/tconstruct/blocks/SlimeExplosive.java @@ -136,7 +136,7 @@ public void onEntityCollidedWithBlock (World par1World, int par2, int par3, int if (entityarrow.isBurning()) { this.primeTnt(par1World, par2, par3, par4, 1, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase) entityarrow.shootingEntity : null); - WorldHelper.setBlockToAir(par1World,par2, par3, par4); + WorldHelper.setBlockToAir(par1World, par2, par3, par4); } } } diff --git a/src/main/java/tconstruct/blocks/SoilBlock.java b/src/main/java/tconstruct/blocks/SoilBlock.java index ef56940d01c..3b2d49ee3b3 100644 --- a/src/main/java/tconstruct/blocks/SoilBlock.java +++ b/src/main/java/tconstruct/blocks/SoilBlock.java @@ -24,7 +24,8 @@ public SoilBlock() @Override public void onEntityWalking (World world, int x, int y, int z, Entity entity) { - if (entity instanceof EntityLivingBase){ + if (entity instanceof EntityLivingBase) + { if (((EntityLivingBase) entity).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { int metadata = world.getBlockMetadata(x, y, z); diff --git a/src/main/java/tconstruct/blocks/StoneTorch.java b/src/main/java/tconstruct/blocks/StoneTorch.java index b089b3c588e..ab85dc7d189 100644 --- a/src/main/java/tconstruct/blocks/StoneTorch.java +++ b/src/main/java/tconstruct/blocks/StoneTorch.java @@ -84,9 +84,8 @@ private boolean canPlaceTorchOn (World par1World, int par2, int par3, int par4) */ public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { - return par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) || par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) - || par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true) || par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) - || canPlaceTorchOn(par1World, par2, par3 - 1, par4); + return par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) || par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) || par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true) + || par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) || canPlaceTorchOn(par1World, par2, par3 - 1, par4); } /** diff --git a/src/main/java/tconstruct/blocks/TConstructBlock.java b/src/main/java/tconstruct/blocks/TConstructBlock.java index 70a543b807f..c4feeb4bfec 100644 --- a/src/main/java/tconstruct/blocks/TConstructBlock.java +++ b/src/main/java/tconstruct/blocks/TConstructBlock.java @@ -19,9 +19,9 @@ public class TConstructBlock extends MantleBlock public String[] textureNames; public IIcon[] icons; - public TConstructBlock( Material material, float hardness, String[] tex) + public TConstructBlock(Material material, float hardness, String[] tex) { - super( material); + super(material); setHardness(hardness); this.setCreativeTab(TConstructRegistry.blockTab); textureNames = tex; diff --git a/src/main/java/tconstruct/blocks/TConstructFluid.java b/src/main/java/tconstruct/blocks/TConstructFluid.java index 88f6b289d48..91ac28ac1b2 100644 --- a/src/main/java/tconstruct/blocks/TConstructFluid.java +++ b/src/main/java/tconstruct/blocks/TConstructFluid.java @@ -33,6 +33,7 @@ public int getRenderBlockPass () { return alpha ? 1 : 0; } + //TODO registerBlockIcons @Override public void registerBlockIcons (IIconRegister iconRegister) diff --git a/src/main/java/tconstruct/blocks/ToolStationBlock.java b/src/main/java/tconstruct/blocks/ToolStationBlock.java index b188e5047d3..e240bf0f022 100644 --- a/src/main/java/tconstruct/blocks/ToolStationBlock.java +++ b/src/main/java/tconstruct/blocks/ToolStationBlock.java @@ -116,7 +116,8 @@ public AxisAlignedBB getSelectedBoundingBoxFromPool (World world, int x, int y, { int metadata = world.getBlockMetadata(x, y, z); if (metadata == 5) - return AxisAlignedBB.getAABBPool().getAABB((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY - 0.125, (double) z + this.maxZ); + return AxisAlignedBB.getAABBPool().getAABB((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY - 0.125, + (double) z + this.maxZ); return AxisAlignedBB.getAABBPool().getAABB((double) x + this.minX, (double) y + this.minY, (double) z + this.minZ, (double) x + this.maxX, (double) y + this.maxY, (double) z + this.maxZ); } @@ -218,6 +219,6 @@ public void onBlockPlacedBy (World world, int x, int y, int z, EntityLivingBase @Override public TileEntity createNewTileEntity (World var1, int var2) { - return createTileEntity(var1,var2); + return createTileEntity(var1, var2); } } diff --git a/src/main/java/tconstruct/blocks/component/SmelteryScan.java b/src/main/java/tconstruct/blocks/component/SmelteryScan.java index 3d6c6ab168e..f5349486d17 100644 --- a/src/main/java/tconstruct/blocks/component/SmelteryScan.java +++ b/src/main/java/tconstruct/blocks/component/SmelteryScan.java @@ -44,7 +44,7 @@ protected boolean checkAir (int x, int y, int z) protected boolean checkServant (int x, int y, int z) { Block block = world.getBlock(x, y, z); - if (block == null || world.getBlock( x, y, z) == Blocks.air || !isValidBlock(x, y, z)) + if (block == null || world.getBlock(x, y, z) == Blocks.air || !isValidBlock(x, y, z)) return false; if (!block.hasTileEntity(world.getBlockMetadata(x, y, z))) @@ -130,7 +130,7 @@ public void readNetworkNBT (NBTTagCompound tags) { super.readNetworkNBT(tags); - NBTTagList tanks = tags.getTagList("Tanks",11); + NBTTagList tanks = tags.getTagList("Tanks", 11); if (tanks != null) { lavaTanks.clear(); diff --git a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java index e772f2c7726..00d186f12aa 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingBasinLogic.java @@ -436,13 +436,13 @@ public boolean hasCustomInventoryName () public void closeInventory () { // TODO Auto-generated method stub - + } @Override public void openInventory () { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java index 69114b8f1ee..6f93088f5a4 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingChannelLogic.java @@ -17,7 +17,7 @@ public class CastingChannelLogic extends TileEntity implements IFluidTank, IFluidHandler, IActiveLogic { - public final static int fillMax = TConstruct.ingotLiquidValue*5; + public final static int fillMax = TConstruct.ingotLiquidValue * 5; public final static int outputMax = TConstruct.ingotLiquidValue; public FluidStack liquid; public ForgeDirection lastProvider; diff --git a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java index 309faf20f3c..9a254e9fe34 100644 --- a/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CastingTableLogic.java @@ -434,13 +434,13 @@ public boolean hasCustomInventoryName () public void closeInventory () { // TODO Auto-generated method stub - + } @Override public void openInventory () { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tconstruct/blocks/logic/CraftingStationLogic.java b/src/main/java/tconstruct/blocks/logic/CraftingStationLogic.java index ecc6d8a21e8..147ff947298 100644 --- a/src/main/java/tconstruct/blocks/logic/CraftingStationLogic.java +++ b/src/main/java/tconstruct/blocks/logic/CraftingStationLogic.java @@ -120,13 +120,13 @@ public boolean hasCustomInventoryName () public void closeInventory () { // TODO Auto-generated method stub - + } @Override public void openInventory () { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java index 2e1bdc118d3..0bcdc755117 100644 --- a/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java +++ b/src/main/java/tconstruct/blocks/logic/DryingRackLogic.java @@ -139,13 +139,13 @@ public boolean hasCustomInventoryName () public void closeInventory () { // TODO Auto-generated method stub - + } @Override public void openInventory () { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java index 8743d3e50c0..8bf9d673ce9 100644 --- a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java @@ -703,32 +703,31 @@ public void alignInitialPlacement (int x, int y, int z) Block eastBlock = worldObj.getBlock(x + 1, y, z); Block westBlock = worldObj.getBlock(x - 1, y, z); - if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) - && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air)) + if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) && (eastBlock == null || eastBlock == Blocks.air) + && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x, y, z); } - else if ((northBlock != null && !(northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) - && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air))) + else if ((northBlock != null && !(northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air))) { checkValidStructure(x, y, z - 1); } - else if ((northBlock == null || northBlock == Blocks.air) && (southBlock != null && !(southBlock == Blocks.air)) - && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air)) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock != null && !(southBlock == Blocks.air)) && (eastBlock == null || eastBlock == Blocks.air) + && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x, y, z + 1); } - else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) - && (eastBlock != null && !(eastBlock == Blocks.air)) && (westBlock == null || westBlock == Blocks.air)) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) && (eastBlock != null && !(eastBlock == Blocks.air)) + && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x - 1, y, z); } - else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) - && (eastBlock == null || eastBlock == Blocks.air) && (westBlock != null && !(westBlock == Blocks.air))) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) && (eastBlock == null || eastBlock == Blocks.air) + && (westBlock != null && !(westBlock == Blocks.air))) { checkValidStructure(x + 1, y, z); } diff --git a/src/main/java/tconstruct/blocks/logic/TankAirLogic.java b/src/main/java/tconstruct/blocks/logic/TankAirLogic.java index 99e3011300f..f50cf097cdf 100644 --- a/src/main/java/tconstruct/blocks/logic/TankAirLogic.java +++ b/src/main/java/tconstruct/blocks/logic/TankAirLogic.java @@ -131,7 +131,7 @@ public boolean canUpdate() //DELETE public void updateEntity () { - WorldHelper.setBlockToAir(worldObj,xCoord, yCoord, zCoord); + WorldHelper.setBlockToAir(worldObj, xCoord, yCoord, zCoord); } //Keep TE regardless of metadata @@ -200,13 +200,12 @@ public boolean hasCustomInventoryName () @Override public void closeInventory () - { + { } @Override public void openInventory () - { + { } - } diff --git a/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java b/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java index 5a14a874d14..5eb04ddc541 100644 --- a/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java +++ b/src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java @@ -69,7 +69,7 @@ public void writeToNBT (NBTTagCompound par1NBTTagCompound) public void readFromNBT (NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items",9); + NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 9); this.inventory = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) @@ -263,5 +263,4 @@ public void updateEntity () } } - } diff --git a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java index c1df6b2f46e..0edb0ed3fb2 100644 --- a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java @@ -124,11 +124,11 @@ public boolean hasCustomInventoryName () @Override public void closeInventory () - { + { } @Override public void openInventory () - { + { } } diff --git a/src/main/java/tconstruct/blocks/slime/SlimeGrass.java b/src/main/java/tconstruct/blocks/slime/SlimeGrass.java index fb1173a5ec8..fde6dede611 100644 --- a/src/main/java/tconstruct/blocks/slime/SlimeGrass.java +++ b/src/main/java/tconstruct/blocks/slime/SlimeGrass.java @@ -123,7 +123,7 @@ else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) Block block = par1World.getBlock(posX, posY, posZ); if (block == Blocks.dirt) { - par1World.setBlock(posX, posY, posZ,(Block) this, 1, 3); + par1World.setBlock(posX, posY, posZ, (Block) this, 1, 3); return; } int blockMeta = par1World.getBlockMetadata(posX, posY, posZ); diff --git a/src/main/java/tconstruct/blocks/slime/SlimeLeaves.java b/src/main/java/tconstruct/blocks/slime/SlimeLeaves.java index 6869422627e..13fc06b61be 100644 --- a/src/main/java/tconstruct/blocks/slime/SlimeLeaves.java +++ b/src/main/java/tconstruct/blocks/slime/SlimeLeaves.java @@ -151,8 +151,9 @@ public void dropBlockAsItemWithChance (World world, int x, int y, int z, int met } } - @Override - public String[] func_150125_e() { - return new String[]{"slime"}; - } + @Override + public String[] func_150125_e () + { + return new String[] { "slime" }; + } } diff --git a/src/main/java/tconstruct/blocks/slime/SlimeTallGrass.java b/src/main/java/tconstruct/blocks/slime/SlimeTallGrass.java index d2a5c6a8129..34cc9c3d18e 100644 --- a/src/main/java/tconstruct/blocks/slime/SlimeTallGrass.java +++ b/src/main/java/tconstruct/blocks/slime/SlimeTallGrass.java @@ -116,7 +116,6 @@ public ArrayList getDrops (World world, int x, int y, int z, int meta return ret; } - @Override public boolean isShearable (ItemStack item, IBlockAccess world, int x, int y, int z) { diff --git a/src/main/java/tconstruct/blocks/traps/Punji.java b/src/main/java/tconstruct/blocks/traps/Punji.java index d2e64f00d98..fc957be01e2 100644 --- a/src/main/java/tconstruct/blocks/traps/Punji.java +++ b/src/main/java/tconstruct/blocks/traps/Punji.java @@ -60,8 +60,8 @@ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer if (stack != null && stack == new ItemStack(TRepo.punji)) { world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3); - world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.stepSound.soundName, - (this.stepSound.getVolume() + 1.0F) / 2.0F, this.stepSound.getPitch() * 0.8F); + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.stepSound.soundName, (this.stepSound.getVolume() + 1.0F) / 2.0F, + this.stepSound.getPitch() * 0.8F); player.swingItem(); if (!player.capabilities.isCreativeMode) { diff --git a/src/main/java/tconstruct/client/TClientEvents.java b/src/main/java/tconstruct/client/TClientEvents.java index 31a61ab6b64..6ac01257ad1 100644 --- a/src/main/java/tconstruct/client/TClientEvents.java +++ b/src/main/java/tconstruct/client/TClientEvents.java @@ -49,12 +49,12 @@ public void onSound (SoundLoadEvent event) initSounds = true; try { - /* SoundManager soundmanager = event.manager; - soundmanager.addSound("tinker:frypan_hit.ogg"); - soundmanager.addSound("tinker:little_saw.ogg"); - soundmanager.addSound("tinker:launcher_clank.ogg"); - TConstruct.logger.info("Successfully loaded sounds."); - */ + /* SoundManager soundmanager = event.manager; + soundmanager.addSound("tinker:frypan_hit.ogg"); + soundmanager.addSound("tinker:little_saw.ogg"); + soundmanager.addSound("tinker:launcher_clank.ogg"); + TConstruct.logger.info("Successfully loaded sounds."); + */ } catch (Exception e) { @@ -243,7 +243,7 @@ public void drawTexturedModalRect (int par1, int par2, int par3, int par4, int p } double zLevel = 0; - + /*@SubscribeEvent public void fovModifier(FOVUpdateEvent event) { diff --git a/src/main/java/tconstruct/client/TProxyClient.java b/src/main/java/tconstruct/client/TProxyClient.java index 1b30ca6a9d8..0747c17adb2 100644 --- a/src/main/java/tconstruct/client/TProxyClient.java +++ b/src/main/java/tconstruct/client/TProxyClient.java @@ -947,11 +947,12 @@ public void postInit () { //MinecraftForgeClient.registerItemRenderer(TRepo.armorPattern.itemID, new RenderArmorCast()); } - - private static IIcon getIcon(IIcon icon) + + private static IIcon getIcon (IIcon icon) { - if (icon != null) return icon; - return ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + if (icon != null) + return icon; + return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } } diff --git a/src/main/java/tconstruct/client/block/BarricadeRender.java b/src/main/java/tconstruct/client/block/BarricadeRender.java index 3dd1fb7375d..2706c3dcd96 100644 --- a/src/main/java/tconstruct/client/block/BarricadeRender.java +++ b/src/main/java/tconstruct/client/block/BarricadeRender.java @@ -154,5 +154,4 @@ public int getRenderId () return model; } - } diff --git a/src/main/java/tconstruct/client/block/BlockSkinRenderHelper.java b/src/main/java/tconstruct/client/block/BlockSkinRenderHelper.java index c3392ee4478..643429e7fb3 100644 --- a/src/main/java/tconstruct/client/block/BlockSkinRenderHelper.java +++ b/src/main/java/tconstruct/client/block/BlockSkinRenderHelper.java @@ -63,7 +63,7 @@ else if (render.hasOverrideBlockTexture()) float f7; int i1; - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { if (render.renderMinY <= 0.0D) { @@ -178,7 +178,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { if (render.renderMaxY >= 1.0D) { @@ -284,7 +284,7 @@ else if (render.hasOverrideBlockTexture()) IIcon icon; - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { if (render.renderMinZ <= 0.0D) { @@ -401,7 +401,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { if (render.renderMaxZ >= 1.0D) { @@ -518,7 +518,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { if (render.renderMinX <= 0.0D) { @@ -635,7 +635,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { if (render.renderMaxX >= 1.0D) { @@ -794,7 +794,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); @@ -802,7 +802,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); @@ -812,7 +812,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata IIcon icon; - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -821,7 +821,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -830,7 +830,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -839,7 +839,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -904,7 +904,7 @@ else if (render.hasOverrideBlockTexture()) float f7; int i1; - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { if (render.renderMinY <= 0.0D) { @@ -1019,7 +1019,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { if (render.renderMaxY >= 1.0D) { @@ -1123,7 +1123,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { if (render.renderMinZ <= 0.0D) { @@ -1239,7 +1239,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { if (render.renderMaxZ >= 1.0D) { @@ -1355,7 +1355,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { if (render.renderMinX <= 0.0D) { @@ -1471,7 +1471,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { if (render.renderMaxX >= 1.0D) { @@ -1630,7 +1630,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); @@ -1638,7 +1638,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); @@ -1648,7 +1648,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin IIcon icon; - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -1657,7 +1657,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -1666,7 +1666,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -1675,7 +1675,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin flag = true; } - if (render.renderAllFaces || block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -1686,7 +1686,9 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon stillIcon, IIcon flowin return flag; } - public static float getAmbientOcclusionLightValue(IBlockAccess access, int x, int y, int z){ + + public static float getAmbientOcclusionLightValue (IBlockAccess access, int x, int y, int z) + { return access.getBlock(x, y, z).getAmbientOcclusionLightValue(); } } diff --git a/src/main/java/tconstruct/client/block/DryingRackSpecialRender.java b/src/main/java/tconstruct/client/block/DryingRackSpecialRender.java index 4734e225815..bf727c1e15b 100644 --- a/src/main/java/tconstruct/client/block/DryingRackSpecialRender.java +++ b/src/main/java/tconstruct/client/block/DryingRackSpecialRender.java @@ -84,6 +84,6 @@ void renderItem (DryingRackLogic logic, ItemStack stack) @Override public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8) { - this.render((DryingRackLogic) logic, var2, var4, var6, var8); + this.render((DryingRackLogic) logic, var2, var4, var6, var8); } } diff --git a/src/main/java/tconstruct/client/block/RenderLiquid.java b/src/main/java/tconstruct/client/block/RenderLiquid.java index 6de33d4f5f8..b7ed7338c3d 100644 --- a/src/main/java/tconstruct/client/block/RenderLiquid.java +++ b/src/main/java/tconstruct/client/block/RenderLiquid.java @@ -59,7 +59,7 @@ else if (render.hasOverrideBlockTexture()) flag1 = false; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) { if (render.renderMinY <= 0.0D) { @@ -174,7 +174,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) { if (render.renderMaxY >= 1.0D) { @@ -278,7 +278,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) { if (render.renderMinZ <= 0.0D) { @@ -395,7 +395,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) { if (render.renderMaxZ >= 1.0D) { @@ -512,7 +512,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) { if (render.renderMinX <= 0.0D) { @@ -629,7 +629,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) { if (render.renderMaxX >= 1.0D) { @@ -793,7 +793,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); @@ -801,7 +801,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); @@ -809,7 +809,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -818,7 +818,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -827,7 +827,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -836,7 +836,7 @@ static boolean renderMetadataBlockWithColorMultiplier (Block block, int metadata flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -893,7 +893,7 @@ else if (render.hasOverrideBlockTexture()) flag1 = false; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) { if (render.renderMinY <= 0.0D) { @@ -1008,7 +1008,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) { if (render.renderMaxY >= 1.0D) { @@ -1023,10 +1023,10 @@ else if (render.hasOverrideBlockTexture()) render.aoLightValueScratchXYPP = getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); render.aoLightValueScratchYZPN = getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); render.aoLightValueScratchYZPP = getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); - boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getMaterial().getCanBlockGrass(); - boolean flag4 = render.blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); + boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); + boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag4 = render.blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getMaterial().getCanBlockGrass(); if ((!flag4) && (!flag2)) { @@ -1112,7 +1112,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) { if (render.renderMinZ <= 0.0D) { @@ -1127,10 +1127,10 @@ else if (render.hasOverrideBlockTexture()) render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); - boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); - boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); - boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getMaterial().getCanBlockGrass(); - boolean flag4 = render.blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag4 = render.blockAccess.getBlock(xPos, yPos - 1, zPos - 1).getMaterial().getCanBlockGrass(); if ((!flag2) && (!flag4)) { @@ -1228,7 +1228,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) { if (render.renderMaxZ >= 1.0D) { @@ -1243,10 +1243,10 @@ else if (render.hasOverrideBlockTexture()) render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); - boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); - boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); - boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getMaterial().getCanBlockGrass(); - boolean flag4 = render.blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag5 = render.blockAccess.getBlock(xPos, yPos + 1, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag4 = render.blockAccess.getBlock(xPos, yPos - 1, zPos + 1).getMaterial().getCanBlockGrass(); if ((!flag2) && (!flag4)) { @@ -1344,7 +1344,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) { if (render.renderMinX <= 0.0D) { @@ -1359,10 +1359,10 @@ else if (render.hasOverrideBlockTexture()) render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); - boolean flag3 = render.blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag5 = render.blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); - boolean flag4 = render.blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag3 = render.blockAccess.getBlock(xPos - 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); + boolean flag2 = render.blockAccess.getBlock(xPos - 1, yPos - 1, zPos).getMaterial().getCanBlockGrass(); + boolean flag5 = render.blockAccess.getBlock(xPos - 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag4 = render.blockAccess.getBlock(xPos - 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); if ((!flag5) && (!flag2)) { @@ -1460,7 +1460,7 @@ else if (render.hasOverrideBlockTexture()) flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) { if (render.renderMaxX >= 1.0D) { @@ -1476,9 +1476,9 @@ else if (render.hasOverrideBlockTexture()) render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); boolean flag3 = render.blockAccess.getBlock(xPos + 1, yPos + 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag2 = render.blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getMaterial().getCanBlockGrass(); - boolean flag5 = render.blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); - boolean flag4 = render.blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); + boolean flag2 = render.blockAccess.getBlock(xPos + 1, yPos - 1, zPos).getMaterial().getCanBlockGrass(); + boolean flag5 = render.blockAccess.getBlock(xPos + 1, yPos, zPos + 1).getMaterial().getCanBlockGrass(); + boolean flag4 = render.blockAccess.getBlock(xPos + 1, yPos, zPos - 1).getMaterial().getCanBlockGrass(); if ((!flag2) && (!flag4)) { @@ -1618,7 +1618,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0))) { tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); @@ -1626,7 +1626,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1))) { tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); @@ -1634,7 +1634,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2))) { tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -1643,7 +1643,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3))) { tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); @@ -1652,7 +1652,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4))) { tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); @@ -1661,7 +1661,7 @@ static boolean renderFakeBlockWithColorMultiplier (IIcon texture, int xPos, int flag = true; } - if ((render.renderAllFaces) || (block. shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) + if ((render.renderAllFaces) || (block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5))) { tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); diff --git a/src/main/java/tconstruct/client/block/SearedRender.java b/src/main/java/tconstruct/client/block/SearedRender.java index 9b557cea2a5..f8fdbc3dac6 100644 --- a/src/main/java/tconstruct/client/block/SearedRender.java +++ b/src/main/java/tconstruct/client/block/SearedRender.java @@ -250,21 +250,21 @@ else if (metadata == 1) } float yMin = 0F; - Block uBlock= world.getBlock(x, y - 1, z); + Block uBlock = world.getBlock(x, y - 1, z); int uMeta = world.getBlockMetadata(x, y - 1, z); - if (uBlock== TRepo.searedBlock && uMeta == 0) + if (uBlock == TRepo.searedBlock && uMeta == 0) { yMin = -0.125F; } - else if (uBlock== TRepo.searedBlock && uMeta == 2) + else if (uBlock == TRepo.searedBlock && uMeta == 2) { yMin = -0.75F; } - else if (uBlock== TRepo.lavaTank) + else if (uBlock == TRepo.lavaTank) { yMin = -1F; } - else if (uBlock== TRepo.castingChannel) + else if (uBlock == TRepo.castingChannel) { yMin = -0.5F; } diff --git a/src/main/java/tconstruct/client/block/SmelteryRender.java b/src/main/java/tconstruct/client/block/SmelteryRender.java index 98b7fb68687..67e0d875202 100644 --- a/src/main/java/tconstruct/client/block/SmelteryRender.java +++ b/src/main/java/tconstruct/client/block/SmelteryRender.java @@ -20,7 +20,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler public static int smelteryModel = RenderingRegistry.getNextAvailableRenderId(); @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + public void renderInventoryBlock (Block block, int metadata, int modelID, RenderBlocks renderer) { if (modelID == smelteryModel) { @@ -146,9 +146,9 @@ void renderLayer (SmelteryLogic logic, int start, int posX, int posY, int posZ, //TODO is this needed??? //if (blockToRender.itemID < 4096) //Block - // { - Block liquidBlock = BlockUtils.getBlockFromItemStack(blockToRender); - BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world); + // { + Block liquidBlock = BlockUtils.getBlockFromItemStack(blockToRender); + BlockSkinRenderHelper.renderMetadataBlock(liquidBlock, blockToRender.getItemDamage(), posX + i % 3, posY, posZ + i / 3, renderer, world); //} /*else //No items, only blocks diff --git a/src/main/java/tconstruct/client/entity/FancyItemRender.java b/src/main/java/tconstruct/client/entity/FancyItemRender.java index c53fde9f2f1..044974cd395 100644 --- a/src/main/java/tconstruct/client/entity/FancyItemRender.java +++ b/src/main/java/tconstruct/client/entity/FancyItemRender.java @@ -74,7 +74,7 @@ public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, d block = BlockUtils.getBlockFromItem(itemstack.getItem()); - if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, field_147909_c,1)) + if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, field_147909_c, 1)) { ; } diff --git a/src/main/java/tconstruct/client/entity/projectile/ArrowRender.java b/src/main/java/tconstruct/client/entity/projectile/ArrowRender.java index c85817eff5c..c2ab53f52f9 100644 --- a/src/main/java/tconstruct/client/entity/projectile/ArrowRender.java +++ b/src/main/java/tconstruct/client/entity/projectile/ArrowRender.java @@ -71,7 +71,7 @@ public void doRenderItem (ArrowEntity par1ArrowEntity, double par2, double par4, int i; Block block = null; - block = BlockUtils.getBlockFromItem(itemstack.getItem()); + block = BlockUtils.getBlockFromItem(itemstack.getItem()); if (itemstack.getItemSpriteNumber() == 0 && block != null && RenderBlocks.renderItemIn3d(BlockUtils.getBlockFromItem(itemstack.getItem()).getRenderType())) { @@ -141,7 +141,7 @@ public void doRenderItem (ArrowEntity par1ArrowEntity, double par2, double par4, if (this.renderWithColor) { - int l =itemstack.getItem().getColorFromItemStack(itemstack, 0); + int l = itemstack.getItem().getColorFromItemStack(itemstack, 0); f8 = (float) (l >> 16 & 255) / 255.0F; float f9 = (float) (l >> 8 & 255) / 255.0F; f5 = (float) (l & 255) / 255.0F; diff --git a/src/main/java/tconstruct/client/entity/projectile/DaggerRenderCustom.java b/src/main/java/tconstruct/client/entity/projectile/DaggerRenderCustom.java index 535b93ed077..8377b63da51 100644 --- a/src/main/java/tconstruct/client/entity/projectile/DaggerRenderCustom.java +++ b/src/main/java/tconstruct/client/entity/projectile/DaggerRenderCustom.java @@ -54,7 +54,7 @@ public void doRenderItem (DaggerEntity dagger, double par2, double par4, double GL11.glTranslatef(-7 / 16f, -8 / 16f, -1 / 32f); float scale = 1.35f; GL11.glScalef(scale, scale, scale); - ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, field_147909_c,1); + ForgeHooksClient.renderEntityItem(null, item, 0, 0, random, renderManager.renderEngine, field_147909_c, 1); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } diff --git a/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java b/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java index 179586cb251..3689a08a0fb 100644 --- a/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java +++ b/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java @@ -289,7 +289,7 @@ public List getLiquidTooltip (FluidStack liquid, boolean par2) ArrayList list = new ArrayList(); if (liquid.fluidID == -37) { - list.add("\u00A7f"+(StatCollector.translateToLocal("gui.smeltery1"))); + list.add("\u00A7f" + (StatCollector.translateToLocal("gui.smeltery1"))); list.add("mB: " + liquid.amount); } else diff --git a/src/main/java/tconstruct/client/gui/ArmorExtendedGui.java b/src/main/java/tconstruct/client/gui/ArmorExtendedGui.java index 8aff7d82c65..dd6b97cc981 100644 --- a/src/main/java/tconstruct/client/gui/ArmorExtendedGui.java +++ b/src/main/java/tconstruct/client/gui/ArmorExtendedGui.java @@ -143,7 +143,6 @@ public static void drawPlayerOnGui (Minecraft par0Minecraft, int par1, int par2, OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); } - /*protected void keyTyped(char par1, int par2) { if (par2 == TControls.armorKey.keyCode) diff --git a/src/main/java/tconstruct/client/gui/CraftingStationGui.java b/src/main/java/tconstruct/client/gui/CraftingStationGui.java index 039bf8610a1..a40b6242024 100644 --- a/src/main/java/tconstruct/client/gui/CraftingStationGui.java +++ b/src/main/java/tconstruct/client/gui/CraftingStationGui.java @@ -217,8 +217,8 @@ void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) offset++; fontRendererObj.drawString(StatCollector.translateToLocal("gui.toolstation13"), xSize + 8, base + offset * 10, 0xffffff); offset++; - fontRendererObj.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")) + ", " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, base + offset - * 10, 0xffffff); + fontRendererObj.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")) + ", " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, base + offset * 10, + 0xffffff); offset++; offset++; } diff --git a/src/main/java/tconstruct/client/gui/NewContainerGui.java b/src/main/java/tconstruct/client/gui/NewContainerGui.java index 06a2b64fe3b..647446eed26 100644 --- a/src/main/java/tconstruct/client/gui/NewContainerGui.java +++ b/src/main/java/tconstruct/client/gui/NewContainerGui.java @@ -245,7 +245,7 @@ protected void renderToolTip (ItemStack par1ItemStack, int par2, int par3) { if (k == 0) { - list.set(k, par1ItemStack.getRarity().rarityColor + (String)list.get(k)); + list.set(k, par1ItemStack.getRarity().rarityColor + (String) list.get(k)); } else { diff --git a/src/main/java/tconstruct/client/gui/PartCrafterGui.java b/src/main/java/tconstruct/client/gui/PartCrafterGui.java index 4678ed701aa..bcc7aa47b3a 100644 --- a/src/main/java/tconstruct/client/gui/PartCrafterGui.java +++ b/src/main/java/tconstruct/client/gui/PartCrafterGui.java @@ -34,7 +34,7 @@ public PartCrafterGui(InventoryPlayer inventoryplayer, PartBuilderLogic partlogi logic = partlogic; drawChestPart = container instanceof PartCrafterChestContainer; - title = "\u00A7n"+(StatCollector.translateToLocal("gui.partcrafter1")); + title = "\u00A7n" + (StatCollector.translateToLocal("gui.partcrafter1")); } protected void drawGuiContainerForegroundLayer (int par1, int par2) diff --git a/src/main/java/tconstruct/client/gui/SmelteryGui.java b/src/main/java/tconstruct/client/gui/SmelteryGui.java index b10f85d8229..596f6267679 100644 --- a/src/main/java/tconstruct/client/gui/SmelteryGui.java +++ b/src/main/java/tconstruct/client/gui/SmelteryGui.java @@ -266,7 +266,7 @@ public List getLiquidTooltip (FluidStack liquid, boolean par2) ArrayList list = new ArrayList(); if (liquid.fluidID == -37) { - list.add("\u00A7f"+StatCollector.translateToLocal("gui.smeltery1")); + list.add("\u00A7f" + StatCollector.translateToLocal("gui.smeltery1")); list.add("mB: " + liquid.amount); } else @@ -441,7 +441,7 @@ public void mouseClicked (int mouseX, int mouseY, int mouseButton) int sizeY = liquidSize; if (mouseX >= leftX && mouseX <= leftX + sizeX && mouseY >= topY && mouseY < topY + sizeY) { - //TODO Update fluid stuff + //TODO Update fluid stuff fluidToBeBroughtUp = liquid.fluidID; /*Packet250CustomPayload packet = new Packet250CustomPayload(); @@ -472,7 +472,7 @@ public void mouseClicked (int mouseX, int mouseY, int mouseButton) packet.length = bos.size(); PacketDispatcher.sendPacketToServer(packet);*/ - + TConstruct.packetPipeline.sendToServer(new PacketSmeltery(logic.getWorld().provider.dimensionId, logic.xCoord, logic.yCoord, logic.zCoord, this.isShiftKeyDown(), fluidToBeBroughtUp)); } } diff --git a/src/main/java/tconstruct/client/gui/StencilTableGui.java b/src/main/java/tconstruct/client/gui/StencilTableGui.java index a0d5d6f9479..92e7f689885 100644 --- a/src/main/java/tconstruct/client/gui/StencilTableGui.java +++ b/src/main/java/tconstruct/client/gui/StencilTableGui.java @@ -137,7 +137,7 @@ void updateServer (ItemStack stack) packet.length = bos.size(); PacketDispatcher.sendPacketToServer(packet);*/ - + TConstruct.packetPipeline.sendToServer(new PacketStencilTable(logic.xCoord, logic.yCoord, logic.zCoord, stack)); } } diff --git a/src/main/java/tconstruct/client/gui/ToolForgeGui.java b/src/main/java/tconstruct/client/gui/ToolForgeGui.java index 1390c7a8cbe..d9dc307af9d 100644 --- a/src/main/java/tconstruct/client/gui/ToolForgeGui.java +++ b/src/main/java/tconstruct/client/gui/ToolForgeGui.java @@ -85,7 +85,7 @@ void resetGui () setSlotType(0); iconX = new int[] { 0, 1, 2, 13 }; iconY = new int[] { 13, 13, 13, 13 }; - title = "\u00A7n"+StatCollector.translateToLocal("gui.toolforge1"); + title = "\u00A7n" + StatCollector.translateToLocal("gui.toolforge1"); body = StatCollector.translateToLocal("gui.toolforge2"); } diff --git a/src/main/java/tconstruct/client/gui/ToolStationGui.java b/src/main/java/tconstruct/client/gui/ToolStationGui.java index 08cc1ccfdb2..40d019a54cf 100644 --- a/src/main/java/tconstruct/client/gui/ToolStationGui.java +++ b/src/main/java/tconstruct/client/gui/ToolStationGui.java @@ -296,8 +296,8 @@ void drawModularToolStats (ItemStack stack, ToolCore tool, NBTTagCompound tags) offset++; fontRendererObj.drawString(StatCollector.translateToLocal("gui.toolstation13"), xSize + 8, base + offset * 10, 0xffffff); offset++; - fontRendererObj - .drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")) + ", " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, base + offset * 10, 0xffffff); + fontRendererObj.drawString("- " + getHarvestLevelName(tags.getInteger("HarvestLevel")) + ", " + getHarvestLevelName(tags.getInteger("HarvestLevel2")), xSize + 8, base + offset * 10, + 0xffffff); offset++; offset++; } @@ -492,7 +492,7 @@ void updateServer (String name) packet.length = bos.size(); PacketDispatcher.sendPacketToServer(packet);*/ - + TConstruct.packetPipeline.sendToServer(new PacketToolStation(logic.xCoord, logic.yCoord, logic.zCoord, name)); } diff --git a/src/main/java/tconstruct/client/pages/BlockCastPage.java b/src/main/java/tconstruct/client/pages/BlockCastPage.java index 7b16c91181f..fd810870eaa 100644 --- a/src/main/java/tconstruct/client/pages/BlockCastPage.java +++ b/src/main/java/tconstruct/client/pages/BlockCastPage.java @@ -59,7 +59,7 @@ public void renderContentLayer (int localWidth, int localHeight, boolean isTrans String ingr = new String("Ingredients"); if (isTranslatable) ingr = StatCollector.translateToLocal(ingr); - manual.fonts.drawString( ingr + ":", localWidth + 120, localHeight + 32, 0); + manual.fonts.drawString(ingr + ":", localWidth + 120, localHeight + 32, 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); diff --git a/src/main/java/tconstruct/client/pages/MaterialPage.java b/src/main/java/tconstruct/client/pages/MaterialPage.java index 9a0bd71dfc4..6d670f6e7b9 100644 --- a/src/main/java/tconstruct/client/pages/MaterialPage.java +++ b/src/main/java/tconstruct/client/pages/MaterialPage.java @@ -140,7 +140,7 @@ public void renderContentLayer (int localWidth, int localHeight, boolean isTrans manual.fonts.drawString(durability + ": " + material.durability(), localWidth, localHeight + 40, 0); manual.fonts.drawString(handleModifier + ": " + material.handleDurability() + "x", localWidth, localHeight + 50, 0); - manual.fonts.drawString(fullToolDurability+ ": " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0); + manual.fonts.drawString(fullToolDurability + ": " + (int) (material.durability() * material.handleDurability()), localWidth, localHeight + 60, 0); manual.fonts.drawString(miningSpeed + ": " + material.toolSpeed() / 100f, localWidth, localHeight + 80, 0); manual.fonts.drawString(miningLevel + ": " + material.harvestLevel() + " (" + PartCrafterGui.getHarvestLevelName(material.harvestLevel()) + ")", localWidth, localHeight + 90, 0); diff --git a/src/main/java/tconstruct/common/TProxyCommon.java b/src/main/java/tconstruct/common/TProxyCommon.java index 81509f9c610..c9121532a4f 100644 --- a/src/main/java/tconstruct/common/TProxyCommon.java +++ b/src/main/java/tconstruct/common/TProxyCommon.java @@ -34,7 +34,7 @@ public class TProxyCommon implements IGuiHandler public static int armorGuiID = 101; public static int knapsackGuiID = 102; - // public static int manualGuiID = -1;// moved to Mantle + // public static int manualGuiID = -1;// moved to Mantle @Override public Object getServerGuiElement (int ID, EntityPlayer player, World world, int x, int y, int z) diff --git a/src/main/java/tconstruct/common/TRepo.java b/src/main/java/tconstruct/common/TRepo.java index 6507563f4c3..bd27c59a131 100644 --- a/src/main/java/tconstruct/common/TRepo.java +++ b/src/main/java/tconstruct/common/TRepo.java @@ -270,12 +270,11 @@ public class TRepo public static Fluid[] fluids = new Fluid[27]; public static Block[] fluidBlocks = new Block[26]; - + //recipe stuff public static boolean thaumcraftAvailable; public static boolean initRecipes; public static Item[] patternOutputs; public static FluidStack[] liquids; - } diff --git a/src/main/java/tconstruct/entity/CartEntity.java b/src/main/java/tconstruct/entity/CartEntity.java index 06cf2bc7aa8..3124ec70760 100644 --- a/src/main/java/tconstruct/entity/CartEntity.java +++ b/src/main/java/tconstruct/entity/CartEntity.java @@ -709,7 +709,7 @@ protected void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) if (getSizeInventory() > 0) { - NBTTagList var2 = par1NBTTagCompound.getTagList("Items",9); + NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 9); this.cargoItems = new ItemStack[this.getSizeInventory()]; for (int var3 = 0; var3 < var2.tagCount(); ++var3) diff --git a/src/main/java/tconstruct/entity/FakeBlockEntity.java b/src/main/java/tconstruct/entity/FakeBlockEntity.java index ab9baebffce..e0024052fb8 100644 --- a/src/main/java/tconstruct/entity/FakeBlockEntity.java +++ b/src/main/java/tconstruct/entity/FakeBlockEntity.java @@ -40,13 +40,13 @@ protected void writeEntityToNBT (NBTTagCompound var1) @Override public void writeSpawnData (ByteBuf buffer) { - + } @Override public void readSpawnData (ByteBuf additionalData) { - + } } diff --git a/src/main/java/tconstruct/inventory/ContainerLandmine.java b/src/main/java/tconstruct/inventory/ContainerLandmine.java index 1d35b7e1e37..a194e786a56 100644 --- a/src/main/java/tconstruct/inventory/ContainerLandmine.java +++ b/src/main/java/tconstruct/inventory/ContainerLandmine.java @@ -217,13 +217,13 @@ else if (this.field_94536_g != 0) { if (par2 == 0) { - par4EntityPlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(),false); + par4EntityPlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack(), false); inventoryplayer.setItemStack((ItemStack) null); } if (par2 == 1) { - par4EntityPlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1),false); + par4EntityPlayer.dropPlayerItemWithRandomChoice(inventoryplayer.getItemStack().splitStack(1), false); if (inventoryplayer.getItemStack().stackSize == 0) { @@ -238,7 +238,7 @@ else if (par3 == 1) { return null; } - + Object localObject2; slot2 = (Slot) this.inventorySlots.get(par1); @@ -249,7 +249,7 @@ else if (par3 == 1) if (itemstack1 != null) { - localObject2 = ((ItemStack)itemstack1).getItem(); + localObject2 = ((ItemStack) itemstack1).getItem(); itemstack = itemstack1.copy(); if (slot2 != null && slot2.getStack() != null && slot2.getStack().getItem() == localObject2) @@ -372,8 +372,8 @@ else if (itemstack4.stackSize <= slot2.getSlotStackLimit()) inventoryplayer.setItemStack(itemstack1); } } - else if (itemstack1 == itemstack4 && itemstack4.getMaxStackSize() > 1 - && (!itemstack1.getHasSubtypes() || itemstack1.getItemDamage() == itemstack4.getItemDamage()) && ItemStack.areItemStackTagsEqual(itemstack1, itemstack4)) + else if (itemstack1 == itemstack4 && itemstack4.getMaxStackSize() > 1 && (!itemstack1.getHasSubtypes() || itemstack1.getItemDamage() == itemstack4.getItemDamage()) + && ItemStack.areItemStackTagsEqual(itemstack1, itemstack4)) { k1 = itemstack1.stackSize; @@ -460,7 +460,7 @@ else if (par3 == 4 && inventoryplayer.getItemStack() == null && par1 >= 0) { itemstack1 = slot2.decrStackSize(par2 == 0 ? 1 : slot2.getStack().stackSize); slot2.onPickupFromSlot(par4EntityPlayer, itemstack1); - par4EntityPlayer.dropPlayerItemWithRandomChoice(itemstack1,false); + par4EntityPlayer.dropPlayerItemWithRandomChoice(itemstack1, false); } } else if (par3 == 6 && par1 >= 0) diff --git a/src/main/java/tconstruct/inventory/CraftingStationContainer.java b/src/main/java/tconstruct/inventory/CraftingStationContainer.java index b55607580bc..4317e487a21 100644 --- a/src/main/java/tconstruct/inventory/CraftingStationContainer.java +++ b/src/main/java/tconstruct/inventory/CraftingStationContainer.java @@ -143,7 +143,7 @@ public void onContainerClosed (EntityPlayer par1EntityPlayer) if (itemstack != null) { - par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack,false); + par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); } } } diff --git a/src/main/java/tconstruct/inventory/FrypanContainer.java b/src/main/java/tconstruct/inventory/FrypanContainer.java index 9d39308dabd..5880b7ed43a 100644 --- a/src/main/java/tconstruct/inventory/FrypanContainer.java +++ b/src/main/java/tconstruct/inventory/FrypanContainer.java @@ -14,7 +14,7 @@ public class FrypanContainer extends Container public FrypanContainer(EntityPlayer player, FrypanLogic frypan) { - InventoryPlayer inventoryplayer = player.inventory; + InventoryPlayer inventoryplayer = player.inventory; logic = frypan; this.addSlotToContainer(new Slot(frypan, 1, 26, 45)); for (int y = 0; y < 2; y++) diff --git a/src/main/java/tconstruct/inventory/SlotFrypan.java b/src/main/java/tconstruct/inventory/SlotFrypan.java index d12113d952a..15dafc28c6a 100644 --- a/src/main/java/tconstruct/inventory/SlotFrypan.java +++ b/src/main/java/tconstruct/inventory/SlotFrypan.java @@ -6,25 +6,30 @@ import net.minecraft.nbt.NBTTagCompound; import tconstruct.achievements.TAchievements; -public class SlotFrypan extends Slot{ +public class SlotFrypan extends Slot +{ - public EntityPlayer player; - - public SlotFrypan(IInventory par1IInventory, int par2, int par3, int par4, EntityPlayer player) { - super(par1IInventory, par2, par3, par4); - this.player = player; - } - - @Override - public void putStack(ItemStack par1ItemStack){ + public EntityPlayer player; + + public SlotFrypan(IInventory par1IInventory, int par2, int par3, int par4, EntityPlayer player) + { + super(par1IInventory, par2, par3, par4); + this.player = player; + } + + @Override + public void putStack (ItemStack par1ItemStack) + { super.putStack(par1ItemStack); - if(par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem() instanceof ItemFood && par1ItemStack.hasTagCompound()){ - NBTTagCompound stackTagCompound = par1ItemStack.getTagCompound(); - if(stackTagCompound == null || !stackTagCompound.getBoolean("frypanKill")){ - return; - } - player.addStat(TAchievements.achievements.get("tconstruct.dualConvenience"), 1); + if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem() instanceof ItemFood && par1ItemStack.hasTagCompound()) + { + NBTTagCompound stackTagCompound = par1ItemStack.getTagCompound(); + if (stackTagCompound == null || !stackTagCompound.getBoolean("frypanKill")) + { + return; + } + player.addStat(TAchievements.achievements.get("tconstruct.dualConvenience"), 1); } - } + } } diff --git a/src/main/java/tconstruct/items/ArmorPattern.java b/src/main/java/tconstruct/items/ArmorPattern.java index 650b8dfba3b..7e1d48edb98 100644 --- a/src/main/java/tconstruct/items/ArmorPattern.java +++ b/src/main/java/tconstruct/items/ArmorPattern.java @@ -19,7 +19,7 @@ public class ArmorPattern extends CraftingItem implements ItemBlocklike public ArmorPattern(int id, String patternType, String folder) { - super( patternName, getPatternNames(patternType), folder, "tinker", TConstructRegistry.materialTab); + super(patternName, getPatternNames(patternType), folder, "tinker", TConstructRegistry.materialTab); this.setHasSubtypes(true); this.setMaxDamage(0); this.setContainerItem(this); diff --git a/src/main/java/tconstruct/items/FilledBucket.java b/src/main/java/tconstruct/items/FilledBucket.java index a405eeedf8c..05ada1d2835 100644 --- a/src/main/java/tconstruct/items/FilledBucket.java +++ b/src/main/java/tconstruct/items/FilledBucket.java @@ -140,13 +140,16 @@ public boolean tryPlaceContainedLiquid (World world, int clickX, int clickY, int } else { - try { + try + { int metadata = 0; if (TRepo.fluidBlocks[type] instanceof BlockFluidFinite) metadata = 7; world.setBlock(clickX, clickY, clickZ, TRepo.fluidBlocks[type], metadata, 3); //TODO: Merge liquids - } catch (ArrayIndexOutOfBoundsException ex) { + } + catch (ArrayIndexOutOfBoundsException ex) + { TConstruct.logger.warn("AIOBE occured when placing bucket into world; " + ex); return false; } diff --git a/src/main/java/tconstruct/items/GoldenHead.java b/src/main/java/tconstruct/items/GoldenHead.java index 9dda116b549..483b6a1e482 100644 --- a/src/main/java/tconstruct/items/GoldenHead.java +++ b/src/main/java/tconstruct/items/GoldenHead.java @@ -76,7 +76,7 @@ public void registerIcons (IIconRegister iconRegister) @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { - list.add("\u00a75\u00a7o"+StatCollector.translateToLocal("goldenhead1.tooltip")); - list.add("\u00a75\u00a7o"+StatCollector.translateToLocal("goldenhead2.tooltip")); + list.add("\u00a75\u00a7o" + StatCollector.translateToLocal("goldenhead1.tooltip")); + list.add("\u00a75\u00a7o" + StatCollector.translateToLocal("goldenhead2.tooltip")); } } diff --git a/src/main/java/tconstruct/items/MetalPattern.java b/src/main/java/tconstruct/items/MetalPattern.java index a2d01db0e4b..cea8b27cfe3 100644 --- a/src/main/java/tconstruct/items/MetalPattern.java +++ b/src/main/java/tconstruct/items/MetalPattern.java @@ -29,10 +29,10 @@ protected static String[] getPatternNames (String partType) private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign", "knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "", "", "arrowhead", "gem" }; - public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + public void getSubItems (Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) { for (int i = 0; i < patternName.length; i++) if (!(patternName[i].equals(""))) - p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, i)); } } diff --git a/src/main/java/tconstruct/items/Pattern.java b/src/main/java/tconstruct/items/Pattern.java index bb55cbff52b..c155d19800a 100644 --- a/src/main/java/tconstruct/items/Pattern.java +++ b/src/main/java/tconstruct/items/Pattern.java @@ -147,6 +147,6 @@ public int getPatternCost (ItemStack pattern) @Override public ItemStack getPatternOutput (ItemStack stack, ItemStack input, MaterialSet set) { - return TConstructRegistry.getPartMapping((Item)this, stack.getItemDamage(), set.materialID); + return TConstructRegistry.getPartMapping((Item) this, stack.getItemDamage(), set.materialID); } } diff --git a/src/main/java/tconstruct/items/StrangeFood.java b/src/main/java/tconstruct/items/StrangeFood.java index 813f8436d99..55078a4e7b1 100644 --- a/src/main/java/tconstruct/items/StrangeFood.java +++ b/src/main/java/tconstruct/items/StrangeFood.java @@ -17,12 +17,12 @@ public StrangeFood() { super(new int[] { 2, 2 }, new float[] { 1f, 1f }, new String[] { "edibleslime", "edibleblood" }, new String[] { "food/edibleslime", "food/edibleblood" }); } - + @Override protected void onFoodEaten (ItemStack stack, World world, EntityPlayer player) { if (stack.getItemDamage() == 1) - player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20*15, 0)); + player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id, 20 * 15, 0)); } @Override diff --git a/src/main/java/tconstruct/items/armor/HeartCanister.java b/src/main/java/tconstruct/items/armor/HeartCanister.java index 2477cd91e29..4a4dc73aecb 100644 --- a/src/main/java/tconstruct/items/armor/HeartCanister.java +++ b/src/main/java/tconstruct/items/armor/HeartCanister.java @@ -19,7 +19,7 @@ public class HeartCanister extends CraftingItem public HeartCanister() { - super(new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, "", "tinker", TConstructRegistry.materialTab ); + super(new String[] { "empty", "miniheart.red", "heart" }, new String[] { "canister_empty", "miniheart_red", "canister_heart" }, "", "tinker", TConstructRegistry.materialTab); this.setMaxStackSize(10); } diff --git a/src/main/java/tconstruct/items/blocks/BarricadeItem.java b/src/main/java/tconstruct/items/blocks/BarricadeItem.java index 78bca643d29..609466850d6 100644 --- a/src/main/java/tconstruct/items/blocks/BarricadeItem.java +++ b/src/main/java/tconstruct/items/blocks/BarricadeItem.java @@ -38,8 +38,7 @@ public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int { side = 1; } - else if (b != Blocks.vine && b != Blocks.tallgrass && b != Blocks.deadbush - && (b == null || !b.canPlaceBlockAt(world, x, y, z))) + else if (b != Blocks.vine && b != Blocks.tallgrass && b != Blocks.deadbush && (b == null || !b.canPlaceBlockAt(world, x, y, z))) { if (side == 0) { @@ -94,8 +93,8 @@ else if (world.canPlaceEntityOnSide(this.b, x, y, z, false, side, player, stack) if (placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata)) { - world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName, - (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName, (block.stepSound.getVolume() + 1.0F) / 2.0F, + block.stepSound.getPitch() * 0.8F); --stack.stackSize; } diff --git a/src/main/java/tconstruct/items/blocks/HamboneItemBlock.java b/src/main/java/tconstruct/items/blocks/HamboneItemBlock.java index b27607f6cdb..2999c214db7 100644 --- a/src/main/java/tconstruct/items/blocks/HamboneItemBlock.java +++ b/src/main/java/tconstruct/items/blocks/HamboneItemBlock.java @@ -40,7 +40,7 @@ public HamboneItemBlock(Block b) @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) { - list.add("\u00A74"+StatCollector.translateToLocal("hambone1.tooltip")); + list.add("\u00A74" + StatCollector.translateToLocal("hambone1.tooltip")); list.add(StatCollector.translateToLocal("hambone2.tooltip")); } diff --git a/src/main/java/tconstruct/items/blocks/ItemBlockLandmine.java b/src/main/java/tconstruct/items/blocks/ItemBlockLandmine.java index 1b1238a7bad..30ba78d836a 100644 --- a/src/main/java/tconstruct/items/blocks/ItemBlockLandmine.java +++ b/src/main/java/tconstruct/items/blocks/ItemBlockLandmine.java @@ -47,7 +47,7 @@ public void addInformation (ItemStack par1ItemStack, EntityPlayer par2EntityPlay break; } - par3List.add(StatCollector.translateToLocal("landmine5.tooltip") + interaction); + par3List.add(StatCollector.translateToLocal("landmine5.tooltip") + interaction); } @Override diff --git a/src/main/java/tconstruct/items/blocks/SlimeSaplingItemBlock.java b/src/main/java/tconstruct/items/blocks/SlimeSaplingItemBlock.java index f6405eda92e..6923772b4f0 100644 --- a/src/main/java/tconstruct/items/blocks/SlimeSaplingItemBlock.java +++ b/src/main/java/tconstruct/items/blocks/SlimeSaplingItemBlock.java @@ -3,7 +3,6 @@ import net.minecraft.block.Block; import mantle.blocks.abstracts.MultiItemBlock; - public class SlimeSaplingItemBlock extends MultiItemBlock { public static final String blockTypes[] = { "bluegreen" }; diff --git a/src/main/java/tconstruct/items/blocks/SlimeTallGrassItem.java b/src/main/java/tconstruct/items/blocks/SlimeTallGrassItem.java index 45bf4074dd0..1c0324460c2 100644 --- a/src/main/java/tconstruct/items/blocks/SlimeTallGrassItem.java +++ b/src/main/java/tconstruct/items/blocks/SlimeTallGrassItem.java @@ -14,12 +14,11 @@ public class SlimeTallGrassItem extends MultiItemBlock public SlimeTallGrassItem(Block b) { - super(b,"block.slime", blockTypes ); + super(b, "block.slime", blockTypes); setMaxDamage(0); setHasSubtypes(true); } - @SideOnly(Side.CLIENT) public IIcon getIconFromDamage (int meta) { diff --git a/src/main/java/tconstruct/items/blocks/SmelteryItemBlock.java b/src/main/java/tconstruct/items/blocks/SmelteryItemBlock.java index 28f7af6202c..11eb3994c63 100644 --- a/src/main/java/tconstruct/items/blocks/SmelteryItemBlock.java +++ b/src/main/java/tconstruct/items/blocks/SmelteryItemBlock.java @@ -21,8 +21,6 @@ public SmelteryItemBlock(Block b) setHasSubtypes(true); } - - @Override @SideOnly(Side.CLIENT) public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) diff --git a/src/main/java/tconstruct/items/blocks/SoilSlabItem.java b/src/main/java/tconstruct/items/blocks/SoilSlabItem.java index a81f3536066..28a7001dffe 100644 --- a/src/main/java/tconstruct/items/blocks/SoilSlabItem.java +++ b/src/main/java/tconstruct/items/blocks/SoilSlabItem.java @@ -16,7 +16,7 @@ public class SoilSlabItem extends MultiItemBlock public SoilSlabItem(Block b) { - super(b, "block.soil.slab", blockTypes ); + super(b, "block.soil.slab", blockTypes); setMaxDamage(0); setHasSubtypes(true); } @@ -27,7 +27,7 @@ public void addInformation (ItemStack stack, EntityPlayer player, List list, boo { switch (stack.getItemDamage()) { - case 3: + case 3: list.add(StatCollector.translateToLocal("craftedsoil.slab1.tooltip")); break; case 4: diff --git a/src/main/java/tconstruct/items/blocks/SpeedSlabItem.java b/src/main/java/tconstruct/items/blocks/SpeedSlabItem.java index d5a6c28cd05..708a5b0837f 100644 --- a/src/main/java/tconstruct/items/blocks/SpeedSlabItem.java +++ b/src/main/java/tconstruct/items/blocks/SpeedSlabItem.java @@ -10,8 +10,8 @@ public class SpeedSlabItem extends MultiItemBlock { - public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", - "brownstone.smooth.fancy", "brownstone.smooth.chiseled" }; + public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy", + "brownstone.smooth.chiseled" }; public SpeedSlabItem(Block b) { diff --git a/src/main/java/tconstruct/items/blocks/StainedGlassClearPaneItem.java b/src/main/java/tconstruct/items/blocks/StainedGlassClearPaneItem.java index 0bb89fb8a30..c5457becb36 100644 --- a/src/main/java/tconstruct/items/blocks/StainedGlassClearPaneItem.java +++ b/src/main/java/tconstruct/items/blocks/StainedGlassClearPaneItem.java @@ -5,8 +5,7 @@ public class StainedGlassClearPaneItem extends MultiItemBlock { - public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", - "purple", "blue", "brown", "green", "red", "black" }; + public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" }; public StainedGlassClearPaneItem(Block b) { diff --git a/src/main/java/tconstruct/items/tools/Battleaxe.java b/src/main/java/tconstruct/items/tools/Battleaxe.java index 28a3c885d31..c6a7aeb9986 100644 --- a/src/main/java/tconstruct/items/tools/Battleaxe.java +++ b/src/main/java/tconstruct/items/tools/Battleaxe.java @@ -247,7 +247,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl return false; World world = player.worldObj; - final Block wood = world.getBlock(x,y,z); + final Block wood = world.getBlock(x, y, z); NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); final int meta = world.getBlockMetadata(x, y, z); for (int yPos = y + 1; yPos < y + 9; yPos++) diff --git a/src/main/java/tconstruct/items/tools/Hammer.java b/src/main/java/tconstruct/items/tools/Hammer.java index 82da22e6f0b..9571386a890 100644 --- a/src/main/java/tconstruct/items/tools/Hammer.java +++ b/src/main/java/tconstruct/items/tools/Hammer.java @@ -68,7 +68,7 @@ protected Material[] getEffectiveMaterials () return materials; } - static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material. anvil }; + static Material[] materials = new Material[] { Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil }; @Override public Item getHeadItem () diff --git a/src/main/java/tconstruct/items/tools/Hatchet.java b/src/main/java/tconstruct/items/tools/Hatchet.java index 3b83b53ffd0..a1e21f8f20c 100644 --- a/src/main/java/tconstruct/items/tools/Hatchet.java +++ b/src/main/java/tconstruct/items/tools/Hatchet.java @@ -42,7 +42,7 @@ public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random); } - static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus};//TODO find this//, Material.pumpkin }; + static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus };//TODO find this//, Material.pumpkin }; @Override public Item getHeadItem () diff --git a/src/main/java/tconstruct/items/tools/LumberAxe.java b/src/main/java/tconstruct/items/tools/LumberAxe.java index 220f84899a8..a52578136e3 100644 --- a/src/main/java/tconstruct/items/tools/LumberAxe.java +++ b/src/main/java/tconstruct/items/tools/LumberAxe.java @@ -63,7 +63,7 @@ public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random); } - static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus};//TODO find this//, Material.pumpkin }; + static Material[] materials = { Material.wood, Material.vine, Material.circuits, Material.cactus };//TODO find this//, Material.pumpkin }; /* Lumber axe specific */ @@ -139,7 +139,8 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl return false; World world = player.worldObj; - final Block wood = world.getBlock(x, y, z);; + final Block wood = world.getBlock(x, y, z); + ; if (wood == null) { return super.onBlockStartBreak(stack, x, y, z, player); diff --git a/src/main/java/tconstruct/items/tools/Mattock.java b/src/main/java/tconstruct/items/tools/Mattock.java index 80cf800e32e..1aeeca9dd4c 100644 --- a/src/main/java/tconstruct/items/tools/Mattock.java +++ b/src/main/java/tconstruct/items/tools/Mattock.java @@ -47,7 +47,7 @@ protected String getSecondHarvestType () return "shovel"; } - static Material[] axeMaterials = { Material.wood, Material.cactus};//TODO find this//, Material.pumpkin, Material.plants, Material.vine }; + static Material[] axeMaterials = { Material.wood, Material.cactus };//TODO find this//, Material.pumpkin, Material.plants, Material.vine }; static Material[] shovelMaterials = { Material.grass, Material.ground, Material.clay }; @Override diff --git a/src/main/java/tconstruct/items/tools/Scythe.java b/src/main/java/tconstruct/items/tools/Scythe.java index f54ab0b0409..2c2e123c35a 100644 --- a/src/main/java/tconstruct/items/tools/Scythe.java +++ b/src/main/java/tconstruct/items/tools/Scythe.java @@ -40,7 +40,7 @@ protected Material[] getEffectiveMaterials () return materials; } - static Material[] materials = new Material[] { Material.web, Material.cactus};//TODO find this//, Material.pumpkin, Material.plants, Material.vine, Material.leaves }; + static Material[] materials = new Material[] { Material.web, Material.cactus };//TODO find this//, Material.pumpkin, Material.plants, Material.vine, Material.leaves }; @Override public Item getHeadItem () diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index 8b43fd5a68c..7125f75cb7e 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -512,13 +512,13 @@ public static void registerActiveToolMod (ActiveToolMod mod) * 5: Has rotational TileEntity data * 6: Custom placement logic */ - + //moved to TMech //public static HashMap drawbridgeState = new HashMap(); /* Blocks that are interchangable with each other. Ex: Still and flowing water */ - // static HashMap interchangableBlockMapping = new HashMap (); + // static HashMap interchangableBlockMapping = new HashMap (); /*Blocks that place items, and vice versa */ - // public static HashBiMap blockToItemMapping; + // public static HashBiMap blockToItemMapping; static void initializeDrawbridgeState () { diff --git a/src/main/java/tconstruct/library/armor/ArmorCore.java b/src/main/java/tconstruct/library/armor/ArmorCore.java index eeb59fd0604..be8b421254e 100644 --- a/src/main/java/tconstruct/library/armor/ArmorCore.java +++ b/src/main/java/tconstruct/library/armor/ArmorCore.java @@ -111,7 +111,8 @@ public void damageArmor (EntityLivingBase entity, ItemStack stack, DamageSource stack.setTagCompound(tags); data = new NBTTagCompound(); tags.setTag(SET_NAME, data); - data.setDouble("damageReduction", baseProtection); } + data.setDouble("damageReduction", baseProtection); + } data = tags.getCompoundTag(SET_NAME); diff --git a/src/main/java/tconstruct/library/armor/ArmorMod.java b/src/main/java/tconstruct/library/armor/ArmorMod.java index bdb7aa85ac1..d0e74063e1c 100644 --- a/src/main/java/tconstruct/library/armor/ArmorMod.java +++ b/src/main/java/tconstruct/library/armor/ArmorMod.java @@ -39,8 +39,8 @@ public boolean validArmorType (ArmorCore armor) { return true; } - - protected NBTTagCompound getAttributeTag(String attributeType, String modifierName, double amount, boolean flat, UUID uuid) + + protected NBTTagCompound getAttributeTag (String attributeType, String modifierName, double amount, boolean flat, UUID uuid) { NBTTagCompound tag = new NBTTagCompound(); tag.setString("AttributeName", attributeType); diff --git a/src/main/java/tconstruct/library/client/TConstructClientRegistry.java b/src/main/java/tconstruct/library/client/TConstructClientRegistry.java index 6441e767a47..09f61939c2d 100644 --- a/src/main/java/tconstruct/library/client/TConstructClientRegistry.java +++ b/src/main/java/tconstruct/library/client/TConstructClientRegistry.java @@ -103,7 +103,6 @@ public static void registerManualSmeltery (String name, ItemStack output, ItemSt recipeIcons.put(name, recipe); } - //Gui public static void addToolButton (ToolGuiElement element) { diff --git a/src/main/java/tconstruct/library/component/MultiFluidTank.java b/src/main/java/tconstruct/library/component/MultiFluidTank.java index a2e9d7c4ffb..8a56439de74 100644 --- a/src/main/java/tconstruct/library/component/MultiFluidTank.java +++ b/src/main/java/tconstruct/library/component/MultiFluidTank.java @@ -180,7 +180,7 @@ public FluidTankInfo[] getMultiTankInfo () @Override public void readNetworkNBT (NBTTagCompound tags) { - NBTTagList liquidTag = tags.getTagList("Liquids",9); + NBTTagList liquidTag = tags.getTagList("Liquids", 9); fluidlist.clear(); for (int iter = 0; iter < liquidTag.tagCount(); iter++) diff --git a/src/main/java/tconstruct/library/component/TankLayerScan.java b/src/main/java/tconstruct/library/component/TankLayerScan.java index da32e9df8af..c54728aaae4 100644 --- a/src/main/java/tconstruct/library/component/TankLayerScan.java +++ b/src/main/java/tconstruct/library/component/TankLayerScan.java @@ -13,7 +13,6 @@ import mantle.blocks.iface.IMasterLogic; import mantle.blocks.iface.IServantLogic; - public class TankLayerScan extends LogicComponent { protected TileEntity master; @@ -497,7 +496,7 @@ public void cleanup () public void readFromNBT (NBTTagCompound tags) { super.readFromNBT(tags); - NBTTagList layerAir = tags.getTagList("AirLayer",11); + NBTTagList layerAir = tags.getTagList("AirLayer", 11); if (layerAir != null) { layerAirCoords.clear(); @@ -516,7 +515,7 @@ public void readFromNBT (NBTTagCompound tags) for (int i = 0; i < blocks.tagCount(); ++i) { - int[] coord = blocks.func_150306_c(i); + int[] coord = blocks.func_150306_c(i); blockCoords.add(new CoordTuple(coord[0], coord[1], coord[2])); } } @@ -561,7 +560,7 @@ public void writeToNBT (NBTTagCompound tags) NBTTagList air = new NBTTagList(); for (CoordTuple coord : airCoords) { - air.appendTag(new NBTTagIntArray( new int[] { coord.x, coord.y, coord.z })); + air.appendTag(new NBTTagIntArray(new int[] { coord.x, coord.y, coord.z })); } tags.setTag("Air", air); tags.setInteger("structureTop", structureTop); diff --git a/src/main/java/tconstruct/library/crafting/Smeltery.java b/src/main/java/tconstruct/library/crafting/Smeltery.java index 5756a9acce6..9a10bad9238 100644 --- a/src/main/java/tconstruct/library/crafting/Smeltery.java +++ b/src/main/java/tconstruct/library/crafting/Smeltery.java @@ -42,6 +42,7 @@ public static void addMelting (Item item, int metadata, int temperature, FluidSt { addMelting(new ItemStack(item, 1, metadata), item, metadata, temperature, output); } + /** Adds mappings between a block and its liquid * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new FluidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); * diff --git a/src/main/java/tconstruct/library/event/SmelteryEvent.java b/src/main/java/tconstruct/library/event/SmelteryEvent.java index b5a2bd7ba19..44ac8201347 100644 --- a/src/main/java/tconstruct/library/event/SmelteryEvent.java +++ b/src/main/java/tconstruct/library/event/SmelteryEvent.java @@ -5,38 +5,44 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -public class SmelteryEvent extends Event { - - public InventoryLogic component; - public int x, y, z; - - public SmelteryEvent(InventoryLogic component, int x, int y, int z){ - this.component = component; - this.x = x; - this.y = y; - this.z = z; - } - - public static class ItemInsertedIntoCasting extends SmelteryEvent { - public ItemStack item; - public EntityPlayer player; - - public ItemInsertedIntoCasting(InventoryLogic component, int x, int y, int z, ItemStack item, EntityPlayer player) { - super(component, x, y, z); - this.item = item; - this.player = player; - } - } - - public static class ItemRemovedFromCasting extends SmelteryEvent { - public ItemStack item; - public EntityPlayer player; - - public ItemRemovedFromCasting(InventoryLogic component, int x, int y, int z, ItemStack item, EntityPlayer player) { - super(component, x, y, z); - this.item = item; - this.player = player; - } - } - +public class SmelteryEvent extends Event +{ + + public InventoryLogic component; + public int x, y, z; + + public SmelteryEvent(InventoryLogic component, int x, int y, int z) + { + this.component = component; + this.x = x; + this.y = y; + this.z = z; + } + + public static class ItemInsertedIntoCasting extends SmelteryEvent + { + public ItemStack item; + public EntityPlayer player; + + public ItemInsertedIntoCasting(InventoryLogic component, int x, int y, int z, ItemStack item, EntityPlayer player) + { + super(component, x, y, z); + this.item = item; + this.player = player; + } + } + + public static class ItemRemovedFromCasting extends SmelteryEvent + { + public ItemStack item; + public EntityPlayer player; + + public ItemRemovedFromCasting(InventoryLogic component, int x, int y, int z, ItemStack item, EntityPlayer player) + { + super(component, x, y, z); + this.item = item; + this.player = player; + } + } + } diff --git a/src/main/java/tconstruct/library/event/ToolCraftedEvent.java b/src/main/java/tconstruct/library/event/ToolCraftedEvent.java index a98e97cdac6..07053c36de9 100644 --- a/src/main/java/tconstruct/library/event/ToolCraftedEvent.java +++ b/src/main/java/tconstruct/library/event/ToolCraftedEvent.java @@ -5,16 +5,18 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -public class ToolCraftedEvent extends Event { +public class ToolCraftedEvent extends Event +{ + + public IInventory inventory; + public EntityPlayer player; + public ItemStack tool; + + public ToolCraftedEvent(IInventory inventory, EntityPlayer player, ItemStack tool) + { + this.inventory = inventory; + this.player = player; + this.tool = tool; + } - public IInventory inventory; - public EntityPlayer player; - public ItemStack tool; - - public ToolCraftedEvent(IInventory inventory, EntityPlayer player, ItemStack tool){ - this.inventory = inventory; - this.player = player; - this.tool = tool; - } - } diff --git a/src/main/java/tconstruct/library/tools/AbilityHelper.java b/src/main/java/tconstruct/library/tools/AbilityHelper.java index 347323ec422..506a222b60a 100644 --- a/src/main/java/tconstruct/library/tools/AbilityHelper.java +++ b/src/main/java/tconstruct/library/tools/AbilityHelper.java @@ -491,7 +491,7 @@ public static boolean hoeGround (ItemStack stack, EntityPlayer player, World wor if (event.getResult() == Result.ALLOW) { - + onBlockChanged(stack, world, Blocks.air, x, y, z, player, random); return true; } @@ -506,8 +506,8 @@ public static boolean hoeGround (ItemStack stack, EntityPlayer player, World wor else { Block block = Blocks.farmland; - world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName, - (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.soundName, (block.stepSound.getVolume() + 1.0F) / 2.0F, + block.stepSound.getPitch() * 0.8F); if (world.isRemote) { @@ -633,6 +633,6 @@ public static MovingObjectPosition raytraceFromEntity (World world, Entity playe d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); } Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); - return world.func_147447_a(vec3, vec31, par3, !par3,par3); + return world.func_147447_a(vec3, vec31, par3, !par3, par3); } } diff --git a/src/main/java/tconstruct/modifiers/armor/AModHealthBoost.java b/src/main/java/tconstruct/modifiers/armor/AModHealthBoost.java index 83112db2ed6..dbcbfba728c 100644 --- a/src/main/java/tconstruct/modifiers/armor/AModHealthBoost.java +++ b/src/main/java/tconstruct/modifiers/armor/AModHealthBoost.java @@ -25,7 +25,7 @@ public AModHealthBoost(int effect, EnumSet armorTypes, ItemStack[ protected boolean canModify (ItemStack tool, ItemStack[] input) { NBTTagCompound tags = tool.getTagCompound().getCompoundTag(getTagName()); - int amount = matchingItems(input)*modifyAmount; + int amount = matchingItems(input) * modifyAmount; return tags.getInteger("Modifiers") >= amount; } @@ -36,7 +36,7 @@ public void modify (ItemStack[] input, ItemStack armor) NBTTagCompound armorTag = armor.getTagCompound().getCompoundTag(getTagName()); int modifiers = armorTag.getInteger("Modifiers"); - modifiers -= matchingAmount(input)*modifyAmount; + modifiers -= matchingAmount(input) * modifyAmount; armorTag.setInteger("Modifiers", modifiers); int amount = matchingAmount(input); @@ -49,7 +49,7 @@ public void modify (ItemStack[] input, ItemStack armor) NBTTagList attributes; if (baseTag.hasKey("AttributeModifiers")) { - attributes = baseTag.getTagList("AttributeModifiers",9); + attributes = baseTag.getTagList("AttributeModifiers", 9); for (int iter = 0; iter < attributes.tagCount(); iter++) { NBTTagCompound tag = (NBTTagCompound) attributes.getCompoundTagAt(iter); diff --git a/src/main/java/tconstruct/modifiers/armor/AModKnockbackResistance.java b/src/main/java/tconstruct/modifiers/armor/AModKnockbackResistance.java index 37c40abc75d..3b8a0bc7e09 100644 --- a/src/main/java/tconstruct/modifiers/armor/AModKnockbackResistance.java +++ b/src/main/java/tconstruct/modifiers/armor/AModKnockbackResistance.java @@ -62,7 +62,7 @@ public void modify (ItemStack[] input, ItemStack armor) attributes = new NBTTagList(); baseTag.setTag("AttributeModifiers", attributes); } - attributes.appendTag(getAttributeTag("generic.knockbackResistance", key, amount*0.01, modifierType, getUUIDFromItem(armor))); + attributes.appendTag(getAttributeTag("generic.knockbackResistance", key, amount * 0.01, modifierType, getUUIDFromItem(armor))); } private static final UUID head = UUID.fromString("4188779d-69d4-487c-b307-c4c182522c44"); diff --git a/src/main/java/tconstruct/modifiers/armor/AModMoveSpeed.java b/src/main/java/tconstruct/modifiers/armor/AModMoveSpeed.java index 5e398543150..c4eb78e8ce0 100644 --- a/src/main/java/tconstruct/modifiers/armor/AModMoveSpeed.java +++ b/src/main/java/tconstruct/modifiers/armor/AModMoveSpeed.java @@ -37,7 +37,7 @@ public void modify (ItemStack[] input, ItemStack armor) int modifiers = armorTag.getInteger("Modifiers"); modifiers -= amount; armorTag.setInteger("Modifiers", modifiers); - + if (armorTag.hasKey(key)) { amount += armorTag.getInteger(key); @@ -47,7 +47,7 @@ public void modify (ItemStack[] input, ItemStack armor) NBTTagList attributes; if (baseTag.hasKey("AttributeModifiers")) { - attributes = baseTag.getTagList("AttributeModifiers",9); + attributes = baseTag.getTagList("AttributeModifiers", 9); for (int iter = 0; iter < attributes.tagCount(); iter++) { NBTTagCompound tag = (NBTTagCompound) attributes.getCompoundTagAt(iter); diff --git a/src/main/java/tconstruct/modifiers/armor/AModProtection.java b/src/main/java/tconstruct/modifiers/armor/AModProtection.java index 20d8071a760..1ea7a89b77e 100644 --- a/src/main/java/tconstruct/modifiers/armor/AModProtection.java +++ b/src/main/java/tconstruct/modifiers/armor/AModProtection.java @@ -12,6 +12,7 @@ public class AModProtection extends ArmorModTypeFilter { int modifyAmount = 3; + public AModProtection(int effect, EnumSet armorTypes, ItemStack[] items, int[] values) { super(effect, "ExoProtection", armorTypes, items, values); @@ -38,6 +39,6 @@ public void modify (ItemStack[] input, ItemStack armor) int amount = matchingAmount(input); double absorb = armorTag.getDouble("protection"); absorb += amount; - armorTag.setDouble("protection", absorb); + armorTag.setDouble("protection", absorb); } } \ No newline at end of file diff --git a/src/main/java/tconstruct/modifiers/tools/ToolModTypeFilter.java b/src/main/java/tconstruct/modifiers/tools/ToolModTypeFilter.java index d09c0a4b8cd..05c7ea73adf 100644 --- a/src/main/java/tconstruct/modifiers/tools/ToolModTypeFilter.java +++ b/src/main/java/tconstruct/modifiers/tools/ToolModTypeFilter.java @@ -57,7 +57,7 @@ public boolean matches (ItemStack[] input, ItemStack tool) } if (!match) return false; - + minimumMatch = true; } return minimumMatch; diff --git a/src/main/java/tconstruct/plugins/ICompatPlugin.java b/src/main/java/tconstruct/plugins/ICompatPlugin.java index 8f19f7885ac..f4519bf6442 100644 --- a/src/main/java/tconstruct/plugins/ICompatPlugin.java +++ b/src/main/java/tconstruct/plugins/ICompatPlugin.java @@ -6,18 +6,19 @@ * Do not include mod API usage directly in this file except for IMC! This must be constructable even * when the target mod isn't available due to Java not allowing static abstracts. */ -public interface ICompatPlugin { +public interface ICompatPlugin +{ // Mod ID the plugin handles - public abstract String getModId(); + public abstract String getModId (); // Called during TCon PreInit - public abstract void preInit(); + public abstract void preInit (); // Called during TCon Init - public abstract void init(); + public abstract void init (); // Called during TCon PostInit - public abstract void postInit(); + public abstract void postInit (); } diff --git a/src/main/java/tconstruct/plugins/PluginController.java b/src/main/java/tconstruct/plugins/PluginController.java index 2f721c8e8b3..b9c6c9ad0d2 100644 --- a/src/main/java/tconstruct/plugins/PluginController.java +++ b/src/main/java/tconstruct/plugins/PluginController.java @@ -15,7 +15,8 @@ public class PluginController { - private enum Phase { + private enum Phase + { PRELAUNCH, PREINIT, INIT, POSTINIT, DONE } @@ -24,15 +25,17 @@ private enum Phase { private List plugins = new LinkedList(); private Phase currPhase = Phase.PRELAUNCH; - private PluginController() { + private PluginController() + { String path = Loader.instance().getConfigDir().toString() + File.separator + "TDynstruct.cfg"; TConstruct.logger.info("[PluginController] Using config path: " + path); conf = new Configuration(new File(path)); } - public static PluginController getController() + public static PluginController getController () { - if (instance == null) instance = new PluginController(); + if (instance == null) + instance = new PluginController(); return instance; } @@ -44,7 +47,7 @@ public static PluginController getController() * * @param plugin Plugin to register */ - public void registerPlugin(ICompatPlugin plugin) + public void registerPlugin (ICompatPlugin plugin) { conf.load(); boolean shouldLoad = conf.get("Plugins", plugin.getModId(), true).getBoolean(true); @@ -55,53 +58,58 @@ public void registerPlugin(ICompatPlugin plugin) } // This does the actual plugin loading if mod is present; needed to allow force-enabling. - private void loadPlugin(ICompatPlugin plugin) + private void loadPlugin (ICompatPlugin plugin) { - if (!Loader.isModLoaded(plugin.getModId())) return; + if (!Loader.isModLoaded(plugin.getModId())) + return; TConstruct.logger.info("[PluginController] Registering compat plugin for " + plugin.getModId()); plugins.add(plugin); - switch (currPhase) // Play catch-up if plugin is registered late + switch (currPhase) + // Play catch-up if plugin is registered late { - case DONE: - case POSTINIT: - plugin.preInit(); - plugin.init(); - plugin.postInit(); - break; - case INIT: - plugin.preInit(); - plugin.init(); - break; - case PREINIT: - plugin.preInit(); - break; - default: - break; + case DONE: + case POSTINIT: + plugin.preInit(); + plugin.init(); + plugin.postInit(); + break; + case INIT: + plugin.preInit(); + plugin.init(); + break; + case PREINIT: + plugin.preInit(); + break; + default: + break; } } - public void preInit() + public void preInit () { currPhase = Phase.PREINIT; - for (ICompatPlugin pl : plugins) pl.preInit(); + for (ICompatPlugin pl : plugins) + pl.preInit(); } - public void init() + public void init () { currPhase = Phase.INIT; - for (ICompatPlugin pl : plugins) pl.init(); + for (ICompatPlugin pl : plugins) + pl.init(); } - public void postInit() + public void postInit () { currPhase = Phase.POSTINIT; - for (ICompatPlugin pl : plugins) pl.postInit(); + for (ICompatPlugin pl : plugins) + pl.postInit(); currPhase = Phase.DONE; } - public void registerBuiltins() + public void registerBuiltins () { // Mystcraft is pushed in through the backdoor so it can't be disabled. loadPlugin(new Mystcraft()); @@ -110,10 +118,10 @@ public void registerBuiltins() registerPlugin(new BuildcraftTransport()); //registerPlugin(new ForgeMultiPart()); registerPlugin(new IC2()); - // registerPlugin(new MineFactoryReloaded()); + // registerPlugin(new MineFactoryReloaded()); //registerPlugin(new NotEnoughItems()); registerPlugin(new Thaumcraft()); - // registerPlugin(new Waila()); + // registerPlugin(new Waila()); } } diff --git a/src/main/java/tconstruct/plugins/ic2/IC2.java b/src/main/java/tconstruct/plugins/ic2/IC2.java index c6857de5aba..289a9bb2be4 100644 --- a/src/main/java/tconstruct/plugins/ic2/IC2.java +++ b/src/main/java/tconstruct/plugins/ic2/IC2.java @@ -16,27 +16,32 @@ import java.util.Map; -public class IC2 implements ICompatPlugin { +public class IC2 implements ICompatPlugin +{ private static final String IC2_UUM_FLUIDNAME = "uumatter"; private Fluid fluidUUM; @Override - public String getModId() { + public String getModId () + { return "IC2"; } @Override - public void preInit() { + public void preInit () + { } @Override - public void init() { + public void init () + { TConstruct.logger.info("[IC2] Preparing for shenanigans."); fluidUUM = FluidRegistry.getFluid(IC2_UUM_FLUIDNAME); - if (fluidUUM == null) return; + if (fluidUUM == null) + return; // Useful stuff //ItemStack ingotCast = new ItemStack(TRepo.metalPattern, 1, 0); @@ -71,7 +76,8 @@ public void init() { } @Override - public void postInit() { + public void postInit () + { } diff --git a/src/main/java/tconstruct/plugins/imc/AppEng.java b/src/main/java/tconstruct/plugins/imc/AppEng.java index b240f09704d..3ba4c7b7cbf 100644 --- a/src/main/java/tconstruct/plugins/imc/AppEng.java +++ b/src/main/java/tconstruct/plugins/imc/AppEng.java @@ -7,25 +7,28 @@ import java.util.Arrays; import java.util.List; -public class AppEng implements ICompatPlugin { +public class AppEng implements ICompatPlugin +{ - private static List spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic", - "CraftingStationLogic", "DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic", "PartBuilderLogic", - "PatternChestLogic", "SmelteryDrainLogic", "SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic", "ToolStationLogic", - "TowerFurnaceLogic", "MultiServantLogic"); + private static List spatialIOLogics = Arrays.asList("AdaptiveSmelteryLogic", "AqueductLogic", "CastingBasinLogic", "CastingChannelLogic", "CastingTableLogic", "CraftingStationLogic", + "DryingRackLogic", "EssenceExtractorLogic", "FaucetLogic", "FrypanLogic", "GolemPedestalLogic", "LavaTankLogic", "PartBuilderLogic", "PatternChestLogic", "SmelteryDrainLogic", + "SmelteryLogic", "StencilTableLogic", "TankAirLogic", "TileEntityLandmine", "ToolForgeLogic", "ToolStationLogic", "TowerFurnaceLogic", "MultiServantLogic"); @Override - public String getModId() { + public String getModId () + { return "AppliedEnergistics"; } @Override - public void preInit() { + public void preInit () + { } @Override - public void init() { + public void init () + { TConstruct.logger.info("[AppEng] Registering for Spatial IO."); for (String s : spatialIOLogics) { @@ -34,7 +37,8 @@ public void init() { } @Override - public void postInit() { + public void postInit () + { } diff --git a/src/main/java/tconstruct/plugins/imc/BuildcraftTransport.java b/src/main/java/tconstruct/plugins/imc/BuildcraftTransport.java index e5f83f2ddfa..7288135c390 100644 --- a/src/main/java/tconstruct/plugins/imc/BuildcraftTransport.java +++ b/src/main/java/tconstruct/plugins/imc/BuildcraftTransport.java @@ -6,20 +6,24 @@ import tconstruct.common.TRepo; import tconstruct.plugins.ICompatPlugin; -public class BuildcraftTransport implements ICompatPlugin { +public class BuildcraftTransport implements ICompatPlugin +{ @Override - public String getModId() { + public String getModId () + { return "BuildCraft|Transport"; } @Override - public void preInit() { + public void preInit () + { } @Override - public void init() { + public void init () + { TConstruct.logger.info("[BC|Transport] Registering facades."); // Smeltery Blocks addFacade(TRepo.smeltery, 2); @@ -61,7 +65,8 @@ public void init() { } @Override - public void postInit() { + public void postInit () + { } diff --git a/src/main/java/tconstruct/plugins/imc/Mystcraft.java b/src/main/java/tconstruct/plugins/imc/Mystcraft.java index 11ef88cfa8a..44e75455c2e 100644 --- a/src/main/java/tconstruct/plugins/imc/Mystcraft.java +++ b/src/main/java/tconstruct/plugins/imc/Mystcraft.java @@ -5,29 +5,35 @@ import tconstruct.TConstruct; import tconstruct.plugins.ICompatPlugin; -public class Mystcraft implements ICompatPlugin { +public class Mystcraft implements ICompatPlugin +{ - private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten", - "moltenArdite", "ender", "steel.molten", "platinum.molten" }; + private static String[] fluids = new String[] { "invar.molten", "electrum.molten", "bronze.molten", "aluminumbrass.molten", "manyullyn.molten", "alumite.molten", "cobalt.molten", "moltenArdite", + "ender", "steel.molten", "platinum.molten" }; @Override - public String getModId() { + public String getModId () + { return "Mystcraft"; } @Override - public void preInit() { + public void preInit () + { } @Override - public void init() { + public void init () + { TConstruct.logger.info("[Mystcraft] Blacklisting Mystcraft fluid symbols."); - for (String nm : fluids) sendFluidBlacklist(nm); + for (String nm : fluids) + sendFluidBlacklist(nm); } @Override - public void postInit() { + public void postInit () + { } diff --git a/src/main/java/tconstruct/plugins/imc/Thaumcraft.java b/src/main/java/tconstruct/plugins/imc/Thaumcraft.java index e49e62d1a1e..7ca39d6f684 100644 --- a/src/main/java/tconstruct/plugins/imc/Thaumcraft.java +++ b/src/main/java/tconstruct/plugins/imc/Thaumcraft.java @@ -6,20 +6,24 @@ import tconstruct.common.TRepo; import tconstruct.plugins.ICompatPlugin; -public class Thaumcraft implements ICompatPlugin { +public class Thaumcraft implements ICompatPlugin +{ @Override - public String getModId() { + public String getModId () + { return "Thaumcraft"; } @Override - public void preInit() { + public void preInit () + { } @Override - public void init() { + public void init () + { TConstruct.logger.info("[Thaumcraft] Registering harvestables."); FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 12)); FMLInterModComms.sendMessage("Thaumcraft", "harvestClickableCrop", new ItemStack(TRepo.oreBerry, 1, 13)); @@ -30,7 +34,8 @@ public void init() { } @Override - public void postInit() { + public void postInit () + { } diff --git a/src/main/java/tconstruct/preloader/AccessTransformers.java b/src/main/java/tconstruct/preloader/AccessTransformers.java index df6aa4c70e4..21af7b93b76 100644 --- a/src/main/java/tconstruct/preloader/AccessTransformers.java +++ b/src/main/java/tconstruct/preloader/AccessTransformers.java @@ -5,21 +5,27 @@ import java.io.IOException; import java.lang.reflect.Method; -public class AccessTransformers extends AccessTransformer { +public class AccessTransformers extends AccessTransformer +{ - public AccessTransformers() throws IOException { + public AccessTransformers() throws IOException + { super(); readMapFile("TConstruct_at.cfg"); } - private void readMapFile(String name) { + private void readMapFile (String name) + { TConstructLoaderContainer.logger.info("[AT] Loading AT file: " + name); - try { - Method me = AccessTransformer.class.getDeclaredMethod("readMapFile", new Class[]{String.class}); + try + { + Method me = AccessTransformer.class.getDeclaredMethod("readMapFile", new Class[] { String.class }); me.setAccessible(true); me.invoke(this, name); - } catch (Exception ex) { + } + catch (Exception ex) + { TConstructLoaderContainer.logger.error("[AT] Unknown failure occured: " + ex.getMessage()); ex.printStackTrace(); } diff --git a/src/main/java/tconstruct/preloader/helpers/PropertyManager.java b/src/main/java/tconstruct/preloader/helpers/PropertyManager.java index cdd03f5b1e7..05aa2deee3b 100644 --- a/src/main/java/tconstruct/preloader/helpers/PropertyManager.java +++ b/src/main/java/tconstruct/preloader/helpers/PropertyManager.java @@ -27,7 +27,7 @@ private PropertyManager() public static final String propFileName = "TConPreloader.cfg"; - private static String[] vars = new String[]{"preloaderContainer_verboseLog", "asmInterfaceRepair_verboseLog"}; + private static String[] vars = new String[] { "preloaderContainer_verboseLog", "asmInterfaceRepair_verboseLog" }; public static boolean preloaderContainer_verboseLog = false; public static boolean asmInterfaceRepair_verboseLog = false; @@ -64,7 +64,8 @@ public static boolean getOrCreateProps () throws PropAccessException { throw new PropAccessException(); } - catch (NullPointerException ex) { + catch (NullPointerException ex) + { TConstructLoaderContainer.logger.warn("Preloader config structure has changed; attempting to recreate."); attemptCreate(fp, props); } @@ -78,13 +79,14 @@ public static boolean getOrCreateProps () throws PropAccessException return false; } - private static void attemptCreate(File fp, Properties props) throws PropAccessException { + private static void attemptCreate (File fp, Properties props) throws PropAccessException + { // Attempt (re)creation try { if (fp.exists()) fp.delete(); - + if (fp.createNewFile()) { TConstructLoaderContainer.logger.info("Creating new properties file, as none found..."); diff --git a/src/main/java/tconstruct/util/MiningExplosion.java b/src/main/java/tconstruct/util/MiningExplosion.java index 067b4131ebe..7617a15ce97 100644 --- a/src/main/java/tconstruct/util/MiningExplosion.java +++ b/src/main/java/tconstruct/util/MiningExplosion.java @@ -75,8 +75,8 @@ public void doExplosionA () if (k1 != Blocks.air) { Block block = k1; - float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.world, l, i1, j1, block) : block.getExplosionResistance(this.exploder, world, - l, i1, j1, explosionX, explosionY, explosionZ); + float f3 = this.exploder != null ? this.exploder.func_145772_a(this, this.world, l, i1, j1, block) : block.getExplosionResistance(this.exploder, world, l, i1, j1, + explosionX, explosionY, explosionZ); f1 -= (f3 + 0.8F) * f2 * 0.25f; } diff --git a/src/main/java/tconstruct/util/SmelteryDamageSource.java b/src/main/java/tconstruct/util/SmelteryDamageSource.java index 4f720e30772..600e28b81fc 100644 --- a/src/main/java/tconstruct/util/SmelteryDamageSource.java +++ b/src/main/java/tconstruct/util/SmelteryDamageSource.java @@ -35,6 +35,7 @@ public IChatComponent func_151519_b (EntityLivingBase par1EntityLiving) EntityLivingBase entityliving1 = par1EntityLiving.func_94060_bK(); String s = "death." + type + this.damageType; String s1 = s + ".player"; - return entityliving1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] {par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_()}): new ChatComponentTranslation(s, new Object[] {par1EntityLiving.func_145748_c_()}); + return entityliving1 != null && StatCollector.canTranslate(s1) ? new ChatComponentTranslation(s1, new Object[] { par1EntityLiving.func_145748_c_(), entityliving1.func_145748_c_() }) + : new ChatComponentTranslation(s, new Object[] { par1EntityLiving.func_145748_c_() }); } } diff --git a/src/main/java/tconstruct/util/TCraftingHandler.java b/src/main/java/tconstruct/util/TCraftingHandler.java index 4fd060af2d9..5d88efdd034 100644 --- a/src/main/java/tconstruct/util/TCraftingHandler.java +++ b/src/main/java/tconstruct/util/TCraftingHandler.java @@ -18,10 +18,10 @@ public class TCraftingHandler //implements ICraftingHandler @SubscribeEvent public void onCrafting (ItemCraftedEvent event)//EntityPlayer player, ItemStack itemstack, IInventory craftMatrix) { - Item item = event.crafting.getItem(); + Item item = event.crafting.getItem(); if (!event.player.worldObj.isRemote) { - if (ComparisonHelper.areEquivalent(item,TRepo.toolStationWood)) + if (ComparisonHelper.areEquivalent(item, TRepo.toolStationWood)) { TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(event.player.getDisplayName()); NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct"); @@ -32,7 +32,7 @@ public void onCrafting (ItemCraftedEvent event)//EntityPlayer player, ItemStack AbilityHelper.spawnItemAtPlayer(event.player, new ItemStack(TRepo.manualBook, 1, 1)); } } - if (ComparisonHelper.areEquivalent(item,TRepo.smeltery) || ComparisonHelper.areEquivalent(item,TRepo.lavaTank)) + if (ComparisonHelper.areEquivalent(item, TRepo.smeltery) || ComparisonHelper.areEquivalent(item, TRepo.lavaTank)) { TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(event.player.getDisplayName()); NBTTagCompound tags = event.player.getEntityData().getCompoundTag("TConstruct"); @@ -44,9 +44,10 @@ public void onCrafting (ItemCraftedEvent event)//EntityPlayer player, ItemStack } event.player.addStat(TAchievements.achievements.get("tconstruct.smelteryMaker"), 1); } - - if (ComparisonHelper.areEquivalent(item,TRepo.craftingStationWood)){ - event.player.addStat(TAchievements.achievements.get("tconstruct.betterCrafting"), 1); + + if (ComparisonHelper.areEquivalent(item, TRepo.craftingStationWood)) + { + event.player.addStat(TAchievements.achievements.get("tconstruct.betterCrafting"), 1); } } } diff --git a/src/main/java/tconstruct/util/TEventHandler.java b/src/main/java/tconstruct/util/TEventHandler.java index 9b273d029cf..3227e86a740 100644 --- a/src/main/java/tconstruct/util/TEventHandler.java +++ b/src/main/java/tconstruct/util/TEventHandler.java @@ -570,7 +570,7 @@ public void bucketFill (FillBucketEvent evt) { if (evt.entityPlayer.capabilities.isCreativeMode) { - WorldHelper.setBlockToAir(evt.world,hitX, hitY, hitZ); + WorldHelper.setBlockToAir(evt.world, hitX, hitY, hitZ); } else { @@ -629,22 +629,26 @@ public void bucketFill (FillBucketEvent evt) @SubscribeEvent public void livingUpdate (LivingUpdateEvent event) { - if(event.entityLiving instanceof EntityPlayer){ - EntityPlayer player = (EntityPlayer) event.entityLiving; + if (event.entityLiving instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) event.entityLiving; TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName()); - - if(stats != null){ - ArmorExtended armor = stats.armor; - for(int i = 0; i < armor.getSizeInventory(); i++){ - if(armor.getStackInSlot(i) != null){ - armor.getStackInSlot(i).getItem().onUpdate(armor.getStackInSlot(i), player.worldObj, player, i, false); - armor.getStackInSlot(i).getItem().onArmorTick(player.worldObj, player, armor.getStackInSlot(i)); - } - } + + if (stats != null) + { + ArmorExtended armor = stats.armor; + for (int i = 0; i < armor.getSizeInventory(); i++) + { + if (armor.getStackInSlot(i) != null) + { + armor.getStackInSlot(i).getItem().onUpdate(armor.getStackInSlot(i), player.worldObj, player, i, false); + armor.getStackInSlot(i).getItem().onArmorTick(player.worldObj, player, armor.getStackInSlot(i)); + } + } } - } + } } - + //Player interact event - prevent breaking of tank air blocks in creative @SubscribeEvent public void playerInteract (PlayerInteractEvent event) diff --git a/src/main/java/tconstruct/util/TEventHandlerAchievement.java b/src/main/java/tconstruct/util/TEventHandlerAchievement.java index d297b7bf504..e53739bbd4f 100644 --- a/src/main/java/tconstruct/util/TEventHandlerAchievement.java +++ b/src/main/java/tconstruct/util/TEventHandlerAchievement.java @@ -8,30 +8,38 @@ import tconstruct.library.event.ToolCraftedEvent; import tconstruct.library.tools.*; -public class TEventHandlerAchievement { +public class TEventHandlerAchievement +{ @SubscribeEvent - public void onToolCrafted(ToolCraftedEvent event){ - if(event.player != null && !(event.player instanceof FakePlayer)){ - event.player.addStat(TAchievements.achievements.get("tconstruct.tinkerer"), 1); - - if(event.tool != null && event.tool.getItem() instanceof Weapon){ - event.player.addStat(TAchievements.achievements.get("tconstruct.preparedFight"), 1); - } - - if(event.inventory != null && event.inventory instanceof ToolForgeLogic && event.tool.getItem() instanceof ToolCore && ((ToolCore)event.tool.getItem()).durabilityTypeExtra() != 0){ - event.player.addStat(TAchievements.achievements.get("tconstruct.proTinkerer"), 1); - } - } - } - + public void onToolCrafted (ToolCraftedEvent event) + { + if (event.player != null && !(event.player instanceof FakePlayer)) + { + event.player.addStat(TAchievements.achievements.get("tconstruct.tinkerer"), 1); + + if (event.tool != null && event.tool.getItem() instanceof Weapon) + { + event.player.addStat(TAchievements.achievements.get("tconstruct.preparedFight"), 1); + } + + if (event.inventory != null && event.inventory instanceof ToolForgeLogic && event.tool.getItem() instanceof ToolCore && ((ToolCore) event.tool.getItem()).durabilityTypeExtra() != 0) + { + event.player.addStat(TAchievements.achievements.get("tconstruct.proTinkerer"), 1); + } + } + } + @SubscribeEvent - public void onItemPlacedIntoCasting(SmelteryEvent.ItemInsertedIntoCasting event){ - if(event.player != null && event.item != null){ - if(event.item.getItem() instanceof ToolCore){ - event.player.addStat(TAchievements.achievements.get("tconstruct.doingItWrong"), 1); - } - } - } - + public void onItemPlacedIntoCasting (SmelteryEvent.ItemInsertedIntoCasting event) + { + if (event.player != null && event.item != null) + { + if (event.item.getItem() instanceof ToolCore) + { + event.player.addStat(TAchievements.achievements.get("tconstruct.doingItWrong"), 1); + } + } + } + } diff --git a/src/main/java/tconstruct/util/config/DimensionBlacklist.java b/src/main/java/tconstruct/util/config/DimensionBlacklist.java index f276934b306..f37cd274da7 100644 --- a/src/main/java/tconstruct/util/config/DimensionBlacklist.java +++ b/src/main/java/tconstruct/util/config/DimensionBlacklist.java @@ -15,7 +15,7 @@ public class DimensionBlacklist public static int promisedLandDimensionID = -100; public static int twilightForestDimensionID = -100; - public static void getBadBimensions() + public static void getBadBimensions () { updateModDimIDs(); @@ -61,13 +61,13 @@ public static boolean isDimNoPool (int dim) return noPoolDims.contains(dim); } - private static void updateModDimIDs() + private static void updateModDimIDs () { updateTwiForestID(); updateBoPID(); } - private static void updateTwiForestID() + private static void updateTwiForestID () { String location = Loader.instance().getConfigDir().getPath(); File newFile = new File(location + File.separator + "TwilightForest.cfg"); @@ -80,10 +80,11 @@ private static void updateTwiForestID() twilightForestDimensionID = config.get("dimension", "dimensionID", -100).getInt(); TConstruct.logger.trace("Twilight Forest Dim ID: " + twilightForestDimensionID); } - else twilightForestDimensionID = -100; + else + twilightForestDimensionID = -100; } - private static void updateBoPID() + private static void updateBoPID () { String location = Loader.instance().getConfigDir().getPath(); File newFile = new File(location + File.separator + "biomesoplenty" + File.separator + "ids.cfg"); @@ -96,7 +97,8 @@ private static void updateBoPID() promisedLandDimensionID = config.get("dimension settings", "Promised Land Dimension ID", -200).getInt(); TConstruct.logger.trace("Promised Lands Dim ID: " + promisedLandDimensionID); } - else promisedLandDimensionID = -100; + else + promisedLandDimensionID = -100; } } diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index 0eadf435989..d025d4caad9 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -20,7 +20,7 @@ public static void initProps (File confFile) Configuration config = new Configuration(confFile); /* Load the configuration file */ config.load(); - + superfunWorld = config.get("Superfun", "All the world is Superfun", false).getBoolean(false); TRepo.supressMissingToolLogs = config.get("Logging", "Disable tool build messages", false).getBoolean(false); @@ -47,7 +47,6 @@ public static void initProps (File confFile) denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false); craftEndstone = config.get("Difficulty Changes", "Allow creation of endstone", true).getBoolean(true); - ingotsPerOre = config.get("Smeltery Output Modification", "Ingots per ore", 2, "Number of ingots returned from smelting ores in the smeltery").getDouble(2); ingotsBronzeAlloy = config.get("Smeltery Output Modification", "Bronze ingot return", 4, "Number of ingots returned from smelting Bronze in the smeltery").getDouble(4); ingotsAluminumBrassAlloy = config.get("Smeltery Output Modification", "Aluminum Brass ingot return", 4, "Number of ingots returned from smelting Aluminum Brass in the smeltery").getDouble(4); diff --git a/src/main/java/tconstruct/util/landmine/behavior/Behavior.java b/src/main/java/tconstruct/util/landmine/behavior/Behavior.java index 9095a777fdc..a62c17f8ef4 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/Behavior.java +++ b/src/main/java/tconstruct/util/landmine/behavior/Behavior.java @@ -58,17 +58,20 @@ public static void registerBuiltInBehaviors () addBehavior(new ItemStack(Items.snowball), shoot); addBehavior(new ItemStack(Items.ender_pearl), shoot); addBehavior(new ItemStack(Items.shears), shear); - + //Make sure the part below this comment is executed last(to avoid conflicts) Iterator i1 = Block.blockRegistry.iterator(); - while(i1.hasNext()){ - Object ob = i1.next(); - if(ob != null && ob instanceof Block){ - Block b = (Block) ob; - if(b.getMaterial().isOpaque() && b.renderAsNormalBlock() && !b.canProvidePower() && !(b instanceof ITileEntityProvider) && !behaviorsListBlocks.containsKey(new ItemStack(b))){ - addBehavior(new ItemStack(b), blockThrow); - } - } + while (i1.hasNext()) + { + Object ob = i1.next(); + if (ob != null && ob instanceof Block) + { + Block b = (Block) ob; + if (b.getMaterial().isOpaque() && b.renderAsNormalBlock() && !b.canProvidePower() && !(b instanceof ITileEntityProvider) && !behaviorsListBlocks.containsKey(new ItemStack(b))) + { + addBehavior(new ItemStack(b), blockThrow); + } + } } } diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java index 712bea4ee2a..ae6af56e86c 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorBlockThrow.java @@ -65,8 +65,8 @@ public void executeLogic (World par1World, int par2, int par3, int par4, ItemSta break; } - EntityFallingBlock entityfallingsand = new EntityFallingBlock(par1World, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 2F), (double) ((float) par4 + 0.5F), BlockUtils.getBlockFromItemStack(par5ItemStack), - par5ItemStack.getItemDamage()); + EntityFallingBlock entityfallingsand = new EntityFallingBlock(par1World, (double) ((float) par2 + 0.5F), (double) ((float) par3 + 2F), (double) ((float) par4 + 0.5F), + BlockUtils.getBlockFromItemStack(par5ItemStack), par5ItemStack.getItemDamage()); entityfallingsand.preventEntitySpawning = false; entityfallingsand.ticksExisted = 2; entityfallingsand.setVelocity(vec0, vec1, vec2); diff --git a/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java b/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java index debf4fa15a7..986dc6986f9 100644 --- a/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java +++ b/src/main/java/tconstruct/util/landmine/behavior/BehaviorFirecharge.java @@ -43,8 +43,8 @@ public void executeLogic (World par1World, int par2, int par3, int par4, ItemSta { for (int j = par4 - 2; j <= (par4 + 2); j++) { - if ((par1World.getBlock(i, par3, j) == null || (par1World.getBlock(i, par3, j) != null && par1World.getBlock(i, par3, j).isReplaceable( - par1World, i, par3, j))) && ItemBlockLandmine.getRandom().nextInt(5) == 0 && Blocks.fire.canPlaceBlockAt(par1World, i, par3, j)) + if ((par1World.getBlock(i, par3, j) == null || (par1World.getBlock(i, par3, j) != null && par1World.getBlock(i, par3, j).isReplaceable(par1World, i, par3, j))) + && ItemBlockLandmine.getRandom().nextInt(5) == 0 && Blocks.fire.canPlaceBlockAt(par1World, i, par3, j)) { par1World.setBlock(i, par3, j, Blocks.fire); } diff --git a/src/main/java/tconstruct/util/network/packet/AbstractPacket.java b/src/main/java/tconstruct/util/network/packet/AbstractPacket.java index 1135229aaa3..37f6ea87af4 100644 --- a/src/main/java/tconstruct/util/network/packet/AbstractPacket.java +++ b/src/main/java/tconstruct/util/network/packet/AbstractPacket.java @@ -8,35 +8,36 @@ * AbstractPacket class. Should be the parent of all packets wishing to use the PacketPipeline. * @author sirgingalot */ -public abstract class AbstractPacket { +public abstract class AbstractPacket +{ - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils}) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); + /** + * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils}) + * + * @param ctx channel context + * @param buffer the buffer to encode into + */ + public abstract void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer); - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils}) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); + /** + * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See @link{cpw.mods.fml.common.network.ByteBuffUtils}) + * + * @param ctx channel context + * @param buffer the buffer to decode from + */ + public abstract void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer); - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); + /** + * Handle a packet on the client side. Note this occurs after decoding has completed. + * + * @param player the player reference + */ + public abstract void handleClientSide (EntityPlayer player); - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); + /** + * Handle a packet on the server side. Note this occurs after decoding has completed. + * + * @param player the player reference + */ + public abstract void handleServerSide (EntityPlayer player); } diff --git a/src/main/java/tconstruct/util/network/packet/PacketDoubleJump.java b/src/main/java/tconstruct/util/network/packet/PacketDoubleJump.java index f6e747760cc..6b187b0434e 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketDoubleJump.java +++ b/src/main/java/tconstruct/util/network/packet/PacketDoubleJump.java @@ -4,28 +4,33 @@ import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; -public class PacketDoubleJump extends AbstractPacket { +public class PacketDoubleJump extends AbstractPacket +{ - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { + @Override + public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { - } + } - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { + @Override + public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { - } + } - @Override - public void handleClientSide(EntityPlayer player) { + @Override + public void handleClientSide (EntityPlayer player) + { - } + } - @Override - public void handleServerSide(EntityPlayer player) { - //String user = inputStream.readUTF(); - //EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user); - player.fallDistance = 0; - } + @Override + public void handleServerSide (EntityPlayer player) + { + //String user = inputStream.readUTF(); + //EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user); + player.fallDistance = 0; + } } diff --git a/src/main/java/tconstruct/util/network/packet/PacketExtendedInventory.java b/src/main/java/tconstruct/util/network/packet/PacketExtendedInventory.java index 09be42f95f2..6f1ecf10d4f 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketExtendedInventory.java +++ b/src/main/java/tconstruct/util/network/packet/PacketExtendedInventory.java @@ -5,48 +5,56 @@ import net.minecraft.entity.player.EntityPlayer; import tconstruct.TConstruct; -public class PacketExtendedInventory extends AbstractPacket { - - byte type; - - public PacketExtendedInventory() { - - } - - public PacketExtendedInventory(byte type) { - this.type = type; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeByte(type); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - type = buffer.readByte(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - - } - - @Override - public void handleServerSide(EntityPlayer player) { - //String user = inputStream.readUTF(); - //EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user); - switch (type) { - case 0: - player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); - break; - case 1: - player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); - break; - case 2: - player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); - break; - } - } +public class PacketExtendedInventory extends AbstractPacket +{ + + byte type; + + public PacketExtendedInventory() + { + + } + + public PacketExtendedInventory(byte type) + { + this.type = type; + } + + @Override + public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + buffer.writeByte(type); + } + + @Override + public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + type = buffer.readByte(); + } + + @Override + public void handleClientSide (EntityPlayer player) + { + + } + + @Override + public void handleServerSide (EntityPlayer player) + { + //String user = inputStream.readUTF(); + //EntityPlayer player = TConstruct.playerTracker.getEntityPlayer(user); + switch (type) + { + case 0: + player.openGui(TConstruct.instance, TConstruct.proxy.inventoryGui, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); + break; + case 1: + player.openGui(TConstruct.instance, TConstruct.proxy.armorGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); + break; + case 2: + player.openGui(TConstruct.instance, TConstruct.proxy.knapsackGuiID, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); + break; + } + } } diff --git a/src/main/java/tconstruct/util/network/packet/PacketPipeline.java b/src/main/java/tconstruct/util/network/packet/PacketPipeline.java index 3a9bfa41f79..6e2189a7b94 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketPipeline.java +++ b/src/main/java/tconstruct/util/network/packet/PacketPipeline.java @@ -18,191 +18,214 @@ * some code from: cpw */ @ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - - private EnumMap channels; - private LinkedList> packets = new LinkedList>(); - private boolean isPostInitialised = false; - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - // You should log here!! - return false; - } - - if (this.packets.contains(clazz)) { - // You should log here!! - return false; - } - - if (this.isPostInitialised) { - // You should log here!! - return false; - } - - this.packets.add(clazz); - return true; - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, AbstractPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - AbstractPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - // Method to call from FMLInitializationEvent - public void initalise() { - this.channels = NetworkRegistry.INSTANCE.newChannel("TConstruct", this); - registerPackets(); - } - - public void registerPackets(){ - registerPacket(PacketDoubleJump.class); - registerPacket(PacketExtendedInventory.class); - registerPacket(PacketSmeltery.class); - registerPacket(PacketStencilTable.class); - registerPacket(PacketToolStation.class); - } - - // Method to call from FMLPostInitializationEvent - // Ensures that packet discriminators are common between server and client by using logical sorting - public void postInitialise() { - if (this.isPostInitialised) { - return; - } - - this.isPostInitialised = true; - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(AbstractPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(AbstractPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(AbstractPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(AbstractPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(AbstractPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } +public class PacketPipeline extends MessageToMessageCodec +{ + + private EnumMap channels; + private LinkedList> packets = new LinkedList>(); + private boolean isPostInitialised = false; + + /** + * Register your packet with the pipeline. Discriminators are automatically set. + * + * @param clazz the class to register + * + * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet + */ + public boolean registerPacket (Class clazz) + { + if (this.packets.size() > 256) + { + // You should log here!! + return false; + } + + if (this.packets.contains(clazz)) + { + // You should log here!! + return false; + } + + if (this.isPostInitialised) + { + // You should log here!! + return false; + } + + this.packets.add(clazz); + return true; + } + + // In line encoding of the packet, including discriminator setting + @Override + protected void encode (ChannelHandlerContext ctx, AbstractPacket msg, List out) throws Exception + { + ByteBuf buffer = Unpooled.buffer(); + Class clazz = msg.getClass(); + if (!this.packets.contains(msg.getClass())) + { + throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); + } + + byte discriminator = (byte) this.packets.indexOf(clazz); + buffer.writeByte(discriminator); + msg.encodeInto(ctx, buffer); + FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get()); + out.add(proxyPacket); + } + + // In line decoding and handling of the packet + @Override + protected void decode (ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception + { + ByteBuf payload = msg.payload(); + byte discriminator = payload.readByte(); + Class clazz = this.packets.get(discriminator); + if (clazz == null) + { + throw new NullPointerException("No packet registered for discriminator: " + discriminator); + } + + AbstractPacket pkt = clazz.newInstance(); + pkt.decodeInto(ctx, payload.slice()); + + EntityPlayer player; + switch (FMLCommonHandler.instance().getEffectiveSide()) + { + case CLIENT: + player = this.getClientPlayer(); + pkt.handleClientSide(player); + break; + + case SERVER: + INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); + player = ((NetHandlerPlayServer) netHandler).playerEntity; + pkt.handleServerSide(player); + break; + + default: + } + + out.add(pkt); + } + + // Method to call from FMLInitializationEvent + public void initalise () + { + this.channels = NetworkRegistry.INSTANCE.newChannel("TConstruct", this); + registerPackets(); + } + + public void registerPackets () + { + registerPacket(PacketDoubleJump.class); + registerPacket(PacketExtendedInventory.class); + registerPacket(PacketSmeltery.class); + registerPacket(PacketStencilTable.class); + registerPacket(PacketToolStation.class); + } + + // Method to call from FMLPostInitializationEvent + // Ensures that packet discriminators are common between server and client by using logical sorting + public void postInitialise () + { + if (this.isPostInitialised) + { + return; + } + + this.isPostInitialised = true; + Collections.sort(this.packets, new Comparator>() + { + + @Override + public int compare (Class clazz1, Class clazz2) + { + int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName()); + if (com == 0) + { + com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); + } + + return com; + } + }); + } + + @SideOnly(Side.CLIENT) + private EntityPlayer getClientPlayer () + { + return Minecraft.getMinecraft().thePlayer; + } + + /** + * Send this message to everyone. + *

+ * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper + * + * @param message The message to send + */ + public void sendToAll (AbstractPacket message) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + /** + * Send this message to the specified player. + *

+ * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper + * + * @param message The message to send + * @param player The player to send it to + */ + public void sendTo (AbstractPacket message, EntityPlayerMP player) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + /** + * Send this message to everyone within a certain range of a point. + *

+ * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper + * + * @param message The message to send + * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send + */ + public void sendToAllAround (AbstractPacket message, NetworkRegistry.TargetPoint point) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + /** + * Send this message to everyone within the supplied dimension. + *

+ * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper + * + * @param message The message to send + * @param dimensionId The dimension id to target + */ + public void sendToDimension (AbstractPacket message, int dimensionId) + { + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); + this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); + this.channels.get(Side.SERVER).writeAndFlush(message); + } + + /** + * Send this message to the server. + *

+ * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper + * + * @param message The message to send + */ + public void sendToServer (AbstractPacket message) + { + this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); + this.channels.get(Side.CLIENT).writeAndFlush(message); + } } \ No newline at end of file diff --git a/src/main/java/tconstruct/util/network/packet/PacketSmeltery.java b/src/main/java/tconstruct/util/network/packet/PacketSmeltery.java index 6c32f80bcb9..63f1e85e19e 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketSmeltery.java +++ b/src/main/java/tconstruct/util/network/packet/PacketSmeltery.java @@ -14,53 +14,60 @@ import net.minecraftforge.fluids.FluidStack; import tconstruct.blocks.logic.SmelteryLogic; -public class PacketSmeltery extends AbstractPacket { - - int dimension, x, y, z, fluidID; - boolean isShiftPressed; - - public PacketSmeltery(){ - - } - - public PacketSmeltery(int dimension, int x, int y, int z, boolean isShiftPressed, int fluidID){ - this.dimension = dimension; - this.x = x; - this.y = y; - this.z = z; - this.isShiftPressed = isShiftPressed; - this.fluidID = fluidID; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(dimension); - buffer.writeInt(x); - buffer.writeInt(y); - buffer.writeInt(z); - buffer.writeBoolean(isShiftPressed); - - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - dimension = buffer.readInt(); - x = buffer.readInt(); +public class PacketSmeltery extends AbstractPacket +{ + + int dimension, x, y, z, fluidID; + boolean isShiftPressed; + + public PacketSmeltery() + { + + } + + public PacketSmeltery(int dimension, int x, int y, int z, boolean isShiftPressed, int fluidID) + { + this.dimension = dimension; + this.x = x; + this.y = y; + this.z = z; + this.isShiftPressed = isShiftPressed; + this.fluidID = fluidID; + } + + @Override + public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + buffer.writeInt(dimension); + buffer.writeInt(x); + buffer.writeInt(y); + buffer.writeInt(z); + buffer.writeBoolean(isShiftPressed); + + } + + @Override + public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + dimension = buffer.readInt(); + x = buffer.readInt(); y = buffer.readInt(); z = buffer.readInt(); isShiftPressed = buffer.readBoolean(); fluidID = buffer.readInt(); - } + } - @Override - public void handleClientSide(EntityPlayer player) { + @Override + public void handleClientSide (EntityPlayer player) + { - } + } - @Override - public void handleServerSide(EntityPlayer player) { + @Override + public void handleServerSide (EntityPlayer player) + { World world = player.worldObj; - + TileEntity te = world.getTileEntity(x, y, z); if (te instanceof SmelteryLogic) @@ -87,6 +94,6 @@ public void handleServerSide(EntityPlayer player) { //Old code: PacketDispatcher.sendPacketToAllInDimension(te.getDescriptionPacket(), dimension); FMLCommonHandler.instance().getClientToServerNetworkManager().scheduleOutboundPacket(te.getDescriptionPacket()); } - } + } } diff --git a/src/main/java/tconstruct/util/network/packet/PacketStencilTable.java b/src/main/java/tconstruct/util/network/packet/PacketStencilTable.java index ace9f392ec3..1e365267d8e 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketStencilTable.java +++ b/src/main/java/tconstruct/util/network/packet/PacketStencilTable.java @@ -9,50 +9,58 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -public class PacketStencilTable extends AbstractPacket { - - int x, y, z; - ItemStack contents; - - public PacketStencilTable() { - - } - - public PacketStencilTable(int x, int y, int z, ItemStack contents) { - this.x = x; - this.y = y; - this.z = z; - this.contents = contents; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(x); - buffer.writeInt(y); - buffer.writeInt(z); - ByteBufUtils.writeItemStack(buffer, contents); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - x = buffer.readInt(); - y = buffer.readInt(); - z = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.worldObj; - TileEntity te = world.getTileEntity(x, y, z); - - if (te instanceof InventoryLogic) { - ((InventoryLogic) te).setInventorySlotContents(1, contents); - } - } +public class PacketStencilTable extends AbstractPacket +{ + + int x, y, z; + ItemStack contents; + + public PacketStencilTable() + { + + } + + public PacketStencilTable(int x, int y, int z, ItemStack contents) + { + this.x = x; + this.y = y; + this.z = z; + this.contents = contents; + } + + @Override + public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + buffer.writeInt(x); + buffer.writeInt(y); + buffer.writeInt(z); + ByteBufUtils.writeItemStack(buffer, contents); + } + + @Override + public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + x = buffer.readInt(); + y = buffer.readInt(); + z = buffer.readInt(); + } + + @Override + public void handleClientSide (EntityPlayer player) + { + + } + + @Override + public void handleServerSide (EntityPlayer player) + { + World world = player.worldObj; + TileEntity te = world.getTileEntity(x, y, z); + + if (te instanceof InventoryLogic) + { + ((InventoryLogic) te).setInventorySlotContents(1, contents); + } + } } diff --git a/src/main/java/tconstruct/util/network/packet/PacketToolStation.java b/src/main/java/tconstruct/util/network/packet/PacketToolStation.java index 95521146b94..e371f3b6491 100644 --- a/src/main/java/tconstruct/util/network/packet/PacketToolStation.java +++ b/src/main/java/tconstruct/util/network/packet/PacketToolStation.java @@ -8,52 +8,61 @@ import net.minecraft.world.World; import tconstruct.blocks.logic.*; -public class PacketToolStation extends AbstractPacket { - - private int x, y, z; - private String toolName; - - public PacketToolStation() { - } - - public PacketToolStation(int x, int y, int z, String toolName) { - this.x = x; - this.y = y; - this.z = z; - this.toolName = toolName; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(x); - buffer.writeInt(y); - buffer.writeInt(z); - ByteBufUtils.writeUTF8String(buffer, toolName); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - x = buffer.readInt(); - y = buffer.readInt(); - z = buffer.readInt(); - toolName = ByteBufUtils.readUTF8String(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.worldObj; - TileEntity te = world.getTileEntity(x, y, z); - - if (te instanceof ToolStationLogic) { - ((ToolStationLogic) te).setToolname(toolName); - } - if (te instanceof ToolForgeLogic) { - ((ToolForgeLogic) te).setToolname(toolName); - } - } +public class PacketToolStation extends AbstractPacket +{ + + private int x, y, z; + private String toolName; + + public PacketToolStation() + { + } + + public PacketToolStation(int x, int y, int z, String toolName) + { + this.x = x; + this.y = y; + this.z = z; + this.toolName = toolName; + } + + @Override + public void encodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + buffer.writeInt(x); + buffer.writeInt(y); + buffer.writeInt(z); + ByteBufUtils.writeUTF8String(buffer, toolName); + } + + @Override + public void decodeInto (ChannelHandlerContext ctx, ByteBuf buffer) + { + x = buffer.readInt(); + y = buffer.readInt(); + z = buffer.readInt(); + toolName = ByteBufUtils.readUTF8String(buffer); + } + + @Override + public void handleClientSide (EntityPlayer player) + { + } + + @Override + public void handleServerSide (EntityPlayer player) + { + World world = player.worldObj; + TileEntity te = world.getTileEntity(x, y, z); + + if (te instanceof ToolStationLogic) + { + ((ToolStationLogic) te).setToolname(toolName); + } + if (te instanceof ToolForgeLogic) + { + ((ToolForgeLogic) te).setToolname(toolName); + } + } } diff --git a/src/main/java/tconstruct/util/player/ArmorExtended.java b/src/main/java/tconstruct/util/player/ArmorExtended.java index be24ad0b886..8cea1f58c6c 100644 --- a/src/main/java/tconstruct/util/player/ArmorExtended.java +++ b/src/main/java/tconstruct/util/player/ArmorExtended.java @@ -258,7 +258,7 @@ public void saveToNBT (EntityPlayer entityplayer) public void readFromNBT (EntityPlayer entityplayer) { NBTTagCompound tags = entityplayer.getEntityData(); - NBTTagList tagList = tags.getTagList("TConstruct.Inventory",9); + NBTTagList tagList = tags.getTagList("TConstruct.Inventory", 9); for (int i = 0; i < tagList.tagCount(); ++i) { NBTTagCompound nbttagcompound = (NBTTagCompound) tagList.getCompoundTagAt(i); diff --git a/src/main/java/tconstruct/util/player/TPlayerHandler.java b/src/main/java/tconstruct/util/player/TPlayerHandler.java index c890b8a5593..115d5ecd3bf 100644 --- a/src/main/java/tconstruct/util/player/TPlayerHandler.java +++ b/src/main/java/tconstruct/util/player/TPlayerHandler.java @@ -49,12 +49,12 @@ public void onPlayerChangedDimension (PlayerChangedDimensionEvent event) { savePlayerStats(event.player, false); } + @SubscribeEvent public void onPlayerRespawn (PlayerRespawnEvent event) { onPlayerRespawn(event.player); } - public void onPlayerLogin (EntityPlayer entityplayer) { diff --git a/src/main/java/tconstruct/worldgen/SlimeTreeGen.java b/src/main/java/tconstruct/worldgen/SlimeTreeGen.java index cdd8c1129a3..fca31ad8fe6 100644 --- a/src/main/java/tconstruct/worldgen/SlimeTreeGen.java +++ b/src/main/java/tconstruct/worldgen/SlimeTreeGen.java @@ -156,7 +156,6 @@ void placeTrunk (World world, int xPos, int yPos, int zPos, int height) { Block block = world.getBlock(xPos, yPos + localHeight, zPos); - if (block == null || block == Blocks.air || block.isLeaves(world, xPos, yPos + localHeight, zPos)) { this.setBlockAndMetadata(world, xPos, yPos + localHeight, zPos, TRepo.slimeGel, this.metaWood); diff --git a/src/main/java/tconstruct/worldgen/village/ComponentSmeltery.java b/src/main/java/tconstruct/worldgen/village/ComponentSmeltery.java index 39052d12829..10045db1999 100644 --- a/src/main/java/tconstruct/worldgen/village/ComponentSmeltery.java +++ b/src/main/java/tconstruct/worldgen/village/ComponentSmeltery.java @@ -16,6 +16,7 @@ import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraft.world.gen.structure.StructureVillagePieces.Start; + public class ComponentSmeltery extends StructureVillagePieces.House1 { private int averageGroundLevel = -1; @@ -127,13 +128,13 @@ protected void fillWithMetaBlocks (World par1World, StructureBoundingBox par2Str protected void func_143012_a (NBTTagCompound var1) { // TODO Auto-generated method stub - + } @Override protected void func_143011_b (NBTTagCompound var1) { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tconstruct/worldgen/village/ComponentToolWorkshop.java b/src/main/java/tconstruct/worldgen/village/ComponentToolWorkshop.java index f1f643e42b2..d3b425e0018 100644 --- a/src/main/java/tconstruct/worldgen/village/ComponentToolWorkshop.java +++ b/src/main/java/tconstruct/worldgen/village/ComponentToolWorkshop.java @@ -17,7 +17,6 @@ import net.minecraft.world.gen.structure.StructureVillagePieces.Start; import net.minecraft.world.gen.structure.MapGenStructureIO; - public class ComponentToolWorkshop extends StructureVillagePieces.House1 { private int averageGroundLevel = -1; @@ -129,7 +128,7 @@ public boolean addComponentParts (World world, Random random, StructureBoundingB //this.placeBlockAtCurrentPosition(world, TRepo.toolStationWood, 5, 1, 1, 2, sbb); this.placeBlockAtCurrentPosition(world, TRepo.toolStationWood, 1, 1, 1, 3, sbb); this.generateStructureCraftingStationContents(world, sbb, random, 1, 1, 4, TRepo.tinkerHouseChest.getItems(random), TRepo.tinkerHouseChest.getCount(random)); - // this.placeBlockAtCurrentPosition(world, TRepo.craftingStationWood, 0, 1, 1, 4, sbb); + // this.placeBlockAtCurrentPosition(world, TRepo.craftingStationWood, 0, 1, 1, 4, sbb); this.placeBlockAtCurrentPosition(world, TRepo.toolStationWood, 10, 1, 1, 5, sbb); //ChestGenHooks info = ChestGenHooks.getInfo("TinkerHouse"); @@ -176,6 +175,7 @@ protected boolean generateStructureCraftingStationContents (World world, Structu return false; } } + protected boolean generateStructurePatternChestContents (World world, StructureBoundingBox par2StructureBoundingBox, Random random, int x, int y, int z, WeightedRandomChestContent[] content, int par8) { diff --git a/src/main/java/tconstruct/worldgen/village/VillageSmelteryHandler.java b/src/main/java/tconstruct/worldgen/village/VillageSmelteryHandler.java index 628b17d8c53..174ae81f76f 100644 --- a/src/main/java/tconstruct/worldgen/village/VillageSmelteryHandler.java +++ b/src/main/java/tconstruct/worldgen/village/VillageSmelteryHandler.java @@ -22,7 +22,6 @@ public Class getComponentClass () return ComponentSmeltery.class; } - @Override public Object buildComponent (PieceWeight villagePiece, Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { diff --git a/src/main/java/tconstruct/worldgen/village/VillageToolStationHandler.java b/src/main/java/tconstruct/worldgen/village/VillageToolStationHandler.java index 46d7c517f7f..32749f8af38 100644 --- a/src/main/java/tconstruct/worldgen/village/VillageToolStationHandler.java +++ b/src/main/java/tconstruct/worldgen/village/VillageToolStationHandler.java @@ -24,7 +24,6 @@ public Class getComponentClass () return ComponentToolWorkshop.class; } - @Override public Object buildComponent (PieceWeight villagePiece, Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) {