From 9f4323bb0d0559dcd5b88f04a9f1b5232572dfed Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 2 Oct 2015 16:48:01 +0200 Subject: [PATCH] cleanup --- .../actuallyadditions/ActuallyAdditions.java | 1 + .../achievement/TheAchievements.java | 2 +- .../blocks/BlockBreaker.java | 10 ++- .../blocks/BlockCanolaPress.java | 8 +- .../blocks/BlockCoalGenerator.java | 14 +-- .../blocks/BlockCoffeeMachine.java | 4 +- .../blocks/BlockColoredLamp.java | 12 +-- .../blocks/BlockCompost.java | 22 +++-- .../blocks/BlockContainerBase.java | 4 +- .../blocks/BlockDropper.java | 10 ++- .../blocks/BlockEnergizer.java | 14 +-- .../actuallyadditions/blocks/BlockFeeder.java | 8 +- .../blocks/BlockFermentingBarrel.java | 8 +- .../blocks/BlockFluidCollector.java | 10 ++- .../blocks/BlockFluidFlowing.java | 4 +- .../blocks/BlockFurnaceDouble.java | 54 +++++------ .../blocks/BlockGeneric.java | 2 +- .../blocks/BlockGiantChest.java | 11 ++- .../blocks/BlockGreenhouseGlass.java | 2 +- .../blocks/BlockGrinder.java | 22 ++--- .../blocks/BlockHeatCollector.java | 6 +- .../blocks/BlockInputter.java | 8 +- .../blocks/BlockItemRepairer.java | 10 ++- .../blocks/BlockLampPowerer.java | 4 +- .../blocks/BlockLavaFactoryController.java | 6 +- .../actuallyadditions/blocks/BlockMisc.java | 6 +- .../blocks/BlockOilGenerator.java | 14 +-- .../blocks/BlockOreMagnet.java | 3 +- .../blocks/BlockPhantom.java | 20 +++-- .../actuallyadditions/blocks/BlockPlant.java | 10 ++- .../actuallyadditions/blocks/BlockSlabs.java | 4 +- .../blocks/BlockSmileyCloud.java | 8 +- .../blocks/BlockTreasureChest.java | 22 ++--- .../blocks/BlockWildPlant.java | 6 +- .../blocks/BlockXPSolidifier.java | 3 +- .../blocks/render/RenderItems.java | 4 +- .../booklet/page/PageFurnace.java | 1 + .../communication/InterModCommunications.java | 16 +++- .../config/ConfigurationHandler.java | 2 +- .../config/values/ConfigCrafting.java | 2 +- .../config/values/ConfigIntValues.java | 4 +- .../crafting/CrusherCrafting.java | 44 ++++++--- .../crafting/InitCrafting.java | 2 +- .../crafting/ToolCrafting.java | 2 +- .../creative/CreativeTab.java | 4 +- .../event/EntityLivingEvent.java | 2 +- .../event/LivingDropEvent.java | 4 +- .../gadget/ModelStandardBlock.java | 2 +- .../gadget/cloud/SmileyCloudEasterEggs.java | 19 ++++ .../ellpeck/actuallyadditions/gen/OreGen.java | 16 ++-- .../gen/VillageComponentCustomCropField.java | 14 +-- .../gen/VillageComponentJamHouse.java | 4 +- .../inventory/ContainerBreaker.java | 29 +++--- .../inventory/ContainerCanolaPress.java | 26 +++--- .../inventory/ContainerCoalGenerator.java | 24 +++-- .../inventory/ContainerCoffeeMachine.java | 42 +++++---- .../inventory/ContainerCrafter.java | 36 +++++--- .../inventory/ContainerDrill.java | 38 +++++--- .../inventory/ContainerDropper.java | 29 +++--- .../inventory/ContainerEnergizer.java | 28 +++--- .../inventory/ContainerEnervator.java | 28 +++--- .../inventory/ContainerFeeder.java | 25 +++--- .../inventory/ContainerFermentingBarrel.java | 26 +++--- .../inventory/ContainerFluidCollector.java | 26 +++--- .../inventory/ContainerFurnaceDouble.java | 30 ++++--- .../inventory/ContainerGiantChest.java | 31 ++++--- .../inventory/ContainerGrinder.java | 34 ++++--- .../inventory/ContainerInputter.java | 15 +++- .../inventory/ContainerOilGenerator.java | 26 +++--- .../inventory/ContainerOreMagnet.java | 30 ++++--- .../inventory/ContainerPhantomPlacer.java | 25 +++--- .../inventory/ContainerRepairer.java | 30 ++++--- .../inventory/ContainerXPSolidifier.java | 16 ++-- .../inventory/gui/GuiCanolaPress.java | 10 +-- .../inventory/gui/GuiCoalGenerator.java | 2 +- .../inventory/gui/GuiCoffeeMachine.java | 6 +- .../inventory/gui/GuiEnergizer.java | 2 +- .../inventory/gui/GuiEnervator.java | 2 +- .../inventory/gui/GuiFeeder.java | 6 +- .../inventory/gui/GuiFermentingBarrel.java | 8 +- .../inventory/gui/GuiFluidCollector.java | 2 +- .../inventory/gui/GuiFurnaceDouble.java | 4 +- .../inventory/gui/GuiGrinder.java | 6 +- .../inventory/gui/GuiInputter.java | 12 ++- .../inventory/gui/GuiOilGenerator.java | 4 +- .../inventory/gui/GuiOreMagnet.java | 4 +- .../inventory/gui/GuiRepairer.java | 2 +- .../inventory/gui/GuiSmileyCloud.java | 4 +- .../inventory/slot/SlotFilter.java | 1 + .../items/InitForeignPaxels.java | 8 +- .../actuallyadditions/items/InitItems.java | 2 +- .../actuallyadditions/items/ItemArmorAA.java | 2 +- .../actuallyadditions/items/ItemBattery.java | 2 +- .../actuallyadditions/items/ItemBooklet.java | 2 +- .../actuallyadditions/items/ItemBucketAA.java | 2 +- .../items/ItemCoffeeBean.java | 2 +- .../items/ItemCrafterOnAStick.java | 6 +- .../actuallyadditions/items/ItemDrill.java | 89 +++++++++++++------ .../items/ItemDrillUpgrade.java | 2 +- .../actuallyadditions/items/ItemDust.java | 4 +- .../items/ItemFertilizer.java | 2 +- .../actuallyadditions/items/ItemFoods.java | 6 +- .../items/ItemGrowthRing.java | 6 +- .../items/ItemHairyBall.java | 4 +- .../actuallyadditions/items/ItemJams.java | 8 +- .../actuallyadditions/items/ItemKnife.java | 4 +- .../items/ItemLeafBlower.java | 17 ++-- .../actuallyadditions/items/ItemMisc.java | 4 +- .../items/ItemPhantomConnector.java | 2 +- .../items/ItemPotionRing.java | 7 +- .../items/ItemResonantRice.java | 2 +- .../actuallyadditions/items/ItemSeed.java | 2 +- .../items/ItemSpecialDrop.java | 4 +- .../items/ItemTeleStaff.java | 10 ++- .../items/ItemWingsOfTheBats.java | 9 +- .../items/tools/ItemAllToolAA.java | 18 ++-- .../items/tools/ItemAxeAA.java | 2 +- .../items/tools/ItemHoeAA.java | 2 +- .../items/tools/ItemPickaxeAA.java | 2 +- .../items/tools/ItemShovelAA.java | 2 +- .../items/tools/ItemSwordAA.java | 2 +- .../nei/NEIActuallyAdditionsConfig.java | 2 +- .../network/gui/IButtonReactor.java | 3 +- .../network/gui/INumberReactor.java | 3 +- .../network/gui/IStringReactor.java | 3 +- .../network/sync/IPacketSyncerToClient.java | 1 + .../recipe/CrusherRecipeAutoRegistry.java | 2 +- .../tile/TileEntityBase.java | 62 ++++++------- .../tile/TileEntityBreaker.java | 10 ++- .../tile/TileEntityCanolaPress.java | 14 +-- .../tile/TileEntityCoalGenerator.java | 15 ++-- .../tile/TileEntityCoffeeMachine.java | 20 +++-- .../tile/TileEntityCompost.java | 10 ++- .../tile/TileEntityDropper.java | 4 +- .../tile/TileEntityEnergizer.java | 2 +- .../tile/TileEntityEnervator.java | 2 +- .../tile/TileEntityFeeder.java | 27 +++--- .../tile/TileEntityFermentingBarrel.java | 22 +++-- .../tile/TileEntityFishingNet.java | 12 +-- .../tile/TileEntityFluidCollector.java | 34 ++++--- .../tile/TileEntityFurnaceDouble.java | 36 +++++--- .../tile/TileEntityGreenhouseGlass.java | 8 +- .../tile/TileEntityGrinder.java | 46 +++++++--- .../tile/TileEntityInputter.java | 78 +++++++++++----- .../tile/TileEntityInventoryBase.java | 12 +-- .../tile/TileEntityItemRepairer.java | 10 ++- .../tile/TileEntityLavaFactoryController.java | 4 +- .../tile/TileEntityOilGenerator.java | 17 ++-- .../tile/TileEntityOreMagnet.java | 12 ++- .../tile/TileEntityPhantomPlacer.java | 8 +- .../tile/TileEntityPhantomface.java | 8 +- .../tile/TileEntitySmileyCloud.java | 4 +- .../tile/TileEntityXPSolidifier.java | 15 +++- .../update/ThreadUpdateChecker.java | 2 +- .../update/UpdateCheckerClientNotifier.java | 2 +- .../actuallyadditions/util/AssetUtil.java | 4 +- .../util/FakePlayerUtil.java | 4 +- .../actuallyadditions/util/StringUtil.java | 10 ++- .../actuallyadditions/util/WorldUtil.java | 26 ++++-- 159 files changed, 1234 insertions(+), 719 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java index aed36b96a..d981ef93e 100644 --- a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java +++ b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java @@ -43,6 +43,7 @@ import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.update.UpdateChecker; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.Util; + // So that BuildCraft Oil always gets used @Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, dependencies = "after:BuildCraft|Energy", canBeDeactivated = false, guiFactory = "ellpeck.actuallyadditions.config.GuiFactory") public class ActuallyAdditions{ diff --git a/src/main/java/ellpeck/actuallyadditions/achievement/TheAchievements.java b/src/main/java/ellpeck/actuallyadditions/achievement/TheAchievements.java index 515d38ab3..f40e3afa1 100644 --- a/src/main/java/ellpeck/actuallyadditions/achievement/TheAchievements.java +++ b/src/main/java/ellpeck/actuallyadditions/achievement/TheAchievements.java @@ -50,7 +50,7 @@ public enum TheAchievements{ public final int type; TheAchievements(String name, int x, int y, ItemStack displayStack, Achievement hasToHaveBefore, int type){ - this.ach = new Achievement("achievement." + ModUtil.MOD_ID_LOWER + "." + name, ModUtil.MOD_ID_LOWER + "." + name, x, y, displayStack, hasToHaveBefore); + this.ach = new Achievement("achievement."+ModUtil.MOD_ID_LOWER+"."+name, ModUtil.MOD_ID_LOWER+"."+name, x, y, displayStack, hasToHaveBefore); if(hasToHaveBefore == null) this.ach.initIndependentStat(); this.ach.registerStat(); this.type = type; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java index 1ddedc42f..453f947a5 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockBreaker.java @@ -76,16 +76,18 @@ public class BlockBreaker extends BlockContainerBase implements IActAddItemOrBlo @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityBreaker breaker = (TileEntityBreaker)world.getTileEntity(x, y, z); - if (breaker != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BREAKER.ordinal(), world, x, y, z); + if(breaker != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.BREAKER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java index d5ff90fc9..a0f1ce726 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCanolaPress.java @@ -53,15 +53,17 @@ public class BlockCanolaPress extends BlockContainerBase implements IActAddItemO @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityCanolaPress press = (TileEntityCanolaPress)world.getTileEntity(x, y, z); - if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, x, y, z); + if(press != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CANOLA_PRESS.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java index 538efa0a3..b917920c6 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoalGenerator.java @@ -49,9 +49,9 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte public void randomDisplayTick(World world, int x, int y, int z, Random rand){ int meta = world.getBlockMetadata(x, y, z); - if (meta == 1){ + if(meta == 1){ for(int i = 0; i < 5; i++){ - world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); } } } @@ -69,16 +69,18 @@ public class BlockCoalGenerator extends BlockContainerBase implements IActAddIte @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityCoalGenerator press = (TileEntityCoalGenerator)world.getTileEntity(x, y, z); - if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COAL_GENERATOR.ordinal(), world, x, y, z); + if(press != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COAL_GENERATOR.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java index b8fb3c490..20e495dc7 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCoffeeMachine.java @@ -58,7 +58,9 @@ public class BlockCoffeeMachine extends BlockContainerBase implements IActAddIte public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int f6, float f7, float f8, float f9){ if(!world.isRemote){ TileEntityCoffeeMachine machine = (TileEntityCoffeeMachine)world.getTileEntity(x, y, z); - if (machine != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z); + if(machine != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.COFFEE_MACHINE.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java index ac0713044..a7dd1015e 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockColoredLamp.java @@ -74,7 +74,9 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{ if(world.getBlockMetadata(x, y, z) != color.ordinal()){ if(!world.isRemote){ world.setBlockMetadataWithNotify(x, y, z, color.ordinal(), 2); - if(!player.capabilities.isCreativeMode) player.inventory.decrStackSize(player.inventory.currentItem, 1); + if(!player.capabilities.isCreativeMode){ + player.inventory.decrStackSize(player.inventory.currentItem, 1); + } } return true; } @@ -98,7 +100,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{ @SuppressWarnings("all") @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for (int j = 0; j < allLampTypes.length; j++){ + for(int j = 0; j < allLampTypes.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -128,7 +130,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ for(int i = 0; i < allLampTypes.length; i++){ - this.textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + ((IActAddItemOrBlock)InitBlocks.blockColoredLamp).getName() + allLampTypes[i].name + (isOn ? "On" : "")); + this.textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+((IActAddItemOrBlock)InitBlocks.blockColoredLamp).getName()+allLampTypes[i].name+(isOn ? "On" : "")); } } @@ -150,7 +152,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return InitBlocks.blockColoredLamp.getUnlocalizedName() + allLampTypes[stack.getItemDamage()].getName(); + return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].getName(); } @Override @@ -161,7 +163,7 @@ public class BlockColoredLamp extends Block implements IActAddItemOrBlock{ @Override public String getItemStackDisplayName(ItemStack stack){ if(stack.getItemDamage() >= allLampTypes.length) return null; - return StringUtil.localize(this.getUnlocalizedName(stack)+".name") + (((BlockColoredLamp)this.theBlock).isOn ? " (" + StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc") + ")" : ""); + return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.theBlock).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".onSuffix.desc")+")" : ""); } } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java index 0e467ac91..e0f4505a5 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java @@ -54,15 +54,23 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo TileEntityCompost tile = (TileEntityCompost)world.getTileEntity(x, y, z); //Add items to be composted if(stackPlayer != null && stackPlayer.getItem() instanceof ItemMisc && stackPlayer.getItemDamage() == TheMiscItems.MASHED_FOOD.ordinal() && (tile.slots[0] == null || (!(tile.slots[0].getItem() instanceof ItemFertilizer) && tile.slots[0].stackSize < ConfigIntValues.COMPOST_AMOUNT.getValue()))){ - if(tile.slots[0] == null) tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal()); - else tile.slots[0].stackSize++; + if(tile.slots[0] == null){ + tile.slots[0] = new ItemStack(stackPlayer.getItem(), 1, TheMiscItems.MASHED_FOOD.ordinal()); + } + else{ + tile.slots[0].stackSize++; + } if(!player.capabilities.isCreativeMode) player.inventory.getCurrentItem().stackSize--; } //Add Fertilizer to player's inventory - else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize() - tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){ - if(stackPlayer == null) player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy()); - else player.getCurrentEquippedItem().stackSize+=tile.slots[0].stackSize; + else if(tile.slots[0] != null && (stackPlayer == null || (stackPlayer.getItem() instanceof ItemFertilizer && stackPlayer.stackSize <= stackPlayer.getMaxStackSize()-tile.slots[0].stackSize)) && tile.slots[0].getItem() instanceof ItemFertilizer){ + if(stackPlayer == null){ + player.inventory.setInventorySlotContents(player.inventory.currentItem, tile.slots[0].copy()); + } + else{ + player.getCurrentEquippedItem().stackSize += tile.slots[0].stackSize; + } tile.slots[0] = null; } } @@ -78,9 +86,9 @@ public class BlockCompost extends BlockContainerBase implements IActAddItemOrBlo super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); - this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setBlockBounds(1.0F-f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); - this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + this.setBlockBounds(0.0F, 0.0F, 1.0F-f, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(world, x, y, z, mask, list, collidingEntity); this.setBlockBoundsForItemRender(); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java index 461354d82..af03a234a 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockContainerBase.java @@ -51,7 +51,9 @@ public abstract class BlockContainerBase extends BlockContainer{ float dY = rand.nextFloat()*0.8F+0.1F; float dZ = rand.nextFloat()*0.8F+0.1F; EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, stack.copy()); - if(stack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); + if(stack.hasTagCompound()){ + entityItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy()); + } float factor = 0.05F; entityItem.motionX = rand.nextGaussian()*factor; entityItem.motionY = rand.nextGaussian()*factor+0.2F; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java index 84170982e..0efb596a8 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockDropper.java @@ -73,16 +73,18 @@ public class BlockDropper extends BlockContainerBase implements IActAddItemOrBlo @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityDropper dropper = (TileEntityDropper)world.getTileEntity(x, y, z); - if (dropper != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DROPPER.ordinal(), world, x, y, z); + if(dropper != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.DROPPER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockEnergizer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockEnergizer.java index 759e0de13..db9e0f3f1 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockEnergizer.java @@ -57,9 +57,9 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.sideIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side"); } @Override @@ -67,11 +67,15 @@ public class BlockEnergizer extends BlockContainerBase implements IActAddItemOrB if(!world.isRemote){ if(this.isEnergizer){ TileEntityEnergizer energizer = (TileEntityEnergizer)world.getTileEntity(x, y, z); - if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERGIZER.ordinal(), world, x, y, z); + if(energizer != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERGIZER.ordinal(), world, x, y, z); + } } else{ TileEntityEnervator energizer = (TileEntityEnervator)world.getTileEntity(x, y, z); - if(energizer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERVATOR.ordinal(), world, x, y, z); + if(energizer != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ENERVATOR.ordinal(), world, x, y, z); + } } return true; } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java index 90f691e66..b8ba5a4ac 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java @@ -53,15 +53,17 @@ public class BlockFeeder extends BlockContainerBase implements IActAddItemOrBloc @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFeeder feeder = (TileEntityFeeder)world.getTileEntity(x, y, z); - if (feeder != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FEEDER.ordinal(), world, x, y, z); + if(feeder != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FEEDER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java index ec1361064..a02000345 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFermentingBarrel.java @@ -49,7 +49,9 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFermentingBarrel press = (TileEntityFermentingBarrel)world.getTileEntity(x, y, z); - if (press != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, x, y, z); + if(press != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FERMENTING_BARREL.ordinal(), world, x, y, z); + } return true; } return true; @@ -69,8 +71,8 @@ public class BlockFermentingBarrel extends BlockContainerBase implements IActAdd @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.iconTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.iconTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java index ef28a7bd7..c848e44ef 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidCollector.java @@ -76,16 +76,18 @@ public class BlockFluidCollector extends BlockContainerBase implements IActAddIt @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFluidCollector collector = (TileEntityFluidCollector)world.getTileEntity(x, y, z); - if (collector != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, x, y, z); + if(collector != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FLUID_COLLECTOR.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java index b8061ac62..1a997511b 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFluidFlowing.java @@ -58,8 +58,8 @@ public class BlockFluidFlowing extends BlockFluidClassic implements IActAddItemO @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.stillIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Still"); - this.flowingIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Flowing"); + this.stillIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Still"); + this.flowingIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Flowing"); this.definedFluid.setIcons(this.stillIcon, this.flowingIcon); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java index da851e37b..f2efe0d79 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java @@ -50,12 +50,12 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){ - int rotation = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; - if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); - if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); - if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); - if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); + if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); + if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); + if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); + if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); } @Override @@ -79,7 +79,9 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){ int meta = world.getBlockMetadata(x, y, z); if(side == 1) return this.topIcon; - if(side == meta+2 && meta <= 3) return this.frontIcon; + if(side == meta+2 && meta <= 3){ + return this.frontIcon; + } else if(side == meta-2 && meta > 3) return this.onIcon; return this.blockIcon; } @@ -87,17 +89,19 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "On"); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"On"); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityFurnaceDouble furnace = (TileEntityFurnaceDouble)world.getTileEntity(x, y, z); - if (furnace != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z); + if(furnace != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.FURNACE_DOUBLE.ordinal(), world, x, y, z); + } return true; } return true; @@ -108,32 +112,32 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IActAddIte public void randomDisplayTick(World world, int x, int y, int z, Random rand){ int meta = world.getBlockMetadata(x, y, z); - if (meta > 3){ - float f = (float)x + 0.5F; - float f1 = (float)y + 0.0F + rand.nextFloat() * 6.0F / 16.0F; - float f2 = (float)z + 0.5F; + if(meta > 3){ + float f = (float)x+0.5F; + float f1 = (float)y+0.0F+rand.nextFloat()*6.0F/16.0F; + float f2 = (float)z+0.5F; float f3 = 0.52F; - float f4 = rand.nextFloat() * 0.6F - 0.3F; + float f4 = rand.nextFloat()*0.6F-0.3F; if(meta == 6){ - world.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)(f-f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", (double)(f-f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D); } if(meta == 7){ - world.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)(f+f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", (double)(f+f3), (double)f1, (double)(f2+f4), 0.0D, 0.0D, 0.0D); } if(meta == 4){ - world.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)(f+f4), (double)f1, (double)(f2-f3), 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", (double)(f+f4), (double)f1, (double)(f2-f3), 0.0D, 0.0D, 0.0D); } if(meta == 5){ - world.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)(f+f4), (double)f1, (double)(f2+f3), 0.0D, 0.0D, 0.0D); + world.spawnParticle("flame", (double)(f+f4), (double)f1, (double)(f2+f3), 0.0D, 0.0D, 0.0D); } for(int i = 0; i < 5; i++){ - world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGeneric.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGeneric.java index c21213594..061fc600a 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGeneric.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGeneric.java @@ -48,7 +48,7 @@ public class BlockGeneric extends Block implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } public static class TheItemBlock extends ItemBlock{ diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java index b2d2c1eec..6aa3979a4 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java @@ -54,16 +54,18 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityGiantChest chest = (TileEntityGiantChest)world.getTileEntity(x, y, z); - if (chest != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.GIANT_CHEST.ordinal(), world, x, y, z); + if(chest != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.GIANT_CHEST.ordinal(), world, x, y, z); + } return true; } return true; @@ -100,6 +102,7 @@ public class BlockGiantChest extends BlockContainerBase implements IActAddItemOr public String getUnlocalizedName(ItemStack stack){ return this.getUnlocalizedName(); } + @Override public int getMetadata(int damage){ return damage; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java index a232cf7c6..f199c397f 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGreenhouseGlass.java @@ -66,7 +66,7 @@ public class BlockGreenhouseGlass extends BlockContainerBase implements IActAddI @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java index 59108ccd6..98c327546 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java @@ -72,30 +72,32 @@ public class BlockGrinder extends BlockContainerBase implements IActAddItemOrBlo public void randomDisplayTick(World world, int x, int y, int z, Random rand){ int meta = world.getBlockMetadata(x, y, z); - if (meta == 1){ + if(meta == 1){ for(int i = 0; i < 5; i++){ - double xRand = new Random().nextDouble()/0.75D - 0.5D; - double zRand = new Random().nextDouble()/0.75D - 0.5D; - world.spawnParticle("crit", (double)x+0.4F, (double)y + 0.8F, (double)z+0.4F, xRand, 0.5D, zRand); + double xRand = new Random().nextDouble()/0.75D-0.5D; + double zRand = new Random().nextDouble()/0.75D-0.5D; + world.spawnParticle("crit", (double)x+0.4F, (double)y+0.8F, (double)z+0.4F, xRand, 0.5D, zRand); } - world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); } } @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderTop"); - this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderOn"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":blockGrinderBottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderTop"); + this.onIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderOn"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockGrinderBottom"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityGrinder grinder = (TileEntityGrinder)world.getTileEntity(x, y, z); - if (grinder != null) player.openGui(ActuallyAdditions.instance, this.isDouble ? GuiHandler.GuiTypes.GRINDER_DOUBLE.ordinal() : GuiHandler.GuiTypes.GRINDER.ordinal(), world, x, y, z); + if(grinder != null){ + player.openGui(ActuallyAdditions.instance, this.isDouble ? GuiHandler.GuiTypes.GRINDER_DOUBLE.ordinal() : GuiHandler.GuiTypes.GRINDER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java index 1a2195264..a7fe3a197 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java @@ -51,9 +51,9 @@ public class BlockHeatCollector extends BlockContainerBase implements IActAddIte @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Side"); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Side"); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java index f86701477..6cd24ccaa 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java @@ -61,14 +61,16 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z); - if (inputter != null) player.openGui(ActuallyAdditions.instance, this.isAdvanced ? GuiHandler.GuiTypes.INPUTTER_ADVANCED.ordinal() : GuiHandler.GuiTypes.INPUTTER.ordinal(), world, x, y, z); + if(inputter != null){ + player.openGui(ActuallyAdditions.instance, this.isAdvanced ? GuiHandler.GuiTypes.INPUTTER_ADVANCED.ordinal() : GuiHandler.GuiTypes.INPUTTER.ordinal(), world, x, y, z); + } return true; } return true; @@ -120,7 +122,7 @@ public class BlockInputter extends BlockContainerBase implements IActAddItemOrBl this.toPick = rand.nextInt(NAME_FLAVOUR_AMOUNTS)+1; } - return StringUtil.localize(this.getUnlocalizedName()+".name") + " (" + StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name") + ")"; + return StringUtil.localize(this.getUnlocalizedName()+".name")+" ("+StringUtil.localize("tile."+ModUtil.MOD_ID_LOWER+".blockInputter.add."+this.toPick+".name")+")"; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java index feacc036d..6a3a59617 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java @@ -63,16 +63,18 @@ public class BlockItemRepairer extends BlockContainerBase implements IActAddItem @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityItemRepairer repairer = (TileEntityItemRepairer)world.getTileEntity(x, y, z); - if (repairer != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.REPAIRER.ordinal(), world, x, y, z); + if(repairer != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.REPAIRER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLampPowerer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLampPowerer.java index 917b246b6..4880f30b5 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLampPowerer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLampPowerer.java @@ -96,8 +96,8 @@ public class BlockLampPowerer extends Block implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); } public static class TheItemBlock extends ItemBlock{ diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java index 8e79e6256..35a08e3f4 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLavaFactoryController.java @@ -53,8 +53,8 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); } @Override @@ -69,7 +69,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IA if(state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA){ player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".factory.works.desc"))); } - player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored() + "/" + factory.storage.getMaxEnergyStored() + " RF")); + player.addChatComponentMessage(new ChatComponentText(factory.storage.getEnergyStored()+"/"+factory.storage.getMaxEnergyStored()+" RF")); } return true; } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java index ff184ee65..561e5a23d 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java @@ -42,7 +42,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{ @SuppressWarnings("all") @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for (int j = 0; j < allMiscBlocks.length; j++){ + for(int j = 0; j < allMiscBlocks.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -61,7 +61,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ for(int i = 0; i < textures.length; i++){ - textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allMiscBlocks[i].getName()); + textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allMiscBlocks[i].getName()); } } @@ -88,7 +88,7 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allMiscBlocks.length ? " ERROR!" : allMiscBlocks[stack.getItemDamage()].getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java index a644b80ab..6dcbc0349 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOilGenerator.java @@ -49,9 +49,9 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem public void randomDisplayTick(World world, int x, int y, int z, Random rand){ int meta = world.getBlockMetadata(x, y, z); - if (meta == 1){ + if(meta == 1){ for(int i = 0; i < 5; i++){ - world.spawnParticle("smoke", (double)x+0.5F, (double)y + 1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); + world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); } } } @@ -69,16 +69,18 @@ public class BlockOilGenerator extends BlockContainerBase implements IActAddItem @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityOilGenerator generator = (TileEntityOilGenerator)world.getTileEntity(x, y, z); - if (generator != null) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, x, y, z); + if(generator != null){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.OIL_GENERATOR.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java index 62f60a486..d92a1e062 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockOreMagnet.java @@ -63,8 +63,9 @@ public class BlockOreMagnet extends BlockContainerBase implements IActAddItemOrB public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityOreMagnet magnet = (TileEntityOreMagnet)world.getTileEntity(x, y, z); - if(magnet != null) + if(magnet != null){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.ORE_MAGNET.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantom.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantom.java index e0ce7f89e..b8c6b42fe 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantom.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPhantom.java @@ -77,19 +77,27 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo if(tile instanceof IPhantomTile){ IPhantomTile phantom = (IPhantomTile)tile; if(player.isSneaking() || phantom.getGuiID() == -1){ - player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc") + ": " + phantom.getRange())); + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".blockPhantomRange.desc")+": "+phantom.getRange())); if(phantom.hasBoundPosition()){ int distance = (int)Vec3.createVectorHelper(x, y, z).distanceTo(Vec3.createVectorHelper(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())); Item item = phantom.getBoundPosition().getItemBlock(); String name = item == null ? "Absolutely Nothing" : item.getItemStackDisplayName(new ItemStack(phantom.getBoundPosition().getBlock(), 1, phantom.getBoundPosition().getMetadata())); player.addChatComponentMessage(new ChatComponentText(StringUtil.localizeFormatted("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance))); - if(phantom.isBoundThingInRange()) player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); - else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); + if(phantom.isBoundThingInRange()){ + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedRange.desc"))); + } + else{ + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.connectedNoRange.desc"))); + } + } + else{ + player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); } - else player.addChatComponentMessage(new ChatComponentText(StringUtil.localize("tooltip."+ModUtil.MOD_ID_LOWER+".phantom.notConnected.desc"))); } - else player.openGui(ActuallyAdditions.instance, phantom.getGuiID(), world, x, y, z); + else{ + player.openGui(ActuallyAdditions.instance, phantom.getGuiID(), world, x, y, z); + } } } } @@ -120,7 +128,7 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java index 7937e1f1d..8e1644718 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockPlant.java @@ -59,10 +59,12 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta){ if(meta < 7){ - if (meta == 6) meta = 5; + if(meta == 6) meta = 5; return this.textures[meta >> 1]; } - else return this.textures[this.textures.length-1]; + else{ + return this.textures[this.textures.length-1]; + } } @Override @@ -93,8 +95,8 @@ public class BlockPlant extends BlockCrops implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - for (int i = 0; i < this.textures.length; i++){ - textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Stage" + (i+1)); + for(int i = 0; i < this.textures.length; i++){ + textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Stage"+(i+1)); } } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java index 3e3d2f1f8..7b2f7dff0 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSlabs.java @@ -62,8 +62,8 @@ public class BlockSlabs extends Block implements IActAddItemOrBlock{ @Override public int onBlockPlaced(World par1World, int blockX, int blockY, int blockZ, int side, float hitX, float hitY, float hitZ, int meta){ - if (side == 1) return meta; - if (side == 0 || hitY >= 0.5F) return meta+1; + if(side == 1) return meta; + if(side == 0 || hitY >= 0.5F) return meta+1; return meta; } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java index 56f68591e..5f6faece1 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockSmileyCloud.java @@ -80,10 +80,10 @@ public class BlockSmileyCloud extends BlockContainerBase implements IActAddItemO public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){ int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; - if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2); - if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 2); - if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2); - if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 3, 2); + if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2); + if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 1, 2); + if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 0, 2); + if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 3, 2); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockTreasureChest.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockTreasureChest.java index 89b102fe0..f79d70d4f 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockTreasureChest.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockTreasureChest.java @@ -57,12 +57,12 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{ @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack){ - int rotation = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; - if (rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); - if (rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); - if (rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); - if (rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); + if(rotation == 0) world.setBlockMetadataWithNotify(x, y, z, 0, 2); + if(rotation == 1) world.setBlockMetadataWithNotify(x, y, z, 3, 2); + if(rotation == 2) world.setBlockMetadataWithNotify(x, y, z, 1, 2); + if(rotation == 3) world.setBlockMetadataWithNotify(x, y, z, 2, 2); } @Override @@ -90,10 +90,10 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); - this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); - this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Front"); + this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Bottom"); + this.frontIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Front"); } @Override @@ -118,7 +118,9 @@ public class BlockTreasureChest extends Block implements IActAddItemOrBlock{ float dY = rand.nextFloat()*0.8F+0.1F; float dZ = rand.nextFloat()*0.8F+0.1F; EntityItem entityItem = new EntityItem(world, x+dX, y+dY, z+dZ, itemStack.copy()); - if(itemStack.hasTagCompound()) entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy()); + if(itemStack.hasTagCompound()){ + entityItem.getEntityItem().setTagCompound((NBTTagCompound)itemStack.getTagCompound().copy()); + } float factor = 0.05F; entityItem.motionX = rand.nextGaussian()*factor; entityItem.motionY = rand.nextGaussian()*factor+0.2F; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockWildPlant.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockWildPlant.java index 645431e36..98aeaa6df 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockWildPlant.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockWildPlant.java @@ -41,7 +41,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{ @Override public boolean canBlockStay(World world, int x, int y, int z){ - return world.getBlockMetadata(x, y, z) == TheWildPlants.RICE.ordinal() ? world.getBlock(x, y-1, z).getMaterial() == Material.water : world.getBlock(x, y - 1, z).canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, this); + return world.getBlockMetadata(x, y, z) == TheWildPlants.RICE.ordinal() ? world.getBlock(x, y-1, z).getMaterial() == Material.water : world.getBlock(x, y-1, z).canSustainPlant(world, x, y-1, z, ForgeDirection.UP, this); } @Override @@ -52,7 +52,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{ @SuppressWarnings("all") @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for (int j = 0; j < allWildPlants.length; j++){ + for(int j = 0; j < allWildPlants.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -103,7 +103,7 @@ public class BlockWildPlant extends BlockBush implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allWildPlants.length ? " ERROR!" : allWildPlants[stack.getItemDamage()].getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockXPSolidifier.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockXPSolidifier.java index 8b7cd9c55..d2f63c50f 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockXPSolidifier.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockXPSolidifier.java @@ -89,8 +89,9 @@ public class BlockXPSolidifier extends BlockContainerBase implements IActAddItem public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityXPSolidifier solidifier = (TileEntityXPSolidifier)world.getTileEntity(x, y, z); - if(solidifier != null) + if(solidifier != null){ player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.XP_SOLIDIFIER.ordinal(), world, x, y, z); + } return true; } return true; diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderItems.java b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderItems.java index 95d5daa30..266c1de80 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderItems.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/render/RenderItems.java @@ -24,7 +24,7 @@ public class RenderItems implements IItemRenderer{ public RenderItems(ModelBaseAA model){ this.theModel = model; - this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/" + this.theModel.getName() + ".png"); + this.theTexture = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/blocks/models/"+this.theModel.getName()+".png"); } @Override @@ -42,7 +42,7 @@ public class RenderItems implements IItemRenderer{ switch(type){ case INVENTORY: GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-0.5F, -1.27F, 0.5F); GL11.glRotatef(180F, 0F, 1F, 0F); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java index ef6675679..a9e06d666 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java @@ -32,6 +32,7 @@ public class PageFurnace extends BookletPage{ this.input = input; InitBooklet.pagesWithItemStackData.add(this); } + public PageFurnace(int id, ItemStack result){ this(id, null, result); } diff --git a/src/main/java/ellpeck/actuallyadditions/communication/InterModCommunications.java b/src/main/java/ellpeck/actuallyadditions/communication/InterModCommunications.java index 0ff3de499..7ed2bcde3 100644 --- a/src/main/java/ellpeck/actuallyadditions/communication/InterModCommunications.java +++ b/src/main/java/ellpeck/actuallyadditions/communication/InterModCommunications.java @@ -38,7 +38,9 @@ public class InterModCommunications{ CrusherRecipeManualRegistry.registerRecipe(input, outputOne, outputTwo, secondChance); ModUtil.LOGGER.info("Crusher Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+outputOne.toString()+(outputTwo != null ? " + "+outputTwo.toString()+", Second Chance: "+secondChance : "")); } - else ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!"); + else{ + ModUtil.LOGGER.error("Crusher Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input or an Output!"); + } } } @@ -56,7 +58,9 @@ public class InterModCommunications{ ItemCoffee.registerIngredient(new ItemCoffee.Ingredient(input, new PotionEffect[]{effect}, maxAmp)); ModUtil.LOGGER.info("Coffee Machine Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+input.toString()+" -> "+effect.toString()); } - else ModUtil.LOGGER.error("Coffee Machine Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Input, a Potion ID, a Duration or a max Amplifier!"); + else{ + ModUtil.LOGGER.error("Coffee Machine Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Input, a Potion ID, a Duration or a max Amplifier!"); + } } } @@ -70,7 +74,9 @@ public class InterModCommunications{ HairyBallHandler.addReturn(output, chance); ModUtil.LOGGER.info("Ball Of Hair Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance); } - else ModUtil.LOGGER.error("Ball Of Hair Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Output or a Chance!"); + else{ + ModUtil.LOGGER.error("Ball Of Hair Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Output or a Chance!"); + } } } @@ -86,7 +92,9 @@ public class InterModCommunications{ TreasureChestHandler.addReturn(output, chance, minAmount, maxAmount); ModUtil.LOGGER.info("Treasure Chest Recipe that was sent from Mod "+message.getSender()+" has been registered successfully: "+output.toString()+", Chance: "+chance+", Min Amount: "+minAmount+", Max Amount: "+maxAmount); } - else ModUtil.LOGGER.error("Treasure Chest Recipe that was sent from Mod " + message.getSender() + " could not be registered: It's missing an Output, a Chance or minimum and maximum Amounts!"); + else{ + ModUtil.LOGGER.error("Treasure Chest Recipe that was sent from Mod "+message.getSender()+" could not be registered: It's missing an Output, a Chance or minimum and maximum Amounts!"); + } } } } diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java index ae4735016..65947c7ce 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigurationHandler.java @@ -45,7 +45,7 @@ public class ConfigurationHandler{ @SubscribeEvent public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event){ - if (event.modID.equalsIgnoreCase(ModUtil.MOD_ID)){ + if(event.modID.equalsIgnoreCase(ModUtil.MOD_ID)){ loadConfig(); } } diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java index 4de143a6d..b634709a3 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java @@ -168,7 +168,7 @@ public enum ConfigCrafting{ this.name = name; this.category = category.name; this.defaultValue = defaultValue; - this.extraText = extraText.length() > 0 ? extraText + " " : ""; + this.extraText = extraText.length() > 0 ? extraText+" " : ""; } ConfigCrafting(String name, ConfigCategories category, boolean defaultValue){ diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 0e75b4965..4bbca2832 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -48,14 +48,14 @@ public enum ConfigIntValues{ QUARTZ_HARVEST_LEVEL("Quartz: Harvest Level", ConfigCategories.TOOL_VALUES, 2, 0, 3, "What Harvest Level Quartz Tools have (0 = Wood, 1 = Stone, 2 = Iron, 3 = Diamond)"), QUARTZ_USES("Quartz: Max Uses", ConfigCategories.TOOL_VALUES, 280, 50, 20000, "How often Quartz Tools can be used"), QUARTZ_ENCHANTABILITY("Quartz: Enchantability", ConfigCategories.TOOL_VALUES, 10, 1, 30, "How enchantable an Quartz Tool is"), - + EMERALD_ARMOR_DURABILITY("Emerald Armor: Durability", ConfigCategories.ARMOR_VALUES, 1500, 10, 10000, "The Durability of Emerald Armor"), EMERALD_ARMOR_HEAD_DAMAGE("Emerald Helmets: Damage Reduction", ConfigCategories.ARMOR_VALUES, 5, 0, 10, "The Damage Reduction of Emerald Helmets"), EMERALD_ARMOR_CHEST_DAMAGE("Emerald Chests: Damage Reduction", ConfigCategories.ARMOR_VALUES, 9, 0, 10, "The Damage Reduction of Emerald Chests"), EMERALD_ARMOR_LEGS_DAMAGE("Emerald Legs: Damage Reduction", ConfigCategories.ARMOR_VALUES, 8, 0, 10, "The Damage Reduction of Emerald Legs"), EMERALD_ARMOR_BOOTS_DAMAGE("Emerald Boots: Damage Reduction", ConfigCategories.ARMOR_VALUES, 5, 0, 10, "The Damage Reduction of Emerald Boots"), EMERALD_ARMOR_ENCHANTABILITY("Emerald Armor: Enchantability", ConfigCategories.ARMOR_VALUES, 15, 1, 30, "The Enchantability of Emerald Armor"), - + QUARTZ_ARMOR_DURABILITY("Quartz Armor: Durability", ConfigCategories.ARMOR_VALUES, 200, 10, 10000, "The Durability of Quartz Armor"), QUARTZ_ARMOR_HEAD_DAMAGE("Quartz Helmets: Damage Reduction", ConfigCategories.ARMOR_VALUES, 3, 0, 10, "The Damage Reduction of Quartz Helmets"), QUARTZ_ARMOR_CHEST_DAMAGE("Quartz Chests: Damage Reduction", ConfigCategories.ARMOR_VALUES, 6, 0, 10, "The Damage Reduction of Quartz Chests"), diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java index 1a14a12a8..0fe031ee2 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/CrusherCrafting.java @@ -27,19 +27,41 @@ public class CrusherCrafting{ public static void init(){ ModUtil.LOGGER.info("Initializing Crusher Recipes..."); - if(ConfigCrafting.REDSTONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10)); - if(ConfigCrafting.LAPIS.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(Items.dye, 12, 4)); - if(ConfigCrafting.COAL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal())); - if(ConfigCrafting.COAL_ORE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 3)); - if(ConfigCrafting.COAL_BLOCKS.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(Items.coal, 9)); + if(ConfigCrafting.REDSTONE.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10)); + } + if(ConfigCrafting.LAPIS.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.lapis_ore), new ItemStack(Items.dye, 12, 4)); + } + if(ConfigCrafting.COAL.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Items.coal), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal())); + } + if(ConfigCrafting.COAL_ORE.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 3)); + } + if(ConfigCrafting.COAL_BLOCKS.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.coal_block), new ItemStack(Items.coal, 9)); + } - if(ConfigCrafting.COBBLESTONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand)); - if(ConfigCrafting.GRAVEL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint)); - if(ConfigCrafting.STONE.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); - if(ConfigCrafting.RICE_SUGAR.isEnabled()) CrusherRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2)); + if(ConfigCrafting.COBBLESTONE.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand)); + } + if(ConfigCrafting.GRAVEL.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint)); + } + if(ConfigCrafting.STONE.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(Blocks.stone), new ItemStack(Blocks.cobblestone)); + } + if(ConfigCrafting.RICE_SUGAR.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.sugar, 2)); + } - if(ConfigCrafting.NICKEL.isEnabled()) CrusherRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2, 1); - if(ConfigCrafting.IRON.isEnabled()) CrusherRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2, 1); + if(ConfigCrafting.NICKEL.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe("oreNickel", "dustNickel", "dustPlatinum", 15, 2, 1); + } + if(ConfigCrafting.IRON.isEnabled()){ + CrusherRecipeManualRegistry.registerRecipe("oreIron", "dustIron", "dustGold", 20, 2, 1); + } CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("oreNether", 6)); CrusherRecipeAutoRegistry.searchCases.add(new SearchCase("orePoor", 4, "nugget")); diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java index 84d56a358..fddc245b8 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/InitCrafting.java @@ -12,7 +12,7 @@ package ellpeck.actuallyadditions.crafting; import ellpeck.actuallyadditions.util.ModUtil; -public class InitCrafting { +public class InitCrafting{ public static void init(){ ModUtil.LOGGER.info("Initializing Crafting Recipes..."); diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java index df2f741af..5b93c0b91 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java @@ -60,7 +60,7 @@ public class ToolCrafting{ "EE", " S", " S", 'E', "gemEmerald", 'S', new ItemStack(Items.stick))); - + //Helm GameRegistry.addRecipe(new ItemStack(InitItems.itemHelmEmerald), "OOO", "O O", diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index 37be78cd9..80586f1f3 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -111,7 +111,7 @@ public class CreativeTab extends CreativeTabs{ add(InitItems.itemGrowthRing); add(InitItems.itemMagnetRing); add(InitItems.itemWaterRemovalRing); - + add(InitItems.itemPhantomConnector); add(InitItems.itemBucketCanolaOil); add(InitItems.itemBucketOil); @@ -163,7 +163,7 @@ public class CreativeTab extends CreativeTabs{ add(InitItems.itemAxeEmerald); add(InitItems.itemShovelEmerald); add(InitItems.itemHoeEmerald); - + add(InitItems.itemHelmEmerald); add(InitItems.itemChestEmerald); add(InitItems.itemPantsEmerald); diff --git a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java index ead61e758..9d09b3d62 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/EntityLivingEvent.java @@ -33,7 +33,7 @@ public class EntityLivingEvent{ EntityOcelot theOcelot = (EntityOcelot)event.entityLiving; if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && theOcelot.isTamed()){ if(new Random().nextInt(ConfigIntValues.CAT_DROP_CHANCE.getValue())+1 == 1){ - EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX + 0.5, theOcelot.posY + 0.5, theOcelot.posZ + 0.5, new ItemStack(InitItems.itemHairyBall)); + EntityItem item = new EntityItem(theOcelot.worldObj, theOcelot.posX+0.5, theOcelot.posY+0.5, theOcelot.posZ+0.5, new ItemStack(InitItems.itemHairyBall)); theOcelot.worldObj.spawnEntityInWorld(item); } } diff --git a/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java b/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java index 4dcdb8142..abcd14501 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/LivingDropEvent.java @@ -34,8 +34,8 @@ public class LivingDropEvent{ for(int i = 0; i < TheSpecialDrops.values().length; i++){ TheSpecialDrops theDrop = TheSpecialDrops.values()[i]; if(theDrop.canDrop && theDrop.dropFrom.isAssignableFrom(event.entityLiving.getClass())){ - if(new Random().nextInt(100) + 1 <= theDrop.chance){ - event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount) + 1, theDrop.ordinal()), 0); + if(new Random().nextInt(100)+1 <= theDrop.chance){ + event.entityLiving.entityDropItem(new ItemStack(InitItems.itemSpecialDrop, new Random().nextInt(theDrop.maxAmount)+1, theDrop.ordinal()), 0); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/gadget/ModelStandardBlock.java b/src/main/java/ellpeck/actuallyadditions/gadget/ModelStandardBlock.java index 556f4d74f..ee727ad72 100644 --- a/src/main/java/ellpeck/actuallyadditions/gadget/ModelStandardBlock.java +++ b/src/main/java/ellpeck/actuallyadditions/gadget/ModelStandardBlock.java @@ -34,6 +34,6 @@ public class ModelStandardBlock extends ModelBaseAA{ @Override public String getName(){ - return "model" + this.name; + return "model"+this.name; } } diff --git a/src/main/java/ellpeck/actuallyadditions/gadget/cloud/SmileyCloudEasterEggs.java b/src/main/java/ellpeck/actuallyadditions/gadget/cloud/SmileyCloudEasterEggs.java index a879e147b..e85be93da 100644 --- a/src/main/java/ellpeck/actuallyadditions/gadget/cloud/SmileyCloudEasterEggs.java +++ b/src/main/java/ellpeck/actuallyadditions/gadget/cloud/SmileyCloudEasterEggs.java @@ -34,6 +34,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"glenthor", "glenthorlp", "twoofeight"}; } + @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(Items.dye, 1, 2)); @@ -46,6 +47,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"ellpeck", "ellopecko", "peck"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemPhantomConnector)); @@ -58,6 +60,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"tyrex", "lord_tobinho", "tobinho"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.fishing_rod)); @@ -70,6 +73,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"dqmhose", "xdqmhose", "hose"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.reeds)); @@ -82,6 +86,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"jemx", "jemxx", "jemxxx", "spielertobi200"}; } + @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(Items.milk_bucket)); @@ -94,6 +99,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"vazkii", "vaski", "waskie"}; } + @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(Items.dye, 1, 15)); @@ -106,6 +112,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"kitty", "kiddy", "kittyvancat", "kittyvancatlp"}; } + @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(Items.fish)); @@ -119,6 +126,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"canitz", "canitzp", "kannnichts", "kannnichtsp"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.wooden_sword)); @@ -131,6 +139,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"lari", "larixine", "xine", "laxi", "lachsirine", "lala", "lalilu"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.iron_helmet)); @@ -143,6 +152,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"rotesding", "dotesring"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.milk_bucket)); @@ -156,6 +166,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"bande", "bandelenth"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.diamond_pickaxe)); @@ -168,6 +179,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"wolle", "wuitoi"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.string)); @@ -180,6 +192,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"pakto", "paktosan", "paktosanlp"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.dye, 1, 9)); @@ -192,6 +205,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"honka", "honkalonka", "lonka", "lonki"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9)); @@ -204,6 +218,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"acid", "acid_blues", "acidblues"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal())); @@ -216,6 +231,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"jasin", "jasindow"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.written_book)); @@ -228,6 +244,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"lordi", "lordhallo"}; } + @Override public void renderExtra(float f){ renderHoldingItem(true, new ItemStack(Items.paper)); @@ -241,6 +258,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"freakyninja", "ninja", "tl"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.diamond_sword)); @@ -253,6 +271,7 @@ public class SmileyCloudEasterEggs{ public String[] getTriggerNames(){ return new String[]{"nihon", "nihontiger", "tiger"}; } + @Override public void renderExtra(float f){ renderHoldingItem(false, new ItemStack(Items.stone_pickaxe)); diff --git a/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java b/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java index 09dff7488..5f926d1e6 100644 --- a/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java +++ b/src/main/java/ellpeck/actuallyadditions/gen/OreGen.java @@ -36,8 +36,8 @@ public class OreGen implements IWorldGenerator{ switch(world.provider.dimensionId){ case -1: generateNether(world, random, chunkX*16, chunkZ*16); - //case 0: - // generateSurface(world, random, chunkX*16, chunkZ*16); + //case 0: + // generateSurface(world, random, chunkX*16, chunkZ*16); case 1: generateEnd(world, random, chunkX*16, chunkZ*16); default: @@ -63,15 +63,17 @@ public class OreGen implements IWorldGenerator{ public void addOreSpawn(Block block, int meta, Block blockIn, World world, Random random, int blockXPos, int blockZPos, int maxVeinSize, int chancesToSpawn, int minY, int maxY){ if(maxY > minY){ - int yDiff = maxY - minY; + int yDiff = maxY-minY; for(int i = 0; i < chancesToSpawn; i++){ - int posX = blockXPos + random.nextInt(16); - int posY = minY + random.nextInt(yDiff); - int posZ = blockZPos + random.nextInt(16); + int posX = blockXPos+random.nextInt(16); + int posY = minY+random.nextInt(yDiff); + int posZ = blockZPos+random.nextInt(16); new WorldGenMinable(block, meta, maxVeinSize, blockIn).generate(world, random, posX, posY, posZ); } } - else ModUtil.LOGGER.fatal("Couldn't generate '" + block.getUnlocalizedName() + "' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); + else{ + ModUtil.LOGGER.fatal("Couldn't generate '"+block.getUnlocalizedName()+"' into the world because the Min Y coordinate is bigger than the Max! This is definitely a Config Error! Check the Files!"); + } } public static void init(){ diff --git a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentCustomCropField.java b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentCustomCropField.java index 1a6d3e61c..9fa325310 100644 --- a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentCustomCropField.java +++ b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentCustomCropField.java @@ -56,7 +56,7 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); this.spawnActualHouse(world, rand, sbb); - for (int i = 0; i < xSize; i++){ + for(int i = 0; i < xSize; i++){ for(int j = 0; j < zSize; j++){ this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); this.func_151554_b(world, Blocks.dirt, 0, i, -1, j, sbb); @@ -68,10 +68,14 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous private Block getRandomCropType(Random rand){ switch(rand.nextInt(4)){ - case 0: return InitBlocks.blockFlax; - case 1: return InitBlocks.blockCoffee; - case 2: return InitBlocks.blockRice; - default: return InitBlocks.blockCanola; + case 0: + return InitBlocks.blockFlax; + case 1: + return InitBlocks.blockCoffee; + case 2: + return InitBlocks.blockRice; + default: + return InitBlocks.blockCanola; } } diff --git a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java index 432a423f6..5d6672bfa 100644 --- a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java +++ b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java @@ -59,7 +59,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.air); this.spawnActualHouse(world, rand, sbb); - for (int i = 0; i < xSize; i++){ + for(int i = 0; i < xSize; i++){ for(int j = 0; j < zSize; j++){ this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); this.func_151554_b(world, Blocks.cobblestone, 0, i, -1, j, sbb); @@ -100,7 +100,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.cobblestone); this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.cobblestone); this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.planks); - this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i* 8, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 2, sbb); this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 6, sbb); this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.glass_pane); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerBreaker.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerBreaker.java index b575d3d49..6132c6799 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerBreaker.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerBreaker.java @@ -27,19 +27,19 @@ public class ContainerBreaker extends Container{ public ContainerBreaker(InventoryPlayer inventory, TileEntityBase tile){ this.breaker = (TileEntityBreaker)tile; - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 3; j++){ this.addSlotToContainer(new Slot(this.breaker, j+i*3, 62+j*18, 21+i*18)); } } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -57,7 +57,7 @@ public class ContainerBreaker extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -69,16 +69,21 @@ public class ContainerBreaker extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java index 27f05df1e..272277cd5 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCanolaPress.java @@ -37,13 +37,13 @@ public class ContainerCanolaPress extends Container{ this.addSlotToContainer(new Slot(this.press, 1, 136, 73)); this.addSlotToContainer(new SlotOutput(this.press, 2, 136, 42)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -61,7 +61,7 @@ public class ContainerCanolaPress extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -79,14 +79,20 @@ public class ContainerCanolaPress extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java index 0de6c560c..023b2af9f 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoalGenerator.java @@ -30,13 +30,13 @@ public class ContainerCoalGenerator extends Container{ this.addSlotToContainer(new Slot(this.generator, 0, 87, 43)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -69,14 +69,20 @@ public class ContainerCoalGenerator extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoffeeMachine.java index 86803cd3f..7b55f78a5 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCoffeeMachine.java @@ -38,8 +38,8 @@ public class ContainerCoffeeMachine extends Container{ this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_INPUT, 80, 42)); this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_OUTPUT, 80, 73)); - for (int i = 0; i < 4; i++){ - for (int j = 0; j < 2; j++){ + for(int i = 0; i < 4; i++){ + for(int j = 0; j < 2; j++){ this.addSlotToContainer(new Slot(machine, j+i*2+3, 125+j*18, 6+i*18)); } } @@ -47,13 +47,13 @@ public class ContainerCoffeeMachine extends Container{ this.addSlotToContainer(new Slot(machine, TileEntityCoffeeMachine.SLOT_WATER_INPUT, 26, 73)); this.addSlotToContainer(new SlotOutput(machine, TileEntityCoffeeMachine.SLOT_WATER_OUTPUT, 45, 73)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -71,7 +71,7 @@ public class ContainerCoffeeMachine extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -84,30 +84,42 @@ public class ContainerCoffeeMachine extends Container{ else if(slot >= inventoryStart){ //Shift from Inventory if(newStack.getItem() == InitItems.itemMisc && newStack.getItemDamage() == TheMiscItems.CUP.ordinal()){ - if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT+1, false)){ + return null; + } } else if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(FluidRegistry.WATER, 1))){ - if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_WATER_INPUT, TileEntityCoffeeMachine.SLOT_WATER_INPUT+1, false)){ + return null; + } } else if(ItemCoffee.getIngredientFromStack(newStack) != null){ if(!this.mergeItemStack(newStack, 3, 11, false)) return null; } else if(newStack.getItem() == InitItems.itemCoffeeBean){ - if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS, TileEntityCoffeeMachine.SLOT_COFFEE_BEANS+1, false)){ + return null; + } } // else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCrafter.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCrafter.java index 735eb5915..5aaaa36b1 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCrafter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerCrafter.java @@ -38,19 +38,19 @@ public class ContainerCrafter extends Container{ this.z = (int)player.posZ; this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ - this.addSlotToContainer(new Slot(this.craftMatrix, j + i*3, 30 + j*18, 17 + i*18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 3; j++){ + this.addSlotToContainer(new Slot(this.craftMatrix, j+i*3, 30+j*18, 17+i*18)); } } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i*9 + 9, 8 + j*18, 84 + i*18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 84+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i*18, 142)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 142)); } this.onCraftMatrixChanged(this.craftMatrix); @@ -65,8 +65,8 @@ public class ContainerCrafter extends Container{ public void onContainerClosed(EntityPlayer player){ super.onContainerClosed(player); - if (!this.world.isRemote){ - for (int i = 0; i < 9; ++i){ + if(!this.world.isRemote){ + for(int i = 0; i < 9; ++i){ ItemStack stack = this.craftMatrix.getStackInSlotOnClosing(i); if(stack != null) player.dropPlayerItemWithRandomChoice(stack, false); } @@ -91,12 +91,20 @@ public class ContainerCrafter extends Container{ if(!this.mergeItemStack(savedStack, 10, 46, true)) return null; theSlot.onSlotChange(savedStack, stack); } - else if(slot >= 10 && slot < 37 && !this.mergeItemStack(savedStack, 37, 46, false)) return null; - else if(slot >= 37 && slot < 46 && !this.mergeItemStack(savedStack, 10, 37, false)) return null; + else if(slot >= 10 && slot < 37 && !this.mergeItemStack(savedStack, 37, 46, false)){ + return null; + } + else if(slot >= 37 && slot < 46 && !this.mergeItemStack(savedStack, 10, 37, false)){ + return null; + } else if(!this.mergeItemStack(savedStack, 10, 46, false)) return null; - if(savedStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(savedStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } if(savedStack.stackSize == stack.stackSize) return null; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java index 8a64515f6..8efc02ed5 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDrill.java @@ -48,8 +48,12 @@ public class ContainerDrill extends Container{ } } for(int i = 0; i < 9; i++){ - if(i == inventory.currentItem) this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 116)); - else this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 116)); + if(i == inventory.currentItem){ + this.addSlotToContainer(new SlotImmovable(inventory, i, 8+i*18, 116)); + } + else{ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 116)); + } } ItemStack stack = inventory.getCurrentItem(); @@ -70,15 +74,19 @@ public class ContainerDrill extends Container{ if(stack != null && stack.getItem() instanceof ItemDrill){ ((ItemDrill)stack.getItem()).writeSlotsToNBT(this.drillInventory.slots, inventory.getCurrentItem()); } - super.onContainerClosed(player); + super.onContainerClosed(player); } @Override public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer player){ //par3 appears to be the type of clicking //par3 == 2 appears to be one of the number keys being hit - if(par3 == 2 && par2 == inventory.currentItem) return null; - else return super.slotClick(par1, par2, par3, player); + if(par3 == 2 && par2 == inventory.currentItem){ + return null; + } + else{ + return super.slotClick(par1, par2, par3, player); + } } @Override @@ -90,7 +98,7 @@ public class ContainerDrill extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -105,14 +113,20 @@ public class ContainerDrill extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; @@ -190,7 +204,7 @@ public class ContainerDrill extends Container{ @Override public ItemStack decrStackSize(int i, int j){ - if (slots[i] != null){ + if(slots[i] != null){ ItemStack stackAt; if(slots[i].stackSize <= j){ stackAt = slots[i]; @@ -200,7 +214,7 @@ public class ContainerDrill extends Container{ } else{ stackAt = slots[i].splitStack(j); - if (slots[i].stackSize == 0) slots[i] = null; + if(slots[i].stackSize == 0) slots[i] = null; this.markDirty(); return stackAt; } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDropper.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDropper.java index 98651f374..fccc31f61 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDropper.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerDropper.java @@ -27,19 +27,19 @@ public class ContainerDropper extends Container{ public ContainerDropper(InventoryPlayer inventory, TileEntityBase tile){ this.dropper = (TileEntityDropper)tile; - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 3; j++){ this.addSlotToContainer(new Slot(this.dropper, j+i*3, 62+j*18, 21+i*18)); } } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -57,7 +57,7 @@ public class ContainerDropper extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -69,16 +69,21 @@ public class ContainerDropper extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java index 41bba8873..3e194e108 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnergizer.java @@ -37,13 +37,13 @@ public class ContainerEnergizer extends Container{ this.addSlotToContainer(new Slot(this.energizer, 0, 76, 73)); this.addSlotToContainer(new SlotOutput(this.energizer, 1, 76, 42)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } final EntityPlayer finalPlayer = player; for(int i = 0; i < 4; ++i){ @@ -53,10 +53,12 @@ public class ContainerEnergizer extends Container{ public int getSlotStackLimit(){ return 1; } + @Override public boolean isItemValid(ItemStack stack){ return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); } + @Override @SideOnly(Side.CLIENT) public IIcon getBackgroundIconIndex(){ @@ -80,7 +82,7 @@ public class ContainerEnergizer extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -100,14 +102,20 @@ public class ContainerEnergizer extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java index 2c9f67044..9e3510646 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerEnervator.java @@ -37,13 +37,13 @@ public class ContainerEnervator extends Container{ this.addSlotToContainer(new Slot(this.enervator, 0, 76, 73)); this.addSlotToContainer(new SlotOutput(this.enervator, 1, 76, 42)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } final EntityPlayer finalPlayer = player; for(int i = 0; i < 4; ++i){ @@ -53,10 +53,12 @@ public class ContainerEnervator extends Container{ public int getSlotStackLimit(){ return 1; } + @Override public boolean isItemValid(ItemStack stack){ return stack != null && stack.getItem().isValidArmor(stack, finalI, finalPlayer); } + @Override @SideOnly(Side.CLIENT) public IIcon getBackgroundIconIndex(){ @@ -80,7 +82,7 @@ public class ContainerEnervator extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -100,14 +102,20 @@ public class ContainerEnervator extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java index 2fe7d2a85..b93f72c4c 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFeeder.java @@ -28,13 +28,13 @@ public class ContainerFeeder extends Container{ this.tileFeeder = (TileEntityFeeder)tile; this.addSlotToContainer(new Slot(this.tileFeeder, 0, 80, 45)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 74 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 74+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 132)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 132)); } } @@ -52,7 +52,7 @@ public class ContainerFeeder extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -64,16 +64,21 @@ public class ContainerFeeder extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java index eadbc9a72..92c45ce9f 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFermentingBarrel.java @@ -36,13 +36,13 @@ public class ContainerFermentingBarrel extends Container{ this.addSlotToContainer(new Slot(this.barrel, 2, 118, 74)); this.addSlotToContainer(new SlotOutput(this.barrel, 3, 118, 43)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -60,7 +60,7 @@ public class ContainerFermentingBarrel extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -78,14 +78,20 @@ public class ContainerFermentingBarrel extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFluidCollector.java index c5669235f..d7bf5215b 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFluidCollector.java @@ -32,13 +32,13 @@ public class ContainerFluidCollector extends Container{ this.addSlotToContainer(new Slot(collector, 0, 90, 73)); this.addSlotToContainer(new SlotOutput(collector, 1, 90, 42)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -56,7 +56,7 @@ public class ContainerFluidCollector extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -76,14 +76,20 @@ public class ContainerFluidCollector extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java index 0b9d06ef1..6aaf8297a 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerFurnaceDouble.java @@ -34,13 +34,13 @@ public class ContainerFurnaceDouble extends Container{ this.addSlotToContainer(new Slot(this.tileFurnace, TileEntityFurnaceDouble.SLOT_INPUT_2, 109, 21)); this.addSlotToContainer(new SlotFurnace(inventory.player, this.tileFurnace, TileEntityFurnaceDouble.SLOT_OUTPUT_2, 108, 69)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -58,7 +58,7 @@ public class ContainerFurnaceDouble extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -72,7 +72,9 @@ public class ContainerFurnaceDouble extends Container{ //Shift from Inventory if(FurnaceRecipes.smelting().getSmeltingResult(newStack) != null){ if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_1, TileEntityFurnaceDouble.SLOT_INPUT_1+1, false)){ - if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityFurnaceDouble.SLOT_INPUT_2, TileEntityFurnaceDouble.SLOT_INPUT_2+1, false)){ + return null; + } } } // @@ -80,14 +82,20 @@ public class ContainerFurnaceDouble extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java index d25434199..843155331 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGiantChest.java @@ -27,19 +27,19 @@ public class ContainerGiantChest extends Container{ public ContainerGiantChest(InventoryPlayer inventory, TileEntityBase tile){ this.tileChest = (TileEntityGiantChest)tile; - for (int i = 0; i < 9; i++){ - for (int j = 0; j < 13; j++){ - this.addSlotToContainer(new Slot(this.tileChest, j + (i*13), 5 + j * 18, 5 + i * 18)); + for(int i = 0; i < 9; i++){ + for(int j = 0; j < 13; j++){ + this.addSlotToContainer(new Slot(this.tileChest, j+(i*13), 5+j*18, 5+i*18)); } } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 33 + 8 + j * 18, 172 + 4 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 33+8+j*18, 172+4+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 33 + 8 + i * 18, 172 + 62)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 33+8+i*18, 172+62)); } } @@ -57,7 +57,7 @@ public class ContainerGiantChest extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -69,16 +69,21 @@ public class ContainerGiantChest extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java index 00652a507..5dc4c8335 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerGrinder.java @@ -40,13 +40,13 @@ public class ContainerGrinder extends Container{ this.addSlotToContainer(new SlotOutput(this.tileGrinder, TileEntityGrinder.SLOT_OUTPUT_2_2, 121, 69)); } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -64,7 +64,7 @@ public class ContainerGrinder extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -79,9 +79,13 @@ public class ContainerGrinder extends Container{ if(CrusherRecipeManualRegistry.getOutput(newStack, false) != null){ if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_1, TileEntityGrinder.SLOT_INPUT_1+1, false)){ if(this.isDouble){ - if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityGrinder.SLOT_INPUT_2, TileEntityGrinder.SLOT_INPUT_2+1, false)){ + return null; + } + } + else{ + return null; } - else return null; } } // @@ -89,14 +93,20 @@ public class ContainerGrinder extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java index fe4cb52d9..ff39e1f3d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java @@ -65,7 +65,9 @@ public class ContainerInputter extends Container{ //Calls the Filter's SlotClick function return ((SlotFilter)getSlot(par1)).slotClick(player, par2); } - else return super.slotClick(par1, par2, par3, player); + else{ + return super.slotClick(par1, par2, par3, player); + } } @Override @@ -89,14 +91,19 @@ public class ContainerInputter extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if(newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java index 53a7b9c27..d72b13647 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOilGenerator.java @@ -34,13 +34,13 @@ public class ContainerOilGenerator extends Container{ this.addSlotToContainer(new Slot(this.generator, 0, 98, 74)); this.addSlotToContainer(new SlotOutput(this.generator, 1, 98, 43)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -58,7 +58,7 @@ public class ContainerOilGenerator extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -73,14 +73,20 @@ public class ContainerOilGenerator extends Container{ else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOreMagnet.java index 79f6ab63f..0f07eba32 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerOreMagnet.java @@ -36,13 +36,13 @@ public class ContainerOreMagnet extends Container{ this.addSlotToContainer(new SlotOutput(this.magnet, TileEntityOreMagnet.SLOT_UPGRADE, 71, 43)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -60,7 +60,7 @@ public class ContainerOreMagnet extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -68,21 +68,29 @@ public class ContainerOreMagnet extends Container{ if(slot >= inventoryStart){ //Shift from Inventory if(FluidContainerRegistry.containsFluid(newStack, new FluidStack(InitBlocks.fluidOil, 1))){ - if(!this.mergeItemStack(newStack, TileEntityOreMagnet.SLOT_OIL_INPUT, TileEntityOreMagnet.SLOT_OIL_INPUT+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityOreMagnet.SLOT_OIL_INPUT, TileEntityOreMagnet.SLOT_OIL_INPUT+1, false)){ + return null; + } } // else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerPhantomPlacer.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerPhantomPlacer.java index eb3569827..25182fce4 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerPhantomPlacer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerPhantomPlacer.java @@ -27,19 +27,19 @@ public class ContainerPhantomPlacer extends Container{ public ContainerPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){ this.placer = (TileEntityPhantomPlacer)tile; - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 3; j++){ + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 3; j++){ this.addSlotToContainer(new Slot(this.placer, j+i*3, 62+j*18, 21+i*18)); } } - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -69,14 +69,19 @@ public class ContainerPhantomPlacer extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ return null; + } } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if(newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java index 3208396ad..dc4893fb0 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerRepairer.java @@ -31,13 +31,13 @@ public class ContainerRepairer extends Container{ this.addSlotToContainer(new Slot(this.tileRepairer, TileEntityItemRepairer.SLOT_INPUT, 47, 53)); this.addSlotToContainer(new SlotOutput(this.tileRepairer, TileEntityItemRepairer.SLOT_OUTPUT, 109, 53)); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + for(int i = 0; i < 3; i++){ + for(int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j+i*9+9, 8+j*18, 97+i*18)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8+i*18, 155)); } } @@ -55,7 +55,7 @@ public class ContainerRepairer extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -63,21 +63,29 @@ public class ContainerRepairer extends Container{ if(slot >= inventoryStart){ //Shift from Inventory if(TileEntityItemRepairer.canBeRepaired(newStack)){ - if(!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false)) return null; + if(!this.mergeItemStack(newStack, TileEntityItemRepairer.SLOT_INPUT, TileEntityItemRepairer.SLOT_INPUT+1, false)){ + return null; + } } // else if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerXPSolidifier.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerXPSolidifier.java index 88ae07941..825f4d768 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerXPSolidifier.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerXPSolidifier.java @@ -54,7 +54,7 @@ public class ContainerXPSolidifier extends Container{ Slot theSlot = (Slot)this.inventorySlots.get(slot); - if (theSlot != null && theSlot.getHasStack()){ + if(theSlot != null && theSlot.getHasStack()){ ItemStack newStack = theSlot.getStack(); ItemStack currentStack = newStack.copy(); @@ -63,14 +63,20 @@ public class ContainerXPSolidifier extends Container{ if(slot >= inventoryStart && slot <= inventoryEnd){ if(!this.mergeItemStack(newStack, hotbarStart, hotbarEnd+1, false)) return null; } - else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)) return null; + else if(slot >= inventoryEnd+1 && slot < hotbarEnd+1 && !this.mergeItemStack(newStack, inventoryStart, inventoryEnd+1, false)){ + return null; + } } else if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, false)) return null; - if (newStack.stackSize == 0) theSlot.putStack(null); - else theSlot.onSlotChanged(); + if(newStack.stackSize == 0){ + theSlot.putStack(null); + } + else{ + theSlot.onSlotChanged(); + } - if (newStack.stackSize == currentStack.stackSize) return null; + if(newStack.stackSize == currentStack.stackSize) return null; theSlot.onPickupFromSlot(player, newStack); return currentStack; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java index 622ddb0de..beb8b484c 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCanolaPress.java @@ -55,29 +55,29 @@ public class GuiCanolaPress extends GuiContainer{ if(this.press.storage.getEnergyStored() > 0){ int i = this.press.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft + 43, this.guiTop+89-i, 176, 29, 16, i); + drawTexturedModalRect(this.guiLeft+43, this.guiTop+89-i, 176, 29, 16, i); } if(this.press.tank.getFluidAmount() > 0){ int i = this.press.getTankScaled(83); - drawTexturedModalRect(this.guiLeft + 117, this.guiTop+89-i, 192, 29, 16, i); + drawTexturedModalRect(this.guiLeft+117, this.guiTop+89-i, 192, 29, 16, i); } if(this.press.currentProcessTime > 0){ int i = this.press.getProcessScaled(29); - drawTexturedModalRect(this.guiLeft + 83, this.guiTop+32, 176, 0, 12, i); + drawTexturedModalRect(this.guiLeft+83, this.guiTop+32, 176, 0, 12, i); } } @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.press.storage.getEnergyStored() + "/" + this.press.storage.getMaxEnergyStored() + " RF"; + String text1 = this.press.storage.getEnergyStored()+"/"+this.press.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.press.tank.getFluidAmount() + "/" + this.press.tank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); + String text2 = this.press.tank.getFluidAmount()+"/"+this.press.tank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java index 28b100dc9..09ca32414 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoalGenerator.java @@ -66,7 +66,7 @@ public class GuiCoalGenerator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; + String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java index b9ba03c76..e962f8427 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiCoffeeMachine.java @@ -110,16 +110,16 @@ public class GuiCoffeeMachine extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.machine.storage.getEnergyStored() + "/" + this.machine.storage.getMaxEnergyStored() + " RF"; + String text1 = this.machine.storage.getEnergyStored()+"/"+this.machine.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+16 && y >= guiTop+5 && x <= guiLeft+23 && y <= guiTop+89){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text3 = this.machine.tank.getFluidAmount() + "/" + this.machine.tank.getCapacity() + " mB "+FluidRegistry.WATER.getLocalizedName(this.machine.tank.getFluid()); + String text3 = this.machine.tank.getFluidAmount()+"/"+this.machine.tank.getCapacity()+" mB "+FluidRegistry.WATER.getLocalizedName(this.machine.tank.getFluid()); if(x >= guiLeft+27 && y >= guiTop+5 && x <= guiLeft+33 && y <= guiTop+70){ this.func_146283_a(Collections.singletonList(text3), x, y); } - String text2 = this.machine.coffeeCacheAmount + "/" + this.machine.coffeeCacheMaxAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); + String text2 = this.machine.coffeeCacheAmount+"/"+this.machine.coffeeCacheMaxAmount+" "+StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".gui.coffee"); if(x >= guiLeft+40 && y >= guiTop+25 && x <= guiLeft+49 && y <= guiTop+56){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java index 0e82e58c3..c3f5b87a2 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnergizer.java @@ -61,7 +61,7 @@ public class GuiEnergizer extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.energizer.storage.getEnergyStored() + "/" + this.energizer.storage.getMaxEnergyStored() + " RF"; + String text1 = this.energizer.storage.getEnergyStored()+"/"+this.energizer.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java index bc3688928..d88635b8b 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiEnervator.java @@ -61,7 +61,7 @@ public class GuiEnervator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.enervator.storage.getEnergyStored() + "/" + this.enervator.storage.getMaxEnergyStored() + " RF"; + String text1 = this.enervator.storage.getEnergyStored()+"/"+this.enervator.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+57 && y >= guiTop+6 && x <= guiLeft+72 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java index cf2024269..36f9027bc 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFeeder.java @@ -57,11 +57,13 @@ public class GuiFeeder extends GuiContainer{ this.drawTexturedModalRect(guiLeft+85, guiTop+42-i, 181, 19+19-i, 6, 20); } - if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()) + if(this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < ConfigIntValues.FEEDER_THRESHOLD.getValue()){ this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 16, 8, 8); + } - if(this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue()) + if(this.tileFeeder.currentAnimalAmount >= ConfigIntValues.FEEDER_THRESHOLD.getValue()){ this.drawTexturedModalRect(guiLeft+70, guiTop+31, 192, 24, 8, 8); + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java index 75646db60..45a324347 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFermentingBarrel.java @@ -55,12 +55,12 @@ public class GuiFermentingBarrel extends GuiContainer{ if(this.press.canolaTank.getFluidAmount() > 0){ int i = this.press.getCanolaTankScaled(83); - drawTexturedModalRect(this.guiLeft + 61, this.guiTop+89-i, 192, 29, 16, i); + drawTexturedModalRect(this.guiLeft+61, this.guiTop+89-i, 192, 29, 16, i); } if(this.press.oilTank.getFluidAmount() > 0){ int i = this.press.getOilTankScaled(83); - drawTexturedModalRect(this.guiLeft + 99, this.guiTop+89-i, 176, 29, 16, i); + drawTexturedModalRect(this.guiLeft+99, this.guiTop+89-i, 176, 29, 16, i); } if(this.press.currentProcessTime > 0){ @@ -73,12 +73,12 @@ public class GuiFermentingBarrel extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.press.canolaTank.getFluidAmount() + "/" + this.press.canolaTank.getCapacity() + " mB " +StringUtil.localize("fluid.canolaoil"); + String text1 = this.press.canolaTank.getFluidAmount()+"/"+this.press.canolaTank.getCapacity()+" mB "+StringUtil.localize("fluid.canolaoil"); if(x >= guiLeft+61 && y >= guiTop+6 && x <= guiLeft+76 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.press.oilTank.getFluidAmount() + "/" + this.press.oilTank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); + String text2 = this.press.oilTank.getFluidAmount()+"/"+this.press.oilTank.getCapacity()+" mB "+StringUtil.localize("fluid.oil"); if(x >= guiLeft+99 && y >= guiTop+6 && x <= guiLeft+114 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFluidCollector.java index dc0094ecc..a606e078f 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFluidCollector.java @@ -62,7 +62,7 @@ public class GuiFluidCollector extends GuiContainer{ public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text2 = this.collector.tank.getFluidAmount()+"/"+this.collector.tank.getCapacity()+" mB "+ (this.collector.tank.getFluidAmount() > 0 ? this.collector.tank.getFluid().getLocalizedName() : ""); + String text2 = this.collector.tank.getFluidAmount()+"/"+this.collector.tank.getCapacity()+" mB "+(this.collector.tank.getFluidAmount() > 0 ? this.collector.tank.getFluid().getLocalizedName() : ""); if(x >= guiLeft+68 && y >= guiTop+6 && x <= guiLeft+83 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java index f5bf1a77a..a44bf3553 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiFurnaceDouble.java @@ -61,14 +61,14 @@ public class GuiFurnaceDouble extends GuiContainer{ } if(this.tileFurnace.secondSmeltTime > 0){ int i = this.tileFurnace.getSecondTimeToScale(23); - this.drawTexturedModalRect(this.guiLeft + 101, this.guiTop + 40, 176, 22, 24, i); + this.drawTexturedModalRect(this.guiLeft+101, this.guiTop+40, 176, 22, 24, i); } } @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileFurnace.storage.getEnergyStored() + "/" + this.tileFurnace.storage.getMaxEnergyStored() + " RF"; + String text = this.tileFurnace.storage.getEnergyStored()+"/"+this.tileFurnace.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java index 1b1a03ed2..1ff48d101 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiGrinder.java @@ -66,7 +66,7 @@ public class GuiGrinder extends GuiContainer{ if(this.tileGrinder.storage.getEnergyStored() > 0){ int i = this.tileGrinder.getEnergyScaled(83); - drawTexturedModalRect(this.guiLeft + (isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i); + drawTexturedModalRect(this.guiLeft+(isDouble ? 14 : 43), this.guiTop+89-i, 176, (isDouble ? 44 : 23), 16, i); } if(this.tileGrinder.firstCrushTime > 0){ int i = this.tileGrinder.getFirstTimeToScale(23); @@ -75,7 +75,7 @@ public class GuiGrinder extends GuiContainer{ if(this.isDouble){ if(this.tileGrinder.secondCrushTime > 0){ int i = this.tileGrinder.getSecondTimeToScale(23); - this.drawTexturedModalRect(this.guiLeft + 101, this.guiTop + 40, 176, 22, 24, i); + this.drawTexturedModalRect(this.guiLeft+101, this.guiTop+40, 176, 22, 24, i); } } } @@ -83,7 +83,7 @@ public class GuiGrinder extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileGrinder.storage.getEnergyStored() + "/" + this.tileGrinder.storage.getMaxEnergyStored() + " RF"; + String text = this.tileGrinder.storage.getEnergyStored()+"/"+this.tileGrinder.storage.getMaxEnergyStored()+" RF"; if((this.isDouble && x >= guiLeft+14 && y >= guiTop+6 && x <= guiLeft+29 && y <= guiTop+88) || (!this.isDouble && x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88)){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java index 304f70262..a267e8e95 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiInputter.java @@ -265,7 +265,9 @@ public class GuiInputter extends GuiContainer{ this.setVariable(this.fieldPullStart, 2); this.setVariable(this.fieldPullEnd, 3); } - else PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + else{ + PacketHandler.theNetwork.sendToServer(new PacketGuiButton(x, y, z, world, button.id, Minecraft.getMinecraft().thePlayer)); + } } public static class SmallerButton extends GuiButton{ @@ -290,8 +292,12 @@ public class GuiInputter extends GuiContainer{ this.mouseDragged(mc, x, y); int color = 14737632; - if(packedFGColour != 0) color = packedFGColour; - else if(!this.enabled) color = 10526880; + if(packedFGColour != 0){ + color = packedFGColour; + } + else if(!this.enabled){ + color = 10526880; + } else if(this.field_146123_n) color = 16777120; this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition+this.width/2, this.yPosition+(this.height-8)/2, color); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java index 35ad50784..29a0918bd 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOilGenerator.java @@ -72,11 +72,11 @@ public class GuiOilGenerator extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.generator.storage.getEnergyStored() + "/" + this.generator.storage.getMaxEnergyStored() + " RF"; + String text1 = this.generator.storage.getEnergyStored()+"/"+this.generator.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.generator.tank.getFluidAmount() + "/" + this.generator.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); + String text2 = this.generator.tank.getFluidAmount()+"/"+this.generator.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java index ede84dbca..db639da8e 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiOreMagnet.java @@ -68,11 +68,11 @@ public class GuiOreMagnet extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text1 = this.magnet.storage.getEnergyStored() + "/" + this.magnet.storage.getMaxEnergyStored() + " RF"; + String text1 = this.magnet.storage.getEnergyStored()+"/"+this.magnet.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+43 && y >= guiTop+6 && x <= guiLeft+58 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text1), x, y); } - String text2 = this.magnet.tank.getFluidAmount() + "/" + this.magnet.tank.getCapacity() + " mB " +StringUtil.localize("fluid.oil"); + String text2 = this.magnet.tank.getFluidAmount()+"/"+this.magnet.tank.getCapacity()+" mB "+StringUtil.localize("fluid.oil"); if(x >= guiLeft+117 && y >= guiTop+6 && x <= guiLeft+132 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text2), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java index e2c507271..fc11b46b1 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiRepairer.java @@ -64,7 +64,7 @@ public class GuiRepairer extends GuiContainer{ @Override public void drawScreen(int x, int y, float f){ super.drawScreen(x, y, f); - String text = this.tileRepairer.storage.getEnergyStored() + "/" + this.tileRepairer.storage.getMaxEnergyStored() + " RF"; + String text = this.tileRepairer.storage.getEnergyStored()+"/"+this.tileRepairer.storage.getMaxEnergyStored()+" RF"; if(x >= guiLeft+28 && y >= guiTop+6 && x <= guiLeft+43 && y <= guiTop+88){ this.func_146283_a(Collections.singletonList(text), x, y); } diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiSmileyCloud.java b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiSmileyCloud.java index 55c14c09d..2588b455d 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/gui/GuiSmileyCloud.java @@ -94,7 +94,9 @@ public class GuiSmileyCloud extends GuiContainer{ this.nameField.textboxKeyTyped(theChar, key); } } - else super.keyTyped(theChar, key); + else{ + super.keyTyped(theChar, key); + } } public void setVariable(GuiTextField field){ diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java b/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java index 5f118be5e..dbbd90bd9 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java @@ -24,6 +24,7 @@ public class SlotFilter extends Slot{ /** * Gets called when the Filter Slot is clicked * Needs to be called in slotClick() in the Container! + * * @param player The player * @param button The button pressed (1 is right mouse button!) * @return Nothing, as the Item didn't really get "transferred" diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitForeignPaxels.java b/src/main/java/ellpeck/actuallyadditions/items/InitForeignPaxels.java index 58d35012d..8183cfbec 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitForeignPaxels.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitForeignPaxels.java @@ -64,7 +64,9 @@ public class InitForeignPaxels{ } } } - else ModUtil.LOGGER.info(MEKANISM_TOOLS+" not loaded, can't initialize Special AIOTs."); + else{ + ModUtil.LOGGER.info(MEKANISM_TOOLS+" not loaded, can't initialize Special AIOTs."); + } } //Thermal Foundation @@ -91,7 +93,9 @@ public class InitForeignPaxels{ } } } - else ModUtil.LOGGER.info(THERMAL_FOUNDATION+" not loaded, can't initialize Special AIOTs."); + else{ + ModUtil.LOGGER.info(THERMAL_FOUNDATION+" not loaded, can't initialize Special AIOTs."); + } } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 88f09d1b6..a7f9b2923 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -48,7 +48,7 @@ public class InitItems{ public static Item itemShovelEmerald; public static Item itemSwordEmerald; public static Item itemHoeEmerald; - + public static Item itemHelmEmerald; public static Item itemChestEmerald; public static Item itemPantsEmerald; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java b/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java index 83fa00a1e..f159320ab 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemArmorAA.java @@ -52,7 +52,7 @@ public class ItemArmorAA extends ItemArmor implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java index 88563a76e..321200ead 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBattery.java @@ -41,7 +41,7 @@ public class ItemBattery extends ItemEnergy{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBooklet.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBooklet.java index 3c9895fb4..8363f3978 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBooklet.java @@ -45,7 +45,7 @@ public class ItemBooklet extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java b/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java index d6a29aeaa..510f2d3d8 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemBucketAA.java @@ -45,7 +45,7 @@ public class ItemBucketAA extends ItemBucket implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java index 85ee65254..c0e8f25e3 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCoffeeBean.java @@ -41,7 +41,7 @@ public class ItemCoffeeBean extends ItemFood implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java index d278628e0..7ddd5243d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java @@ -38,12 +38,14 @@ public class ItemCrafterOnAStick extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ - if(!world.isRemote) player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); + if(!world.isRemote){ + player.openGui(ActuallyAdditions.instance, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); + } return stack; } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index f3aba2af6..e3dd38f4f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -67,8 +67,9 @@ public class ItemDrill extends ItemEnergy{ try{ //Places the Block into the World if(equip.tryPlaceItemIntoWorld(player, world, x, y, z, hitSide, hitX, hitY, hitZ)){ - if(!player.capabilities.isCreativeMode) + if(!player.capabilities.isCreativeMode){ player.inventory.setInventorySlotContents(slot, equip.stackSize <= 0 ? null : equip.copy()); + } //Synchronizes the Client player.inventoryContainer.detectAndSendChanges(); return true; @@ -80,7 +81,9 @@ public class ItemDrill extends ItemEnergy{ ModUtil.LOGGER.error("Player "+player.getDisplayName()+" who should place a Block using a Drill at "+player.posX+", "+player.posY+", "+player.posZ+" in World "+world.provider.dimensionId+" threw an Exception! Don't let that happen again!"); } } - else return true; + else{ + return true; + } } } } @@ -111,6 +114,7 @@ public class ItemDrill extends ItemEnergy{ /** * Gets the Mining Speed of the Drill + * * @param stack The Drill * @return The Mining Speed depending on the Speed Upgrades */ @@ -118,16 +122,23 @@ public class ItemDrill extends ItemEnergy{ float efficiency = ConfigFloatValues.DRILL_DAMAGE.getValue(); if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED)){ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){ - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)) efficiency += 37.0F; - else efficiency += 25.0F; + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)){ + efficiency += 37.0F; + } + else{ + efficiency += 25.0F; + } + } + else{ + efficiency += 8.0F; } - else efficiency += 8.0F; } return efficiency; } /** * Gets the Energy that is used per Block broken + * * @param stack The Drill * @return The Energy use per Block */ @@ -139,27 +150,31 @@ public class ItemDrill extends ItemEnergy{ use += ConfigIntValues.DRILL_SPEED_EXTRA_USE.getValue(); if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_II)){ use += ConfigIntValues.DRILL_SPEED_II_EXTRA_USE.getValue(); - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SPEED_III)){ use += ConfigIntValues.DRILL_SPEED_III_EXTRA_USE.getValue(); + } } } //Silk Touch - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){ use += ConfigIntValues.DRILL_SILK_EXTRA_USE.getValue(); + } //Fortune if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){ use += ConfigIntValues.DRILL_FORTUNE_EXTRA_USE.getValue(); - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II)){ use += ConfigIntValues.DRILL_FORTUNE_II_EXTRA_USE.getValue(); + } } //Size if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.THREE_BY_THREE)){ use += ConfigIntValues.DRILL_THREE_BY_THREE_EXTRA_USE.getValue(); - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){ use += ConfigIntValues.DRILL_FIVE_BY_FIVE_EXTRA_USE.getValue(); + } } return use; @@ -172,7 +187,8 @@ public class ItemDrill extends ItemEnergy{ /** * Checks if a certain Upgrade is applied - * @param stack The Drill + * + * @param stack The Drill * @param upgrade The Upgrade to be checked * @return Is the Upgrade applied? */ @@ -182,7 +198,8 @@ public class ItemDrill extends ItemEnergy{ /** * Checks if a certain Upgrade is installed and returns it as an ItemStack - * @param stack The Drill + * + * @param stack The Drill * @param upgrade The Upgrade to be checked * @return The Upgrade, if it's installed */ @@ -214,6 +231,7 @@ public class ItemDrill extends ItemEnergy{ /** * Writes all of the Slots to NBT + * * @param slots The Slots * @param stack The Drill */ @@ -240,6 +258,7 @@ public class ItemDrill extends ItemEnergy{ /** * Gets all of the Slots from NBT + * * @param stack The Drill * @return All of the Slots */ @@ -266,12 +285,13 @@ public class ItemDrill extends ItemEnergy{ /** * Breaks Blocks in a certain Radius * Has to be called on both Server and Client - * @param stack The Drill + * + * @param stack The Drill * @param radius The Radius to break Blocks in (0 means only 1 Block will be broken!) - * @param world The World - * @param x The X Coord of the main Block to break - * @param y The Y Coord of the main Block to break - * @param z The Z Coord of the main Block to break + * @param world The World + * @param x The X Coord of the main Block to break + * @param y The Y Coord of the main Block to break + * @param z The Z Coord of the main Block to break * @param player The Player who breaks the Blocks */ public boolean breakBlocks(ItemStack stack, int radius, World world, int x, int y, int z, EntityPlayer player){ @@ -302,7 +322,9 @@ public class ItemDrill extends ItemEnergy{ if(this.getEnergyStored(stack) >= use){ if(!this.tryHarvestBlock(world, x, y, z, false, stack, player, use)) return false; } - else return false; + else{ + return false; + } //Break Blocks around if(radius > 0){ @@ -316,7 +338,9 @@ public class ItemDrill extends ItemEnergy{ this.tryHarvestBlock(world, xPos, yPos, zPos, true, stack, player, use); } } - else return false; + else{ + return false; + } } } } @@ -329,14 +353,15 @@ public class ItemDrill extends ItemEnergy{ * Tries to harvest a certain Block * Breaks the Block, drops Particles etc. * Has to be called on both Server and Client - * @param world The World - * @param xPos The X Position of the Block to break - * @param yPos The Y Position of the Block to break - * @param zPos The Z Position of the Block to break + * + * @param world The World + * @param xPos The X Position of the Block to break + * @param yPos The Y Position of the Block to break + * @param zPos The Z Position of the Block to break * @param isExtra If the Block is the Block that was looked at when breaking or an additional Block - * @param stack The Drill - * @param player The Player breaking the Blocks - * @param use The Energy that should be extracted per Block + * @param stack The Drill + * @param player The Player breaking the Blocks + * @param use The Energy that should be extracted per Block */ private boolean tryHarvestBlock(World world, int xPos, int yPos, int zPos, boolean isExtra, ItemStack stack, EntityPlayer player, int use){ Block block = world.getBlock(xPos, yPos, zPos); @@ -362,11 +387,13 @@ public class ItemDrill extends ItemEnergy{ int use = this.getEnergyUsePerBlock(stack); if(this.getEnergyStored(stack) >= use){ //Enchants the Drill depending on the Upgrades it has - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.SILK_TOUCH)){ ItemUtil.addEnchantment(stack, Enchantment.silkTouch, 1); + } else{ - if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)) + if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE)){ ItemUtil.addEnchantment(stack, Enchantment.fortune, this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FORTUNE_II) ? 3 : 1); + } } //Breaks the Blocks @@ -374,9 +401,13 @@ public class ItemDrill extends ItemEnergy{ if(this.getHasUpgrade(stack, ItemDrillUpgrade.UpgradeType.FIVE_BY_FIVE)){ toReturn = this.breakBlocks(stack, 2, player.worldObj, x, y, z, player); } - else toReturn = this.breakBlocks(stack, 1, player.worldObj, x, y, z, player); + else{ + toReturn = this.breakBlocks(stack, 1, player.worldObj, x, y, z, player); + } + } + else{ + toReturn = this.breakBlocks(stack, 0, player.worldObj, x, y, z, player); } - else toReturn = this.breakBlocks(stack, 0, player.worldObj, x, y, z, player); //Removes Enchantments added above ItemUtil.removeEnchantment(stack, Enchantment.silkTouch); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java index 7d5a18c26..70db26c62 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrillUpgrade.java @@ -78,7 +78,7 @@ public class ItemDrillUpgrade extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java index 237471e79..6bccb0f4f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java @@ -57,7 +57,7 @@ public class ItemDust extends Item implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allDusts.length ? " ERROR!" : allDusts[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allDusts.length ? " ERROR!" : allDusts[stack.getItemDamage()].getName()); } @Override @@ -74,6 +74,6 @@ public class ItemDust extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java index 972a581d9..89201f15b 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java @@ -47,7 +47,7 @@ public class ItemFertilizer extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index 3edd36c29..eba591489 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -70,14 +70,14 @@ public class ItemFoods extends ItemFood implements IActAddItemOrBlock{ @SuppressWarnings("all") @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for (int j = 0; j < allFoods.length; j++){ + for(int j = 0; j < allFoods.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allFoods.length ? " ERROR!" : allFoods[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allFoods.length ? " ERROR!" : allFoods[stack.getItemDamage()].getName()); } @Override @@ -105,7 +105,7 @@ public class ItemFoods extends ItemFood implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ for(int i = 0; i < textures.length; i++){ - textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allFoods[i].getName()); + textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allFoods[i].getName()); } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java index 113f03593..bd80e4223 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemGrowthRing.java @@ -84,7 +84,9 @@ public class ItemGrowthRing extends ItemEnergy{ stack.stackTagCompound.setInteger("WaitTime", 0); } - else stack.stackTagCompound.setInteger("WaitTime", waitTime+1); + else{ + stack.stackTagCompound.setInteger("WaitTime", waitTime+1); + } //Use Energy every tick if(!player.capabilities.isCreativeMode){ @@ -106,7 +108,7 @@ public class ItemGrowthRing extends ItemEnergy{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java b/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java index 310bdc735..ab425122c 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemHairyBall.java @@ -39,7 +39,7 @@ public class ItemHairyBall extends Item implements IActAddItemOrBlock{ player.worldObj.spawnEntityInWorld(entityItem); } stack.stackSize--; - world.playSoundAtEntity(player, "random.pop", 0.2F, new Random().nextFloat() * 0.1F + 0.9F); + world.playSoundAtEntity(player, "random.pop", 0.2F, new Random().nextFloat()*0.1F+0.9F); } return stack; } @@ -61,7 +61,7 @@ public class ItemHairyBall extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java index 651d2f439..4939e1b1f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java @@ -64,14 +64,14 @@ public class ItemJams extends ItemFood implements IActAddItemOrBlock{ @SuppressWarnings("all") @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for (int j = 0; j < allJams.length; j++){ + for(int j = 0; j < allJams.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allJams.length ? " ERROR!" : allJams[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allJams.length ? " ERROR!" : allJams[stack.getItemDamage()].getName()); } @Override @@ -115,8 +115,8 @@ public class ItemJams extends ItemFood implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); - this.overlayIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Overlay"); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); + this.overlayIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+"Overlay"); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java index b6547ca54..ea65decba 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java @@ -35,7 +35,7 @@ public class ItemKnife extends Item implements IActAddItemOrBlock{ @Override public ItemStack getContainerItem(ItemStack stack){ ItemStack theStack = stack.copy(); - theStack.setItemDamage(theStack.getItemDamage() + 1); + theStack.setItemDamage(theStack.getItemDamage()+1); theStack.stackSize = 1; return theStack; } @@ -63,7 +63,7 @@ public class ItemKnife extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index 612c4db8b..3951dbbc9 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -45,21 +45,24 @@ public class ItemLeafBlower extends Item implements IActAddItemOrBlock{ @Override public void onUsingTick(ItemStack stack, EntityPlayer player, int time){ if(!player.worldObj.isRemote){ - if(time <= getMaxItemUseDuration(stack) && (this.isAdvanced || time % 3 == 0)){ + if(time <= getMaxItemUseDuration(stack) && (this.isAdvanced || time%3 == 0)){ //Breaks the Blocks this.breakStuff(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); //Plays a Minecart sounds (It really sounds like a Leaf Blower!) - if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()) player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F); + if(ConfigBoolValues.LEAF_BLOWER_SOUND.isEnabled()){ + player.worldObj.playSoundAtEntity(player, "minecart.base", 0.3F, 0.001F); + } } } } /** * Breaks (harvests) Grass and Leaves around + * * @param world The World - * @param x The X Position of the Player - * @param y The Y Position of the Player - * @param z The Z Position of the Player + * @param x The X Position of the Player + * @param y The Y Position of the Player + * @param z The Z Position of the Player */ public void breakStuff(World world, int x, int y, int z){ ArrayList breakPositions = new ArrayList(); @@ -94,7 +97,7 @@ public class ItemLeafBlower extends Item implements IActAddItemOrBlock{ for(ItemStack theDrop : drops){ //Drops the Items into the World - world.spawnEntityInWorld(new EntityItem(world, theCoord.getX() + 0.5, theCoord.getY() + 0.5, theCoord.getZ() + 0.5, theDrop)); + world.spawnEntityInWorld(new EntityItem(world, theCoord.getX()+0.5, theCoord.getY()+0.5, theCoord.getZ()+0.5, theDrop)); } } } @@ -129,7 +132,7 @@ public class ItemLeafBlower extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java index 66a60378f..9c9d94980 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java @@ -58,7 +58,7 @@ public class ItemMisc extends Item implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allMiscItems.length ? " ERROR!" : allMiscItems[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allMiscItems.length ? " ERROR!" : allMiscItems[stack.getItemDamage()].getName()); } @Override @@ -70,7 +70,7 @@ public class ItemMisc extends Item implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ for(int i = 0; i < textures.length; i++){ - textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allMiscItems[i].getName()); + textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allMiscItems[i].getName()); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java index 58b5a57b2..3451e2f1a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java @@ -121,7 +121,7 @@ public class ItemPhantomConnector extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java index 2316e125d..2f9307acd 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java @@ -58,8 +58,9 @@ public class ItemPotionRing extends Item implements IActAddItemOrBlock{ thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true)); } } - else + else{ thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true)); + } } } } @@ -90,7 +91,7 @@ public class ItemPotionRing extends Item implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allRings.length ? " ERROR!" : allRings[stack.getItemDamage()].getName().substring("potion".length())); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allRings.length ? " ERROR!" : allRings[stack.getItemDamage()].getName().substring("potion".length())); } @Override @@ -107,7 +108,7 @@ public class ItemPotionRing extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java index 9c4e1b078..d4c4814de 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemResonantRice.java @@ -46,7 +46,7 @@ public class ItemResonantRice extends Item implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java index 282747c4a..30b2668c6 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSeed.java @@ -54,7 +54,7 @@ public class ItemSeed extends ItemSeeds implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java index 1fc2cc9b3..38e812ba7 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java @@ -80,7 +80,7 @@ public class ItemSpecialDrop extends Item implements IActAddItemOrBlock{ @Override public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + (stack.getItemDamage() >= allDrops.length ? " ERROR!" : allDrops[stack.getItemDamage()].getName()); + return this.getUnlocalizedName()+(stack.getItemDamage() >= allDrops.length ? " ERROR!" : allDrops[stack.getItemDamage()].getName()); } @Override @@ -92,7 +92,7 @@ public class ItemSpecialDrop extends Item implements IActAddItemOrBlock{ @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ for(int i = 0; i < textures.length; i++){ - textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + allDrops[i].getName()); + textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allDrops[i].getName()); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemTeleStaff.java b/src/main/java/ellpeck/actuallyadditions/items/ItemTeleStaff.java index dc16eade5..b163e0a75 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemTeleStaff.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemTeleStaff.java @@ -52,7 +52,7 @@ public class ItemTeleStaff extends ItemEnergy{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override @@ -74,8 +74,12 @@ public class ItemTeleStaff extends ItemEnergy{ private int getWaitTime(ItemStack stack){ NBTTagCompound compound = stack.getTagCompound(); - if(compound == null) return 0; - else return compound.getInteger("waitTime"); + if(compound == null){ + return 0; + } + else{ + return compound.getInteger("waitTime"); + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java b/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java index 7a3734073..aa6b35086 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemWingsOfTheBats.java @@ -29,10 +29,10 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{ * A List containing all of the Players that can currently fly * Used so that Flight from other Mods' Items doesn't get broken when * these Wings aren't worn - * + *

