From 262976074e3e0af80df9a29f42680401d8f56b9f Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 17 Jun 2016 23:50:38 +0200 Subject: [PATCH] Massive cleanup --- .../api/ActuallyAdditionsAPI.java | 6 +- .../api/recipe/CompostRecipe.java | 8 +- .../mod/blocks/BlockCoalGenerator.java | 2 - .../mod/blocks/BlockColoredLamp.java | 12 +- .../mod/blocks/BlockCrystal.java | 12 +- .../mod/blocks/BlockItemViewer.java | 1 - .../mod/blocks/BlockOilGenerator.java | 3 - .../mod/blocks/BlockWildPlant.java | 16 +-- .../mod/blocks/InitBlocks.java | 4 +- .../mod/blocks/render/RenderSmileyCloud.java | 2 +- .../mod/booklet/BookletUtils.java | 6 +- .../mod/booklet/GuiBooklet.java | 14 +- .../mod/booklet/GuiBookletStand.java | 2 +- .../mod/booklet/InitBooklet.java | 15 +- .../mod/booklet/button/BookmarkButton.java | 2 +- .../mod/booklet/button/TexturedButton.java | 2 +- .../mod/booklet/chapter/BookletChapter.java | 3 +- .../chapter/BookletChapterCrusher.java | 2 +- .../mod/booklet/page/PageCoffeeRecipe.java | 2 +- .../mod/booklet/page/PageCrafting.java | 2 +- .../mod/booklet/page/PageCrusherRecipe.java | 2 +- .../mod/booklet/page/PageFurnace.java | 2 +- .../mod/booklet/page/PageLinkButton.java | 2 +- .../mod/booklet/page/PageReconstructor.java | 2 +- .../mod/config/ConfigValues.java | 2 +- .../mod/crafting/BlockCrafting.java | 10 +- .../mod/crafting/CrusherCrafting.java | 40 +++--- .../mod/crafting/FoodCrafting.java | 2 +- .../mod/crafting/InitCrafting.java | 2 +- .../mod/crafting/ItemCrafting.java | 18 ++- .../mod/crafting/MiscCrafting.java | 10 +- .../mod/crafting/ToolCrafting.java | 32 ++--- .../mod/creative/CreativeTab.java | 6 +- .../mod/data/PlayerData.java | 2 +- .../actuallyadditions/mod/data/WorldData.java | 16 +-- .../mod/event/InitEvents.java | 2 +- .../mod/event/PlayerConnectionEvents.java | 1 - .../mod/fluids/InitFluids.java | 2 +- .../mod/gen/InitVillager.java | 6 +- .../mod/gen/JamVillagerTradeHandler.java | 16 +-- .../gen/VillageComponentCustomCropField.java | 18 +-- .../mod/gen/VillageComponentJamHouse.java | 18 +-- .../mod/inventory/ContainerBreaker.java | 8 +- .../mod/inventory/ContainerCanolaPress.java | 8 +- .../mod/inventory/ContainerCoalGenerator.java | 8 +- .../mod/inventory/ContainerCoffeeMachine.java | 8 +- .../ContainerDirectionalBreaker.java | 8 +- .../mod/inventory/ContainerDrill.java | 8 +- .../mod/inventory/ContainerDropper.java | 8 +- .../mod/inventory/ContainerEnergizer.java | 8 +- .../mod/inventory/ContainerEnervator.java | 8 +- .../mod/inventory/ContainerFeeder.java | 8 +- .../inventory/ContainerFermentingBarrel.java | 8 +- .../mod/inventory/ContainerFilter.java | 8 +- .../inventory/ContainerFluidCollector.java | 8 +- .../mod/inventory/ContainerFurnaceDouble.java | 8 +- .../mod/inventory/ContainerGiantChest.java | 8 +- .../mod/inventory/ContainerGrinder.java | 8 +- .../mod/inventory/ContainerInputter.java | 8 +- .../ContainerLaserRelayItemWhitelist.java | 8 +- .../mod/inventory/ContainerMiner.java | 8 +- .../mod/inventory/ContainerOilGenerator.java | 8 +- .../mod/inventory/ContainerPhantomPlacer.java | 8 +- .../inventory/ContainerRangedCollector.java | 8 +- .../mod/inventory/ContainerRepairer.java | 8 +- .../mod/inventory/ContainerXPSolidifier.java | 8 +- .../mod/inventory/gui/GuiBreaker.java | 4 +- .../mod/inventory/gui/GuiCanolaPress.java | 4 +- .../mod/inventory/gui/GuiCoalGenerator.java | 4 +- .../mod/inventory/gui/GuiCoffeeMachine.java | 4 +- .../mod/inventory/gui/GuiCrafter.java | 4 +- .../inventory/gui/GuiDirectionalBreaker.java | 4 +- .../mod/inventory/gui/GuiDrill.java | 4 +- .../mod/inventory/gui/GuiDropper.java | 4 +- .../mod/inventory/gui/GuiEnergizer.java | 4 +- .../mod/inventory/gui/GuiEnervator.java | 4 +- .../mod/inventory/gui/GuiFeeder.java | 4 +- .../inventory/gui/GuiFermentingBarrel.java | 4 +- .../mod/inventory/gui/GuiFluidCollector.java | 4 +- .../mod/inventory/gui/GuiFurnaceDouble.java | 4 +- .../mod/inventory/gui/GuiGiantChest.java | 4 +- .../mod/inventory/gui/GuiGrinder.java | 6 +- .../gui/GuiLaserRelayItemWhitelist.java | 5 +- .../mod/inventory/gui/GuiMiner.java | 4 +- .../mod/inventory/gui/GuiOilGenerator.java | 4 +- .../mod/inventory/gui/GuiPhantomPlacer.java | 4 +- .../mod/inventory/gui/GuiRangedCollector.java | 4 +- .../mod/inventory/gui/GuiRepairer.java | 4 +- .../mod/inventory/gui/GuiSmileyCloud.java | 4 +- .../mod/inventory/gui/GuiXPSolidifier.java | 4 +- .../mod/items/InitForeignPaxels.java | 44 +++--- .../mod/items/InitItems.java | 5 +- .../mod/items/ItemCrystal.java | 10 +- .../mod/items/ItemDrill.java | 57 ++++---- .../actuallyadditions/mod/items/ItemDust.java | 12 +- .../mod/items/ItemFilter.java | 1 - .../mod/items/ItemFoods.java | 22 +-- .../actuallyadditions/mod/items/ItemJams.java | 22 +-- .../mod/items/ItemLaserWrench.java | 2 +- .../actuallyadditions/mod/items/ItemMisc.java | 12 +- .../mod/items/ItemPotionRing.java | 18 +-- .../mod/items/ItemWingsOfTheBats.java | 8 +- .../mod/items/lens/LensRecipeHandler.java | 26 ++-- .../mod/items/lens/Lenses.java | 2 +- .../mod/material/InitArmorMaterials.java | 2 +- .../mod/material/InitToolMaterials.java | 2 +- .../mod/misc/BannerHelper.java | 2 +- .../mod/misc/DungeonLoot.java | 2 +- .../mod/misc/LaserRelayConnectionHandler.java | 2 +- .../mod/misc/SoundHandler.java | 2 +- .../mod/misc/cloud/SmileyCloudEasterEggs.java | 6 +- .../mod/misc/special/SpecialRenderInit.java | 8 +- .../mod/nei/NEIBookletRecipe.java | 2 +- .../mod/nei/NEICoffeeMachineRecipe.java | 2 +- .../mod/nei/NEICompostRecipe.java | 2 +- .../mod/nei/NEIFurnaceDoubleRecipe.java | 8 +- .../mod/nei/NEIHairyBallRecipe.java | 2 +- .../mod/nei/NEIReconstructorRecipe.java | 2 +- .../mod/nei/NEITreasureChestRecipe.java | 2 +- .../mod/network/PacketHandler.java | 100 ++++++------- .../mod/ore/InitOreDict.java | 2 +- .../mod/proxy/ClientProxy.java | 2 +- .../mod/recipe/CrusherRecipeRegistry.java | 2 +- .../mod/recipe/FuelHandler.java | 12 +- .../mod/recipe/HairyBallHandler.java | 2 +- .../mod/recipe/TreasureChestHandler.java | 2 +- .../tile/TileEntityAtomicReconstructor.java | 2 - .../mod/tile/TileEntityBase.java | 3 +- .../mod/tile/TileEntityCanolaPress.java | 1 - .../mod/tile/TileEntityCoalGenerator.java | 2 - .../mod/tile/TileEntityDisplayStand.java | 2 +- .../mod/tile/TileEntityEnervator.java | 1 - .../mod/tile/TileEntityFermentingBarrel.java | 1 - .../mod/tile/TileEntityFurnaceSolar.java | 1 - .../mod/tile/TileEntityLaserRelayEnergy.java | 2 +- .../mod/tile/TileEntityLaserRelayItem.java | 2 +- .../TileEntityLaserRelayItemWhitelist.java | 32 ++--- .../mod/tile/TileEntityLeafGenerator.java | 3 - .../mod/tile/TileEntityMiner.java | 1 - .../mod/tile/TileEntityOilGenerator.java | 2 - .../mod/tile/TileEntityPhantomEnergyface.java | 1 - .../mod/tile/TileEntityPhantomLiquiface.java | 6 - .../mod/tile/TileEntityPhantomPlacer.java | 1 - .../mod/tile/TileEntityPlayerInterface.java | 2 +- .../mod/tile/TileEntityXPSolidifier.java | 136 +++++++++--------- .../mod/update/UpdateChecker.java | 2 +- .../actuallyadditions/mod/util/AssetUtil.java | 3 +- .../mod/util/FakePlayerUtil.java | 2 +- .../actuallyadditions/mod/util/ItemUtil.java | 6 +- .../actuallyadditions/mod/util/ModUtil.java | 2 +- .../actuallyadditions/mod/util/PosUtil.java | 2 +- .../mod/util/RecipeUtil.java | 2 +- .../mod/util/StringUtil.java | 2 +- .../actuallyadditions/mod/util/Util.java | 2 +- .../actuallyadditions/mod/util/WorldUtil.java | 1 - .../mod/util/compat/CompatUtil.java | 2 +- .../mod/util/compat/TeslaUtil.java | 11 +- 157 files changed, 603 insertions(+), 662 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java index f061d87ec..83c79e6b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/ActuallyAdditionsAPI.java @@ -174,7 +174,7 @@ public final class ActuallyAdditionsAPI{ * @param output The output as an ItemStack * @param energyUse The amount of RF used per conversion * @param type The type of lens used for the conversion. To use the default type, use method below. - * Note how this always has to be the same instance of the lens type that the item also has for it to work! + * Note how this always has to be the same INSTANCE of the lens type that the item also has for it to work! */ public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse, LensConversion type){ RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); @@ -191,7 +191,7 @@ public final class ActuallyAdditionsAPI{ * @param output The output's OreDictionary name * @param energyUse The amount of RF used per conversion * @param type The type of lens used for the conversion. To use the default type, use method below - * Note how this always has to be the same instance of the lens type that the item also has for it to work! + * Note how this always has to be the same INSTANCE of the lens type that the item also has for it to work! */ public static void addReconstructorLensConversionRecipe(String input, String output, int energyUse, LensConversion type){ RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type)); @@ -204,7 +204,7 @@ public final class ActuallyAdditionsAPI{ /** * Adds an item and the way it is modified to the Atomic Reconstructor's color lens. * This also works for blocks, but they have to be in their item form. - * The way it is modified is an instance of IColorLensChanger. When modifying the item, + * The way it is modified is an INSTANCE of IColorLensChanger. When modifying the item, * its modifyItem() method will be called with a stack containing the item. * * @param item The item (or block's item) to add diff --git a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java index e98a877b4..cab1f74ee 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/api/recipe/CompostRecipe.java @@ -15,10 +15,10 @@ import net.minecraft.item.ItemStack; public class CompostRecipe{ - public ItemStack input; - public ItemStack output; - public Block inputDisplay; - public Block outputDisplay; + public final ItemStack input; + public final ItemStack output; + public final Block inputDisplay; + public final Block outputDisplay; public CompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay){ this.input = input; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java index 1e80dd6d9..213c79544 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCoalGenerator.java @@ -16,10 +16,8 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index 78911d8b4..13ea5a03f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -41,8 +41,8 @@ import java.util.Random; public class BlockColoredLamp extends BlockBase{ - public static final TheColoredLampColors[] allLampTypes = TheColoredLampColors.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allLampTypes.length-1); + public static final TheColoredLampColors[] ALL_LAMP_TYPES = TheColoredLampColors.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_LAMP_TYPES.length-1); public final boolean isOn; public BlockColoredLamp(boolean isOn, String name){ @@ -106,7 +106,7 @@ public class BlockColoredLamp extends BlockBase{ @Override @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 < ALL_LAMP_TYPES.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -123,7 +123,7 @@ public class BlockColoredLamp extends BlockBase{ @Override protected void registerRendering(){ - for(int i = 0; i < allLampTypes.length; i++){ + for(int i = 0; i < ALL_LAMP_TYPES.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } } @@ -149,7 +149,7 @@ public class BlockColoredLamp extends BlockBase{ @Override public String getItemStackDisplayName(ItemStack stack){ - if(stack.getItemDamage() >= allLampTypes.length){ + if(stack.getItemDamage() >= ALL_LAMP_TYPES.length){ return StringUtil.BUGGED_ITEM_NAME; } return StringUtil.localize(this.getUnlocalizedName(stack)+".name")+(((BlockColoredLamp)this.block).isOn ? " ("+StringUtil.localize("tooltip."+ModUtil.MOD_ID+".onSuffix.desc")+")" : ""); @@ -158,7 +158,7 @@ public class BlockColoredLamp extends BlockBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return InitBlocks.blockColoredLamp.getUnlocalizedName()+allLampTypes[stack.getItemDamage()].name; + return InitBlocks.blockColoredLamp.getUnlocalizedName()+ALL_LAMP_TYPES[stack.getItemDamage()].name; } } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java index c1da939bf..f7165ced5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystal.java @@ -30,8 +30,8 @@ import java.util.List; public class BlockCrystal extends BlockBase{ - public static final TheCrystals[] allCrystals = TheCrystals.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allCrystals.length-1); + public static final TheCrystals[] ALL_CRYSTALS = TheCrystals.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_CRYSTALS.length-1); public BlockCrystal(String name){ super(Material.ROCK, name); @@ -48,7 +48,7 @@ public class BlockCrystal extends BlockBase{ @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allCrystals.length; j++){ + for(int j = 0; j < ALL_CRYSTALS.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -60,14 +60,14 @@ public class BlockCrystal extends BlockBase{ @Override protected void registerRendering(){ - for(int i = 0; i < allCrystals.length; i++){ + for(int i = 0; i < ALL_CRYSTALS.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allCrystals.length ? EnumRarity.COMMON : allCrystals[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_CRYSTALS.length ? EnumRarity.COMMON : ALL_CRYSTALS[stack.getItemDamage()].rarity; } @Override @@ -86,7 +86,7 @@ public class BlockCrystal extends BlockBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allCrystals.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allCrystals[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_CRYSTALS[stack.getItemDamage()].name; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java index fee3a1b7e..f6224fb32 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java @@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayItem; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java index 9bcee2f6e..de01e8298 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockOilGenerator.java @@ -15,12 +15,9 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java index 8985d9a97..28e5b8fbe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockWildPlant.java @@ -40,8 +40,8 @@ import java.util.List; public class BlockWildPlant extends BlockBushBase{ - public static final TheWildPlants[] allWildPlants = TheWildPlants.values(); - private static final PropertyInteger META = PropertyInteger.create("meta", 0, allWildPlants.length-1); + public static final TheWildPlants[] ALL_WILD_PLANTS = TheWildPlants.values(); + private static final PropertyInteger META = PropertyInteger.create("meta", 0, ALL_WILD_PLANTS.length-1); public BlockWildPlant(String name){ super(name); @@ -59,13 +59,13 @@ public class BlockWildPlant extends BlockBushBase{ @SideOnly(Side.CLIENT) public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player){ int metadata = PosUtil.getMetadata(pos, world); - return metadata >= allWildPlants.length ? null : new ItemStack(((BlockPlant)allWildPlants[metadata].wildVersionOf).seedItem); + return metadata >= ALL_WILD_PLANTS.length ? null : new ItemStack(((BlockPlant)ALL_WILD_PLANTS[metadata].wildVersionOf).seedItem); } @Override @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 < ALL_WILD_PLANTS.length; j++){ list.add(new ItemStack(item, 1, j)); } } @@ -73,7 +73,7 @@ public class BlockWildPlant extends BlockBushBase{ @Override public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune){ int metadata = PosUtil.getMetadata(state); - return metadata >= allWildPlants.length ? null : allWildPlants[metadata].wildVersionOf.getDrops(world, pos, allWildPlants[metadata].wildVersionOf.getStateFromMeta(7), fortune); + return metadata >= ALL_WILD_PLANTS.length ? null : ALL_WILD_PLANTS[metadata].wildVersionOf.getDrops(world, pos, ALL_WILD_PLANTS[metadata].wildVersionOf.getStateFromMeta(7), fortune); } @Override @@ -93,14 +93,14 @@ public class BlockWildPlant extends BlockBushBase{ @Override protected void registerRendering(){ - for(int i = 0; i < allWildPlants.length; i++){ + for(int i = 0; i < ALL_WILD_PLANTS.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), META.getName()+"="+i); } } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allWildPlants.length ? EnumRarity.COMMON : allWildPlants[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? EnumRarity.COMMON : ALL_WILD_PLANTS[stack.getItemDamage()].rarity; } @Override @@ -119,7 +119,7 @@ public class BlockWildPlant extends BlockBushBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allWildPlants.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allWildPlants[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_WILD_PLANTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_WILD_PLANTS[stack.getItemDamage()].name; } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index 772e00750..d46856e69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -13,11 +13,11 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockPlant; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockStair; import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks; -import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; +import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import net.minecraft.block.Block; -public class InitBlocks{ +public final class InitBlocks{ public static Block blockCompost; public static Block blockMisc; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java index 6b286cd35..dfacd162e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java @@ -37,7 +37,7 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer{ if(theCloud.name != null && !theCloud.name.isEmpty()){ easterEggs: - for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.cloudStuff){ + for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF){ for(String triggerName : cloud.getTriggerNames()){ if(triggerName != null && theCloud.name != null){ if(triggerName.equalsIgnoreCase(theCloud.name)){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java index 26b8fe0a5..5f040b42b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/BookletUtils.java @@ -40,7 +40,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -public class BookletUtils{ +public final class BookletUtils{ /** * Tries to open a URL in the Browser @@ -75,7 +75,7 @@ public class BookletUtils{ * Draws the Title of the current chapter, current index entry or just "Actually Additions" if neither is present */ public static void drawTitle(GuiBooklet booklet){ - booklet.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); + booklet.mc.getTextureManager().bindTexture(GuiBooklet.RES_LOC); //Upper title booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize/2-142/2, booklet.guiTop-12, 0, 240, 142, 12); //Lower title @@ -134,7 +134,7 @@ public class BookletUtils{ for(Achievement achievement : InitAchievements.ACHIEVEMENT_LIST){ if(achievement.theItemStack != null && ItemUtil.areItemsEqual(stack, achievement.theItemStack, true)){ if(pre){ - booklet.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); + booklet.mc.getTextureManager().bindTexture(GuiBooklet.RES_LOC); booklet.drawTexturedModalRect(booklet.guiLeft+booklet.xSize+1, booklet.guiTop-18, 166, 154, 22, 21); return; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java index 195ca0f58..70b5c63bc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBooklet.java @@ -57,10 +57,10 @@ import java.util.List; @SideOnly(Side.CLIENT) public class GuiBooklet extends GuiScreen implements IBookletGui{ - public static final ResourceLocation resLoc = AssetUtil.getBookletGuiLocation("guiBooklet"); - public static final ResourceLocation resLocHalloween = AssetUtil.getBookletGuiLocation("guiBookletHalloween"); - public static final ResourceLocation resLocChristmas = AssetUtil.getBookletGuiLocation("guiBookletChristmas"); - public static final ResourceLocation resLocValentine = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay"); + public static final ResourceLocation RES_LOC = AssetUtil.getBookletGuiLocation("guiBooklet"); + public static final ResourceLocation RES_LOC_HALLOWEEN = AssetUtil.getBookletGuiLocation("guiBookletHalloween"); + public static final ResourceLocation RES_LOC_CHRISTMAS = AssetUtil.getBookletGuiLocation("guiBookletChristmas"); + public static final ResourceLocation RES_LOC_VALENTINE = AssetUtil.getBookletGuiLocation("guiBookletValentinesDay"); public static final int CHAPTER_BUTTONS_AMOUNT = 13; public static final int INDEX_BUTTONS_OFFSET = 3; @@ -88,10 +88,10 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ public GuiButton buttonPatreon; public GuiButton buttonViewOnline; public GuiTextField searchField; + public boolean changedPageSinceOpen; private int ticksElapsed; private boolean mousePressed; private int hisNameIsAt; - public boolean changedPageSinceOpen; public GuiBooklet(GuiScreen parentScreen, boolean tryOpenMainPage, boolean saveOnClose){ this.xSize = 146; @@ -128,12 +128,12 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{ //Draws the Background GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? resLocChristmas : (ClientProxy.pumpkinBlurPumpkinBlur ? resLocHalloween : (ClientProxy.bulletForMyValentine ? resLocValentine : resLoc))); + this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? RES_LOC_CHRISTMAS : (ClientProxy.pumpkinBlurPumpkinBlur ? RES_LOC_HALLOWEEN : (ClientProxy.bulletForMyValentine ? RES_LOC_VALENTINE : RES_LOC))); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); //Draws the search bar if(this.currentEntrySet.getCurrentEntry() instanceof BookletEntryAllSearch && this.currentEntrySet.getCurrentChapter() == null){ - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java index 03abe74d3..c5513f546 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/GuiBookletStand.java @@ -26,7 +26,7 @@ public class GuiBookletStand extends GuiBooklet{ private GuiButton buttonSetPage; - private TileEntityBookletStand theStand; + private final TileEntityBookletStand theStand; public GuiBookletStand(TileEntityBase theStand){ super(null, false, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index af5b76e11..11f83c78e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -34,11 +34,10 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraftforge.fml.common.Loader; import java.util.ArrayList; -public class InitBooklet{ +public final class InitBooklet{ public static BookletChapter chapterIntro; @@ -62,7 +61,7 @@ public class InitBooklet{ chapterIntro = new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM")).setImportant(); new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeBook)); - new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.recipesCrystals).setNoText(), new PageCrafting(8, MiscCrafting.recipesCrystalBlocks).setNoText(), new PageReconstructor(9, LensRecipeHandler.mainPageRecipes).setNoText()).setSpecial(); + new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1).addTextReplacement("", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "pageAtomicReconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setPageStacksWildcard(), new PageCrafting(7, MiscCrafting.RECIPES_CRYSTALS).setNoText(), new PageCrafting(8, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText(), new PageReconstructor(9, LensRecipeHandler.MAIN_PAGE_RECIPES).setNoText()).setSpecial(); new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).addTextReplacement("", TileEntityCoalGenerator.PRODUCE).setPageStacksWildcard()); new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText()).setImportant(); new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.REDSTONE), new PageTextOnly(1)); @@ -78,7 +77,7 @@ public class InitBooklet{ ArrayList lampPages = new ArrayList(); lampPages.add(new PageTextOnly(lampPages.size()+1)); lampPages.add(new PageCrafting(lampPages.size()+1, BlockCrafting.recipePowerer).setNoText()); - for(IRecipe recipe : BlockCrafting.recipesLamps){ + for(IRecipe recipe : BlockCrafting.RECIPES_LAMPS){ lampPages.add(new PageCrafting(lampPages.size()+1, recipe).setNoText()); } new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn, 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); @@ -103,7 +102,7 @@ public class InitBooklet{ new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); - new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.recipesMashedFood)); + new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_MASHED_FOOD)); new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, ItemCrafting.recipeCrateKeeper), new PageCrafting(3, ItemCrafting.recipeChestToCrateUpgrade)); new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); @@ -133,7 +132,7 @@ public class InitBooklet{ new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant(); ArrayList aiotPages = new ArrayList(); aiotPages.add(new PageTextOnly(aiotPages.size()+1)); - for(IRecipe recipe : ToolCrafting.recipesPaxels){ + for(IRecipe recipe : ToolCrafting.RECIPES_PAXELS){ aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setNoText().setPageStacksWildcard()); } new BookletChapter("aiots", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.emeraldPaxel), aiotPages.toArray(new BookletPage[aiotPages.size()])).setImportant(); @@ -142,7 +141,7 @@ public class InitBooklet{ ArrayList potionRingPages = new ArrayList(); potionRingPages.add(new PageTextOnly(potionRingPages.size()+1)); - for(IRecipe recipe : ItemCrafting.recipesPotionRings){ + for(IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS){ potionRingPages.add(new PageCrafting(potionRingPages.size()+1, recipe).setNoText()); } new BookletChapter("potionRings", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPotionRing), potionRingPages.toArray(new BookletPage[potionRingPages.size()])); @@ -150,7 +149,7 @@ public class InitBooklet{ new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitItems.itemFilter), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant(); //RF Using Items - new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.recipesDrillColoring), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); + new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_DRILL_COLORING), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial(); new BookletChapter("staff", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant(); new BookletChapter("magnetRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing)); new BookletChapter("growthRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java index 9f45b0b36..9bc03fc12 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/BookmarkButton.java @@ -57,7 +57,7 @@ public class BookmarkButton extends GuiButton{ @Override public void drawButton(Minecraft minecraft, int x, int y){ if(this.visible){ - minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); + minecraft.getTextureManager().bindTexture(GuiBooklet.RES_LOC); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java index eea52d598..d106deb9e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/button/TexturedButton.java @@ -46,7 +46,7 @@ public class TexturedButton extends GuiButton{ @Override public void drawButton(Minecraft minecraft, int x, int y){ if(this.visible){ - minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); + minecraft.getTextureManager().bindTexture(GuiBooklet.RES_LOC); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; int k = this.getHoverState(this.hovered); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java index a784e0745..306b8d6ab 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapter.java @@ -77,8 +77,7 @@ public class BookletChapter implements IBookletChapter{ this.color = TextFormatting.DARK_GREEN; } - public BookletChapter setSpecial(){ + public void setSpecial(){ this.color = TextFormatting.DARK_PURPLE; - return this; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java index f3999a35b..8307d6262 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/chapter/BookletChapterCrusher.java @@ -30,7 +30,7 @@ public class BookletChapterCrusher extends BookletChapter{ ArrayList allPages = new ArrayList(); allPages.addAll(Arrays.asList(pages)); - for(CrusherRecipe recipe : CrusherCrafting.miscRecipes){ + for(CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES){ allPages.add(new PageCrusherRecipe(allPages.size()+1, recipe).setNoText()); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java index f80b9b786..02aaaff39 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCoffeeRecipe.java @@ -37,7 +37,7 @@ public class PageCoffeeRecipe extends BookletPageAA{ @Override @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+19, gui.getGuiTop()+20, 146, 94, 99, 60); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java index b0e6bcdeb..59227005f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrafting.java @@ -52,7 +52,7 @@ public class PageCrafting extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+27, gui.getGuiTop()+20, 146, 20, 99, 60); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java index c841f8596..b2e9df9fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageCrusherRecipe.java @@ -43,7 +43,7 @@ public class PageCrusherRecipe extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipe != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 60, 180, 60, 60); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java index 93018eaa6..e2c1779ac 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageFurnace.java @@ -46,7 +46,7 @@ public class PageFurnace extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.input != null || this.getInputForOutput(this.result) != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 0, 180, 60, 60); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java index 8bf1cd4b9..158d6ce7f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageLinkButton.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils; public class PageLinkButton extends PageButton{ - private String link; + private final String link; public PageLinkButton(int id, String link){ super(id); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java index 8e78062a9..5dafb1c49 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/page/PageReconstructor.java @@ -47,7 +47,7 @@ public class PageReconstructor extends BookletPageAA{ @SideOnly(Side.CLIENT) public void renderPre(IBookletGui gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipes[this.recipePos] != null){ - Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.bulletForMyValentine ? GuiBooklet.RES_LOC_VALENTINE : GuiBooklet.RES_LOC); gui.drawRect(gui.getGuiLeft()+37, gui.getGuiTop()+20, 188, 154, 60, 60); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java index 193a979fa..070f7552b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/ConfigValues.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.config; import de.ellpeck.actuallyadditions.mod.config.values.*; import net.minecraftforge.common.config.Configuration; -public class ConfigValues{ +public final class ConfigValues{ public static void defineConfigValues(Configuration config){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java index d4598cf78..bc7436b75 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -27,9 +27,9 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class BlockCrafting{ +public final class BlockCrafting{ - public static final IRecipe[] recipesLamps = new IRecipe[BlockColoredLamp.allLampTypes.length]; + public static final IRecipe[] RECIPES_LAMPS = new IRecipe[BlockColoredLamp.ALL_LAMP_TYPES.length]; public static IRecipe recipeSmileyCloud; public static IRecipe recipePhantomface; public static IRecipe recipeLiquiface; @@ -704,14 +704,14 @@ public class BlockCrafting{ } if(ConfigCrafting.LAMPS.isEnabled()){ - for(int i = 0; i < BlockColoredLamp.allLampTypes.length; i++){ + for(int i = 0; i < BlockColoredLamp.ALL_LAMP_TYPES.length; i++){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockColoredLamp, 6, i), "GCG", "DQD", "GCG", 'C', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 'G', "glowstone", - 'D', "dye"+BlockColoredLamp.allLampTypes[i].name, + 'D', "dye"+BlockColoredLamp.ALL_LAMP_TYPES[i].name, 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()))); - recipesLamps[i] = RecipeUtil.lastIRecipe(); + RECIPES_LAMPS[i] = RecipeUtil.lastIRecipe(); } GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLampPowerer, 4), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java index 36d3c8b81..2ed31929c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/CrusherCrafting.java @@ -24,9 +24,9 @@ import net.minecraft.item.ItemStack; import java.util.ArrayList; -public class CrusherCrafting{ +public final class CrusherCrafting{ - public static final ArrayList miscRecipes = new ArrayList(); + public static final ArrayList MISC_RECIPES = new ArrayList(); public static CrusherRecipe recipeIronHorseArmor; public static CrusherRecipe recipeGoldHorseArmor; public static CrusherRecipe recipeDiamondHorseArmor; @@ -35,38 +35,38 @@ public class CrusherCrafting{ ModUtil.LOGGER.info("Initializing Crusher Recipes..."); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.BONE), new ItemStack(Items.DYE, 6, 15)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 3)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.YELLOW_FLOWER), new ItemStack(Items.DYE, 3, 11)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 0), new ItemStack(Items.DYE, 3, 1)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 1), new ItemStack(Items.DYE, 3, 12)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 2), new ItemStack(Items.DYE, 3, 13)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 3), new ItemStack(Items.DYE, 3, 7)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 4), new ItemStack(Items.DYE, 3, 1)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 5), new ItemStack(Items.DYE, 3, 14)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 6), new ItemStack(Items.DYE, 3, 7)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 7), new ItemStack(Items.DYE, 3, 9)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.RED_FLOWER, 1, 8), new ItemStack(Items.DYE, 3, 7)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 0), new ItemStack(Items.DYE, 4, 11)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 1), new ItemStack(Items.DYE, 4, 13)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 4), new ItemStack(Items.DYE, 4, 1)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.DOUBLE_PLANT, 1, 5), new ItemStack(Items.DYE, 4, 9)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe("oreRedstone", "dustRedstone", 10); ActuallyAdditionsAPI.addCrusherRecipe("oreLapis", "gemLapis", 12); @@ -79,10 +79,10 @@ public class CrusherCrafting{ ActuallyAdditionsAPI.addCrusherRecipe("stone", "cobblestone", 1); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.SUGAR, 2)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GLOWSTONE), new ItemStack(Items.GLOWSTONE_DUST, 4)); - miscRecipes.add(RecipeUtil.lastCrusherRecipe()); + MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe()); ActuallyAdditionsAPI.addCrusherRecipe("oreNickel", "dustNickel", 2, "dustPlatinum", 1, 15); ActuallyAdditionsAPI.addCrusherRecipe("oreIron", "dustIron", 2, "dustGold", 1, 20); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java index 9ae14c044..cbb4d4f10 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/FoodCrafting.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class FoodCrafting{ +public final class FoodCrafting{ public static IRecipe recipePizza; public static IRecipe recipeHamburger; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java index 5f11ad479..b1146d5fd 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/InitCrafting.java @@ -17,7 +17,7 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -public class InitCrafting{ +public final class InitCrafting{ public static void init(){ ModUtil.LOGGER.info("Initializing Crafting Recipes..."); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java index e70bb06b5..2ad63e56a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ItemCrafting.java @@ -17,7 +17,6 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigCrafting; import de.ellpeck.actuallyadditions.mod.config.values.ConfigStringListValues; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.*; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.RecipeUtil; import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraft.block.IGrowable; @@ -28,7 +27,6 @@ import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.common.IPlantable; -import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; @@ -36,11 +34,11 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import java.util.ArrayList; -public class ItemCrafting{ +public final class ItemCrafting{ - public static final ArrayList recipesMashedFood = new ArrayList(); - public static final ArrayList recipesDrillColoring = new ArrayList(); - public static final ArrayList recipesPotionRings = new ArrayList(); + public static final ArrayList RECIPES_MASHED_FOOD = new ArrayList(); + public static final ArrayList RECIPES_DRILL_COLORING = new ArrayList(); + public static final ArrayList RECIPES_POTION_RINGS = new ArrayList(); public static IRecipe recipePhantomConnector; public static IRecipe recipeCoil; public static IRecipe recipeCoilAdvanced; @@ -195,7 +193,7 @@ public class ItemCrafting{ for(int i = 0; i < 16; i++){ if(i != TheColoredLampColors.LIGHT_BLUE.ordinal()){ GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemDrill, 1, i), lightBlueDrill.copy(), "dye"+TheColoredLampColors.values()[i].name)); - recipesDrillColoring.add(RecipeUtil.lastIRecipe()); + RECIPES_DRILL_COLORING.add(RecipeUtil.lastIRecipe()); } } } @@ -552,9 +550,9 @@ public class ItemCrafting{ public static void addRingRecipeWithStack(ItemStack mainStack, int meta){ GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRing, 1, meta), mainStack, mainStack, mainStack, mainStack, new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), new ItemStack(Items.NETHER_WART), new ItemStack(Items.POTIONITEM), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal())); - recipesPotionRings.add(RecipeUtil.lastIRecipe()); + RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPotionRingAdvanced, 1, meta), new ItemStack(InitItems.itemPotionRing, 1, meta), new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal())); - recipesPotionRings.add(RecipeUtil.lastIRecipe()); + RECIPES_POTION_RINGS.add(RecipeUtil.lastIRecipe()); } public static void initMashedFoodRecipes(){ @@ -564,7 +562,7 @@ public class ItemCrafting{ if(!isBlacklisted(item)){ ItemStack ingredient = new ItemStack(item, 1, Util.WILDCARD); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 8, TheMiscItems.MASHED_FOOD.ordinal()), ingredient, ingredient, ingredient, ingredient, new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD)); - recipesMashedFood.add(RecipeUtil.lastIRecipe()); + RECIPES_MASHED_FOOD.add(RecipeUtil.lastIRecipe()); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java index 7d21de824..d0f545007 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/MiscCrafting.java @@ -24,10 +24,10 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class MiscCrafting{ +public final class MiscCrafting{ - public static final IRecipe[] recipesCrystals = new IRecipe[TheCrystals.values().length]; - public static final IRecipe[] recipesCrystalBlocks = new IRecipe[TheCrystals.values().length]; + public static final IRecipe[] RECIPES_CRYSTALS = new IRecipe[TheCrystals.values().length]; + public static final IRecipe[] RECIPES_CRYSTAL_BLOCKS = new IRecipe[TheCrystals.values().length]; public static void init(){ @@ -36,9 +36,9 @@ public class MiscCrafting{ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCrystal, 1, i), "XXX", "XXX", "XXX", 'X', new ItemStack(InitItems.itemCrystal, 1, i))); - recipesCrystalBlocks[i] = RecipeUtil.lastIRecipe(); + RECIPES_CRYSTAL_BLOCKS[i] = RecipeUtil.lastIRecipe(); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemCrystal, 9, i), new ItemStack(InitBlocks.blockCrystal, 1, i))); - recipesCrystals[i] = RecipeUtil.lastIRecipe(); + RECIPES_CRYSTALS[i] = RecipeUtil.lastIRecipe(); } //Dough diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java index f86e9443f..d0974ae16 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/ToolCrafting.java @@ -26,9 +26,9 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import java.util.ArrayList; -public class ToolCrafting{ +public final class ToolCrafting{ - public static final ArrayList recipesPaxels = new ArrayList(); + public static final ArrayList RECIPES_PAXELS = new ArrayList(); public static void init(){ @@ -61,56 +61,56 @@ public class ToolCrafting{ new ItemStack(Items.WOODEN_SHOVEL), new ItemStack(Items.WOODEN_SWORD), new ItemStack(Items.WOODEN_HOE))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.stonePaxel), new ItemStack(Items.STONE_AXE), new ItemStack(Items.STONE_PICKAXE), new ItemStack(Items.STONE_SHOVEL), new ItemStack(Items.STONE_SWORD), new ItemStack(Items.STONE_HOE))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.ironPaxel), new ItemStack(Items.IRON_AXE), new ItemStack(Items.IRON_PICKAXE), new ItemStack(Items.IRON_SHOVEL), new ItemStack(Items.IRON_SWORD), new ItemStack(Items.IRON_HOE))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.goldPaxel), new ItemStack(Items.GOLDEN_AXE), new ItemStack(Items.GOLDEN_PICKAXE), new ItemStack(Items.GOLDEN_SHOVEL), new ItemStack(Items.GOLDEN_SWORD), new ItemStack(Items.GOLDEN_HOE))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.diamondPaxel), new ItemStack(Items.DIAMOND_AXE), new ItemStack(Items.DIAMOND_PICKAXE), new ItemStack(Items.DIAMOND_SHOVEL), new ItemStack(Items.DIAMOND_SWORD), new ItemStack(Items.DIAMOND_HOE))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.emeraldPaxel), new ItemStack(InitItems.itemAxeEmerald), new ItemStack(InitItems.itemPickaxeEmerald), new ItemStack(InitItems.itemSwordEmerald), new ItemStack(InitItems.itemShovelEmerald), new ItemStack(InitItems.itemHoeEmerald))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.obsidianPaxel), new ItemStack(InitItems.itemAxeObsidian), new ItemStack(InitItems.itemPickaxeObsidian), new ItemStack(InitItems.itemSwordObsidian), new ItemStack(InitItems.itemShovelObsidian), new ItemStack(InitItems.itemHoeObsidian))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.quartzPaxel), new ItemStack(InitItems.itemAxeQuartz), new ItemStack(InitItems.itemPickaxeQuartz), new ItemStack(InitItems.itemSwordQuartz), new ItemStack(InitItems.itemShovelQuartz), new ItemStack(InitItems.itemHoeQuartz))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalRed), new ItemStack(InitItems.itemAxeCrystalRed), @@ -118,42 +118,42 @@ public class ToolCrafting{ new ItemStack(InitItems.itemSwordCrystalRed), new ItemStack(InitItems.itemShovelCrystalRed), new ItemStack(InitItems.itemHoeCrystalRed))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalGreen), new ItemStack(InitItems.itemAxeCrystalGreen), new ItemStack(InitItems.itemPickaxeCrystalGreen), new ItemStack(InitItems.itemSwordCrystalGreen), new ItemStack(InitItems.itemShovelCrystalGreen), new ItemStack(InitItems.itemHoeCrystalGreen))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalBlue), new ItemStack(InitItems.itemAxeCrystalBlue), new ItemStack(InitItems.itemPickaxeCrystalBlue), new ItemStack(InitItems.itemSwordCrystalBlue), new ItemStack(InitItems.itemShovelCrystalBlue), new ItemStack(InitItems.itemHoeCrystalBlue))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalLightBlue), new ItemStack(InitItems.itemAxeCrystalLightBlue), new ItemStack(InitItems.itemPickaxeCrystalLightBlue), new ItemStack(InitItems.itemSwordCrystalLightBlue), new ItemStack(InitItems.itemShovelCrystalLightBlue), new ItemStack(InitItems.itemHoeCrystalLightBlue))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalBlack), new ItemStack(InitItems.itemAxeCrystalBlack), new ItemStack(InitItems.itemPickaxeCrystalBlack), new ItemStack(InitItems.itemSwordCrystalBlack), new ItemStack(InitItems.itemShovelCrystalBlack), new ItemStack(InitItems.itemHoeCrystalBlack))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemPaxelCrystalWhite), new ItemStack(InitItems.itemAxeCrystalWhite), new ItemStack(InitItems.itemPickaxeCrystalWhite), new ItemStack(InitItems.itemSwordCrystalWhite), new ItemStack(InitItems.itemShovelCrystalWhite), new ItemStack(InitItems.itemHoeCrystalWhite))); - recipesPaxels.add(RecipeUtil.lastIRecipe()); + RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index 4547e4974..a8b23940a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -28,7 +28,7 @@ import java.util.List; public class CreativeTab extends CreativeTabs{ - public static final CreativeTab instance = new CreativeTab(); + public static final CreativeTab INSTANCE = new CreativeTab(); private List list; public CreativeTab(){ @@ -310,13 +310,13 @@ public class CreativeTab extends CreativeTabs{ public void add(Item item){ if(item != null){ - item.getSubItems(item, instance, this.list); + item.getSubItems(item, INSTANCE, this.list); } } public void add(Block block){ if(block != null){ - block.getSubBlocks(new ItemStack(block).getItem(), instance, this.list); + block.getSubBlocks(new ItemStack(block).getItem(), INSTANCE, this.list); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java index ef93eda0d..2c4f5b8d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/PlayerData.java @@ -16,7 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; import java.util.ArrayList; import java.util.UUID; -public class PlayerData{ +public final class PlayerData{ public static PlayerSave getDataFromPlayer(EntityPlayer player){ ArrayList data = WorldData.PLAYER_SAVE_DATA; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java index 7cc6515cb..7735892aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/data/WorldData.java @@ -34,10 +34,10 @@ public class WorldData{ public static final String DATA_TAG = ModUtil.MOD_ID+"data"; public static final ArrayList PLAYER_SAVE_DATA = new ArrayList(); - private static Map worldData = new ConcurrentHashMap(); + private static final Map WORLD_DATA = new ConcurrentHashMap(); public final ConcurrentSet laserRelayNetworks = new ConcurrentSet(); - private ISaveHandler handler; - private int dimension; + private final ISaveHandler handler; + private final int dimension; public WorldData(ISaveHandler handler, int dimension){ this.handler = handler; @@ -46,13 +46,13 @@ public class WorldData{ public static WorldData getDataForWorld(World world){ int dim = world.provider.getDimension(); - WorldData data = worldData.get(dim); + WorldData data = WORLD_DATA.get(dim); if(data == null){ data = new WorldData(null, dim); if(world.isRemote){ - worldData.put(dim, data); + WORLD_DATA.put(dim, data); ModUtil.LOGGER.info("Creating temporary WorldData for world "+dim+" on the client!"); } else{ @@ -66,7 +66,7 @@ public class WorldData{ public static void load(World world){ if(!world.isRemote && world instanceof WorldServer){ WorldData data = new WorldData(new WorldSpecificSaveHandler((WorldServer)world, world.getSaveHandler()), world.provider.getDimension()); - worldData.put(data.dimension, data); + WORLD_DATA.put(data.dimension, data); try{ File dataFile = data.handler.getMapFileFromName(DATA_TAG+data.dimension); @@ -92,7 +92,7 @@ public class WorldData{ public static void save(World world){ if(!world.isRemote){ - WorldData data = worldData.get(world.provider.getDimension()); + WorldData data = WORLD_DATA.get(world.provider.getDimension()); if(data != null && data.handler != null){ try{ File dataFile = data.handler.getMapFileFromName(DATA_TAG+data.dimension); @@ -122,7 +122,7 @@ public class WorldData{ public static void unload(World world){ if(!world.isRemote){ - worldData.remove(world.provider.getDimension()); + WORLD_DATA.remove(world.provider.getDimension()); ModUtil.LOGGER.info("Unloading WorldData for world "+world.provider.getDimension()+"!"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java index 6c5b16eed..57f8bb81c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/InitEvents.java @@ -18,7 +18,7 @@ import de.ellpeck.actuallyadditions.mod.util.Util; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Loader; -public class InitEvents{ +public final class InitEvents{ public static void init(){ ModUtil.LOGGER.info("Initializing Events..."); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerConnectionEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerConnectionEvents.java index f385ce589..8e1484145 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerConnectionEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/PlayerConnectionEvents.java @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.data.PlayerData; import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.network.PacketServerToClient; -import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java index 98f73541d..9e4130746 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -19,7 +19,7 @@ import net.minecraftforge.fluids.FluidRegistry; import java.util.Locale; -public class InitFluids{ +public final class InitFluids{ public static Fluid fluidCanolaOil; public static Fluid fluidOil; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java index 42911866c..ddacb3eff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/InitVillager.java @@ -15,7 +15,7 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraftforge.fml.common.registry.VillagerRegistry; -public class InitVillager{ +public final class InitVillager{ public static final String JAM_HOUSE_CHEST_NAME = ModUtil.MOD_ID+".jamHouseChest"; @@ -33,8 +33,8 @@ public class InitVillager{ private static void initJamVillagePart(){ //TODO Fix villager /*int jamID = ConfigIntValues.JAM_VILLAGER_ID.getValue(); - VillagerRegistry.instance().registerVillagerId(jamID); - VillagerRegistry.instance().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler()); + VillagerRegistry.INSTANCE().registerVillagerId(jamID); + VillagerRegistry.INSTANCE().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler()); ChestGenHooks jamHouseChest = ChestGenHooks.getInfo(JAM_HOUSE_CHEST_NAME); jamHouseChest.setMin(5); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java index a02677ed7..f8f0ab7e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/JamVillagerTradeHandler.java @@ -50,17 +50,17 @@ public class JamVillagerTradeHandler{ //@Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){ - for(int trade = 0; trade < trades.size(); trade++){ - for(int want = 0; want < trades.get(trade).wants.size(); want++){ - ItemStack wantsOne = trades.get(trade).wants.get(want); - wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(trade).minStackSize, trades.get(trade).maxStackSize); + for(int trade = 0; trade < this.trades.size(); trade++){ + for(int want = 0; want < this.trades.get(trade).wants.size(); want++){ + ItemStack wantsOne = this.trades.get(trade).wants.get(want); + wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, this.trades.get(trade).minStackSize, this.trades.get(trade).maxStackSize); ItemStack wantsTwo = null; if(rand.nextInt(3) == 0){ - int randomSecondTrade = rand.nextInt(trades.size()); - for(int randomSecondWant = 0; randomSecondWant < trades.get(randomSecondTrade).wants.size(); randomSecondWant++){ - wantsTwo = trades.get(randomSecondTrade).wants.get(randomSecondWant); - wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(randomSecondTrade).minStackSize, trades.get(randomSecondTrade).maxStackSize); + int randomSecondTrade = rand.nextInt(this.trades.size()); + for(int randomSecondWant = 0; randomSecondWant < this.trades.get(randomSecondTrade).wants.size(); randomSecondWant++){ + wantsTwo = this.trades.get(randomSecondTrade).wants.get(randomSecondWant); + wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, this.trades.get(randomSecondTrade).minStackSize, this.trades.get(randomSecondTrade).maxStackSize); } } if(wantsOne == wantsTwo){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java index 19ce4ab0a..61c054aa0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentCustomCropField.java @@ -26,9 +26,9 @@ import java.util.Random; public class VillageComponentCustomCropField extends StructureVillagePieces.House1{ - private static final int xSize = 13; - private static final int ySize = 4; - private static final int zSize = 9; + private static final int X_SIZE = 13; + private static final int Y_SIZE = 4; + private static final int Z_SIZE = 9; private int averageGroundLevel = -1; @@ -42,7 +42,7 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous } public static VillageComponentCustomCropField buildComponent(List pieces, int p1, int p2, int p3, EnumFacing p4){ - StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, xSize, ySize, zSize, p4); + StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentCustomCropField(boundingBox, p4) : null; } @@ -53,15 +53,15 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous if(this.averageGroundLevel < 0){ return true; } - this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+ySize-1, 0); + this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+Y_SIZE-1, 0); } - this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.AIR); + this.fillWithBlocks(world, sbb, 0, 0, 0, X_SIZE-1, Y_SIZE-1, Z_SIZE-1, Blocks.AIR); this.spawnActualHouse(world, rand, sbb); - for(int i = 0; i < xSize; i++){ - for(int j = 0; j < zSize; j++){ - this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); + for(int i = 0; i < X_SIZE; i++){ + for(int j = 0; j < Z_SIZE; j++){ + this.clearCurrentPositionBlocksUpwards(world, i, Y_SIZE, j, sbb); this.replaceAirAndLiquidDownwards(world, Blocks.DIRT.getDefaultState(), i, -1, j, sbb); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java index d73824d21..2ce2f0e6e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/gen/VillageComponentJamHouse.java @@ -24,9 +24,9 @@ import java.util.Random; public class VillageComponentJamHouse extends StructureVillagePieces.House1{ - private static final int xSize = 11; - private static final int ySize = 8; - private static final int zSize = 12; + private static final int X_SIZE = 11; + private static final int Y_SIZE = 8; + private static final int Z_SIZE = 12; private int averageGroundLevel = -1; @@ -40,7 +40,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ } public static VillageComponentJamHouse buildComponent(List pieces, int p1, int p2, int p3, EnumFacing p4){ - StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, xSize, ySize, zSize, p4); + StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, X_SIZE, Y_SIZE, Z_SIZE, p4); return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentJamHouse(boundingBox, p4) : null; } @@ -51,15 +51,15 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{ if(this.averageGroundLevel < 0){ return true; } - this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+ySize-1, 0); + this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+Y_SIZE-1, 0); } - this.fillWithBlocks(world, sbb, 0, 0, 0, xSize-1, ySize-1, zSize-1, Blocks.AIR); + this.fillWithBlocks(world, sbb, 0, 0, 0, X_SIZE-1, Y_SIZE-1, Z_SIZE-1, Blocks.AIR); this.spawnActualHouse(world, rand, sbb); - for(int i = 0; i < xSize; i++){ - for(int j = 0; j < zSize; j++){ - this.clearCurrentPositionBlocksUpwards(world, i, ySize, j, sbb); + for(int i = 0; i < X_SIZE; i++){ + for(int j = 0; j < Z_SIZE; j++){ + this.clearCurrentPositionBlocksUpwards(world, i, Y_SIZE, j, sbb); this.replaceAirAndLiquidDownwards(world, Blocks.COBBLESTONE.getDefaultState(), i, -1, j, sbb); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java index 71c5c5c2d..d32505358 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBreaker.java @@ -44,10 +44,10 @@ public class ContainerBreaker extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java index 8a666ba2a..0fa580100 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCanolaPress.java @@ -42,10 +42,10 @@ public class ContainerCanolaPress extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java index 89162aed5..ac31b4c08 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoalGenerator.java @@ -41,10 +41,10 @@ public class ContainerCoalGenerator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java index 34902031a..6a3235757 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerCoffeeMachine.java @@ -52,10 +52,10 @@ public class ContainerCoffeeMachine extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 11; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 11; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java index b461964e4..31f567093 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDirectionalBreaker.java @@ -44,10 +44,10 @@ public class ContainerDirectionalBreaker extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java index fb2213e5f..e0871a873 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java @@ -66,10 +66,10 @@ public class ContainerDrill extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 5; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 5; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java index 7ac5ef2df..f6843b5b9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDropper.java @@ -44,10 +44,10 @@ public class ContainerDropper extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java index e99b39bd4..4f3382ad8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnergizer.java @@ -70,10 +70,10 @@ public class ContainerEnergizer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java index 112e894b4..d13fa3cd6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerEnervator.java @@ -69,10 +69,10 @@ public class ContainerEnervator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java index f83139cd6..847331f2a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFeeder.java @@ -39,10 +39,10 @@ public class ContainerFeeder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java index 07090c987..eaa94d1f6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFermentingBarrel.java @@ -38,10 +38,10 @@ public class ContainerFermentingBarrel extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 0; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java index 846e3d731..e0855fe6c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFilter.java @@ -63,10 +63,10 @@ public class ContainerFilter extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = SLOT_AMOUNT; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = SLOT_AMOUNT; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java index f622045a4..e48cd81d1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFluidCollector.java @@ -38,10 +38,10 @@ public class ContainerFluidCollector extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 0; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java index fdc5c6f20..cc5a34e4f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerFurnaceDouble.java @@ -45,10 +45,10 @@ public class ContainerFurnaceDouble extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 4; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 4; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java index 2964b390e..5a1da714f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGiantChest.java @@ -45,10 +45,10 @@ public class ContainerGiantChest extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 117; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 117; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java index 3730ba761..9ec622969 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerGrinder.java @@ -51,10 +51,10 @@ public class ContainerGrinder extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = this.isDouble ? 6 : 3; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = this.isDouble ? 6 : 3; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java index 87a82485e..d8ae94535 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerInputter.java @@ -56,10 +56,10 @@ public class ContainerInputter extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = this.isAdvanced ? 25 : 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = this.isAdvanced ? 25 : 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java index db269a3f9..db0bfd991 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerLaserRelayItemWhitelist.java @@ -48,10 +48,10 @@ public class ContainerLaserRelayItemWhitelist extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 0; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java index d7f1bff70..f88888640 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerMiner.java @@ -44,10 +44,10 @@ public class ContainerMiner extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java index 9a1bbe2d9..a77bcc3cf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerOilGenerator.java @@ -37,10 +37,10 @@ public class ContainerOilGenerator extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 0; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 0; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java index ea7e57b2f..9b82c73b1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerPhantomPlacer.java @@ -44,10 +44,10 @@ public class ContainerPhantomPlacer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 9; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 9; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java index 052834770..44ae77f02 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRangedCollector.java @@ -51,10 +51,10 @@ public class ContainerRangedCollector extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 18; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 18; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java index adb34ed27..6f1e45d81 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerRepairer.java @@ -42,10 +42,10 @@ public class ContainerRepairer extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 2; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 2; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java index e67d4b50d..a224ac39e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerXPSolidifier.java @@ -41,10 +41,10 @@ public class ContainerXPSolidifier extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; - final int inventoryEnd = inventoryStart+26; - final int hotbarStart = inventoryEnd+1; - final int hotbarEnd = hotbarStart+8; + int inventoryStart = 1; + int inventoryEnd = inventoryStart+26; + int hotbarStart = inventoryEnd+1; + int hotbarEnd = hotbarStart+8; Slot theSlot = this.inventorySlots.get(slot); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java index 07c5bca4c..6bb2f8022 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiBreaker.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiBreaker extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); private final TileEntityBreaker breaker; public GuiBreaker(InventoryPlayer inventory, TileEntityBase tile){ @@ -46,7 +46,7 @@ public class GuiBreaker extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java index bf66e1fe7..73050816d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCanolaPress.java @@ -27,7 +27,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCanolaPress extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCanolaPress"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCanolaPress"); private final TileEntityCanolaPress press; public GuiCanolaPress(InventoryPlayer inventory, TileEntityBase tile){ @@ -63,7 +63,7 @@ public class GuiCanolaPress extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.press.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java index edb494e16..025ecb650 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoalGenerator.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCoalGenerator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoalGenerator"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCoalGenerator"); private final TileEntityCoalGenerator generator; public GuiCoalGenerator(InventoryPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiCoalGenerator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.generator.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java index e51d0f729..2e01a67b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCoffeeMachine.java @@ -34,7 +34,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiCoffeeMachine extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiCoffeeMachine"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiCoffeeMachine"); private final TileEntityCoffeeMachine machine; private final int x; private final int y; @@ -91,7 +91,7 @@ public class GuiCoffeeMachine extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.machine.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java index 4988e219f..b097bf05f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiCrafter.java @@ -23,7 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiCrafter extends GuiContainer{ - private static final ResourceLocation resLoc = new ResourceLocation("textures/gui/container/crafting_table.png"); + private static final ResourceLocation RES_LOC = new ResourceLocation("textures/gui/container/crafting_table.png"); public GuiCrafter(EntityPlayer player){ super(new ContainerCrafter(player)); @@ -40,7 +40,7 @@ public class GuiCrafter extends GuiContainer{ @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java index 9f9465439..fb6e86771 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDirectionalBreaker.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiDirectionalBreaker extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiDirectionalBreaker"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiDirectionalBreaker"); private final TileEntityDirectionalBreaker breaker; public GuiDirectionalBreaker(InventoryPlayer inventory, TileEntityBase tile){ @@ -58,7 +58,7 @@ public class GuiDirectionalBreaker extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.breaker.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java index 58823fdad..24cdb2e1c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDrill.java @@ -23,7 +23,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiDrill extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiDrill"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiDrill"); public GuiDrill(InventoryPlayer inventory){ super(new ContainerDrill(inventory)); @@ -43,7 +43,7 @@ public class GuiDrill extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+54, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 54); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java index d8846d419..e4e08238d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiDropper.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiDropper extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); private final TileEntityDropper dropper; public GuiDropper(InventoryPlayer inventory, TileEntityBase tile){ @@ -46,7 +46,7 @@ public class GuiDropper extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java index f4054b7ab..2d1fde488 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnergizer.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiEnergizer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiEnergizer"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiEnergizer"); private final TileEntityEnergizer energizer; public GuiEnergizer(EntityPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiEnergizer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.energizer.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java index 5a5bae828..96ed0b201 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiEnervator.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiEnervator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiEnergizer"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiEnergizer"); private final TileEntityEnervator enervator; public GuiEnervator(EntityPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiEnervator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.enervator.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java index a7a3f48c6..761527709 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFeeder.java @@ -28,7 +28,7 @@ import java.util.Arrays; @SideOnly(Side.CLIENT) public class GuiFeeder extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFeeder"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFeeder"); public final TileEntityFeeder tileFeeder; public GuiFeeder(InventoryPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiFeeder extends GuiContainer{ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 70); if(this.tileFeeder.currentTimer > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java index a9318fd33..0f23fd9f3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFermentingBarrel.java @@ -27,7 +27,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFermentingBarrel extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFermentingBarrel"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFermentingBarrel"); private final TileEntityFermentingBarrel press; public GuiFermentingBarrel(InventoryPlayer inventory, TileEntityBase tile){ @@ -64,7 +64,7 @@ public class GuiFermentingBarrel extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.press.canolaTank.getFluidAmount() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java index df766a5d9..abeebadc9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFluidCollector.java @@ -27,7 +27,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFluidCollector extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFluidCollector"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFluidCollector"); private final TileEntityFluidCollector collector; public GuiFluidCollector(InventoryPlayer inventory, TileEntityBase tile){ @@ -59,7 +59,7 @@ public class GuiFluidCollector extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.collector.tank.getFluidAmount() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java index b1cb32229..9619ebc7e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiFurnaceDouble.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiFurnaceDouble extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiFurnaceDouble"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiFurnaceDouble"); private final TileEntityFurnaceDouble tileFurnace; public GuiFurnaceDouble(InventoryPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiFurnaceDouble extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileFurnace.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java index f7de51720..f3dfb19b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGiantChest.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiGiantChest extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGiantChest"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiGiantChest"); final TileEntityGiantChest chest; @@ -44,7 +44,7 @@ public class GuiGiantChest extends GuiContainer{ @Override public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft+33, this.guiTop+172, 0, 0, 176, 86); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java index 5e2255a3e..04e289b8b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiGrinder.java @@ -26,8 +26,8 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiGrinder extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiGrinder"); - private static final ResourceLocation resLocDouble = AssetUtil.getGuiLocation("guiGrinderDouble"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiGrinder"); + private static final ResourceLocation RES_LOC_DOUBLE = AssetUtil.getGuiLocation("guiGrinderDouble"); private final TileEntityGrinder tileGrinder; private final boolean isDouble; @@ -64,7 +64,7 @@ public class GuiGrinder extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(this.isDouble ? resLocDouble : resLoc); + this.mc.getTextureManager().bindTexture(this.isDouble ? RES_LOC_DOUBLE : RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileGrinder.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java index f88974876..f8efd24ad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiLaserRelayItemWhitelist.java @@ -26,7 +26,6 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -37,7 +36,7 @@ import java.util.List; @SideOnly(Side.CLIENT) public class GuiLaserRelayItemWhitelist extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiLaserRelayItemWhitelist"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiLaserRelayItemWhitelist"); private final TileEntityLaserRelayItemWhitelist tile; private SmallerButton whitelistLeft; @@ -124,7 +123,7 @@ public class GuiLaserRelayItemWhitelist extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java index 2a850cb1f..770908793 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiMiner.java @@ -30,7 +30,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiMiner extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); private final TileEntityMiner miner; public GuiMiner(InventoryPlayer inventory, TileEntityBase tile){ @@ -63,7 +63,7 @@ public class GuiMiner extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); String mining = this.miner.onlyMineOres ? "Only Mining Ores" : "Mining Everything"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java index 58149624d..f219d9e2c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiOilGenerator.java @@ -27,7 +27,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiOilGenerator extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiOilGenerator"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiOilGenerator"); private final TileEntityOilGenerator generator; public GuiOilGenerator(InventoryPlayer inventory, TileEntityBase tile){ @@ -62,7 +62,7 @@ public class GuiOilGenerator extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.generator.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java index 5b7341b87..a603f2edb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiPhantomPlacer.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiPhantomPlacer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBreaker"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiBreaker"); private final TileEntityPhantomPlacer placer; public GuiPhantomPlacer(InventoryPlayer inventory, TileEntityBase tile){ @@ -46,7 +46,7 @@ public class GuiPhantomPlacer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java index 9362b6f16..7b0ff8806 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRangedCollector.java @@ -34,7 +34,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiRangedCollector extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiRangedCollector"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiRangedCollector"); private final TileEntityRangedCollector collector; private final int x; private final int y; @@ -85,7 +85,7 @@ public class GuiRangedCollector extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+86, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 86); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java index 452d725a1..1348641c1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiRepairer.java @@ -26,7 +26,7 @@ import java.util.Collections; @SideOnly(Side.CLIENT) public class GuiRepairer extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiRepairer"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiRepairer"); private final TileEntityItemRepairer tileRepairer; public GuiRepairer(InventoryPlayer inventory, TileEntityBase tile){ @@ -57,7 +57,7 @@ public class GuiRepairer extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); if(this.tileRepairer.storage.getEnergyStored() > 0){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java index 93c0c8568..5238f6ea4 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiSmileyCloud.java @@ -35,7 +35,7 @@ import java.io.IOException; @SideOnly(Side.CLIENT) public class GuiSmileyCloud extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiSmileyCloud"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiSmileyCloud"); private final int x; private final int y; @@ -76,7 +76,7 @@ public class GuiSmileyCloud extends GuiContainer{ public void drawGuiContainerBackgroundLayer(float f, int x, int y){ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.nameField.drawTextBox(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java index 47c1f52ab..8d97b7cd2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/GuiXPSolidifier.java @@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiXPSolidifier extends GuiContainer{ - private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiXPSolidifier"); + private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("guiXPSolidifier"); private final TileEntityXPSolidifier solidifier; private final int x; private final int y; @@ -86,7 +86,7 @@ public class GuiXPSolidifier extends GuiContainer{ this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); + this.mc.getTextureManager().bindTexture(RES_LOC); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); this.drawCenteredString(this.fontRendererObj, Integer.toString(this.solidifier.amount), this.guiLeft+88, this.guiTop+30, StringUtil.DECIMAL_COLOR_WHITE); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java index c179ad18c..6bb6368b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitForeignPaxels.java @@ -24,14 +24,14 @@ import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapelessOreRecipe; -public class InitForeignPaxels{ +public final class InitForeignPaxels{ public static final int[] MT_COLORS = new int[]{4166, 2248890, 8882649, 12410135, 11451392, 3684412}; public static final String[] MT_NAMES = new String[]{"Obsidian", "LapisLazuli", "Osmium", "Bronze", "Glowstone", "Steel"}; public static final int[] TF_COLORS = new int[]{13332762, 5407943, 5407895, 5394789, 12960613, 12960653, 12410135, 2999795, 10143162}; public static final int[] SO_COLORS = new int[]{9409450, 2040021, 5714944, 526344, 545032}; - public static final Item[] tfPaxels = new Item[9]; - public static final Item[] soPaxels = new Item[5]; + public static final Item[] TF_PAXELS = new Item[9]; + public static final Item[] SO_PAXELS = new Item[5]; //MekanismTools private static final String MEKANISM_TOOLS = "MekanismTools"; private static final String[] MT_REPAIR_NAMES = new String[]{"ingotRefinedObsidian", "gemLapis", "ingotOsmium", "ingotBronze", "ingotRefinedGlowstone", "ingotSteel"}; @@ -42,7 +42,7 @@ public class InitForeignPaxels{ private static final String SIMPLE_ORES = "simpleores"; private static final String[] SO_NAMES = new String[]{"tin", "mythril", "copper", "onyx", "adamantium"}; private static final String[] SO_REPAIR_NAMES = new String[]{"ingotTin", "ingotMythril", "ingotCopper", "gemOnyx", "ingotAdamantium"}; - private static final Item[] mtPaxels = new Item[6]; + private static final Item[] MT_PAXELS = new Item[6]; public static void init(){ //SimpleOres @@ -50,7 +50,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(SIMPLE_ORES)){ ModUtil.LOGGER.info("Initializing "+SIMPLE_ORES+" AIOTs..."); - for(int i = 0; i < soPaxels.length; i++){ + for(int i = 0; i < SO_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_axe"); Item pickaxe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_pickaxe"); Item hoe = ItemUtil.getItemFromName(SIMPLE_ORES+":"+SO_NAMES[i]+"_hoe"); @@ -59,11 +59,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - soPaxels[i] = new ItemAllToolAA(material, SO_REPAIR_NAMES[i], "paxelSO"+SO_NAMES[i], EnumRarity.RARE, SO_COLORS[i]); + SO_PAXELS[i] = new ItemAllToolAA(material, SO_REPAIR_NAMES[i], "paxelSO"+SO_NAMES[i], EnumRarity.RARE, SO_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(soPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(RecipeUtil.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(SO_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -78,7 +78,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(MEKANISM_TOOLS)){ ModUtil.LOGGER.info("Initializing "+MEKANISM_TOOLS+" AIOTs..."); - for(int i = 0; i < mtPaxels.length; i++){ + for(int i = 0; i < MT_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Axe"); Item pickaxe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Pickaxe"); Item hoe = ItemUtil.getItemFromName(MEKANISM_TOOLS+":"+MT_NAMES[i]+"Hoe"); @@ -87,11 +87,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - mtPaxels[i] = new ItemAllToolAA(material, MT_REPAIR_NAMES[i], "paxelMT"+MT_NAMES[i], EnumRarity.RARE, MT_COLORS[i]); + MT_PAXELS[i] = new ItemAllToolAA(material, MT_REPAIR_NAMES[i], "paxelMT"+MT_NAMES[i], EnumRarity.RARE, MT_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(mtPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(RecipeUtil.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(MT_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -106,7 +106,7 @@ public class InitForeignPaxels{ if(Loader.isModLoaded(THERMAL_FOUNDATION)){ ModUtil.LOGGER.info("Initializing "+THERMAL_FOUNDATION+" AIOTs..."); - for(int i = 0; i < tfPaxels.length; i++){ + for(int i = 0; i < TF_PAXELS.length; i++){ Item axe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.axe"+TF_NAMES[i]); Item pickaxe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.pickaxe"+TF_NAMES[i]); Item hoe = ItemUtil.getItemFromName(THERMAL_FOUNDATION+":tool.hoe"+TF_NAMES[i]); @@ -115,11 +115,11 @@ public class InitForeignPaxels{ if(axe != null && pickaxe != null && hoe != null && sword != null && shovel != null && axe instanceof ItemTool){ Item.ToolMaterial material = ((ItemTool)axe).getToolMaterial(); - tfPaxels[i] = new ItemAllToolAA(material, "ingot"+TF_NAMES[i], "paxelTF"+TF_NAMES[i], EnumRarity.RARE, TF_COLORS[i]); + TF_PAXELS[i] = new ItemAllToolAA(material, "ingot"+TF_NAMES[i], "paxelTF"+TF_NAMES[i], EnumRarity.RARE, TF_COLORS[i]); if(ConfigCrafting.PAXELS.isEnabled()){ - GameRegistry.addRecipe(new ShapelessOreRecipe(tfPaxels[i], axe, pickaxe, hoe, sword, shovel)); - ToolCrafting.recipesPaxels.add(RecipeUtil.lastIRecipe()); + GameRegistry.addRecipe(new ShapelessOreRecipe(TF_PAXELS[i], axe, pickaxe, hoe, sword, shovel)); + ToolCrafting.RECIPES_PAXELS.add(RecipeUtil.lastIRecipe()); } } } @@ -131,19 +131,19 @@ public class InitForeignPaxels{ } public static void addToCreativeTab(){ - for(Item item : tfPaxels){ + for(Item item : TF_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } - for(Item item : mtPaxels){ + for(Item item : MT_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } - for(Item item : soPaxels){ + for(Item item : SO_PAXELS){ if(item != null){ - CreativeTab.instance.add(item); + CreativeTab.INSTANCE.add(item); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java index bdf9f281f..4be4f5e4a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/InitItems.java @@ -22,17 +22,16 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials; import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials; -import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.Util; +import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fml.common.Loader; -public class InitItems{ +public final class InitItems{ public static Item itemBooklet; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java index b8153d1e2..d14a9e45c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystal.java @@ -40,27 +40,27 @@ public class ItemCrystal extends ItemBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+BlockCrystal.allCrystals[stack.getItemDamage()].name; + return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= BlockCrystal.allCrystals.length ? EnumRarity.COMMON : BlockCrystal.allCrystals[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= BlockCrystal.ALL_CRYSTALS.length ? EnumRarity.COMMON : BlockCrystal.ALL_CRYSTALS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < BlockCrystal.allCrystals.length; j++){ + for(int j = 0; j < BlockCrystal.ALL_CRYSTALS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < BlockCrystal.allCrystals.length; i++){ - String name = this.getRegistryName()+BlockCrystal.allCrystals[i].name; + for(int i = 0; i < BlockCrystal.ALL_CRYSTALS.length; i++){ + String name = this.getRegistryName()+BlockCrystal.ALL_CRYSTALS[i].name; ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index 3fbed02c5..b96b4f794 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -73,6 +73,32 @@ public class ItemDrill extends ItemEnergy{ this.setHarvestLevel("pickaxe", HARVEST_LEVEL); } + /** + * Gets all of the Slots from NBT + * + * @param stack The Drill + */ + public static void loadSlotsFromNBT(ItemStack[] slots, ItemStack stack){ + NBTTagCompound compound = stack.getTagCompound(); + if(compound != null){ + TileEntityInventoryBase.loadSlots(slots, compound); + } + } + + /** + * Writes all of the Slots to NBT + * + * @param slots The Slots + * @param stack The Drill + */ + public static void writeSlotsToNBT(ItemStack[] slots, ItemStack stack){ + NBTTagCompound compound = stack.getTagCompound(); + if(compound == null){ + compound = new NBTTagCompound(); + } + TileEntityInventoryBase.saveSlots(slots, compound); + stack.setTagCompound(compound); + } @Override //Places Blocks if the Placing Upgrade is installed @@ -139,19 +165,6 @@ public class ItemDrill extends ItemEnergy{ return null; } - /** - * Gets all of the Slots from NBT - * - * @param stack The Drill - */ - public static void loadSlotsFromNBT(ItemStack[] slots, ItemStack stack){ - NBTTagCompound compound = stack.getTagCompound(); - if(compound != null){ - TileEntityInventoryBase.loadSlots(slots, compound); - } - } - - @Override public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote && player.isSneaking()){ @@ -197,13 +210,11 @@ public class ItemDrill extends ItemEnergy{ } } - @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.EPIC; } - @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ Multimap map = super.getAttributeModifiers(slot, stack); @@ -263,7 +274,6 @@ public class ItemDrill extends ItemEnergy{ return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || block.getMaterial(state).isToolNotRequired() || (block == Blocks.SNOW_LAYER || block == Blocks.SNOW || (block == Blocks.OBSIDIAN ? harvestLevel >= 3 : (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE ? (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK ? (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE ? (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE ? (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE ? (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE ? (block.getMaterial(state) == Material.ROCK || (block.getMaterial(state) == Material.IRON || block.getMaterial(state) == Material.ANVIL)) : harvestLevel >= 2) : harvestLevel >= 1) : harvestLevel >= 1) : harvestLevel >= 2) : harvestLevel >= 2) : harvestLevel >= 2)))); } - @Override public Set getToolClasses(ItemStack stack){ HashSet hashSet = new HashSet(); @@ -388,21 +398,6 @@ public class ItemDrill extends ItemEnergy{ return efficiency; } - /** - * Writes all of the Slots to NBT - * - * @param slots The Slots - * @param stack The Drill - */ - public static void writeSlotsToNBT(ItemStack[] slots, ItemStack stack){ - NBTTagCompound compound = stack.getTagCompound(); - if(compound == null){ - compound = new NBTTagCompound(); - } - TileEntityInventoryBase.saveSlots(slots, compound); - stack.setTagCompound(compound); - } - /** * Breaks Blocks in a certain Radius * Has to be called on both Server and Client diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java index c8942b086..0d40df918 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java @@ -27,7 +27,7 @@ import java.util.List; public class ItemDust extends ItemBase implements IColorProvidingItem{ - public static final TheDusts[] allDusts = TheDusts.values(); + public static final TheDusts[] ALL_DUSTS = TheDusts.values(); public ItemDust(String name){ super(name); @@ -42,26 +42,26 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allDusts.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allDusts[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_DUSTS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_DUSTS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allDusts.length ? EnumRarity.COMMON : allDusts[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_DUSTS.length ? EnumRarity.COMMON : ALL_DUSTS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allDusts.length; j++){ + for(int j = 0; j < ALL_DUSTS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < allDusts.length; i++){ + for(int i = 0; i < ALL_DUSTS.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } @@ -72,7 +72,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{ return new IItemColor(){ @Override public int getColorFromItemstack(ItemStack stack, int pass){ - return stack.getItemDamage() >= allDusts.length ? 0xFFFFFF : allDusts[stack.getItemDamage()].color; + return stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color; } }; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java index e94fb72e4..6a5343bc5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFilter.java @@ -11,7 +11,6 @@ package de.ellpeck.actuallyadditions.mod.items; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill; import de.ellpeck.actuallyadditions.mod.inventory.ContainerFilter; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java index 9af9a471b..4030dcc96 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemFoods.java @@ -31,7 +31,7 @@ import java.util.List; public class ItemFoods extends ItemFoodBase{ - public static final TheFoods[] allFoods = TheFoods.values(); + public static final TheFoods[] ALL_FOODS = TheFoods.values(); public ItemFoods(String name){ super(0, 0.0F, false, name); @@ -43,7 +43,7 @@ public class ItemFoods extends ItemFoodBase{ @Override public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase player){ ItemStack stackToReturn = super.onItemUseFinish(stack, world, player); - ItemStack returnItem = stack.getItemDamage() >= allFoods.length ? null : allFoods[stack.getItemDamage()].returnItem; + ItemStack returnItem = stack.getItemDamage() >= ALL_FOODS.length ? null : ALL_FOODS[stack.getItemDamage()].returnItem; if(returnItem != null && player instanceof EntityPlayer){ if(!((EntityPlayer)player).inventory.addItemStackToInventory(returnItem.copy())){ if(!world.isRemote){ @@ -58,23 +58,23 @@ public class ItemFoods extends ItemFoodBase{ @Override public int getMaxItemUseDuration(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].useDuration; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].useDuration; } @Override public EnumAction getItemUseAction(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? EnumAction.EAT : (allFoods[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT); + return stack.getItemDamage() >= ALL_FOODS.length ? EnumAction.EAT : (ALL_FOODS[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT); } @Override public int getHealAmount(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].healAmount; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].healAmount; } @Override public float getSaturationModifier(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].saturation; + return stack.getItemDamage() >= ALL_FOODS.length ? 0 : ALL_FOODS[stack.getItemDamage()].saturation; } @Override @@ -85,27 +85,27 @@ public class ItemFoods extends ItemFoodBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allFoods[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_FOODS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_FOODS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allFoods.length ? EnumRarity.COMMON : allFoods[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_FOODS.length ? EnumRarity.COMMON : ALL_FOODS[stack.getItemDamage()].rarity; } @Override @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 < ALL_FOODS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < allFoods.length; i++){ - String name = this.getRegistryName()+allFoods[i].name; + for(int i = 0; i < ALL_FOODS.length; i++){ + String name = this.getRegistryName()+ALL_FOODS[i].name; ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ModelResourceLocation(name), "inventory"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java index 36a0374bb..5dfd93ffe 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java @@ -34,7 +34,7 @@ import java.util.List; public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ - public static final TheJams[] allJams = TheJams.values(); + public static final TheJams[] ALL_JAMS = TheJams.values(); public ItemJams(String name){ super(0, 0.0F, false, name); @@ -51,19 +51,19 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allJams[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_JAMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_JAMS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? EnumRarity.COMMON : allJams[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_JAMS.length ? EnumRarity.COMMON : ALL_JAMS[stack.getItemDamage()].rarity; } @Override @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 < ALL_JAMS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @@ -72,11 +72,11 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ public ItemStack onItemUseFinish(ItemStack stack, World world, EntityLivingBase player){ ItemStack stackToReturn = super.onItemUseFinish(stack, world, player); - if(player instanceof EntityPlayer && !world.isRemote && stack.getItemDamage() < allJams.length){ - PotionEffect firstEffectToGet = new PotionEffect(Potion.getPotionById(allJams[stack.getItemDamage()].firstEffectToGet), 200); + if(player instanceof EntityPlayer && !world.isRemote && stack.getItemDamage() < ALL_JAMS.length){ + PotionEffect firstEffectToGet = new PotionEffect(Potion.getPotionById(ALL_JAMS[stack.getItemDamage()].firstEffectToGet), 200); player.addPotionEffect(firstEffectToGet); - PotionEffect secondEffectToGet = new PotionEffect(Potion.getPotionById(allJams[stack.getItemDamage()].secondEffectToGet), 600); + PotionEffect secondEffectToGet = new PotionEffect(Potion.getPotionById(ALL_JAMS[stack.getItemDamage()].secondEffectToGet), 600); player.addPotionEffect(secondEffectToGet); ItemStack returnItem = new ItemStack(Items.GLASS_BOTTLE); @@ -91,17 +91,17 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ @Override public int getHealAmount(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? 0 : allJams[stack.getItemDamage()].healAmount; + return stack.getItemDamage() >= ALL_JAMS.length ? 0 : ALL_JAMS[stack.getItemDamage()].healAmount; } @Override public float getSaturationModifier(ItemStack stack){ - return stack.getItemDamage() >= allJams.length ? 0 : allJams[stack.getItemDamage()].saturation; + return stack.getItemDamage() >= ALL_JAMS.length ? 0 : ALL_JAMS[stack.getItemDamage()].saturation; } @Override protected void registerRendering(){ - for(int i = 0; i < allJams.length; i++){ + for(int i = 0; i < ALL_JAMS.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } @@ -112,7 +112,7 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ return new IItemColor(){ @Override public int getColorFromItemstack(ItemStack stack, int pass){ - return pass > 0 ? (stack.getItemDamage() >= allJams.length ? 0xFFFFFF : allJams[stack.getItemDamage()].color) : 0xFFFFFF; + return pass > 0 ? (stack.getItemDamage() >= ALL_JAMS.length ? 0xFFFFFF : ALL_JAMS[stack.getItemDamage()].color) : 0xFFFFFF; } }; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index dff7de1e5..a2318f1d7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -136,7 +136,7 @@ public class ItemLaserWrench extends ItemBase{ NO_PARTICLES("never show particles"), HOLDING_PARTICLES("show particles when holding a Laser Wrench"); - public String name; + public final String name; WrenchMode(String name){ this.name = name; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java index d13099d81..49f9c5063 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemMisc.java @@ -26,7 +26,7 @@ import java.util.List; public class ItemMisc extends ItemBase{ - public static final TheMiscItems[] allMiscItems = TheMiscItems.values(); + public static final TheMiscItems[] ALL_MISC_ITEMS = TheMiscItems.values(); public ItemMisc(String name){ super(name); @@ -40,19 +40,19 @@ public class ItemMisc extends ItemBase{ @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allMiscItems.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allMiscItems[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_MISC_ITEMS[stack.getItemDamage()].name; } @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allMiscItems.length ? EnumRarity.COMMON : allMiscItems[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_MISC_ITEMS.length ? EnumRarity.COMMON : ALL_MISC_ITEMS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allMiscItems.length; j++){ + for(int j = 0; j < ALL_MISC_ITEMS.length; j++){ if(j != TheMiscItems.YOUTUBE_ICON.ordinal()){ list.add(new ItemStack(this, 1, j)); } @@ -61,8 +61,8 @@ public class ItemMisc extends ItemBase{ @Override protected void registerRendering(){ - for(int i = 0; i < allMiscItems.length; i++){ - String name = this.getRegistryName()+allMiscItems[i].name; + for(int i = 0; i < ALL_MISC_ITEMS.length; i++){ + String name = this.getRegistryName()+ALL_MISC_ITEMS[i].name; ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), new ResourceLocation(name), "inventory"); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java index 805ee857a..325bea2aa 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java @@ -38,7 +38,7 @@ import java.util.List; public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDisplayStandItem{ - public static final ThePotionRings[] allRings = ThePotionRings.values(); + public static final ThePotionRings[] ALL_RINGS = ThePotionRings.values(); private final boolean isAdvanced; @@ -57,14 +57,14 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi @Override public String getUnlocalizedName(ItemStack stack){ - return stack.getItemDamage() >= allRings.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+allRings[stack.getItemDamage()].name; + return stack.getItemDamage() >= ALL_RINGS.length ? StringUtil.BUGGED_ITEM_NAME : this.getUnlocalizedName()+ALL_RINGS[stack.getItemDamage()].name; } @Override public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5){ super.onUpdate(stack, world, player, par4, par5); - if(!world.isRemote && stack.getItemDamage() < allRings.length){ + if(!world.isRemote && stack.getItemDamage() < ALL_RINGS.length){ if(player instanceof EntityPlayer){ EntityPlayer thePlayer = (EntityPlayer)player; ItemStack equippedStack = thePlayer.getHeldItemMainhand(); @@ -76,8 +76,8 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi @Override public String getItemStackDisplayName(ItemStack stack){ String standardName = StringUtil.localize(this.getUnlocalizedName()+".name"); - if(stack.getItemDamage() < allRings.length){ - String effect = StringUtil.localize(allRings[stack.getItemDamage()].name); + if(stack.getItemDamage() < ALL_RINGS.length){ + String effect = StringUtil.localize(ALL_RINGS[stack.getItemDamage()].name); return standardName+" "+effect; } return standardName; @@ -86,20 +86,20 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi @Override public EnumRarity getRarity(ItemStack stack){ - return stack.getItemDamage() >= allRings.length ? EnumRarity.COMMON : allRings[stack.getItemDamage()].rarity; + return stack.getItemDamage() >= ALL_RINGS.length ? EnumRarity.COMMON : ALL_RINGS[stack.getItemDamage()].rarity; } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tab, List list){ - for(int j = 0; j < allRings.length; j++){ + for(int j = 0; j < ALL_RINGS.length; j++){ list.add(new ItemStack(this, 1, j)); } } @Override protected void registerRendering(){ - for(int i = 0; i < allRings.length; i++){ + for(int i = 0; i < ALL_RINGS.length; i++){ ActuallyAdditions.proxy.addRenderRegister(new ItemStack(this, 1, i), this.getRegistryName(), "inventory"); } } @@ -110,7 +110,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi return new IItemColor(){ @Override public int getColorFromItemstack(ItemStack stack, int tintIndex){ - return stack.getItemDamage() >= allRings.length ? 0xFFFFFF : allRings[stack.getItemDamage()].color; + return stack.getItemDamage() >= ALL_RINGS.length ? 0xFFFFFF : ALL_RINGS[stack.getItemDamage()].color; } }; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java index 4c1325210..18a599c7c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemWingsOfTheBats.java @@ -29,7 +29,7 @@ public class ItemWingsOfTheBats extends ItemBase{ *

* (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 final ArrayList wingedPlayers = new ArrayList(); + public static final ArrayList WINGED_PLAYERS = new ArrayList(); public ItemWingsOfTheBats(String name){ super(name); @@ -43,7 +43,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @return Winged? */ public static boolean isPlayerWinged(EntityPlayer player){ - return wingedPlayers.contains(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); + return WINGED_PLAYERS.contains(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); } /** @@ -60,7 +60,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @param worldRemote If the World the Player is in is remote */ public static void removeWingsFromPlayer(EntityPlayer player, boolean worldRemote){ - wingedPlayers.remove(player.getUniqueID()+(worldRemote ? "-Remote" : "")); + WINGED_PLAYERS.remove(player.getUniqueID()+(worldRemote ? "-Remote" : "")); } /** @@ -69,7 +69,7 @@ public class ItemWingsOfTheBats extends ItemBase{ * @param player The Player */ public static void addWingsToPlayer(EntityPlayer player){ - wingedPlayers.add(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); + WINGED_PLAYERS.add(player.getUniqueID()+(player.worldObj.isRemote ? "-Remote" : "")); } /** diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java index 935d8929c..44e94a84a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensRecipeHandler.java @@ -28,9 +28,9 @@ import net.minecraft.item.ItemStack; import java.util.ArrayList; -public class LensRecipeHandler{ +public final class LensRecipeHandler{ - public static final ArrayList mainPageRecipes = new ArrayList(); + public static final ArrayList MAIN_PAGE_RECIPES = new ArrayList(); public static LensConversionRecipe recipeColorLens; public static LensConversionRecipe recipeSoulSand; public static LensConversionRecipe recipeGreenWall; @@ -43,29 +43,29 @@ public class LensRecipeHandler{ public static void init(){ //Crystal Blocks ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.REDSTONE.ordinal()), 400); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.LAPIS_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.LAPIS.ordinal()), 400); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.DIAMOND_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.DIAMOND.ordinal()), 600); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.EMERALD_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.EMERALD.ordinal()), 1000); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()), 600); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Blocks.IRON_BLOCK), new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal()), 800); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); //Crystal Items ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.REDSTONE), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()), 40); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DYE, 1, 4), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.LAPIS.ordinal()), 40); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.DIAMOND), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()), 60); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.EMERALD), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.EMERALD.ordinal()), 100); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.COAL), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.COAL.ordinal()), 60); - mainPageRecipes.add(RecipeUtil.lastReconstructorRecipe()); + MAIN_PAGE_RECIPES.add(RecipeUtil.lastReconstructorRecipe()); ActuallyAdditionsAPI.addReconstructorLensConversionRecipe(new ItemStack(Items.IRON_INGOT), new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()), 80); //Lenses diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java index 572e18895..aca4cb11e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/Lenses.java @@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.items.lens; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.lens.LensConversion; -public class Lenses{ +public final class Lenses{ public static void init(){ ActuallyAdditionsAPI.lensDefaultConversion = new LensConversion(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java index 97ca8781d..b8b9f7e94 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitArmorMaterials.java @@ -18,7 +18,7 @@ import net.minecraftforge.common.util.EnumHelper; import java.util.Locale; -public class InitArmorMaterials{ +public final class InitArmorMaterials{ public static ArmorMaterial armorMaterialEmerald; public static ArmorMaterial armorMaterialObsidian; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java index 74c267311..d631d2d69 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/material/InitToolMaterials.java @@ -16,7 +16,7 @@ import net.minecraftforge.common.util.EnumHelper; import java.util.Locale; -public class InitToolMaterials{ +public final class InitToolMaterials{ public static ToolMaterial toolMaterialEmerald; public static ToolMaterial toolMaterialObsidian; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java index 3b7692ce5..db69bb24d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/BannerHelper.java @@ -18,7 +18,7 @@ import net.minecraftforge.common.util.EnumHelper; import java.util.Locale; -public class BannerHelper{ +public final class BannerHelper{ public static void init(){ addCraftingPattern("Drill", new ItemStack(InitItems.itemDrill)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java index 1ef86a672..2c238b662 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DungeonLoot.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.ModUtil; //TODO Fix dungeon loot (oh god) -public class DungeonLoot{ +public final class DungeonLoot{ public static void init(){ if(ConfigBoolValues.DUNGEON_LOOT.isEnabled()){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java index 1a7e1fe86..05da083e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -19,7 +19,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class LaserRelayConnectionHandler{ +public final class LaserRelayConnectionHandler{ public static NBTTagCompound writeNetworkToNBT(Network network){ NBTTagList list = new NBTTagList(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java index 0105f55fb..8b88c32c3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/SoundHandler.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; -public class SoundHandler{ +public final class SoundHandler{ public static SoundEvent duhDuhDuhDuuuh; public static SoundEvent coffeeMachine; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java index 4bb38ad46..3c4fa9f73 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java @@ -24,9 +24,9 @@ import net.minecraft.item.ItemStack; import java.util.ArrayList; import java.util.List; -public class SmileyCloudEasterEggs{ +public final class SmileyCloudEasterEggs{ - public static final List cloudStuff = new ArrayList(); + public static final List CLOUD_STUFF = new ArrayList(); static{ //Glenthor @@ -374,7 +374,7 @@ public class SmileyCloudEasterEggs{ } private static void register(ISmileyCloudEasterEgg egg){ - cloudStuff.add(egg); + CLOUD_STUFF.add(egg); } private static void renderHoldingItem(boolean leftHand, ItemStack stack){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java index b48ed9ea6..b0f840077 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/SpecialRenderInit.java @@ -25,7 +25,7 @@ import java.util.Properties; public class SpecialRenderInit{ - public static final HashMap specialList = new HashMap(); + public static final HashMap SPECIAL_LIST = new HashMap(); public static void init(){ new ThreadSpecialFetcher(); @@ -60,7 +60,7 @@ public class SpecialRenderInit{ //Add a new Special Renderer to the list if(stack != null){ - specialList.put(key, new RenderSpecial(stack)); + SPECIAL_LIST.put(key, new RenderSpecial(stack)); } } } @@ -68,8 +68,8 @@ public class SpecialRenderInit{ @SubscribeEvent(priority = EventPriority.HIGHEST) public void onPlayerRender(RenderPlayerEvent.Pre event){ - if(!specialList.isEmpty()){ - for(Map.Entry entry : specialList.entrySet()){ + if(!SPECIAL_LIST.isEmpty()){ + for(Map.Entry entry : SPECIAL_LIST.entrySet()){ //Does the player have one of the names from the list? String playerName = event.getEntityPlayer().getName(); if(entry.getKey() != null && playerName != null){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java index dbdb8349d..46d93673b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIBookletRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEIBookletRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEIBookletRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.booklet"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java index 8c18cf273..c16894c90 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICoffeeMachineRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEICoffeeMachineRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEICoffeeMachineRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.coffee"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java index e281a37cd..3e0019800 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEICompostRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEICompostRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.compost"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java index 554545af7..edb1ad4c5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIFurnaceDoubleRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.furnaceDouble"; @@ -33,7 +33,7 @@ public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements I @Override public void loadCraftingRecipes(String outputId, Object... results){ if(outputId.equals(NAME) && getClass() == NEIFurnaceDoubleRecipe.class){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); + Map recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); for(Map.Entry recipe : recipes.entrySet()){ arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); } @@ -46,7 +46,7 @@ public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements I @SuppressWarnings("unchecked") @Override public void loadCraftingRecipes(ItemStack result){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); + Map recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); for(Map.Entry recipe : recipes.entrySet()){ if(NEIServerUtils.areStacksSameType(recipe.getValue(), result)){ arecipes.add(new CachedFurn(recipe.getKey(), recipe.getValue())); @@ -57,7 +57,7 @@ public class NEIFurnaceDoubleRecipe /*extends TemplateRecipeHandler implements I @SuppressWarnings("unchecked") @Override public void loadUsageRecipes(ItemStack ingredient){ - Map recipes = FurnaceRecipes.instance().getSmeltingList(); + Map recipes = FurnaceRecipes.INSTANCE().getSmeltingList(); for(Map.Entry recipe : recipes.entrySet()){ if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getKey(), ingredient)){ CachedFurn theRecipe = new CachedFurn(recipe.getKey(), recipe.getValue()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java index 2ac2f4288..3f05da9a7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIHairyBallRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEIHairyBallRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEIHairyBallRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.ballOfHair"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java index daf7fd1b8..ce3fe9e1f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEIReconstructorRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEIReconstructorRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEIReconstructorRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.reconstructor"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java index f803df38e..586e8bd0c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/nei/NEITreasureChestRecipe.java @@ -10,7 +10,7 @@ package de.ellpeck.actuallyadditions.mod.nei; -public class NEITreasureChestRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ +public final class NEITreasureChestRecipe/* extends TemplateRecipeHandler implements INEIRecipeHandler*/{ public static final String NAME = "actuallyadditions.treasureChest"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java index 7d7962e17..360c5db25 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/network/PacketHandler.java @@ -37,9 +37,7 @@ import java.util.List; public final class PacketHandler{ - public static SimpleNetworkWrapper theNetwork; public static final List DATA_HANDLERS = new ArrayList(); - public static final IDataHandler PARTICLE_HANDLER = new IDataHandler(){ @Override @SideOnly(Side.CLIENT) @@ -47,7 +45,6 @@ public final class PacketHandler{ AssetUtil.renderParticlesFromAToB(compound.getDouble("StartX"), compound.getDouble("StartY"), compound.getDouble("StartZ"), compound.getDouble("EndX"), compound.getDouble("EndY"), compound.getDouble("EndZ"), compound.getInteger("ParticleAmount"), compound.getFloat("ParticleSize"), new float[]{compound.getFloat("Color1"), compound.getFloat("Color2"), compound.getFloat("Color3")}, compound.getFloat("AgeMultiplier")); } }; - public static final IDataHandler TILE_ENTITY_HANDLER = new IDataHandler(){ @Override @SideOnly(Side.CLIENT) @@ -61,7 +58,53 @@ public final class PacketHandler{ } } }; + public static final IDataHandler GUI_BUTTON_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + if(tile instanceof IButtonReactor){ + IButtonReactor reactor = (IButtonReactor)tile; + reactor.onButtonPressed(compound.getInteger("ButtonID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler GUI_NUMBER_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + + if(tile instanceof INumberReactor){ + INumberReactor reactor = (INumberReactor)tile; + reactor.onNumberReceived(compound.getInteger("Number"), compound.getInteger("NumberID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler GUI_STRING_TO_TILE_HANDLER = new IDataHandler(){ + @Override + public void handleData(NBTTagCompound compound){ + World world = DimensionManager.getWorld(compound.getInteger("WorldID")); + TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); + + if(tile instanceof IStringReactor){ + IStringReactor reactor = (IStringReactor)tile; + reactor.onTextReceived(compound.getString("Text"), compound.getInteger("TextID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); + } + } + }; + public static final IDataHandler PLAYER_DATA_TO_CLIENT_HANDLER = new IDataHandler(){ + @Override + @SideOnly(Side.CLIENT) + public void handleData(NBTTagCompound compound){ + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if(player != null){ + PlayerData.getDataFromPlayer(player).theCompound = compound; + } + } + }; + public static SimpleNetworkWrapper theNetwork; public static final IDataHandler BOOKLET_STAND_BUTTON_HANDLER = new IDataHandler(){ @Override public void handleData(NBTTagCompound compound){ @@ -79,46 +122,6 @@ public final class PacketHandler{ } } }; - - public static final IDataHandler GUI_BUTTON_TO_TILE_HANDLER = new IDataHandler(){ - @Override - public void handleData(NBTTagCompound compound){ - World world = DimensionManager.getWorld(compound.getInteger("WorldID")); - TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); - - if(tile instanceof IButtonReactor){ - IButtonReactor reactor = (IButtonReactor)tile; - reactor.onButtonPressed(compound.getInteger("ButtonID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); - } - } - }; - - public static final IDataHandler GUI_NUMBER_TO_TILE_HANDLER = new IDataHandler(){ - @Override - public void handleData(NBTTagCompound compound){ - World world = DimensionManager.getWorld(compound.getInteger("WorldID")); - TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); - - if(tile instanceof INumberReactor){ - INumberReactor reactor = (INumberReactor)tile; - reactor.onNumberReceived(compound.getInteger("Number"), compound.getInteger("NumberID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); - } - } - }; - - public static final IDataHandler GUI_STRING_TO_TILE_HANDLER = new IDataHandler(){ - @Override - public void handleData(NBTTagCompound compound){ - World world = DimensionManager.getWorld(compound.getInteger("WorldID")); - TileEntity tile = world.getTileEntity(new BlockPos(compound.getInteger("X"), compound.getInteger("Y"), compound.getInteger("Z"))); - - if(tile instanceof IStringReactor){ - IStringReactor reactor = (IStringReactor)tile; - reactor.onTextReceived(compound.getString("Text"), compound.getInteger("TextID"), (EntityPlayer)world.getEntityByID(compound.getInteger("PlayerID"))); - } - } - }; - public static final IDataHandler CHANGE_PLAYER_DATA_HANDLER = new IDataHandler(){ @Override public void handleData(NBTTagCompound compound){ @@ -136,17 +139,6 @@ public final class PacketHandler{ } }; - public static final IDataHandler PLAYER_DATA_TO_CLIENT_HANDLER = new IDataHandler(){ - @Override - @SideOnly(Side.CLIENT) - public void handleData(NBTTagCompound compound){ - EntityPlayer player = Minecraft.getMinecraft().thePlayer; - if(player != null){ - PlayerData.getDataFromPlayer(player).theCompound = compound; - } - } - }; - public static void init(){ theNetwork = NetworkRegistry.INSTANCE.newSimpleChannel(ModUtil.MOD_ID); theNetwork.registerMessage(PacketServerToClient.Handler.class, PacketServerToClient.class, 0, Side.CLIENT); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java index b83861a1e..ba0693038 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/ore/InitOreDict.java @@ -24,7 +24,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -public class InitOreDict{ +public final class InitOreDict{ public static void init(){ ModUtil.LOGGER.info("Initializing OreDictionary Entries..."); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java index 9ab99f51a..aa549d507 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/proxy/ClientProxy.java @@ -162,7 +162,7 @@ public class ClientProxy implements IProxy{ ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmileyCloud.class, new RenderSmileyCloud()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayStand.class, new RenderDisplayStand()); - //VillagerRegistry.instance().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID, "textures/entity/villager/jamVillager.png")); + //VillagerRegistry.INSTANCE().registerVillagerSkin(ConfigIntValues.JAM_VILLAGER_ID.getValue(), new ResourceLocation(ModUtil.MOD_ID, "textures/entity/villager/jamVillager.png")); for(Item item : COLOR_PRODIVIDING_ITEMS_FOR_REGISTERING){ if(item instanceof IColorProvidingItem){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java index a8d518ad4..9d9772cb0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/CrusherRecipeRegistry.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -public class CrusherRecipeRegistry{ +public final class CrusherRecipeRegistry{ public static final ArrayList SEARCH_CASES = new ArrayList(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java index ed15811e5..ad8235be2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/FuelHandler.java @@ -26,7 +26,7 @@ import java.util.HashMap; public class FuelHandler implements IFuelHandler{ - private static HashMap, Integer> fuelList = new HashMap, Integer>(); + private static final HashMap, Integer> FUEL_LIST = new HashMap, Integer>(); public static void init(){ ModUtil.LOGGER.info("Initializing Fuelstuffs..."); @@ -42,7 +42,7 @@ public class FuelHandler implements IFuelHandler{ } private static void addFuel(Item item, int metadata, int value){ - fuelList.put(Pair.of(item, metadata), value); + FUEL_LIST.put(Pair.of(item, metadata), value); } private static void addFuel(Block block, int metadata, int value){ @@ -53,13 +53,13 @@ public class FuelHandler implements IFuelHandler{ if(stack != null && stack.getItem() != null){ Pair pair = Pair.of(stack.getItem(), stack.getItemDamage()); - if(fuelList.containsKey(pair)){ - return fuelList.get(pair); + if(FUEL_LIST.containsKey(pair)){ + return FUEL_LIST.get(pair); } else{ pair = Pair.of(stack.getItem(), 0); - if(fuelList.containsKey(pair)){ - return fuelList.get(pair); + if(FUEL_LIST.containsKey(pair)){ + return FUEL_LIST.get(pair); } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java index 97a642993..e3e8bc7cb 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/HairyBallHandler.java @@ -16,7 +16,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -public class HairyBallHandler{ +public final class HairyBallHandler{ public static void init(){ ActuallyAdditionsAPI.addBallOfFurReturnItem(new ItemStack(Items.STRING), 100); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java index 2f848a05c..8ff8a54e1 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/recipe/TreasureChestHandler.java @@ -16,7 +16,7 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheJams; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -public class TreasureChestHandler{ +public final class TreasureChestHandler{ public static void init(){ ActuallyAdditionsAPI.addTreasureChestLoot(new ItemStack(Items.DIAMOND), 5, 1, 2); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java index 3b5739b6e..bdf0ff9ba 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityAtomicReconstructor.java @@ -18,7 +18,6 @@ import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.misc.SoundHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil; @@ -28,7 +27,6 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index 61c3c70bb..ebdd0c15b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -37,12 +37,11 @@ import net.minecraftforge.fml.common.registry.GameRegistry; public abstract class TileEntityBase extends TileEntity implements ITickable{ + public static boolean teslaLoaded; public final String name; public boolean isRedstonePowered; protected int ticksElapsed; - public static boolean teslaLoaded; - public TileEntityBase(String name){ this.name = "container."+ModUtil.MOD_ID+"."+name; } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java index 6570a6750..5e6bbfd03 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCanolaPress.java @@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.items.InitItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java index 2a652e4bd..3dba7652c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityCoalGenerator.java @@ -12,8 +12,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntityFurnace; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java index 091b9cc83..d6c9ef76d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDisplayStand.java @@ -22,7 +22,7 @@ import net.minecraft.util.EnumFacing; public class TileEntityDisplayStand extends TileEntityInventoryBase implements IEnergyDisplay, IEnergyReceiver{ - private EnergyStorage storage = new EnergyStorage(300000); + private final EnergyStorage storage = new EnergyStorage(300000); private int oldEnergy; public TileEntityDisplayStand(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java index 36363aeee..d040975ff 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityEnervator.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyContainerItem; import cofh.api.energy.IEnergyProvider; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java index b76b7dda1..1919c1f60 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFermentingBarrel.java @@ -12,7 +12,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.*; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java index 1ec9e0536..93a66acfc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFurnaceSolar.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java index c62515d97..793d9e183 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayEnergy.java @@ -25,7 +25,7 @@ import java.util.Map; public class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements IEnergyReceiver{ - public Map receiversAround = new HashMap(); + public final Map receiversAround = new HashMap(); public TileEntityLaserRelayEnergy(){ super("laserRelay", false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java index 5adc60c5f..f6e7284bf 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItem.java @@ -26,7 +26,7 @@ import java.util.List; public class TileEntityLaserRelayItem extends TileEntityLaserRelay{ - public List handlersAround = new ArrayList(); + public final List handlersAround = new ArrayList(); public TileEntityLaserRelayItem(String name){ super(name, true); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java index b090192e9..65eb218e9 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelayItemWhitelist.java @@ -163,22 +163,6 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem }.setTile(this); } - @Override - public boolean isWhitelisted(ItemStack stack, boolean output){ - int slotStart = output ? 12 : 0; - return checkFilter(stack, output ? this.isRightWhitelist : this.isLeftWhitelist, this.slots, slotStart, slotStart+12); - } - - @Override - public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ - super.writeSyncableNBT(compound, isForSync); - if(!isForSync){ - TileEntityInventoryBase.saveSlots(this.slots, compound); - } - compound.setBoolean("LeftWhitelist", this.isLeftWhitelist); - compound.setBoolean("RightWhitelist", this.isRightWhitelist); - } - public static boolean checkFilter(ItemStack stack, boolean isWhitelist, ItemStack[] slots, int start, int end){ if(stack != null){ for(int i = start; i < end; i++){ @@ -203,6 +187,22 @@ public class TileEntityLaserRelayItemWhitelist extends TileEntityLaserRelayItem return !isWhitelist; } + @Override + public boolean isWhitelisted(ItemStack stack, boolean output){ + int slotStart = output ? 12 : 0; + return checkFilter(stack, output ? this.isRightWhitelist : this.isLeftWhitelist, this.slots, slotStart, slotStart+12); + } + + @Override + public void writeSyncableNBT(NBTTagCompound compound, boolean isForSync){ + super.writeSyncableNBT(compound, isForSync); + if(!isForSync){ + TileEntityInventoryBase.saveSlots(this.slots, compound); + } + compound.setBoolean("LeftWhitelist", this.isLeftWhitelist); + compound.setBoolean("RightWhitelist", this.isRightWhitelist); + } + @Override public void readSyncableNBT(NBTTagCompound compound, boolean isForSync){ super.readSyncableNBT(compound, isForSync); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java index c6f1d273e..29447fa9a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLeafGenerator.java @@ -13,15 +13,12 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java index 9f0e75805..8d80fc380 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityMiner.java @@ -29,7 +29,6 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.fluids.IFluidBlock; -import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java index 9f5163931..d4621656d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityOilGenerator.java @@ -13,9 +13,7 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyProvider; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; -import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.*; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java index 4b7fb4036..3609a9822 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomEnergyface.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import cofh.api.energy.IEnergyProvider; import cofh.api.energy.IEnergyReceiver; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java index de7f76ed0..3c5ddc8e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomLiquiface.java @@ -11,7 +11,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.mod.blocks.BlockPhantom; -import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.fluids.Fluid; @@ -27,11 +26,6 @@ public class TileEntityPhantomLiquiface extends TileEntityPhantomface implements this.type = BlockPhantom.Type.LIQUIFACE; } - @Override - public void updateEntity(){ - super.updateEntity(); - } - @Override public boolean isBoundThingInRange(){ if(super.isBoundThingInRange()){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java index 36cf1b918..439742590 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomPlacer.java @@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.tile; import de.ellpeck.actuallyadditions.api.tile.IPhantomTile; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler; -import de.ellpeck.actuallyadditions.mod.network.PacketHandler; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.Util; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java index efa5ae58c..e386e9c6e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPlayerInterface.java @@ -24,7 +24,7 @@ public class TileEntityPlayerInterface extends TileEntityInventoryBase implement public static final int DEFAULT_RANGE = 32; public UUID connectedPlayer; - private EnergyStorage storage = new EnergyStorage(30000); + private final EnergyStorage storage = new EnergyStorage(30000); private int range; public TileEntityPlayerInterface(){ diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java index 8ef3bdfa1..5cd50e63c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityXPSolidifier.java @@ -21,6 +21,14 @@ import net.minecraft.util.EnumFacing; public class TileEntityXPSolidifier extends TileEntityInventoryBase implements IButtonReactor{ + private static final Integer[] XP_MAP = new Integer[256]; + + static{ + for(int i = 0; i < XP_MAP.length; i++){ + XP_MAP[i] = getExperienceForLevelImpl(i); + } + } + private final int[] buttonAmounts = new int[]{1, 5, 10, 20, 30, 40, 50, 64, -999}; public short amount; private short lastAmount; @@ -29,6 +37,66 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I super(1, "xpSolidifier"); } + public static int getExperienceForLevel(int level){ + if(level >= 0 && level < XP_MAP.length){ + return XP_MAP[level]; + } + if(level >= 21863){ + return Integer.MAX_VALUE; + } + return getExperienceForLevelImpl(level); + } + + private static int getExperienceForLevelImpl(int level){ + int res = 0; + for(int i = 0; i < level; i++){ + res += getXpBarCapacity(i); + if(res < 0){ + return Integer.MAX_VALUE; + } + } + return res; + } + + public static int getXpBarCapacity(int level){ + if(level >= 30){ + return 112+(level-30)*9; + } + else if(level >= 15){ + return 37+(level-15)*5; + } + return 7+level*2; + } + + public static int getLevelForExperience(int experience){ + for(int i = 0; i < XP_MAP.length; i++){ + if(XP_MAP[i] > experience){ + return i-1; + } + } + int i = XP_MAP.length; + while(getExperienceForLevel(i) <= experience){ + i++; + } + return i-1; + } + + public static int getPlayerXP(EntityPlayer player){ + return (int)(getExperienceForLevel(player.experienceLevel)+(player.experience*player.xpBarCap())); + } + + /* + * The below methods were excerpted from EnderIO by SleepyTrousers with permission, thanks! + */ + + public static void addPlayerXP(EntityPlayer player, int amount){ + int experience = Math.max(0, getPlayerXP(player)+amount); + player.experienceTotal = experience; + player.experienceLevel = getLevelForExperience(experience); + int expForLevel = getExperienceForLevel(player.experienceLevel); + player.experience = (float)(experience-expForLevel)/(float)player.xpBarCap(); + } + @Override public void writeSyncableNBT(NBTTagCompound compound, boolean sync){ super.writeSyncableNBT(compound, sync); @@ -94,72 +162,4 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I } } } - - /* - * The below methods were excerpted from EnderIO by SleepyTrousers with permission, thanks! - */ - - private static final Integer[] XP_MAP = new Integer[256]; - - static{ - for(int i = 0; i < XP_MAP.length; i++){ - XP_MAP[i] = getExperienceForLevelImpl(i); - } - } - - public static int getExperienceForLevel(int level){ - if(level >= 0 && level < XP_MAP.length){ - return XP_MAP[level]; - } - if(level >= 21863){ - return Integer.MAX_VALUE; - } - return getExperienceForLevelImpl(level); - } - - private static int getExperienceForLevelImpl(int level){ - int res = 0; - for(int i = 0; i < level; i++){ - res += getXpBarCapacity(i); - if(res < 0){ - return Integer.MAX_VALUE; - } - } - return res; - } - - public static int getXpBarCapacity(int level){ - if(level >= 30){ - return 112+(level-30)*9; - } - else if(level >= 15){ - return 37+(level-15)*5; - } - return 7+level*2; - } - - public static int getLevelForExperience(int experience){ - for(int i = 0; i < XP_MAP.length; i++){ - if(XP_MAP[i] > experience){ - return i-1; - } - } - int i = XP_MAP.length; - while(getExperienceForLevel(i) <= experience){ - i++; - } - return i-1; - } - - public static int getPlayerXP(EntityPlayer player){ - return (int)(getExperienceForLevel(player.experienceLevel)+(player.experience*player.xpBarCap())); - } - - public static void addPlayerXP(EntityPlayer player, int amount){ - int experience = Math.max(0, getPlayerXP(player)+amount); - player.experienceTotal = experience; - player.experienceLevel = getLevelForExperience(experience); - int expForLevel = getExperienceForLevel(player.experienceLevel); - player.experience = (float)(experience-expForLevel)/(float)player.xpBarCap(); - } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java index 25866dd9b..97b4eab24 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/update/UpdateChecker.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.Util; -public class UpdateChecker{ +public final class UpdateChecker{ public static final String DOWNLOAD_LINK = "http://ellpeck.de/actadddownload"; public static final String CHANGELOG_LINK = "http://ellpeck.de/actaddchangelog"; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java index b62508cf8..34c5e9711 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/AssetUtil.java @@ -25,7 +25,6 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.NetworkRegistry; @@ -33,7 +32,7 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; -public class AssetUtil{ +public final class AssetUtil{ public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java index 49f92d963..22d61c54f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/FakePlayerUtil.java @@ -18,7 +18,7 @@ import net.minecraftforge.common.util.FakePlayerFactory; import java.util.UUID; -public class FakePlayerUtil{ +public final class FakePlayerUtil{ private static final String FAKE_NAME = ModUtil.MOD_ID+"fakeplayer"; private static final GameProfile FAKE_PROFILE = new GameProfile(UUID.nameUUIDFromBytes(FAKE_NAME.getBytes()), FAKE_NAME); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java index 4bfe8c252..5c5c198ad 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ItemUtil.java @@ -24,7 +24,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import java.util.List; -public class ItemUtil{ +public final class ItemUtil{ public static Item getItemFromName(String name){ ResourceLocation resLoc = new ResourceLocation(name); @@ -43,7 +43,7 @@ public class ItemUtil{ itemBlock.setRegistryName(block.getRegistryName()); GameRegistry.register(itemBlock); - block.setCreativeTab(addTab ? CreativeTab.instance : null); + block.setCreativeTab(addTab ? CreativeTab.INSTANCE : null); } public static void registerItem(Item item, String name, boolean addTab){ @@ -52,7 +52,7 @@ public class ItemUtil{ item.setRegistryName(ModUtil.MOD_ID, name); GameRegistry.register(item); - item.setCreativeTab(addTab ? CreativeTab.instance : null); + item.setCreativeTab(addTab ? CreativeTab.INSTANCE : null); if(item instanceof IColorProvidingItem){ ActuallyAdditions.proxy.addColoredItem(item); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java index a7fc537d8..ddf051598 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/ModUtil.java @@ -14,7 +14,7 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class ModUtil{ +public final class ModUtil{ public static final String VERSION = "@VERSION@"; //build.gradle diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java index be19a509b..afe2996af 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/PosUtil.java @@ -20,7 +20,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class PosUtil{ +public final class PosUtil{ public static Material getMaterial(BlockPos pos, IBlockAccess world){ return getBlock(pos, world).getMaterial(world.getBlockState(pos)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java index 2a4274056..084b5d91c 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/RecipeUtil.java @@ -18,7 +18,7 @@ import net.minecraft.item.crafting.IRecipe; import java.util.List; -public class RecipeUtil{ +public final class RecipeUtil{ public static LensConversionRecipe lastReconstructorRecipe(){ List list = ActuallyAdditionsAPI.RECONSTRUCTOR_LENS_CONVERSION_RECIPES; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java index e36e07e0c..827ddb41f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/StringUtil.java @@ -16,7 +16,7 @@ import net.minecraftforge.fluids.FluidTank; import java.util.List; -public class StringUtil{ +public final class StringUtil{ public static final int DECIMAL_COLOR_WHITE = 16777215; public static final int DECIMAL_COLOR_GRAY_TEXT = 4210752; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java index 437b61bb8..e8cbb43df 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Util.java @@ -20,7 +20,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.Locale; import java.util.Random; -public class Util{ +public final class Util{ public static final Random RANDOM = new Random(); public static final int WILDCARD = OreDictionary.WILDCARD_VALUE; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index 127176cf2..809170d5e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -32,7 +32,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.play.client.CPacketPlayerDigging; import net.minecraft.network.play.server.SPacketBlockChange; import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityBanner; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java index 08331ef6a..e255ff944 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/CompatUtil.java @@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.event.FMLInterModComms; -public class CompatUtil{ +public final class CompatUtil{ public static void registerMFRPlant(Block block){ FMLInterModComms.sendMessage("MineFactoryReloaded", "registerHarvestable_Crop", new ItemStack(block, 1, 7)); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java index b0cf1fd36..96b2a607a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/compat/TeslaUtil.java @@ -21,25 +21,20 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.fluids.capability.CapabilityFluidHandler; -import net.minecraftforge.fluids.capability.IFluidHandler; import java.util.HashMap; import java.util.Map; public final class TeslaUtil{ + private static final Map TESLA_MAP = new HashMap(); @CapabilityInject(ITeslaConsumer.class) public static Capability teslaConsumer = null; - @CapabilityInject(ITeslaProducer.class) public static Capability teslaProducer = null; - @CapabilityInject(ITeslaHolder.class) public static Capability teslaHolder = null; - private static final Map TESLA_MAP = new HashMap(); - public static T getTeslaCapability(TileEntityBase tile, Capability capability, EnumFacing facing){ boolean receive = tile instanceof IEnergyReceiver && capability == teslaConsumer; boolean provide = tile instanceof IEnergyProvider && capability == teslaProducer; @@ -52,7 +47,7 @@ public final class TeslaUtil{ } } - public static boolean doTeslaInteraction(TileEntity tile, TileEntity otherTile, EnumFacing side){ + public static void doTeslaInteraction(TileEntity tile, TileEntity otherTile, EnumFacing side){ ITeslaConsumer handlerTo = null; ITeslaProducer handlerFrom = null; @@ -68,10 +63,8 @@ public final class TeslaUtil{ if(drain > 0){ long filled = handlerTo.givePower(drain, false); handlerFrom.takePower(filled, false); - return true; } } - return false; } private static TeslaHandler getHandler(TileEntityBase tile, EnumFacing facing){