* Saves Remote Players separately to make de-synced Event Calling * not bug out Capabilities when taking off the Wings - * + *

* (Partially excerpted from Botania's Wing System by Vazkii (as I had fiddled around with the system and couldn't make it work) with permission, thanks!) */ public static ArrayList wingedPlayers = new ArrayList(); @@ -43,6 +43,7 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{ /** * Checks if the Player is winged + * * @param player The Player * @return Winged? */ @@ -52,7 +53,8 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{ /** * Removes the Player from the List of Players that have Wings - * @param player The Player + * + * @param player The Player * @param worldRemote If the World the Player is in is remote */ public static void removeWingsFromPlayer(EntityPlayer player, boolean worldRemote){ @@ -68,6 +70,7 @@ public class ItemWingsOfTheBats extends Item implements IActAddItemOrBlock{ /** * Adds the Player to the List of Players that have Wings + * * @param player The Player */ public static void addWingsToPlayer(EntityPlayer player){ diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java index 1cf632564..8ded7ba83 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAllToolAA.java @@ -73,7 +73,9 @@ public class ItemAllToolAA extends ItemTool implements IActAddItemOrBlock{ @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ){ - if (!player.canPlayerEdit(x, y, z, side, stack)) return false; + if(!player.canPlayerEdit(x, y, z, side, stack)){ + return false; + } else{ UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z); if(MinecraftForge.EVENT_BUS.post(event)) return false; @@ -82,17 +84,21 @@ public class ItemAllToolAA extends ItemTool implements IActAddItemOrBlock{ return true; } Block block = world.getBlock(x, y, z); - if(side != 0 && world.getBlock(x, y + 1, z).isAir(world, x, y + 1, z) && (block == Blocks.grass || block == Blocks.dirt)){ + if(side != 0 && world.getBlock(x, y+1, z).isAir(world, x, y+1, z) && (block == Blocks.grass || block == Blocks.dirt)){ Block block1 = Blocks.farmland; - world.playSoundEffect((double)((float)x + 0.5F), (double)((float)y + 0.5F), (double)((float)z + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); - if (world.isRemote) return true; + world.playSoundEffect((double)((float)x+0.5F), (double)((float)y+0.5F), (double)((float)z+0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume()+1.0F)/2.0F, block1.stepSound.getPitch()*0.8F); + if(world.isRemote){ + return true; + } else{ world.setBlock(x, y, z, block1); stack.damageItem(1, player); return true; } } - else return false; + else{ + return false; + } } } @@ -118,7 +124,7 @@ public class ItemAllToolAA extends ItemTool implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java index f1d197fbd..9d781b99b 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java @@ -51,7 +51,7 @@ public class ItemAxeAA extends ItemAxe implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java index 91b8867b5..db39681ff 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java @@ -58,7 +58,7 @@ public class ItemHoeAA extends ItemHoe implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java index cbec8fd62..08b1cbbc2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java @@ -56,7 +56,7 @@ public class ItemPickaxeAA extends ItemPickaxe implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java index c793bd455..47f096cfc 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java @@ -58,7 +58,7 @@ public class ItemShovelAA extends ItemSpade implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java index b1dddde8d..c9075c7cc 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java @@ -58,7 +58,7 @@ public class ItemSwordAA extends ItemSword implements IActAddItemOrBlock{ @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java index a956cf7e7..3531b7114 100644 --- a/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java +++ b/src/main/java/ellpeck/actuallyadditions/nei/NEIActuallyAdditionsConfig.java @@ -38,7 +38,7 @@ public class NEIActuallyAdditionsConfig implements IConfigureNEI{ @Override public String getName(){ - return ModUtil.MOD_ID + " NEI Plugin"; + return ModUtil.MOD_ID+" NEI Plugin"; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/network/gui/IButtonReactor.java b/src/main/java/ellpeck/actuallyadditions/network/gui/IButtonReactor.java index a572d47b2..cc3564fdb 100644 --- a/src/main/java/ellpeck/actuallyadditions/network/gui/IButtonReactor.java +++ b/src/main/java/ellpeck/actuallyadditions/network/gui/IButtonReactor.java @@ -17,8 +17,9 @@ public interface IButtonReactor{ /** * Called when a Button in a GUI is pressed * Gets called on the Server, sent from the Client + * * @param buttonID The button's ID - * @param player The Player pressing it + * @param player The Player pressing it */ void onButtonPressed(int buttonID, EntityPlayer player); } diff --git a/src/main/java/ellpeck/actuallyadditions/network/gui/INumberReactor.java b/src/main/java/ellpeck/actuallyadditions/network/gui/INumberReactor.java index 0d12026a6..9cdd89970 100644 --- a/src/main/java/ellpeck/actuallyadditions/network/gui/INumberReactor.java +++ b/src/main/java/ellpeck/actuallyadditions/network/gui/INumberReactor.java @@ -16,7 +16,8 @@ public interface INumberReactor{ /** * Called when a Number gets received after typing it in in the GUI - * @param text The number that was sent (I don't remember why I called it text. Had a reason though.) + * + * @param text The number that was sent (I don't remember why I called it text. Had a reason though.) * @param textID The ID (meaning the place in the GUI) of the number typed in * @param player The Player doing it */ diff --git a/src/main/java/ellpeck/actuallyadditions/network/gui/IStringReactor.java b/src/main/java/ellpeck/actuallyadditions/network/gui/IStringReactor.java index f228ccf22..ee7a37e88 100644 --- a/src/main/java/ellpeck/actuallyadditions/network/gui/IStringReactor.java +++ b/src/main/java/ellpeck/actuallyadditions/network/gui/IStringReactor.java @@ -16,7 +16,8 @@ public interface IStringReactor{ /** * Called when a text gets received after typing it in in the GUI - * @param text The text that was sent + * + * @param text The text that was sent * @param textID The ID (meaning the place in the GUI) of the text typed in * @param player The Player doing it */ diff --git a/src/main/java/ellpeck/actuallyadditions/network/sync/IPacketSyncerToClient.java b/src/main/java/ellpeck/actuallyadditions/network/sync/IPacketSyncerToClient.java index da6f25c13..2ee939a5d 100644 --- a/src/main/java/ellpeck/actuallyadditions/network/sync/IPacketSyncerToClient.java +++ b/src/main/java/ellpeck/actuallyadditions/network/sync/IPacketSyncerToClient.java @@ -19,6 +19,7 @@ public interface IPacketSyncerToClient{ /** * Sets the Values on the Client + * * @param values The Values */ void setValues(int[] values); diff --git a/src/main/java/ellpeck/actuallyadditions/recipe/CrusherRecipeAutoRegistry.java b/src/main/java/ellpeck/actuallyadditions/recipe/CrusherRecipeAutoRegistry.java index 9562916c9..235f21a34 100644 --- a/src/main/java/ellpeck/actuallyadditions/recipe/CrusherRecipeAutoRegistry.java +++ b/src/main/java/ellpeck/actuallyadditions/recipe/CrusherRecipeAutoRegistry.java @@ -46,7 +46,7 @@ public class CrusherRecipeAutoRegistry{ public static void registerFinally(){ String[] names = OreDictionary.getOreNames(); for(String inputName : names){ - + if(!hasException(inputName)){ int resultAmount = 1; String inputNameWithoutPrefix = null; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java index 214594102..41552dffe 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBase.java @@ -37,37 +37,37 @@ public class TileEntityBase extends TileEntity{ public static void init(){ ModUtil.LOGGER.info("Registering TileEntities..."); GameRegistry.registerTileEntity(TileEntityCompost.class, ModUtil.MOD_ID_LOWER+":tileEntityCompost"); - GameRegistry.registerTileEntity(TileEntityFeeder.class, ModUtil.MOD_ID_LOWER + ":tileEntityFeeder"); - GameRegistry.registerTileEntity(TileEntityGiantChest.class, ModUtil.MOD_ID_LOWER + ":tileEntityGiantChest"); - GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER + ":tileEntityGrinder"); - GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceDouble"); - GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputter"); - GameRegistry.registerTileEntity(TileEntityFishingNet.class, ModUtil.MOD_ID_LOWER + ":tileEntityFishingNet"); - GameRegistry.registerTileEntity(TileEntityFurnaceSolar.class, ModUtil.MOD_ID_LOWER + ":tileEntityFurnaceSolar"); - GameRegistry.registerTileEntity(TileEntityHeatCollector.class, ModUtil.MOD_ID_LOWER + ":tileEntityHeatCollector"); - GameRegistry.registerTileEntity(TileEntityItemRepairer.class, ModUtil.MOD_ID_LOWER + ":tileEntityRepairer"); - GameRegistry.registerTileEntity(TileEntityGreenhouseGlass.class, ModUtil.MOD_ID_LOWER + ":tileEntityGreenhouseGlass"); - GameRegistry.registerTileEntity(TileEntityBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityBreaker"); - GameRegistry.registerTileEntity(TileEntityDropper.class, ModUtil.MOD_ID_LOWER + ":tileEntityDropper"); - GameRegistry.registerTileEntity(TileEntityInputter.TileEntityInputterAdvanced.class, ModUtil.MOD_ID_LOWER + ":tileEntityInputterAdvanced"); - GameRegistry.registerTileEntity(TileEntityBreaker.TileEntityPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityPlacer"); - GameRegistry.registerTileEntity(TileEntityGrinder.TileEntityGrinderDouble.class, ModUtil.MOD_ID_LOWER + ":tileEntityGrinderDouble"); - GameRegistry.registerTileEntity(TileEntityCanolaPress.class, ModUtil.MOD_ID_LOWER + ":tileEntityCanolaPress"); - GameRegistry.registerTileEntity(TileEntityFermentingBarrel.class, ModUtil.MOD_ID_LOWER + ":tileEntityFermentingBarrel"); - GameRegistry.registerTileEntity(TileEntityOilGenerator.class, ModUtil.MOD_ID_LOWER + ":tileEntityOilGenerator"); - GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoalGenerator"); - GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomItemface"); - GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomLiquiface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomLiquiface"); - GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomEnergyface.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomEnergyface"); - GameRegistry.registerTileEntity(TileEntityPhantomPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomPlacer"); - GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBreaker"); - GameRegistry.registerTileEntity(TileEntityFluidCollector.class, ModUtil.MOD_ID_LOWER + ":tileEntityFluidCollector"); - GameRegistry.registerTileEntity(TileEntityFluidCollector.TileEntityFluidPlacer.class, ModUtil.MOD_ID_LOWER + ":tileEntityFluidPlacer"); - GameRegistry.registerTileEntity(TileEntityLavaFactoryController.class, ModUtil.MOD_ID_LOWER + ":tileEntityLavaFactoryController"); - GameRegistry.registerTileEntity(TileEntityCoffeeMachine.class, ModUtil.MOD_ID_LOWER + ":tileEntityCoffeeMachine"); - GameRegistry.registerTileEntity(TileEntityPhantomBooster.class, ModUtil.MOD_ID_LOWER + ":tileEntityPhantomBooster"); - GameRegistry.registerTileEntity(TileEntityEnergizer.class, ModUtil.MOD_ID_LOWER + ":tileEntityEnergizer"); - GameRegistry.registerTileEntity(TileEntityEnervator.class, ModUtil.MOD_ID_LOWER + ":tileEntityEnervator"); + GameRegistry.registerTileEntity(TileEntityFeeder.class, ModUtil.MOD_ID_LOWER+":tileEntityFeeder"); + GameRegistry.registerTileEntity(TileEntityGiantChest.class, ModUtil.MOD_ID_LOWER+":tileEntityGiantChest"); + GameRegistry.registerTileEntity(TileEntityGrinder.class, ModUtil.MOD_ID_LOWER+":tileEntityGrinder"); + GameRegistry.registerTileEntity(TileEntityFurnaceDouble.class, ModUtil.MOD_ID_LOWER+":tileEntityFurnaceDouble"); + GameRegistry.registerTileEntity(TileEntityInputter.class, ModUtil.MOD_ID_LOWER+":tileEntityInputter"); + GameRegistry.registerTileEntity(TileEntityFishingNet.class, ModUtil.MOD_ID_LOWER+":tileEntityFishingNet"); + GameRegistry.registerTileEntity(TileEntityFurnaceSolar.class, ModUtil.MOD_ID_LOWER+":tileEntityFurnaceSolar"); + GameRegistry.registerTileEntity(TileEntityHeatCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityHeatCollector"); + GameRegistry.registerTileEntity(TileEntityItemRepairer.class, ModUtil.MOD_ID_LOWER+":tileEntityRepairer"); + GameRegistry.registerTileEntity(TileEntityGreenhouseGlass.class, ModUtil.MOD_ID_LOWER+":tileEntityGreenhouseGlass"); + GameRegistry.registerTileEntity(TileEntityBreaker.class, ModUtil.MOD_ID_LOWER+":tileEntityBreaker"); + GameRegistry.registerTileEntity(TileEntityDropper.class, ModUtil.MOD_ID_LOWER+":tileEntityDropper"); + GameRegistry.registerTileEntity(TileEntityInputter.TileEntityInputterAdvanced.class, ModUtil.MOD_ID_LOWER+":tileEntityInputterAdvanced"); + GameRegistry.registerTileEntity(TileEntityBreaker.TileEntityPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityPlacer"); + GameRegistry.registerTileEntity(TileEntityGrinder.TileEntityGrinderDouble.class, ModUtil.MOD_ID_LOWER+":tileEntityGrinderDouble"); + GameRegistry.registerTileEntity(TileEntityCanolaPress.class, ModUtil.MOD_ID_LOWER+":tileEntityCanolaPress"); + GameRegistry.registerTileEntity(TileEntityFermentingBarrel.class, ModUtil.MOD_ID_LOWER+":tileEntityFermentingBarrel"); + GameRegistry.registerTileEntity(TileEntityOilGenerator.class, ModUtil.MOD_ID_LOWER+":tileEntityOilGenerator"); + GameRegistry.registerTileEntity(TileEntityCoalGenerator.class, ModUtil.MOD_ID_LOWER+":tileEntityCoalGenerator"); + GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomItemface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomItemface"); + GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomLiquiface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomLiquiface"); + GameRegistry.registerTileEntity(TileEntityPhantomface.TileEntityPhantomEnergyface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomEnergyface"); + GameRegistry.registerTileEntity(TileEntityPhantomPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomPlacer"); + GameRegistry.registerTileEntity(TileEntityPhantomPlacer.TileEntityPhantomBreaker.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomBreaker"); + GameRegistry.registerTileEntity(TileEntityFluidCollector.class, ModUtil.MOD_ID_LOWER+":tileEntityFluidCollector"); + GameRegistry.registerTileEntity(TileEntityFluidCollector.TileEntityFluidPlacer.class, ModUtil.MOD_ID_LOWER+":tileEntityFluidPlacer"); + GameRegistry.registerTileEntity(TileEntityLavaFactoryController.class, ModUtil.MOD_ID_LOWER+":tileEntityLavaFactoryController"); + GameRegistry.registerTileEntity(TileEntityCoffeeMachine.class, ModUtil.MOD_ID_LOWER+":tileEntityCoffeeMachine"); + GameRegistry.registerTileEntity(TileEntityPhantomBooster.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomBooster"); + GameRegistry.registerTileEntity(TileEntityEnergizer.class, ModUtil.MOD_ID_LOWER+":tileEntityEnergizer"); + GameRegistry.registerTileEntity(TileEntityEnervator.class, ModUtil.MOD_ID_LOWER+":tileEntityEnervator"); GameRegistry.registerTileEntity(TileEntityXPSolidifier.class, ModUtil.MOD_ID_LOWER+":tileEntityXPSolidifier"); GameRegistry.registerTileEntity(TileEntityOreMagnet.class, ModUtil.MOD_ID_LOWER+":tileEntityOreMagnet"); GameRegistry.registerTileEntity(TileEntitySmileyCloud.class, ModUtil.MOD_ID_LOWER+":tileEntityCloud"); diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBreaker.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBreaker.java index eb94852f9..eec1e8402 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBreaker.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityBreaker.java @@ -63,7 +63,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase{ drops.addAll(blockToBreak.getDrops(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), meta, 0)); if(WorldUtil.addToInventory(this.slots, drops, false)){ - worldObj.playAuxSFX(2001, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), Block.getIdFromBlock(blockToBreak) + (meta << 12)); + worldObj.playAuxSFX(2001, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ(), Block.getIdFromBlock(blockToBreak)+(meta << 12)); WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord); WorldUtil.addToInventory(this.slots, drops, true); this.markDirty(); @@ -72,12 +72,16 @@ public class TileEntityBreaker extends TileEntityInventoryBase{ else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord, this.slots[theSlot])); - if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; + if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ + this.slots[theSlot] = null; + } } } } } - else this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); + else{ + this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); + } } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java index 3d4195067..b391125bc 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCanolaPress.java @@ -61,7 +61,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE } } } - else this.currentProcessTime = 0; + else{ + this.currentProcessTime = 0; + } WorldUtil.fillBucket(tank, slots, 1, 2); @@ -90,17 +92,17 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE @SideOnly(Side.CLIENT) public int getTankScaled(int i){ - return this.tank.getFluidAmount() * i / this.tank.getCapacity(); + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @SideOnly(Side.CLIENT) public int getProcessScaled(int i){ - return this.currentProcessTime * i / ConfigIntValues.PRESS_PROCESSING_TIME.getValue(); + return this.currentProcessTime*i/ConfigIntValues.PRESS_PROCESSING_TIME.getValue(); } @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @Override @@ -196,7 +198,9 @@ public class TileEntityCanolaPress extends TileEntityInventoryBase implements IE if(values[2] != -1){ this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1])); } - else this.tank.setFluid(null); + else{ + this.tank.setFluid(null); + } this.storage.setEnergyStored(values[3]); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java index e88b7faa5..b6bf95203 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoalGenerator.java @@ -54,7 +54,9 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements this.maxBurnTime = burnTime; this.currentBurnTime = burnTime; this.slots[0].stackSize--; - if(this.slots[0].stackSize == 0) this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]); + if(this.slots[0].stackSize == 0){ + this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]); + } } } @@ -71,10 +73,13 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ - if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue()*TileEntityFurnace.getItemBurnTime(this.slots[0]) <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN))) + if(!(this.currentBurnTime <= 0 && this.slots[0] != null && TileEntityFurnace.getItemBurnTime(this.slots[0]) > 0 && ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue()*TileEntityFurnace.getItemBurnTime(this.slots[0]) <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN))){ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + } + } + else{ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } - else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } if(this.storage.getEnergyStored() != this.lastEnergy || this.currentBurnTime != this.lastCurrentBurnTime || this.lastBurnTime != this.maxBurnTime){ @@ -88,12 +93,12 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getBurningScaled(int i){ - return this.currentBurnTime * i / this.maxBurnTime; + return this.currentBurnTime*i/this.maxBurnTime; } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java index 52cba7c43..37f151afb 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCoffeeMachine.java @@ -100,7 +100,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements if(ingredient != null){ if(ingredient.effect(output)){ this.slots[i].stackSize--; - if(this.slots[i].stackSize <= 0) this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]); + if(this.slots[i].stackSize <= 0){ + this.slots[i] = this.slots[i].getItem().getContainerItem(this.slots[i]); + } } } } @@ -113,28 +115,30 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements } } } - else this.brewTime = 0; + else{ + this.brewTime = 0; + } } } @SideOnly(Side.CLIENT) public int getCoffeeScaled(int i){ - return this.coffeeCacheAmount * i / this.coffeeCacheMaxAmount; + return this.coffeeCacheAmount*i/this.coffeeCacheMaxAmount; } @SideOnly(Side.CLIENT) public int getWaterScaled(int i){ - return this.tank.getFluidAmount() * i / this.tank.getCapacity(); + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getBrewScaled(int i){ - return this.brewTime * i / ConfigIntValues.COFFEE_MACHINE_TIME_USED.getValue(); + return this.brewTime*i/ConfigIntValues.COFFEE_MACHINE_TIME_USED.getValue(); } @Override @@ -237,7 +241,9 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements if(values[1] != -1){ this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); } - else this.tank.setFluid(null); + else{ + this.tank.setFluid(null); + } this.storage.setEnergyStored(values[2]); this.brewTime = values[3]; this.coffeeCacheAmount = values[4]; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCompost.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCompost.java index 49d22fa33..9cd7b34a0 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityCompost.java @@ -31,11 +31,15 @@ public class TileEntityCompost extends TileEntityInventoryBase{ if(!worldObj.isRemote){ if(this.slots[0] != null && this.slots[0].stackSize > 0){ - int toSet = this.slots[0].stackSize + (this.slots[0].getItem() instanceof ItemFertilizer ? 1 : 0); - if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != toSet) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, toSet, 2); + int toSet = this.slots[0].stackSize+(this.slots[0].getItem() instanceof ItemFertilizer ? 1 : 0); + if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != toSet){ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, toSet, 2); + } } else{ - if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 0) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + if(worldObj.getBlockMetadata(xCoord, yCoord, zCoord) != 0){ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + } } boolean theFlag = this.conversionTime > 0; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityDropper.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityDropper.java index 4843c8828..daa22e557 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityDropper.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityDropper.java @@ -39,7 +39,9 @@ public class TileEntityDropper extends TileEntityInventoryBase{ } } } - else this.currentTime = ConfigIntValues.DROPPER_TIME_NEEDED.getValue(); + else{ + this.currentTime = ConfigIntValues.DROPPER_TIME_NEEDED.getValue(); + } } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java index 850f811d3..9340d0581 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnergizer.java @@ -82,7 +82,7 @@ public class TileEntityEnergizer extends TileEntityInventoryBase implements IEne @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java index bef113289..eacb044a6 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityEnervator.java @@ -97,7 +97,7 @@ public class TileEntityEnervator extends TileEntityInventoryBase implements IEne @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFeeder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFeeder.java index 50362a5e9..507efabc7 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFeeder.java @@ -39,7 +39,7 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket public void updateEntity(){ if(!worldObj.isRemote){ boolean theFlag = this.currentTimer > 0; - List animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(this.xCoord - ConfigIntValues.FEEDER_REACH.getValue(), this.yCoord - ConfigIntValues.FEEDER_REACH.getValue(), this.zCoord - ConfigIntValues.FEEDER_REACH.getValue(), this.xCoord + ConfigIntValues.FEEDER_REACH.getValue(), this.yCoord + ConfigIntValues.FEEDER_REACH.getValue(), this.zCoord + ConfigIntValues.FEEDER_REACH.getValue())); + List animals = worldObj.getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(this.xCoord-ConfigIntValues.FEEDER_REACH.getValue(), this.yCoord-ConfigIntValues.FEEDER_REACH.getValue(), this.zCoord-ConfigIntValues.FEEDER_REACH.getValue(), this.xCoord+ConfigIntValues.FEEDER_REACH.getValue(), this.yCoord+ConfigIntValues.FEEDER_REACH.getValue(), this.zCoord+ConfigIntValues.FEEDER_REACH.getValue())); if(animals != null){ this.currentAnimalAmount = animals.size(); if(this.currentAnimalAmount >= 2){ @@ -53,16 +53,23 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket this.feedAnimal(randomAnimal); this.slots[0].stackSize--; - if(this.slots[0].stackSize == 0) + if(this.slots[0].stackSize == 0){ this.slots[0] = this.slots[0].getItem().getContainerItem(this.slots[0]); + } } } } - else this.currentTimer++; + else{ + this.currentTimer++; + } + } + else{ + this.currentTimer = 0; } - else this.currentTimer = 0; } - else this.currentTimer = 0; + else{ + this.currentTimer = 0; + } } if(theFlag != this.currentTimer > 0){ @@ -81,16 +88,16 @@ public class TileEntityFeeder extends TileEntityInventoryBase implements IPacket animal.func_146082_f(null); Random rand = new Random(); for(int i = 0; i < 7; i++){ - double d = rand.nextGaussian() * 0.02D; - double d1 = rand.nextGaussian() * 0.02D; - double d2 = rand.nextGaussian() * 0.02D; - worldObj.spawnParticle("heart", (animal.posX + (double)(rand.nextFloat() * animal.width * 2.0F)) - animal.width, animal.posY + 0.5D + (double)(rand.nextFloat() * animal.height), (animal.posZ + (double)(rand.nextFloat() * animal.width * 2.0F)) - animal.width, d, d1, d2); + double d = rand.nextGaussian()*0.02D; + double d1 = rand.nextGaussian()*0.02D; + double d2 = rand.nextGaussian()*0.02D; + worldObj.spawnParticle("heart", (animal.posX+(double)(rand.nextFloat()*animal.width*2.0F))-animal.width, animal.posY+0.5D+(double)(rand.nextFloat()*animal.height), (animal.posZ+(double)(rand.nextFloat()*animal.width*2.0F))-animal.width, d, d1, d2); } } @SideOnly(Side.CLIENT) public int getCurrentTimerToScale(int i){ - return this.currentTimer * i / ConfigIntValues.FEEDER_TIME.getValue(); + return this.currentTimer*i/ConfigIntValues.FEEDER_TIME.getValue(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java index 5e84301c1..3ee5610f9 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFermentingBarrel.java @@ -51,7 +51,9 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen this.markDirty(); } } - else this.currentProcessTime = 0; + else{ + this.currentProcessTime = 0; + } WorldUtil.emptyBucket(canolaTank, slots, 0, 1, InitBlocks.fluidCanolaOil); WorldUtil.fillBucket(oilTank, slots, 2, 3); @@ -87,7 +89,7 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @SideOnly(Side.CLIENT) public int getProcessScaled(int i){ - return this.currentProcessTime * i / ConfigIntValues.BARREL_PROCESSING_TIME.getValue(); + return this.currentProcessTime*i/ConfigIntValues.BARREL_PROCESSING_TIME.getValue(); } @Override @@ -100,12 +102,12 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @SideOnly(Side.CLIENT) public int getOilTankScaled(int i){ - return this.oilTank.getFluidAmount() * i / this.oilTank.getCapacity(); + return this.oilTank.getFluidAmount()*i/this.oilTank.getCapacity(); } @SideOnly(Side.CLIENT) public int getCanolaTankScaled(int i){ - return this.canolaTank.getFluidAmount() * i / this.canolaTank.getCapacity(); + return this.canolaTank.getFluidAmount()*i/this.canolaTank.getCapacity(); } @Override @@ -125,7 +127,9 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill){ - if(from != ForgeDirection.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil) return this.canolaTank.fill(resource, doFill); + if(from != ForgeDirection.DOWN && resource.getFluid() == InitBlocks.fluidCanolaOil){ + return this.canolaTank.fill(resource, doFill); + } return 0; } @@ -165,11 +169,15 @@ public class TileEntityFermentingBarrel extends TileEntityInventoryBase implemen if(values[1] != -1){ this.oilTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); } - else this.oilTank.setFluid(null); + else{ + this.oilTank.setFluid(null); + } if(values[3] != -1){ this.canolaTank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2])); } - else this.canolaTank.setFluid(null); + else{ + this.canolaTank.setFluid(null); + } this.currentProcessTime = values[4]; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java index 4eedeb9e1..5599633ff 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFishingNet.java @@ -31,24 +31,26 @@ public class TileEntityFishingNet extends TileEntityBase{ public void updateEntity(){ if(!worldObj.isRemote){ if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ - if(worldObj.getBlock(xCoord, yCoord - 1, zCoord).getMaterial() == Material.water){ + if(worldObj.getBlock(xCoord, yCoord-1, zCoord).getMaterial() == Material.water){ Random rand = new Random(); if(this.timeUntilNextDrop > 0){ this.timeUntilNextDrop--; if(timeUntilNextDrop <= 0){ ItemStack fishable = FishingHooks.getRandomFishable(rand, this.worldObj.rand.nextFloat()); - TileEntity tile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + TileEntity tile = worldObj.getTileEntity(xCoord, yCoord+1, zCoord); if(tile != null && tile instanceof IInventory){ this.insertIntoInventory((IInventory)tile, fishable); } else{ - EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, fishable); + EntityItem item = new EntityItem(worldObj, xCoord+0.5, yCoord+0.5, zCoord+0.5, fishable); item.lifespan = 2000; worldObj.spawnEntityInWorld(item); } } } - else this.timeUntilNextDrop = ConfigIntValues.FISHER_TIME.getValue() + rand.nextInt(ConfigIntValues.FISHER_TIME.getValue() / 2); + else{ + this.timeUntilNextDrop = ConfigIntValues.FISHER_TIME.getValue()+rand.nextInt(ConfigIntValues.FISHER_TIME.getValue()/2); + } } } } @@ -63,7 +65,7 @@ public class TileEntityFishingNet extends TileEntityBase{ inventory.setInventorySlotContents(i, stack); return; } - if(slot.isItemEqual(stack) && slot.stackSize <= slot.getMaxStackSize() - stack.stackSize && slot.stackSize <= inventory.getInventoryStackLimit() - stack.stackSize){ + if(slot.isItemEqual(stack) && slot.stackSize <= slot.getMaxStackSize()-stack.stackSize && slot.stackSize <= inventory.getInventoryStackLimit()-stack.stackSize){ slot.stackSize += stack.stackSize; return; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java index cf3866081..0be923249 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java @@ -78,7 +78,9 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements if(values[1] != -1){ this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); } - else this.tank.setFluid(null); + else{ + this.tank.setFluid(null); + } } @Override @@ -135,11 +137,11 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } } else if(blockToBreak == Blocks.water || blockToBreak == Blocks.flowing_water){ - if(this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ - this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true); - WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord); - } + if(this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ + this.tank.fill(new FluidStack(FluidRegistry.WATER, FluidContainerRegistry.BUCKET_VOLUME), true); + WorldUtil.breakBlockAtSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord); } + } } else if(this.isPlacer && worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()).isReplaceable(worldObj, coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ())){ if(this.tank.getFluidAmount() >= FluidContainerRegistry.BUCKET_VOLUME){ @@ -155,11 +157,17 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements } } } - else this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); + else{ + this.currentTime = ConfigIntValues.BREAKER_TIME_NEEDED.getValue(); + } } - if(!this.isPlacer) WorldUtil.fillBucket(tank, slots, 0, 1); - else WorldUtil.emptyBucket(tank, slots, 0, 1); + if(!this.isPlacer){ + WorldUtil.fillBucket(tank, slots, 0, 1); + } + else{ + WorldUtil.emptyBucket(tank, slots, 0, 1); + } if(!this.isPlacer && this.tank.getFluidAmount() > 0){ WorldUtil.pushFluid(worldObj, xCoord, yCoord, zCoord, ForgeDirection.DOWN, this.tank); @@ -180,7 +188,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getTankScaled(int i){ - return this.tank.getFluidAmount() * i / this.tank.getCapacity(); + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @Override @@ -200,8 +208,12 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements @Override public boolean isItemValidForSlot(int i, ItemStack stack){ if(i == 0){ - if(this.isPlacer) return FluidContainerRegistry.isFilledContainer(stack); - else return stack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET); + if(this.isPlacer){ + return FluidContainerRegistry.isFilledContainer(stack); + } + else{ + return stack.isItemEqual(FluidContainerRegistry.EMPTY_BUCKET); + } } return false; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java index e15f4fb49..49189eb2a 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFurnaceDouble.java @@ -61,7 +61,9 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements } } } - else this.firstSmeltTime = 0; + else{ + this.firstSmeltTime = 0; + } if(canSmeltOnSecond){ if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue()){ @@ -72,17 +74,25 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements } } } - else this.secondSmeltTime = 0; + else{ + this.secondSmeltTime = 0; + } - if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue() && this.firstSmeltTime > 0 || this.secondSmeltTime > 0) this.storage.extractEnergy(ConfigIntValues.FURNACE_ENERGY_USED.getValue(), false); + if(this.storage.getEnergyStored() >= ConfigIntValues.FURNACE_ENERGY_USED.getValue() && this.firstSmeltTime > 0 || this.secondSmeltTime > 0){ + this.storage.extractEnergy(ConfigIntValues.FURNACE_ENERGY_USED.getValue(), false); + } if(flag != (this.firstSmeltTime > 0 || this.secondSmeltTime > 0)){ this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta > 3){ - if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta-4, 2); + if(!this.canSmeltOn(SLOT_INPUT_1, SLOT_OUTPUT_1) && !this.canSmeltOn(SLOT_INPUT_2, SLOT_OUTPUT_2)){ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta-4, 2); + } + } + else{ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta+4, 2); } - else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, meta+4, 2); } if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstSmelt != this.firstSmeltTime || this.lastSecondSmelt != this.secondSmeltTime){ @@ -110,11 +120,15 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements public void finishBurning(int theInput, int theOutput){ ItemStack output = FurnaceRecipes.smelting().getSmeltingResult(this.slots[theInput]); - if (this.slots[theOutput] == null) this.slots[theOutput] = output.copy(); - else if(this.slots[theOutput].getItem() == output.getItem()) this.slots[theOutput].stackSize += output.stackSize; + if(this.slots[theOutput] == null){ + this.slots[theOutput] = output.copy(); + } + else if(this.slots[theOutput].getItem() == output.getItem()){ + this.slots[theOutput].stackSize += output.stackSize; + } this.slots[theInput].stackSize--; - if (this.slots[theInput].stackSize <= 0) this.slots[theInput] = null; + if(this.slots[theInput].stackSize <= 0) this.slots[theInput] = null; } @Override @@ -135,17 +149,17 @@ public class TileEntityFurnaceDouble extends TileEntityInventoryBase implements @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getFirstTimeToScale(int i){ - return this.firstSmeltTime * i / ConfigIntValues.FURNACE_DOUBLE_SMELT_TIME.getValue(); + return this.firstSmeltTime*i/ConfigIntValues.FURNACE_DOUBLE_SMELT_TIME.getValue(); } @SideOnly(Side.CLIENT) public int getSecondTimeToScale(int i){ - return this.secondSmeltTime * i / ConfigIntValues.FURNACE_DOUBLE_SMELT_TIME.getValue(); + return this.secondSmeltTime*i/ConfigIntValues.FURNACE_DOUBLE_SMELT_TIME.getValue(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java index a3304c9b7..99b2bd1df 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java @@ -40,7 +40,9 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ } } } - else this.timeUntilNextFert = ConfigIntValues.GLASS_TIME_NEEDED.getValue()+new Random().nextInt(ConfigIntValues.GLASS_TIME_NEEDED.getValue()); + else{ + this.timeUntilNextFert = ConfigIntValues.GLASS_TIME_NEEDED.getValue()+new Random().nextInt(ConfigIntValues.GLASS_TIME_NEEDED.getValue()); + } } } } @@ -53,7 +55,9 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ if((block instanceof IGrowable || block instanceof IPlantable) && !(block instanceof BlockGrass)){ return new WorldPos(worldObj, xCoord, i, zCoord); } - else return null; + else{ + return null; + } } } return null; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java index aee0bae04..0b48b51cd 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java @@ -125,7 +125,9 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg } } } - else this.firstCrushTime = 0; + else{ + this.firstCrushTime = 0; + } if(this.isDouble){ if(canCrushOnSecond){ @@ -137,18 +139,26 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg } } } - else this.secondCrushTime = 0; + else{ + this.secondCrushTime = 0; + } } - if(this.storage.getEnergyStored() >= getEnergyUse() && this.firstCrushTime > 0 || this.secondCrushTime > 0) this.storage.extractEnergy(getEnergyUse(), false); + if(this.storage.getEnergyStored() >= getEnergyUse() && this.firstCrushTime > 0 || this.secondCrushTime > 0){ + this.storage.extractEnergy(getEnergyUse(), false); + } if(flag != (this.firstCrushTime > 0 || this.secondCrushTime > 0)){ this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ - if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))) worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + if(!this.canCrushOn(SLOT_INPUT_1, SLOT_OUTPUT_1_1, SLOT_OUTPUT_1_2) && (!this.isDouble || !this.canCrushOn(SLOT_INPUT_2, SLOT_OUTPUT_2_1, SLOT_OUTPUT_2_2))){ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + } + } + else{ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } - else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } if(lastEnergy != this.storage.getEnergyStored() || this.lastFirstCrush != this.firstCrushTime || this.lastSecondCrush != this.secondCrushTime){ @@ -178,22 +188,30 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg public void finishCrushing(int theInput, int theFirstOutput, int theSecondOutput){ ItemStack outputOnFirst = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], false); if(outputOnFirst != null){ - if(this.slots[theFirstOutput] == null) this.slots[theFirstOutput] = outputOnFirst.copy(); - else if(this.slots[theFirstOutput].getItem() == outputOnFirst.getItem()) this.slots[theFirstOutput].stackSize += outputOnFirst.stackSize; + if(this.slots[theFirstOutput] == null){ + this.slots[theFirstOutput] = outputOnFirst.copy(); + } + else if(this.slots[theFirstOutput].getItem() == outputOnFirst.getItem()){ + this.slots[theFirstOutput].stackSize += outputOnFirst.stackSize; + } } int chance = CrusherRecipeManualRegistry.getSecondChance(this.slots[theInput]); ItemStack outputOnSecond = CrusherRecipeManualRegistry.getOutput(this.slots[theInput], true); if(outputOnSecond != null){ - int rand = new Random().nextInt(100) + 1; + int rand = new Random().nextInt(100)+1; if(rand <= chance){ - if(this.slots[theSecondOutput] == null) this.slots[theSecondOutput] = outputOnSecond.copy(); - else if(this.slots[theSecondOutput].getItem() == outputOnSecond.getItem()) this.slots[theSecondOutput].stackSize += outputOnSecond.stackSize; + if(this.slots[theSecondOutput] == null){ + this.slots[theSecondOutput] = outputOnSecond.copy(); + } + else if(this.slots[theSecondOutput].getItem() == outputOnSecond.getItem()){ + this.slots[theSecondOutput].stackSize += outputOnSecond.stackSize; + } } } this.slots[theInput].stackSize--; - if (this.slots[theInput].stackSize <= 0) this.slots[theInput] = null; + if(this.slots[theInput].stackSize <= 0) this.slots[theInput] = null; } @Override @@ -214,17 +232,17 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IEnerg @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getFirstTimeToScale(int i){ - return this.firstCrushTime * i / this.getMaxCrushTime(); + return this.firstCrushTime*i/this.getMaxCrushTime(); } @SideOnly(Side.CLIENT) public int getSecondTimeToScale(int i){ - return this.secondCrushTime * i / this.getMaxCrushTime(); + return this.secondCrushTime*i/this.getMaxCrushTime(); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index 4440508e5..3f140d14e 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -28,13 +28,21 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt public void onNumberReceived(int text, int textID, EntityPlayer player){ if(text != -1){ if(this.placeToPut instanceof IInventory){ - if(textID == 0) this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0); - if(textID == 1) this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0); + if(textID == 0){ + this.slotToPutStart = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()-1), 0); + } + if(textID == 1){ + this.slotToPutEnd = Math.max(Math.min(text, ((IInventory)this.placeToPut).getSizeInventory()), 0); + } } if(this.placeToPull instanceof IInventory){ - if(textID == 2) this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0); - if(textID == 3) this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0); + if(textID == 2){ + this.slotToPullStart = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()-1), 0); + } + if(textID == 3){ + this.slotToPullEnd = Math.max(Math.min(text, ((IInventory)this.placeToPull).getSizeInventory()), 0); + } } } this.markDirty(); @@ -171,8 +179,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt ItemStack tempStack = theInventory.getStackInSlot(i); if(tempStack != null){ //Set maxSize to the max Size of the temporary stack if it's smaller than the Inventory's Max Size - if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); - else maxSize = this.getInventoryStackLimit(); + if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()){ + maxSize = tempStack.getMaxStackSize(); + } + else{ + maxSize = this.getInventoryStackLimit(); + } } //If ESD has enough Space & Item in question is on whitelist if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkBothFilters(tempStack)){ @@ -204,13 +216,13 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt if(this.slots[0] != null){ if(theStack.isItemEqual(this.slots[0])){ //If the StackSize is smaller than the space the ESD has left - if(theStack.stackSize <= maxSize - this.slots[0].stackSize){ + if(theStack.stackSize <= maxSize-this.slots[0].stackSize){ this.slots[0].stackSize += theStack.stackSize; theInventory.setInventorySlotContents(theSlotToPull, null); } //If the StackSize is bigger than what fits into the Inventory - else if(theStack.stackSize > maxSize - this.slots[0].stackSize){ - theInventory.decrStackSize(theSlotToPull, maxSize - this.slots[0].stackSize); + else if(theStack.stackSize > maxSize-this.slots[0].stackSize){ + theInventory.decrStackSize(theSlotToPull, maxSize-this.slots[0].stackSize); this.slots[0].stackSize = maxSize; } } @@ -222,8 +234,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt //Actually puts the Item this.setInventorySlotContents(0, toBePut); //Removes the Item from the inventory getting pulled from - if(theStack.stackSize == toBePut.stackSize) theInventory.setInventorySlotContents(theSlotToPull, null); - else theInventory.decrStackSize(theSlotToPull, toBePut.stackSize); + if(theStack.stackSize == toBePut.stackSize){ + theInventory.setInventorySlotContents(theSlotToPull, null); + } + else{ + theInventory.decrStackSize(theSlotToPull, toBePut.stackSize); + } } } } @@ -247,8 +263,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt for(int i = Math.max(theSlotToPut, 0); i < Math.min(this.slotToPutEnd, theInventory.getSizeInventory()); i++){ ItemStack tempStack = theInventory.getStackInSlot(i); if(tempStack != null){ - if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); - else maxSize = theInventory.getInventoryStackLimit(); + if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()){ + maxSize = tempStack.getMaxStackSize(); + } + else{ + maxSize = theInventory.getInventoryStackLimit(); + } } if(theInventory.isItemValidForSlot(i, this.slots[0]) && (tempStack == null || (tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkBothFilters(this.slots[0])){ if(theSided != null){ @@ -273,13 +293,13 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt if(theStack != null){ ItemStack copiedStack = theStack.copy(); if(copiedStack.isItemEqual(this.slots[0])){ - if(this.slots[0].stackSize <= maxSize - copiedStack.stackSize){ + if(this.slots[0].stackSize <= maxSize-copiedStack.stackSize){ copiedStack.stackSize += this.slots[0].stackSize; this.slots[0] = null; theInventory.setInventorySlotContents(theSlotToPut, copiedStack); } - else if(this.slots[0].stackSize > maxSize - copiedStack.stackSize){ - this.decrStackSize(0, maxSize - copiedStack.stackSize); + else if(this.slots[0].stackSize > maxSize-copiedStack.stackSize){ + this.decrStackSize(0, maxSize-copiedStack.stackSize); copiedStack.stackSize = maxSize; theInventory.setInventorySlotContents(theSlotToPut, copiedStack); } @@ -289,8 +309,12 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt ItemStack toBePut = this.slots[0].copy(); if(maxSize < toBePut.stackSize) toBePut.stackSize = maxSize; theInventory.setInventorySlotContents(theSlotToPut, toBePut); - if(this.slots[0].stackSize == toBePut.stackSize) this.slots[0] = null; - else this.decrStackSize(0, toBePut.stackSize); + if(this.slots[0].stackSize == toBePut.stackSize){ + this.slots[0] = null; + } + else{ + this.decrStackSize(0, toBePut.stackSize); + } } } } @@ -300,6 +324,7 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt /** * Checks if one of the filters contains the ItemStack * (Whitelist or empty Blacklist in one of them always lets the Item through!) + * * @param stack The ItemStack * @return If the Item is filtered correctly */ @@ -309,8 +334,9 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt /** * Checks the Whitelist/Blacklist to see if Item fits - * @param stack The Stack to check for - * @param isPull If we're pulling or putting + * + * @param stack The Stack to check for + * @param isPull If we're pulling or putting * @param isWhitelist If it's set to white- or Blacklist * @return Is Item on White-/Blacklist? */ @@ -371,9 +397,15 @@ public class TileEntityInputter extends TileEntityInventoryBase implements IButt if(buttonID == 2) this.sideToPull++; if(buttonID == 3) this.sideToPull--; - if(this.sideToPut >= 6) this.sideToPut = -1; - else if(this.sideToPut < -1) this.sideToPut = 5; - else if(this.sideToPull >= 6) this.sideToPull = -1; + if(this.sideToPut >= 6){ + this.sideToPut = -1; + } + else if(this.sideToPut < -1){ + this.sideToPut = 5; + } + else if(this.sideToPull >= 6){ + this.sideToPull = -1; + } else if(this.sideToPull < -1) this.sideToPull = 5; this.markDirty(); diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java index 72907f848..cc646f63b 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInventoryBase.java @@ -24,7 +24,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements public TileEntityInventoryBase(int slots, String name){ this.initializeSlots(slots); - this.name = "container." + ModUtil.MOD_ID_LOWER + "." + name; + this.name = "container."+ModUtil.MOD_ID_LOWER+"."+name; } @Override @@ -66,7 +66,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public boolean isUseableByPlayer(EntityPlayer player){ - return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; + return player.getDistanceSq(xCoord+0.5D, yCoord+0.5D, zCoord+0.5D) <= 64; } @Override @@ -100,7 +100,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements @Override public ItemStack decrStackSize(int i, int j){ - if (slots[i] != null){ + if(slots[i] != null){ ItemStack stackAt; if(slots[i].stackSize <= j){ stackAt = slots[i]; @@ -110,7 +110,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } else{ stackAt = slots[i].splitStack(j); - if (slots[i].stackSize == 0) slots[i] = null; + if(slots[i].stackSize == 0) slots[i] = null; this.markDirty(); return stackAt; } @@ -151,6 +151,8 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } return theInt; } - else return new int[0]; + else{ + return new int[0]; + } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java index 2c8818c90..13f5fbe68 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityItemRepairer.java @@ -51,12 +51,14 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I this.storage.extractEnergy(ConfigIntValues.REPAIRER_ENERGY_USED.getValue(), false); if(this.nextRepairTick >= ConfigIntValues.REPAIRER_SPEED_SLOWDOWN.getValue()){ this.nextRepairTick = 0; - this.slots[SLOT_INPUT].setItemDamage(this.slots[SLOT_INPUT].getItemDamage() - 1); + this.slots[SLOT_INPUT].setItemDamage(this.slots[SLOT_INPUT].getItemDamage()-1); } } } } - else this.nextRepairTick = 0; + else{ + this.nextRepairTick = 0; + } if(this.lastEnergy != this.storage.getEnergyStored()){ this.lastEnergy = this.storage.getEnergyStored(); @@ -85,13 +87,13 @@ public class TileEntityItemRepairer extends TileEntityInventoryBase implements I @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getItemDamageToScale(int i){ if(this.slots[SLOT_INPUT] != null){ - return (this.slots[SLOT_INPUT].getMaxDamage()-this.slots[SLOT_INPUT].getItemDamage()) * i / this.slots[SLOT_INPUT].getMaxDamage(); + return (this.slots[SLOT_INPUT].getMaxDamage()-this.slots[SLOT_INPUT].getItemDamage())*i/this.slots[SLOT_INPUT].getMaxDamage(); } return 0; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java index 213f97c72..081e830b0 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLavaFactoryController.java @@ -41,7 +41,9 @@ public class TileEntityLavaFactoryController extends TileEntityBase implements I this.storage.extractEnergy(ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue(), false); } } - else this.currentWorkTime = 0; + else{ + this.currentWorkTime = 0; + } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java index 8d8d35b5c..e49c1640f 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOilGenerator.java @@ -72,10 +72,13 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I this.markDirty(); int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if(meta == 1){ - if(!(ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()*ConfigIntValues.OIL_GEN_BURN_TIME.getValue() <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())) + if(!(ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()*ConfigIntValues.OIL_GEN_BURN_TIME.getValue() <= this.getMaxEnergyStored(ForgeDirection.UNKNOWN)-this.getEnergyStored(ForgeDirection.UNKNOWN) && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount())){ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2); + } + } + else{ + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } - else worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2); } if(this.storage.getEnergyStored() != this.lastEnergy || this.tank.getFluidAmount() != this.lastTank || this.lastBurnTime != this.currentBurnTime){ @@ -89,17 +92,17 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getTankScaled(int i){ - return this.tank.getFluidAmount() * i / this.tank.getCapacity(); + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @SideOnly(Side.CLIENT) public int getBurningScaled(int i){ - return this.currentBurnTime * i / ConfigIntValues.OIL_GEN_BURN_TIME.getValue(); + return this.currentBurnTime*i/ConfigIntValues.OIL_GEN_BURN_TIME.getValue(); } @Override @@ -196,7 +199,9 @@ public class TileEntityOilGenerator extends TileEntityInventoryBase implements I if(values[3] != -1){ this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[3]), values[2])); } - else this.tank.setFluid(null); + else{ + this.tank.setFluid(null); + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java index 25ea785e6..a80c8d98d 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityOreMagnet.java @@ -64,7 +64,9 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne this.mine(); } } - else this.currentWorkTimer = ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()); + else{ + this.currentWorkTimer = ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, ConfigIntValues.ORE_MAGNET_MAX_TIMER.getValue()); + } //Extract energy this.storage.extractEnergy(ConfigIntValues.ORE_MAGNET_ENERGY_USE.getValue(), false); @@ -168,12 +170,12 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne @SideOnly(Side.CLIENT) public int getEnergyScaled(int i){ - return this.storage.getEnergyStored() * i / this.storage.getMaxEnergyStored(); + return this.storage.getEnergyStored()*i/this.storage.getMaxEnergyStored(); } @SideOnly(Side.CLIENT) public int getTankScaled(int i){ - return this.tank.getFluidAmount() * i / this.tank.getCapacity(); + return this.tank.getFluidAmount()*i/this.tank.getCapacity(); } @Override @@ -269,7 +271,9 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne if(values[2] != -1){ this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[2]), values[1])); } - else this.tank.setFluid(null); + else{ + this.tank.setFluid(null); + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomPlacer.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomPlacer.java index bcd117314..0f33e8c49 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomPlacer.java @@ -83,12 +83,16 @@ public class TileEntityPhantomPlacer extends TileEntityInventoryBase implements if(boundPosition.getWorld().getBlock(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()).isReplaceable(boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ())){ int theSlot = WorldUtil.findFirstFilledSlot(this.slots); this.setInventorySlotContents(theSlot, WorldUtil.placeBlockAtSide(ForgeDirection.UNKNOWN, boundPosition.getWorld(), boundPosition.getX(), boundPosition.getY(), boundPosition.getZ(), this.slots[theSlot])); - if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0) this.slots[theSlot] = null; + if(this.slots[theSlot] != null && this.slots[theSlot].stackSize <= 0){ + this.slots[theSlot] = null; + } } } } } - else this.currentTime = ConfigIntValues.PHANTOM_PLACER_TIME.getValue(); + else{ + this.currentTime = ConfigIntValues.PHANTOM_PLACER_TIME.getValue(); + } } } } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java index bb650cc5b..1a92ec384 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityPhantomface.java @@ -52,8 +52,12 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP int newRange = defaultRange; for(int i = 0; i < 3; i++){ Block block = world.getBlock(x, y+1+i, z); - if(block == InitBlocks.blockPhantomBooster) newRange = newRange*2; - else break; + if(block == InitBlocks.blockPhantomBooster){ + newRange = newRange*2; + } + else{ + break; + } } return newRange; } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntitySmileyCloud.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntitySmileyCloud.java index 0dadc98b4..1788fc185 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntitySmileyCloud.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntitySmileyCloud.java @@ -77,7 +77,9 @@ public class TileEntitySmileyCloud extends TileEntityBase implements IPacketSync } this.name = newName; } - else this.name = null; + else{ + this.name = null; + } } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityXPSolidifier.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityXPSolidifier.java index 1bbb9f915..2ede19055 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityXPSolidifier.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityXPSolidifier.java @@ -99,6 +99,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I /** * Gets the Player's XP * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) + * * @param player The Player * @return The XP */ @@ -109,6 +110,7 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I /** * Adds (or removes, if negative) a certain amount of XP from a player * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) + * * @param player The Player * @param amount The Amount */ @@ -129,14 +131,21 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I /** * Gets the amount of experience a certain level contains * (Excerpted from OpenBlocks' XP system with permission, thanks guys!) + * * @param level The Level in question * @return The total XP the level has */ private int getExperienceForLevel(int level){ if(level > 0){ - if(level > 0 && level < 16) return level*17; - else if(level > 15 && level < 31) return (int)(1.5*Math.pow(level, 2)-29.5*level+360); - else return (int)(3.5*Math.pow(level, 2)-151.5*level+2220); + if(level > 0 && level < 16){ + return level*17; + } + else if(level > 15 && level < 31){ + return (int)(1.5*Math.pow(level, 2)-29.5*level+360); + } + else{ + return (int)(3.5*Math.pow(level, 2)-151.5*level+2220); + } } return 0; } diff --git a/src/main/java/ellpeck/actuallyadditions/update/ThreadUpdateChecker.java b/src/main/java/ellpeck/actuallyadditions/update/ThreadUpdateChecker.java index 69a45a9e4..09beb2ce0 100644 --- a/src/main/java/ellpeck/actuallyadditions/update/ThreadUpdateChecker.java +++ b/src/main/java/ellpeck/actuallyadditions/update/ThreadUpdateChecker.java @@ -19,7 +19,7 @@ import java.net.URL; public class ThreadUpdateChecker extends Thread{ public ThreadUpdateChecker(){ - this.setName(ModUtil.MOD_ID + " Update Checker"); + this.setName(ModUtil.MOD_ID+" Update Checker"); this.setDaemon(true); this.start(); } diff --git a/src/main/java/ellpeck/actuallyadditions/update/UpdateCheckerClientNotifier.java b/src/main/java/ellpeck/actuallyadditions/update/UpdateCheckerClientNotifier.java index 9223ad6eb..a0efd0c02 100644 --- a/src/main/java/ellpeck/actuallyadditions/update/UpdateCheckerClientNotifier.java +++ b/src/main/java/ellpeck/actuallyadditions/update/UpdateCheckerClientNotifier.java @@ -26,7 +26,7 @@ public class UpdateCheckerClientNotifier{ @SubscribeEvent(receiveCanceled = true) public void onTick(TickEvent.ClientTickEvent event){ //Don't notify directly to prevent the Message getting lost in Spam on World Joining - if(Minecraft.getSystemTime() % 200 == 0 && !notified && UpdateChecker.doneChecking && Minecraft.getMinecraft().thePlayer != null){ + if(Minecraft.getSystemTime()%200 == 0 && !notified && UpdateChecker.doneChecking && Minecraft.getMinecraft().thePlayer != null){ EntityPlayer player = Minecraft.getMinecraft().thePlayer; if(UpdateChecker.checkFailed){ player.addChatComponentMessage(IChatComponent.Serializer.func_150699_a(StringUtil.localize("info."+ModUtil.MOD_ID_LOWER+".update.failed.desc"))); diff --git a/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java b/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java index d9250b53f..204e705b7 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java @@ -36,12 +36,12 @@ public class AssetUtil{ public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory"); public static ResourceLocation getGuiLocation(String file){ - return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/" + file + ".png"); + return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/"+file+".png"); } public static void displayNameString(FontRenderer font, int xSize, int yPositionOfMachineText, String machineName){ String localMachineName = StringUtil.localize(machineName+".name"); - font.drawString(localMachineName, xSize/2 - font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); + font.drawString(localMachineName, xSize/2-font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/actuallyadditions/util/FakePlayerUtil.java b/src/main/java/ellpeck/actuallyadditions/util/FakePlayerUtil.java index 7f054e1f3..43d352801 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/FakePlayerUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/FakePlayerUtil.java @@ -30,6 +30,8 @@ public class FakePlayerUtil{ } return theFakePlayer; } - else return null; + else{ + return null; + } } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java b/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java index 9e91ac5e7..e1694d079 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/StringUtil.java @@ -29,13 +29,17 @@ public class StringUtil{ /** * Localizes a given formatted String with the given Replacements */ - public static String localizeFormatted(String text, Object ... replace){ + public static String localizeFormatted(String text, Object... replace){ return StatCollector.translateToLocalFormatted(text, replace); } public static String toLowerCase(String string){ - if(string == null) return null; - else return string.toLowerCase(); + if(string == null){ + return null; + } + else{ + return string.toLowerCase(); + } } public static boolean equalsToLowerCase(String one, String two){ diff --git a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java index 8a67716ee..2899a06ec 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java @@ -168,9 +168,12 @@ public class WorldUtil{ if(filled != null && FluidContainerRegistry.isEmptyContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(filled) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ int cap = FluidContainerRegistry.getContainerCapacity(tank.getFluid(), slots[inputSlot]); if(cap > 0 && cap <= tank.getFluidAmount()){ - if(slots[outputSlot] == null) + if(slots[outputSlot] == null){ slots[outputSlot] = FluidContainerRegistry.fillFluidContainer(tank.getFluid(), slots[inputSlot].copy()); - else slots[outputSlot].stackSize++; + } + else{ + slots[outputSlot].stackSize++; + } if(slots[outputSlot] != null){ tank.drain(cap, true); @@ -190,9 +193,12 @@ public class WorldUtil{ if(slots[inputSlot] != null && FluidContainerRegistry.isFilledContainer(slots[inputSlot]) && (slots[outputSlot] == null || (slots[outputSlot].isItemEqual(FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy())) && slots[outputSlot].stackSize < slots[outputSlot].getMaxStackSize()))){ if(containedFluid == null || FluidContainerRegistry.containsFluid(slots[inputSlot], new FluidStack(containedFluid, 0))){ if((tank.getFluid() == null || FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]).isFluidEqual(tank.getFluid())) && tank.getCapacity()-tank.getFluidAmount() >= FluidContainerRegistry.getContainerCapacity(slots[inputSlot])){ - if(slots[outputSlot] == null) + if(slots[outputSlot] == null){ slots[outputSlot] = FluidContainerRegistry.drainFluidContainer(slots[inputSlot].copy()); - else slots[outputSlot].stackSize++; + } + else{ + slots[outputSlot].stackSize++; + } tank.fill(FluidContainerRegistry.getFluidForFilledItem(slots[inputSlot]), true); slots[inputSlot].stackSize--; @@ -218,7 +224,9 @@ public class WorldUtil{ if(side < VERTICAL_DIRECTIONS_ORDER.length){ return VERTICAL_DIRECTIONS_ORDER[side]; } - else return CARDINAL_DIRECTIONS_ORDER[side-VERTICAL_DIRECTIONS_ORDER.length]; + else{ + return CARDINAL_DIRECTIONS_ORDER[side-VERTICAL_DIRECTIONS_ORDER.length]; + } } return ForgeDirection.UNKNOWN; } @@ -240,8 +248,12 @@ public class WorldUtil{ if(slots[i] == null || (slots[i].isItemEqual(stack) && slots[i].stackSize <= stack.getMaxStackSize()-stack.stackSize)){ working++; if(actuallyDo){ - if(slots[i] == null) slots[i] = stack.copy(); - else slots[i].stackSize += stack.stackSize; + if(slots[i] == null){ + slots[i] = stack.copy(); + } + else{ + slots[i].stackSize += stack.stackSize; + } } break; }