From 104ecb66bbf539fcc55744bb772565a1273a3327 Mon Sep 17 00:00:00 2001 From: Tombenpotter Date: Mon, 29 Sep 2014 21:24:50 +0200 Subject: [PATCH] Some stuff Api derpage apparently... Some new drills, and chainsaws. Started working on omnitools, but I got distracted. I NEED TEXTURES :( --- src/main/java/baubles/api/BaubleType.java | 6 +- src/main/java/baubles/api/BaublesApi.java | 58 +- src/main/java/baubles/api/IBauble.java | 66 +- src/main/java/baubles/api/package-info.java | 4 +- src/main/java/ic2/api/Direction.java | 179 +++-- src/main/java/ic2/api/crops/BaseSeed.java | 86 +-- src/main/java/ic2/api/crops/CropCard.java | 657 +++++++++--------- src/main/java/ic2/api/crops/Crops.java | 189 +++-- src/main/java/ic2/api/crops/ICropTile.java | 433 ++++++------ src/main/java/ic2/api/crops/package-info.java | 4 +- src/main/java/ic2/api/energy/EnergyNet.java | 12 +- src/main/java/ic2/api/energy/IEnergyNet.java | 133 ++-- src/main/java/ic2/api/energy/NodeStats.java | 34 +- .../ic2/api/energy/event/EnergyTileEvent.java | 18 +- .../api/energy/event/EnergyTileLoadEvent.java | 14 +- .../energy/event/EnergyTileUnloadEvent.java | 14 +- .../ic2/api/energy/event/package-info.java | 4 +- .../java/ic2/api/energy/package-info.java | 4 +- .../java/ic2/api/energy/prefab/BasicSink.java | 569 ++++++++------- .../ic2/api/energy/prefab/BasicSource.java | 565 ++++++++------- .../ic2/api/energy/prefab/package-info.java | 4 +- .../ic2/api/energy/tile/IEnergyAcceptor.java | 23 +- .../ic2/api/energy/tile/IEnergyConductor.java | 76 +- .../ic2/api/energy/tile/IEnergyEmitter.java | 25 +- .../java/ic2/api/energy/tile/IEnergySink.java | 62 +- .../ic2/api/energy/tile/IEnergySource.java | 52 +- .../java/ic2/api/energy/tile/IEnergyTile.java | 4 +- .../java/ic2/api/energy/tile/IHeatSource.java | 16 +- .../ic2/api/energy/tile/IKineticSource.java | 12 +- .../ic2/api/energy/tile/IMetaDelegate.java | 31 +- .../ic2/api/energy/tile/package-info.java | 4 +- src/main/java/ic2/api/event/LaserEvent.java | 176 +++-- src/main/java/ic2/api/event/PaintEvent.java | 38 +- .../java/ic2/api/event/RetextureEvent.java | 46 +- src/main/java/ic2/api/event/package-info.java | 4 +- .../ic2/api/info/IEnergyValueProvider.java | 22 +- .../java/ic2/api/info/IFuelValueProvider.java | 18 +- src/main/java/ic2/api/info/Info.java | 37 +- src/main/java/ic2/api/info/package-info.java | 4 +- src/main/java/ic2/api/item/ElectricItem.java | 84 +-- .../api/item/IBackupElectricItemManager.java | 4 +- .../java/ic2/api/item/IBlockCuttingBlade.java | 2 +- src/main/java/ic2/api/item/IBoxable.java | 14 +- src/main/java/ic2/api/item/IC2Items.java | 78 +-- src/main/java/ic2/api/item/IElectricItem.java | 76 +- .../ic2/api/item/IElectricItemManager.java | 138 ++-- src/main/java/ic2/api/item/IItemHudInfo.java | 8 +- .../java/ic2/api/item/IKineticWindRotor.java | 10 +- src/main/java/ic2/api/item/IMetalArmor.java | 18 +- .../ic2/api/item/ISpecialElectricItem.java | 14 +- .../java/ic2/api/item/ITerraformingBP.java | 50 +- src/main/java/ic2/api/item/ItemWrapper.java | 75 +- src/main/java/ic2/api/item/package-info.java | 4 +- ...INetworkClientTileEntityEventListener.java | 14 +- .../ic2/api/network/INetworkDataProvider.java | 14 +- .../network/INetworkItemEventListener.java | 16 +- .../INetworkTileEntityEventListener.java | 12 +- .../api/network/INetworkUpdateListener.java | 14 +- .../java/ic2/api/network/NetworkHelper.java | 317 ++++----- .../java/ic2/api/network/package-info.java | 4 +- src/main/java/ic2/api/package-info.java | 4 +- src/main/java/ic2/api/reactor/IReactor.java | 248 +++---- .../java/ic2/api/reactor/IReactorChamber.java | 23 +- .../ic2/api/reactor/IReactorComponent.java | 163 ++--- .../java/ic2/api/reactor/package-info.java | 4 +- .../recipe/ICannerBottleRecipeManager.java | 78 +-- .../recipe/ICannerEnrichRecipeManager.java | 83 ++- .../api/recipe/ICraftingRecipeManager.java | 32 +- .../ic2/api/recipe/IFluidHeatManager.java | 40 +- .../ic2/api/recipe/ILiquidAcceptManager.java | 9 +- .../ic2/api/recipe/IListRecipeManager.java | 56 +- .../ic2/api/recipe/IMachineRecipeManager.java | 61 +- .../java/ic2/api/recipe/IPatternStorage.java | 10 +- .../java/ic2/api/recipe/IRecipeInput.java | 46 +- .../java/ic2/api/recipe/IScrapboxManager.java | 10 +- .../ic2/api/recipe/ISemiFluidFuelManager.java | 40 +- .../api/recipe/RecipeInputFluidContainer.java | 69 +- .../ic2/api/recipe/RecipeInputItemStack.java | 63 +- .../ic2/api/recipe/RecipeInputOreDict.java | 103 ++- .../java/ic2/api/recipe/RecipeOutput.java | 34 +- src/main/java/ic2/api/recipe/Recipes.java | 98 +-- .../java/ic2/api/recipe/package-info.java | 4 +- .../java/ic2/api/tile/ExplosionWhitelist.java | 62 +- .../java/ic2/api/tile/IEnergyStorage.java | 92 +-- src/main/java/ic2/api/tile/IWrenchable.java | 90 +-- src/main/java/ic2/api/tile/package-info.java | 4 +- src/main/java/ic2/api/util/IKeyboard.java | 23 +- src/main/java/ic2/api/util/Keys.java | 2 +- src/main/java/ic2/api/util/package-info.java | 4 +- .../tombenpotter/emt/ElectroMagicTools.java | 100 ++- .../java/tombenpotter/emt/ModInformation.java | 18 +- .../emt/client/gui/GuiEtherealMacerator.java | 32 +- .../gui/GuiIndustrialWandRecharger.java | 32 +- .../emt/client/gui/config/EMTGuiConfig.java | 23 +- .../emt/client/gui/config/EMTGuiFactory.java | 30 +- .../container/ContainerEtheralMacerator.java | 116 ++-- .../ContainerIndustrialWandRecharge.java | 112 +-- .../emt/client/renderer/RenderLaser.java | 116 ++-- .../emt/common/commands/CommandOutputs.java | 108 +-- .../common/module/base/EMTEntityRegistry.java | 42 +- .../module/base/entities/EntityArcher.java | 144 ++-- .../module/base/entities/EntityLaser.java | 540 +++++++------- .../module/base/items/ItemEMTBaubles.java | 314 ++++----- .../base/items/ItemTaintedThorHammer.java | 79 +++ .../module/base/items/ItemThorHammer.java | 105 +++ .../module/base/items/foci/ItemBaseFocus.java | 178 ++--- .../base/items/foci/ItemChristmasFocus.java | 80 +-- .../base/items/foci/ItemExplosionFocus.java | 66 +- .../base/items/foci/ItemShieldFocus.java | 146 ++-- .../base/items/tools/ItemBaseChainsaw.java | 127 ++++ .../base/{ => items}/tools/ItemBaseDrill.java | 33 +- .../{ => items}/tools/ItemBaseOmnitool.java | 14 +- .../base/tile/TileEntityPortableNode.java | 22 +- .../module/base/tools/ItemBaseChainsaw.java | 94 --- .../base/tools/ItemTaintedThorHammer.java | 78 --- .../module/base/tools/ItemThorHammer.java | 105 --- .../module/ic2/IC2ModuleBlockRegistry.java | 46 +- .../module/ic2/IC2ModuleItemRegistry.java | 207 +++--- .../module/ic2/IC2ModuleTERegistry.java | 64 +- .../common/module/ic2/blocks/BlockEMT.java | 118 ++-- .../module/ic2/blocks/BlockEMTMachines.java | 154 ++-- .../module/ic2/blocks/BlockEMTSolars.java | 274 ++++---- .../module/ic2/blocks/BlockEMTSolars2.java | 120 ++-- .../ic2/blocks/BlockEssentiaGenerator.java | 94 +-- .../ic2/blocks/BlockEssentiaGenerators.java | 118 ++-- .../module/ic2/blocks/BlockPortableNode.java | 112 +-- .../common/module/ic2/blocks/BlockShield.java | 94 +-- .../ic2/items/ItemElectricScribingTools.java | 86 +-- .../armor/goggles/ItemElectricGoggles.java | 262 +++---- .../items/armor/goggles/ItemNanoGoggles.java | 72 +- .../armor/goggles/ItemQuantumGoggles.java | 130 ++-- .../goggles/ItemSolarHelmetRevealing.java | 276 ++++---- .../items/blocks/ItemBlockEMTMachines.java | 58 +- .../ic2/items/blocks/ItemBlockEMTSolars.java | 328 ++++----- .../ic2/items/blocks/ItemBlockEMTSolars2.java | 146 ++-- .../blocks/ItemBlockEssentiaGenerator.java | 14 +- .../blocks/ItemBlockEssentiaGenerators.java | 82 +-- .../ic2/items/foci/ItemChargeFocus.java | 102 +-- .../ic2/items/foci/ItemWandChargingFocus.java | 84 +-- .../items/tools/ItemElectricHoeGrowth.java | 112 +-- .../items/tools/ItemElectricThorHammer.java | 274 ++++---- .../tools/chainsaws/ItemDiamondChainsaw.java | 244 +++---- .../tools/chainsaws/ItemStreamChainsaw.java | 126 ++-- .../tools/chainsaws/ItemThaumiumChainsaw.java | 62 +- .../tools/drills/ItemRockbreakerDrill.java | 302 ++++---- .../tools/omnitools/ItemOmnitoolDiamond.java | 80 +-- .../tools/omnitools/ItemOmnitoolIron.java | 264 +++---- .../tools/omnitools/ItemOmnitoolThaumium.java | 80 +-- .../common/module/ic2/tile/TileEntityEMT.java | 68 +- .../ic2/tile/TileEntityEtherealMacerator.java | 438 ++++++------ .../TileEntityIndustrialWandRecharge.java | 264 +++---- .../generators/TileEntityArborGenerator.java | 6 +- .../generators/TileEntityBaseGenerator.java | 86 +-- .../TileEntityEssentiaGenerator.java | 104 +-- .../generators/TileEntityIgnisGenerator.java | 6 +- .../ic2/tile/solars/TileEntitySolarBase.java | 156 ++--- .../tile/solars/air/TileEntityAirSolar.java | 30 +- .../solars/air/TileEntityDoubleAirSolar.java | 14 +- .../solars/air/TileEntityTripleAirSolar.java | 14 +- .../compressed/TileEntityCompressedSolar.java | 14 +- .../TileEntityDoubleCompressedSolar.java | 14 +- .../TileEntityTripleCompressedSolar.java | 14 +- .../tile/solars/dark/TileEntityDarkSolar.java | 26 +- .../dark/TileEntityDoubleDarkSolar.java | 14 +- .../dark/TileEntityTripleDarkSolar.java | 14 +- .../earth/TileEntityDoubleEarthSolar.java | 14 +- .../solars/earth/TileEntityEarthSolar.java | 30 +- .../earth/TileEntityTripleEarthSolar.java | 14 +- .../fire/TileEntityDoubleFireSolar.java | 14 +- .../tile/solars/fire/TileEntityFireSolar.java | 44 +- .../fire/TileEntityTripleFireSolar.java | 14 +- .../order/TileEntityDoubleOrderSolar.java | 14 +- .../solars/order/TileEntityOrderSolar.java | 26 +- .../order/TileEntityTripleOrderSolar.java | 14 +- .../water/TileEntityDoubleWaterSolar.java | 14 +- .../water/TileEntityTripleWaterSolar.java | 14 +- .../solars/water/TileEntityWaterSolar.java | 26 +- .../module/vanilla/VanillaBlocksRegistry.java | 4 +- .../module/vanilla/VanillaItemsRegistry.java | 45 +- .../vanilla/VanillaRecipesRegistry.java | 4 +- .../module/vanilla/items/ItemCrafting.java | 12 +- .../items/tools/ItemVanillaChainsaw.java | 65 ++ .../vanilla/items/tools/ItemVanillaDrill.java | 40 ++ .../emt/common/util/ConfigHandler.java | 359 +++++----- .../emt/common/util/CraftingAspects.java | 96 +-- .../emt/common/util/CreativeTabEMT.java | 3 +- .../common/util/DungeonChestGenerator.java | 16 +- .../emt/common/util/EMTResearchItem.java | 76 +- .../emt/common/util/EntityEventHandler.java | 28 +- .../emt/common/util/EssentiasOutputs.java | 56 +- .../emt/common/util/EventHandlerEMT.java | 54 +- .../emt/common/util/RegistryHandler.java | 32 +- .../emt/common/util/ResearchAspects.java | 90 +-- .../emt/common/util/TextHelper.java | 68 +- .../tombenpotter/emt/proxies/ClientProxy.java | 16 +- .../tombenpotter/emt/proxies/CommonProxy.java | 76 +- 196 files changed, 8231 insertions(+), 8092 deletions(-) create mode 100644 src/main/java/tombenpotter/emt/common/module/base/items/ItemTaintedThorHammer.java create mode 100644 src/main/java/tombenpotter/emt/common/module/base/items/ItemThorHammer.java create mode 100644 src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseChainsaw.java rename src/main/java/tombenpotter/emt/common/module/base/{ => items}/tools/ItemBaseDrill.java (71%) rename src/main/java/tombenpotter/emt/common/module/base/{ => items}/tools/ItemBaseOmnitool.java (75%) delete mode 100644 src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseChainsaw.java delete mode 100644 src/main/java/tombenpotter/emt/common/module/base/tools/ItemTaintedThorHammer.java delete mode 100644 src/main/java/tombenpotter/emt/common/module/base/tools/ItemThorHammer.java create mode 100644 src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaChainsaw.java create mode 100644 src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaDrill.java diff --git a/src/main/java/baubles/api/BaubleType.java b/src/main/java/baubles/api/BaubleType.java index 22349ff..af4a7ac 100644 --- a/src/main/java/baubles/api/BaubleType.java +++ b/src/main/java/baubles/api/BaubleType.java @@ -1,7 +1,7 @@ package baubles.api; public enum BaubleType { - RING, - AMULET, - BELT + RING, + AMULET, + BELT } diff --git a/src/main/java/baubles/api/BaublesApi.java b/src/main/java/baubles/api/BaublesApi.java index f122e90..861a80a 100644 --- a/src/main/java/baubles/api/BaublesApi.java +++ b/src/main/java/baubles/api/BaublesApi.java @@ -1,41 +1,35 @@ package baubles.api; -import java.lang.reflect.Method; - +import cpw.mods.fml.common.FMLLog; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; -import cpw.mods.fml.common.FMLLog; + +import java.lang.reflect.Method; /** * @author Azanor */ -public class BaublesApi -{ - static Method getBaubles; - - /** - * Retrieves the baubles inventory for the supplied player - */ - public static IInventory getBaubles(EntityPlayer player) - { - IInventory ot = null; - - try - { - if(getBaubles == null) - { - Class fake = Class.forName("baubles.common.lib.PlayerHandler"); - getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class); - } - - ot = (IInventory) getBaubles.invoke(null, player); - } - catch(Exception ex) - { - FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles"); - } - - return ot; - } - +public class BaublesApi { + static Method getBaubles; + + /** + * Retrieves the baubles inventory for the supplied player + */ + public static IInventory getBaubles(EntityPlayer player) { + IInventory ot = null; + + try { + if (getBaubles == null) { + Class fake = Class.forName("baubles.common.lib.PlayerHandler"); + getBaubles = fake.getMethod("getPlayerBaubles", EntityPlayer.class); + } + + ot = (IInventory) getBaubles.invoke(null, player); + } catch (Exception ex) { + FMLLog.warning("[Baubles API] Could not invoke baubles.common.lib.PlayerHandler method getPlayerBaubles"); + } + + return ot; + } + } diff --git a/src/main/java/baubles/api/IBauble.java b/src/main/java/baubles/api/IBauble.java index de85ff1..398e84f 100644 --- a/src/main/java/baubles/api/IBauble.java +++ b/src/main/java/baubles/api/IBauble.java @@ -4,43 +4,41 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; /** - * * @author Azanor - * - * This interface should be extended by items that can be worn in bauble slots - * + *

+ * This interface should be extended by items that can be worn in bauble slots */ public interface IBauble { - - /** - * This method return the type of bauble this is. - * Type is used to determine the slots it can go into. - */ - public BaubleType getBaubleType(ItemStack itemstack); - - /** - * This method is called once per tick if the bauble is being worn by a player - */ - public void onWornTick(ItemStack itemstack, EntityLivingBase player); - - /** - * This method is called when the bauble is equipped by a player - */ - public void onEquipped(ItemStack itemstack, EntityLivingBase player); - - /** - * This method is called when the bauble is unequipped by a player - */ - public void onUnequipped(ItemStack itemstack, EntityLivingBase player); - /** - * can this bauble be placed in a bauble slot - */ - public boolean canEquip(ItemStack itemstack, EntityLivingBase player); - - /** - * Can this bauble be removed from a bauble slot - */ - public boolean canUnequip(ItemStack itemstack, EntityLivingBase player); + /** + * This method return the type of bauble this is. + * Type is used to determine the slots it can go into. + */ + public BaubleType getBaubleType(ItemStack itemstack); + + /** + * This method is called once per tick if the bauble is being worn by a player + */ + public void onWornTick(ItemStack itemstack, EntityLivingBase player); + + /** + * This method is called when the bauble is equipped by a player + */ + public void onEquipped(ItemStack itemstack, EntityLivingBase player); + + /** + * This method is called when the bauble is unequipped by a player + */ + public void onUnequipped(ItemStack itemstack, EntityLivingBase player); + + /** + * can this bauble be placed in a bauble slot + */ + public boolean canEquip(ItemStack itemstack, EntityLivingBase player); + + /** + * Can this bauble be removed from a bauble slot + */ + public boolean canUnequip(ItemStack itemstack, EntityLivingBase player); } diff --git a/src/main/java/baubles/api/package-info.java b/src/main/java/baubles/api/package-info.java index f4314ee..841ac0b 100644 --- a/src/main/java/baubles/api/package-info.java +++ b/src/main/java/baubles/api/package-info.java @@ -1,3 +1,3 @@ -@API(apiVersion = "1.7.10-1.0.1.5", owner = "Baubles", provides = "Baubles|API") -package baubles.api; +@API(apiVersion = "1.7.10-1.0.1.5", owner = "Baubles", provides = "Baubles|API") package baubles.api; + import cpw.mods.fml.common.API; \ No newline at end of file diff --git a/src/main/java/ic2/api/Direction.java b/src/main/java/ic2/api/Direction.java index f0c687b..cc8d1fa 100644 --- a/src/main/java/ic2/api/Direction.java +++ b/src/main/java/ic2/api/Direction.java @@ -2,116 +2,115 @@ package ic2.api; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; - import net.minecraftforge.common.util.ForgeDirection; /** * Represents the 6 possible directions along the axis of a block. */ public enum Direction { - /** - * -X - */ - XN, - /** - * +X - */ - XP, + /** + * -X + */ + XN, + /** + * +X + */ + XP, - /** - * -Y - */ - YN, //MC-Code starts with 0 here - /** - * +Y - */ - YP, // 1... + /** + * -Y + */ + YN, //MC-Code starts with 0 here + /** + * +Y + */ + YP, // 1... - /** - * -Z - */ - ZN, - /** - * +Z - */ - ZP; + /** + * -Z + */ + ZN, + /** + * +Z + */ + ZP; - public static Direction fromSideValue(int side) { - return directions[(side + 2) % 6]; - } + public static Direction fromSideValue(int side) { + return directions[(side + 2) % 6]; + } - public static Direction fromForgeDirection(ForgeDirection dir) { - if (dir == ForgeDirection.UNKNOWN) return null; + public static Direction fromForgeDirection(ForgeDirection dir) { + if (dir == ForgeDirection.UNKNOWN) return null; - return fromSideValue(dir.ordinal()); - } + return fromSideValue(dir.ordinal()); + } - /** - * Get the tile entity next to a tile entity following this direction. - * - * @param tileEntity tile entity to check - * @return Adjacent tile entity or null if none exists - */ - public TileEntity applyToTileEntity(TileEntity te) { - return applyTo(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); - } + /** + * Get the tile entity next to a tile entity following this direction. + * + * @param tileEntity tile entity to check + * @return Adjacent tile entity or null if none exists + */ + public TileEntity applyToTileEntity(TileEntity te) { + return applyTo(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord); + } - /** - * Get the tile entity next to a position following this direction. - * - * @param world World to check - * @param x X coordinate to check from - * @param y Y coordinate to check from - * @param z Z coordinate to check from - * @return Adjacent tile entity or null if none exists - */ - public TileEntity applyTo(World world, int x, int y, int z) { - int coords[] = { x, y, z }; + /** + * Get the tile entity next to a position following this direction. + * + * @param world World to check + * @param x X coordinate to check from + * @param y Y coordinate to check from + * @param z Z coordinate to check from + * @return Adjacent tile entity or null if none exists + */ + public TileEntity applyTo(World world, int x, int y, int z) { + int coords[] = {x, y, z}; - coords[ordinal() / 2] += getSign(); + coords[ordinal() / 2] += getSign(); - if (world != null && world.blockExists(coords[0], coords[1], coords[2])) { - try { - return world.getTileEntity(coords[0], coords[1], coords[2]); - } catch (Exception e) { - throw new RuntimeException("error getting TileEntity at dim "+world.provider.dimensionId+" "+coords[0]+"/"+coords[1]+"/"+coords[2]); - } - } + if (world != null && world.blockExists(coords[0], coords[1], coords[2])) { + try { + return world.getTileEntity(coords[0], coords[1], coords[2]); + } catch (Exception e) { + throw new RuntimeException("error getting TileEntity at dim " + world.provider.dimensionId + " " + coords[0] + "/" + coords[1] + "/" + coords[2]); + } + } - return null; - } + return null; + } - /** - * Get the inverse of this direction (XN -> XP, XP -> XN, etc.) - * - * @return Inverse direction - */ - public Direction getInverse() { - return directions[ordinal() ^ 1]; - } + /** + * Get the inverse of this direction (XN -> XP, XP -> XN, etc.) + * + * @return Inverse direction + */ + public Direction getInverse() { + return directions[ordinal() ^ 1]; + } - /** - * Convert this direction to a Minecraft side value. - * - * @return Minecraft side value - */ - public int toSideValue() { - return (ordinal() + 4) % 6; - } + /** + * Convert this direction to a Minecraft side value. + * + * @return Minecraft side value + */ + public int toSideValue() { + return (ordinal() + 4) % 6; + } - /** - * Determine direction sign (N for negative or P for positive). - * - * @return -1 if the direction is negative, +1 if the direction is positive - */ - private int getSign() { - return (ordinal() % 2) * 2 - 1; - } + /** + * Determine direction sign (N for negative or P for positive). + * + * @return -1 if the direction is negative, +1 if the direction is positive + */ + private int getSign() { + return (ordinal() % 2) * 2 - 1; + } - public ForgeDirection toForgeDirection() { - return ForgeDirection.getOrientation(toSideValue()); - } + public ForgeDirection toForgeDirection() { + return ForgeDirection.getOrientation(toSideValue()); + } - public static final Direction[] directions = Direction.values(); + public static final Direction[] directions = Direction.values(); } diff --git a/src/main/java/ic2/api/crops/BaseSeed.java b/src/main/java/ic2/api/crops/BaseSeed.java index de6296b..38a1a21 100644 --- a/src/main/java/ic2/api/crops/BaseSeed.java +++ b/src/main/java/ic2/api/crops/BaseSeed.java @@ -4,53 +4,53 @@ package ic2.api.crops; * Base agriculture seed. Used to determine the state of a plant once it is planted from an item. */ public class BaseSeed { - /** - * Plant ID. - */ - public int id; + /** + * Plant ID. + */ + public int id; - /** - * Plant size. - */ - public int size; + /** + * Plant size. + */ + public int size; - /** - * Plant growth stat. - */ - public int statGrowth; + /** + * Plant growth stat. + */ + public int statGrowth; - /** - * Plant gain stat. - */ - public int statGain; + /** + * Plant gain stat. + */ + public int statGain; - /** - * Plant resistance stat. - */ - public int statResistance; + /** + * Plant resistance stat. + */ + public int statResistance; - /** - * For internal usage only. - */ - public int stackSize; + /** + * For internal usage only. + */ + public int stackSize; - /** - * Create a BaseSeed object. - * - * @param id1 plant ID - * @param size1 plant size - * @param statGrowth1 plant growth stat - * @param statGain1 plant gain stat - * @param statResistance1 plant resistance stat - * @param stackSize1 for internal usage only - */ - public BaseSeed(int id1, int size1, int statGrowth1, int statGain1, int statResistance1, int stackSize1) { - super(); - this.id = id1; - this.size = size1; - this.statGrowth = statGrowth1; - this.statGain = statGain1; - this.statResistance = statResistance1; - this.stackSize = stackSize1; - } + /** + * Create a BaseSeed object. + * + * @param id1 plant ID + * @param size1 plant size + * @param statGrowth1 plant growth stat + * @param statGain1 plant gain stat + * @param statResistance1 plant resistance stat + * @param stackSize1 for internal usage only + */ + public BaseSeed(int id1, int size1, int statGrowth1, int statGain1, int statResistance1, int stackSize1) { + super(); + this.id = id1; + this.size = size1; + this.statGrowth = statGrowth1; + this.statGain = statGain1; + this.statResistance = statResistance1; + this.stackSize = stackSize1; + } } diff --git a/src/main/java/ic2/api/crops/CropCard.java b/src/main/java/ic2/api/crops/CropCard.java index 0c804e1..9c45825 100644 --- a/src/main/java/ic2/api/crops/CropCard.java +++ b/src/main/java/ic2/api/crops/CropCard.java @@ -1,5 +1,7 @@ package ic2.api.crops; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -7,370 +9,381 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - /** * Base agriculture crop. - * + *

* Any crop extending this can be registered using registerCrop to be added into the game. */ public abstract class CropCard { - /** - * Plant name. Will be displayed to the player. - * - * @return Plant name - */ - public abstract String name(); + /** + * Plant name. Will be displayed to the player. + * + * @return Plant name + */ + public abstract String name(); - /** - * Your name here, will be shown in "Discovered by:" when analyzing seeds. - * - * @return Your name - */ - public String discoveredBy() {return "IC2 Team";} + /** + * Your name here, will be shown in "Discovered by:" when analyzing seeds. + * + * @return Your name + */ + public String discoveredBy() { + return "IC2 Team"; + } - /** - * Description of your plant. Keep it short, a few characters per line for up to two lines. - * Default is showing attributes of your plant, 2 per line. - * - * @param i line to get, starting from 0 - * @return The line - */ - public String desc(int i) { - String[] att = attributes(); - if (att == null || att.length == 0) return ""; - if (i == 0) { - String s = att[0]; - if (att.length >= 2) { - s+=", "+att[1]; - if (att.length >= 3) s+=","; - } - return s; - } - if (att.length < 3) return ""; - String s = att[2]; - if (att.length >= 4) s+=", "+att[3]; - return s; - } + /** + * Description of your plant. Keep it short, a few characters per line for up to two lines. + * Default is showing attributes of your plant, 2 per line. + * + * @param i line to get, starting from 0 + * @return The line + */ + public String desc(int i) { + String[] att = attributes(); + if (att == null || att.length == 0) return ""; + if (i == 0) { + String s = att[0]; + if (att.length >= 2) { + s += ", " + att[1]; + if (att.length >= 3) s += ","; + } + return s; + } + if (att.length < 3) return ""; + String s = att[2]; + if (att.length >= 4) s += ", " + att[3]; + return s; + } - /** - * * - * @param crop reference to ICropTile - * @return roots lengt use in isBlockBelow - */ - public int getrootslength(ICropTile crop){ - return 1; - } + /** + * * + * + * @param crop reference to ICropTile + * @return roots lengt use in isBlockBelow + */ + public int getrootslength(ICropTile crop) { + return 1; + } - /** - * Tier of the plant. Ranges from 1 to 16, 0 is Weed. - * Valuable and powerful crops have higher tiers, useless and weak ones have lower tiers. - * - * @return Tier - */ - public abstract int tier(); + /** + * Tier of the plant. Ranges from 1 to 16, 0 is Weed. + * Valuable and powerful crops have higher tiers, useless and weak ones have lower tiers. + * + * @return Tier + */ + public abstract int tier(); - /** - * Describe the plant through a set of stats, influencing breeding. - * Plants sharing stats and attributes will tend to cross-breed more often. - * - * Stats: - * - 0: Chemistry (Industrial uses based on chemical plant components) - * - 1: Consumable (Food, potion ingredients, stuff meant to be eaten or similarly used) - * - 2: Defensive (Plants with defense capabilities (damaging, explosive, chemical) or special abilities in general) - * - 3: Colorful (How colorful/aesthetically/beautiful is the plant, like dye-plants or plants without actual effects) - * - 4: Weed (Is this plant weed-like and rather unwanted/quick-spreading? Rare super-breed plants should have low values here) - * - * @param n index of the requested stat - * @return The requested value of the stats - */ - public abstract int stat(int n); + /** + * Describe the plant through a set of stats, influencing breeding. + * Plants sharing stats and attributes will tend to cross-breed more often. + *

+ * Stats: + * - 0: Chemistry (Industrial uses based on chemical plant components) + * - 1: Consumable (Food, potion ingredients, stuff meant to be eaten or similarly used) + * - 2: Defensive (Plants with defense capabilities (damaging, explosive, chemical) or special abilities in general) + * - 3: Colorful (How colorful/aesthetically/beautiful is the plant, like dye-plants or plants without actual effects) + * - 4: Weed (Is this plant weed-like and rather unwanted/quick-spreading? Rare super-breed plants should have low values here) + * + * @param n index of the requested stat + * @return The requested value of the stats + */ + public abstract int stat(int n); - /** - * Additional attributes of the plant, also influencing breeding. - * Plants sharing stats and attributes will tend to cross-breed more often. - * - * @return Attributes as an array of strings - */ - public abstract String[] attributes(); + /** + * Additional attributes of the plant, also influencing breeding. + * Plants sharing stats and attributes will tend to cross-breed more often. + * + * @return Attributes as an array of strings + */ + public abstract String[] attributes(); - /** - * Determine the max crop size. - * - * Currently only used for texture allocation. - */ - public abstract int maxSize(); + /** + * Determine the max crop size. + *

+ * Currently only used for texture allocation. + */ + public abstract int maxSize(); - /** - * Instantiate your Icons here. - * - * This method will get called by IC2, don't call it yourself. - */ - @SideOnly(Side.CLIENT) - public void registerSprites(IIconRegister iconRegister) { - textures = new IIcon[maxSize()]; + /** + * Instantiate your Icons here. + *

+ * This method will get called by IC2, don't call it yourself. + */ + @SideOnly(Side.CLIENT) + public void registerSprites(IIconRegister iconRegister) { + textures = new IIcon[maxSize()]; - for (int i = 1; i <= textures.length; i++) { - textures[i-1] = iconRegister.registerIcon("ic2:crop/blockCrop."+name()+"."+i); - } - } + for (int i = 1; i <= textures.length; i++) { + textures[i - 1] = iconRegister.registerIcon("ic2:crop/blockCrop." + name() + "." + i); + } + } - /** - * Sprite the crop is meant to be rendered with. - * - * @param crop reference to ICropTile - * @return 0-255, representing the sprite index on the crop's spritesheet. - */ - @SideOnly(Side.CLIENT) - public IIcon getSprite(ICropTile crop) { - if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null; + /** + * Sprite the crop is meant to be rendered with. + * + * @param crop reference to ICropTile + * @return 0-255, representing the sprite index on the crop's spritesheet. + */ + @SideOnly(Side.CLIENT) + public IIcon getSprite(ICropTile crop) { + if (crop.getSize() <= 0 || crop.getSize() > textures.length) return null; - return textures[crop.getSize() - 1]; - } + return textures[crop.getSize() - 1]; + } - /** - * Get the crop's spritesheet. - * Per default crops_0.png of ic2-sprites - * @return Texture file path - */ - public String getTextureFile() { - return "/ic2/sprites/crops_0.png"; - } + /** + * Get the crop's spritesheet. + * Per default crops_0.png of ic2-sprites + * + * @return Texture file path + */ + public String getTextureFile() { + return "/ic2/sprites/crops_0.png"; + } - /** - * Amount of growth points needed to increase the plant's size. - * Default is 200 * tier. - */ - public int growthDuration(ICropTile crop) { - return tier()*200; - } + /** + * Amount of growth points needed to increase the plant's size. + * Default is 200 * tier. + */ + public int growthDuration(ICropTile crop) { + return tier() * 200; + } - /** - * Check whether the plant can grow further. - * - * Consider: - * - Humidity, nutrients and air quality - * - Current size - * - Light level - * - Special biomes or conditions, accessible through crop.worldObj - * - * This method will be called upon empty upgraded crops to check whether a neighboring plant can cross onto it! Don't check if the size is greater than 0 and if the ID is real. - * - * @param crop reference to ICropTile - * @return Whether the crop can grow - */ - public abstract boolean canGrow(ICropTile crop); + /** + * Check whether the plant can grow further. + *

+ * Consider: + * - Humidity, nutrients and air quality + * - Current size + * - Light level + * - Special biomes or conditions, accessible through crop.worldObj + *

+ * This method will be called upon empty upgraded crops to check whether a neighboring plant can cross onto it! Don't check if the size is greater than 0 and if the ID is real. + * + * @param crop reference to ICropTile + * @return Whether the crop can grow + */ + public abstract boolean canGrow(ICropTile crop); - /** - * Calculate the influence for the plant to grow based on humidity, nutrients and air. - * Normal behavior is rating the three stats "normal", with each of them ranging from 0-30. - * Basic rule: Assume everything returns 10. All together must equal 30. Add the factors to your likings, for example (humidity*0.7)+(nutrients*0.9)+(air*1.4) - * - * Default is humidity + nutrients + air (no factors). - * - * @param crop reference to ICropTile - * @param humidity ground humidity, influenced by hydration - * @param nutrients nutrient quality in ground, based on fertilizers - * @param air air quality, influences by open gardens and less crops surrounding this one - * @return 0-30 - */ - public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) { - return (int) (humidity+nutrients+air); - } + /** + * Calculate the influence for the plant to grow based on humidity, nutrients and air. + * Normal behavior is rating the three stats "normal", with each of them ranging from 0-30. + * Basic rule: Assume everything returns 10. All together must equal 30. Add the factors to your likings, for example (humidity*0.7)+(nutrients*0.9)+(air*1.4) + *

+ * Default is humidity + nutrients + air (no factors). + * + * @param crop reference to ICropTile + * @param humidity ground humidity, influenced by hydration + * @param nutrients nutrient quality in ground, based on fertilizers + * @param air air quality, influences by open gardens and less crops surrounding this one + * @return 0-30 + */ + public int weightInfluences(ICropTile crop, float humidity, float nutrients, float air) { + return (int) (humidity + nutrients + air); + } - /** - * Used to determine whether the plant can crossbreed with another crop. - * Default is allow crossbreeding if the size is greater or equal than 3. - * - * @param crop crop to crossbreed with - */ - public boolean canCross(ICropTile crop) { - return crop.getSize() >= 3; - } + /** + * Used to determine whether the plant can crossbreed with another crop. + * Default is allow crossbreeding if the size is greater or equal than 3. + * + * @param crop crop to crossbreed with + */ + public boolean canCross(ICropTile crop) { + return crop.getSize() >= 3; + } - /** - * Called when the plant is rightclicked by a player. - * Default action is harvesting. - * - * Only called Serverside. - * - * @param crop reference to ICropTile - * @param player player rightclicking the crop - * @return Whether the plant has changed - */ - public boolean rightclick(ICropTile crop, EntityPlayer player) { - return crop.harvest(true); - } + /** + * Called when the plant is rightclicked by a player. + * Default action is harvesting. + *

+ * Only called Serverside. + * + * @param crop reference to ICropTile + * @param player player rightclicking the crop + * @return Whether the plant has changed + */ + public boolean rightclick(ICropTile crop, EntityPlayer player) { + return crop.harvest(true); + } - /** - * Use in Crop Havester with insert Cropnalyzer to get best Output. - * - * @param crop reference to ICropTile - * @return need crop size for best output. - */ + /** + * Use in Crop Havester with insert Cropnalyzer to get best Output. + * + * @param crop reference to ICropTile + * @return need crop size for best output. + */ - public abstract int getOptimalHavestSize(ICropTile crop); + public abstract int getOptimalHavestSize(ICropTile crop); - /** - * Check whether the crop can be harvested. - * - * @param crop reference to ICropTile - * @return Whether the crop can be harvested in its current state. - */ - public abstract boolean canBeHarvested(ICropTile crop); + /** + * Check whether the crop can be harvested. + * + * @param crop reference to ICropTile + * @return Whether the crop can be harvested in its current state. + */ + public abstract boolean canBeHarvested(ICropTile crop); - /** - * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. - * Default is 0.95^tier. - * - * @return Chance to drop the gains - */ - public float dropGainChance() { - float base = 1F; - for (int i = 0; i < tier(); i++) {base*=0.95;} - return base; - } + /** + * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. + * Default is 0.95^tier. + * + * @return Chance to drop the gains + */ + public float dropGainChance() { + float base = 1F; + for (int i = 0; i < tier(); i++) { + base *= 0.95; + } + return base; + } - /** - * Item obtained from harvesting the plant. - * - * @param crop reference to ICropTile - * @return Item obtained - */ - public abstract ItemStack getGain(ICropTile crop); + /** + * Item obtained from harvesting the plant. + * + * @param crop reference to ICropTile + * @return Item obtained + */ + public abstract ItemStack getGain(ICropTile crop); - /** - * Get the size of the plant after harvesting. - * Default is 1. - * - * @param crop reference to ICropTile - * @return Plant size after harvesting - */ - public byte getSizeAfterHarvest(ICropTile crop) {return 1;} + /** + * Get the size of the plant after harvesting. + * Default is 1. + * + * @param crop reference to ICropTile + * @return Plant size after harvesting + */ + public byte getSizeAfterHarvest(ICropTile crop) { + return 1; + } - /** - * Called when the plant is leftclicked by a player. - * Default action is picking the plant. - * - * Only called Serverside. - * - * @param crop reference to ICropTile - * @param player player leftclicked the crop - * @return Whether the plant has changed - */ - public boolean leftclick(ICropTile crop, EntityPlayer player) { - return crop.pick(true); - } + /** + * Called when the plant is leftclicked by a player. + * Default action is picking the plant. + *

+ * Only called Serverside. + * + * @param crop reference to ICropTile + * @param player player leftclicked the crop + * @return Whether the plant has changed + */ + public boolean leftclick(ICropTile crop, EntityPlayer player) { + return crop.pick(true); + } - /** - * Base chance for dropping seeds when the plant is picked. - * Default is 0.5*0.8^tier with a bigger chance for sizes greater than 2 and absolutely no chance for size 0. - * - * @param crop reference to ICropTile - * @return Chance to drop the seeds - */ - public float dropSeedChance(ICropTile crop) { - if (crop.getSize() == 1) return 0; - float base = 0.5F; - if (crop.getSize() == 2) base/=2F; - for (int i = 0; i < tier(); i++) {base*=0.8;} - return base; - } + /** + * Base chance for dropping seeds when the plant is picked. + * Default is 0.5*0.8^tier with a bigger chance for sizes greater than 2 and absolutely no chance for size 0. + * + * @param crop reference to ICropTile + * @return Chance to drop the seeds + */ + public float dropSeedChance(ICropTile crop) { + if (crop.getSize() == 1) return 0; + float base = 0.5F; + if (crop.getSize() == 2) base /= 2F; + for (int i = 0; i < tier(); i++) { + base *= 0.8; + } + return base; + } - /** - * Obtain seeds dropped when the plant is picked. - * Multiple drops of the returned ItemStack can occur. - * Default action is generating a seed from this crop. - * - * @param crop reference to ICropTile - * @return Seeds - */ - public ItemStack getSeeds(ICropTile crop) { - return crop.generateSeeds(crop.getID(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel()); - } + /** + * Obtain seeds dropped when the plant is picked. + * Multiple drops of the returned ItemStack can occur. + * Default action is generating a seed from this crop. + * + * @param crop reference to ICropTile + * @return Seeds + */ + public ItemStack getSeeds(ICropTile crop) { + return crop.generateSeeds(crop.getID(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel()); + } - /** - * Called when a neighbor block to the crop has changed. - * - * @param crop reference to ICropTile - */ - public void onNeighbourChange(ICropTile crop) { - // - } + /** + * Called when a neighbor block to the crop has changed. + * + * @param crop reference to ICropTile + */ + public void onNeighbourChange(ICropTile crop) { + // + } - /** - * Check if the crop should emit redstone. - * - * @return Whether the crop should emit redstone - */ - public int emitRedstone(ICropTile crop) {return 0;} + /** + * Check if the crop should emit redstone. + * + * @return Whether the crop should emit redstone + */ + public int emitRedstone(ICropTile crop) { + return 0; + } - /** - * Called when the crop is destroyed. - * - * @param crop reference to ICropTile - */ - public void onBlockDestroyed(ICropTile crop) { - // - } + /** + * Called when the crop is destroyed. + * + * @param crop reference to ICropTile + */ + public void onBlockDestroyed(ICropTile crop) { + // + } - /** - * Get the light value emitted by the plant. - * - * @param crop reference to ICropTile - * @return Light value emitted - */ - public int getEmittedLight(ICropTile crop) {return 0;} + /** + * Get the light value emitted by the plant. + * + * @param crop reference to ICropTile + * @return Light value emitted + */ + public int getEmittedLight(ICropTile crop) { + return 0; + } - /** - * Default is true if the entity is an EntityLiving in jumping or sprinting state. - * - * @param crop reference to ICropTile - * @param entity entity colliding - * @return Whether trampling calculation should happen, return false if the plant is no longer valid. - */ - public boolean onEntityCollision(ICropTile crop, Entity entity) { - if (entity instanceof EntityLivingBase) { - return ((EntityLivingBase) entity).isSprinting(); - } - return false; - } + /** + * Default is true if the entity is an EntityLiving in jumping or sprinting state. + * + * @param crop reference to ICropTile + * @param entity entity colliding + * @return Whether trampling calculation should happen, return false if the plant is no longer valid. + */ + public boolean onEntityCollision(ICropTile crop, Entity entity) { + if (entity instanceof EntityLivingBase) { + return ((EntityLivingBase) entity).isSprinting(); + } + return false; + } - /** - * Called every time the crop ticks. - * Should be called every 256 ticks or around 13 seconds. - * - * @param crop reference to ICropTile - */ - public void tick(ICropTile crop) { - // - } + /** + * Called every time the crop ticks. + * Should be called every 256 ticks or around 13 seconds. + * + * @param crop reference to ICropTile + */ + public void tick(ICropTile crop) { + // + } - /** - * Check whether this plant spreads weed to surrounding tiles. - * Default is true if the plant has a high growth stat (or is weeds) and size greater or equal than 2. - * - * @param crop reference to ICropTile - * @return Whether the plant spreads weed - */ - public boolean isWeed(ICropTile crop) { - return crop.getSize() >= 2 && (crop.getID() == 0 || crop.getGrowth() >= 24); - } + /** + * Check whether this plant spreads weed to surrounding tiles. + * Default is true if the plant has a high growth stat (or is weeds) and size greater or equal than 2. + * + * @param crop reference to ICropTile + * @return Whether the plant spreads weed + */ + public boolean isWeed(ICropTile crop) { + return crop.getSize() >= 2 && (crop.getID() == 0 || crop.getGrowth() >= 24); + } - /** - * Get this plant's ID. - * - * @return ID of this CropCard or -1 if it's not registered - */ - public final int getId() { - return Crops.instance.getIdFor(this); - } + /** + * Get this plant's ID. + * + * @return ID of this CropCard or -1 if it's not registered + */ + public final int getId() { + return Crops.instance.getIdFor(this); + } - @SideOnly(Side.CLIENT) - protected IIcon textures[]; + @SideOnly(Side.CLIENT) + protected IIcon textures[]; } diff --git a/src/main/java/ic2/api/crops/Crops.java b/src/main/java/ic2/api/crops/Crops.java index b49a5a6..1e38f9f 100644 --- a/src/main/java/ic2/api/crops/Crops.java +++ b/src/main/java/ic2/api/crops/Crops.java @@ -1,120 +1,115 @@ package ic2.api.crops; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary.Type; /** * General management of the crop system. */ public abstract class Crops { - public static Crops instance; + public static Crops instance; + /** + * Adds a crop nutrient biome bonus. + *

+ * +10/-10 0 indicates no bonus and negative values indicate a penalty. + * + * @param type Forge biome type to apply the bonus in + * @param nutrientsBonus Nutrient stat bonus + */ + public abstract void addBiomenutrientsBonus(Type type, int nutrientsBonus); + + /** + * Adds a crop humidity biome bonus. + *

+ * +10/-10 0 indicates no bonus and negative values indicate a penalty. + * + * @param type Forge biome type to apply the bonus in + * @param humidityBonus Humidity stat bonus + */ + public abstract void addBiomehumidityBonus(Type type, int humidityBonus); + /** + * Gets the humidity bonus for a biome. + * + * @param biome Biome to check + * @return Humidity bonus or 0 if none + */ + public abstract int getHumidityBiomeBonus(BiomeGenBase biome); - /** - * Adds a crop nutrient biome bonus. - * - * +10/-10 0 indicates no bonus and negative values indicate a penalty. - * - * @param type Forge biome type to apply the bonus in - * @param nutrientsBonus Nutrient stat bonus - */ - public abstract void addBiomenutrientsBonus(Type type, int nutrientsBonus); + /** + * Gets the nutrient bonus for a biome. + * + * @param biome Biome to check + * @return Nutrient bonus or 0 if none + */ + public abstract int getNutrientBiomeBonus(BiomeGenBase biome); - /** - * Adds a crop humidity biome bonus. - * - * +10/-10 0 indicates no bonus and negative values indicate a penalty. - * - * @param type Forge biome type to apply the bonus in - * @param humidityBonus Humidity stat bonus - */ - public abstract void addBiomehumidityBonus(Type type, int humidityBonus); + /** + * Returns the list of registered crops. + * + * @return Registered crops by ID + */ + public abstract CropCard[] getCropList(); + /** + * Auto-assign an ID to a plant and register it. + * Usage of this method is not recommended! Other plants could take your IDs and cause your plants to turn into other plants. + * + * @param crop plant to register + * @return The ID assigned to the plant + */ + public abstract short registerCrop(CropCard crop); - /** - * Gets the humidity bonus for a biome. - * - * @param biome Biome to check - * @return Humidity bonus or 0 if none - */ - public abstract int getHumidityBiomeBonus(BiomeGenBase biome); + /** + * Attempt to register a plant to an ID. + * If the ID is taken, the crop will not be registered and a console print will notify the user. + * + * @param crop plant to register + * @param i ID to register the plant to + * @return Whether the crop was registered + */ + public abstract boolean registerCrop(CropCard crop, int i); - /** - * Gets the nutrient bonus for a biome. - * - * @param biome Biome to check - * @return Nutrient bonus or 0 if none - */ - public abstract int getNutrientBiomeBonus(BiomeGenBase biome); + /** + * Registers a base seed, an item used to plant a crop. + * + * @param stack item + * @param id plant ID + * @param size initial size + * @param growth initial growth stat + * @param gain initial gain stat + * @param resistance initial resistance stat + * @return True if successful + */ + public abstract boolean registerBaseSeed(ItemStack stack, int id, int size, int growth, int gain, int resistance); - /** - * Returns the list of registered crops. - * - * @return Registered crops by ID - */ - public abstract CropCard[] getCropList(); + /** + * Finds a base seed from the given item. + * + * @return Base seed or null if none found + */ + public abstract BaseSeed getBaseSeed(ItemStack stack); - /** - * Auto-assign an ID to a plant and register it. - * Usage of this method is not recommended! Other plants could take your IDs and cause your plants to turn into other plants. - * - * @param crop plant to register - * @return The ID assigned to the plant - */ - public abstract short registerCrop(CropCard crop); + /** + * Execute registerSprites for all registered crop cards. + *

+ * This method will get called by IC2, don't call it yourself. + */ + @SideOnly(Side.CLIENT) + public abstract void startSpriteRegistration(IIconRegister iconRegister); - /** - * Attempt to register a plant to an ID. - * If the ID is taken, the crop will not be registered and a console print will notify the user. - * - * @param crop plant to register - * @param i ID to register the plant to - * @return Whether the crop was registered - */ - public abstract boolean registerCrop(CropCard crop, int i); - - /** - * Registers a base seed, an item used to plant a crop. - * - * @param stack item - * @param id plant ID - * @param size initial size - * @param growth initial growth stat - * @param gain initial gain stat - * @param resistance initial resistance stat - * @return True if successful - */ - public abstract boolean registerBaseSeed(ItemStack stack, int id, int size, int growth, int gain, int resistance); - - /** - * Finds a base seed from the given item. - * - * @return Base seed or null if none found - */ - public abstract BaseSeed getBaseSeed(ItemStack stack); - - /** - * Execute registerSprites for all registered crop cards. - * - * This method will get called by IC2, don't call it yourself. - */ - @SideOnly(Side.CLIENT) - public abstract void startSpriteRegistration(IIconRegister iconRegister); - - /** - * Returns the ID for the given crop. - * - * @param crop Crop to look up - * @return ID, or -1 if not found - */ - public abstract int getIdFor(CropCard crop); + /** + * Returns the ID for the given crop. + * + * @param crop Crop to look up + * @return ID, or -1 if not found + */ + public abstract int getIdFor(CropCard crop); } diff --git a/src/main/java/ic2/api/crops/ICropTile.java b/src/main/java/ic2/api/crops/ICropTile.java index 09b46d7..1b37eeb 100644 --- a/src/main/java/ic2/api/crops/ICropTile.java +++ b/src/main/java/ic2/api/crops/ICropTile.java @@ -10,255 +10,254 @@ import net.minecraft.world.World; * Interface implemented by the crop tile entity. */ public interface ICropTile { - /** - * Get the crop's plant ID. - * - * @return Plant ID, or -1 if there is no plant currently on the crop - */ - public short getID(); + /** + * Get the crop's plant ID. + * + * @return Plant ID, or -1 if there is no plant currently on the crop + */ + public short getID(); - /** - * Set the crop's plant ID. - * - * @param id Plant ID, or -1 for no plant - */ - public void setID(short id); + /** + * Set the crop's plant ID. + * + * @param id Plant ID, or -1 for no plant + */ + public void setID(short id); - /** - * Get the crop's plant size. - * - * @return Plant size, starting with 1 and maximum varies depending on plant - */ - public byte getSize(); + /** + * Get the crop's plant size. + * + * @return Plant size, starting with 1 and maximum varies depending on plant + */ + public byte getSize(); - /** - * Set the crop's plant size. - * - * @param size Plant size - */ - public void setSize(byte size); + /** + * Set the crop's plant size. + * + * @param size Plant size + */ + public void setSize(byte size); - /** - * Get the crop's plant growth stat. - * Higher values indicate faster growth. - * - * @return Plant growth stat - */ - public byte getGrowth(); + /** + * Get the crop's plant growth stat. + * Higher values indicate faster growth. + * + * @return Plant growth stat + */ + public byte getGrowth(); - /** - * Set the crop's plant growth stat. - * - * @param growth Plant growth stat - */ - public void setGrowth(byte growth); + /** + * Set the crop's plant growth stat. + * + * @param growth Plant growth stat + */ + public void setGrowth(byte growth); - /** - * Get the crop's plant gain stat. - * Higher values indicate more drops. - * - * @return Plant gain stat - */ - public byte getGain(); + /** + * Get the crop's plant gain stat. + * Higher values indicate more drops. + * + * @return Plant gain stat + */ + public byte getGain(); - /** - * Set the crop's plant gain stat. - * - * @param gain Plant gain stat - */ - public void setGain(byte gain); + /** + * Set the crop's plant gain stat. + * + * @param gain Plant gain stat + */ + public void setGain(byte gain); - /** - * Get the crop's plant resistance stat. - * Higher values indicate more resistance against trampling. - * - * @return Plant resistance stat - */ - public byte getResistance(); + /** + * Get the crop's plant resistance stat. + * Higher values indicate more resistance against trampling. + * + * @return Plant resistance stat + */ + public byte getResistance(); - /** - * Set the crop's plant resistance stat. - * - * @param resistance Plant resistance stat - */ - public void setResistance(byte resistance); + /** + * Set the crop's plant resistance stat. + * + * @param resistance Plant resistance stat + */ + public void setResistance(byte resistance); - /** - * Get the crop's plant scan level. - * Increases every time the seed is analyzed. - * - * @return Plant scan level - */ - public byte getScanLevel(); + /** + * Get the crop's plant scan level. + * Increases every time the seed is analyzed. + * + * @return Plant scan level + */ + public byte getScanLevel(); - /** - * Set the crop's plant scan level. - * - * @param scanLevel Plant scan level - */ - public void setScanLevel(byte scanLevel); + /** + * Set the crop's plant scan level. + * + * @param scanLevel Plant scan level + */ + public void setScanLevel(byte scanLevel); - /** - * Get the crop's plant custom data, stored alongside the crop. - * Can be modified in place. - * - * @return Plant custom data - */ - public NBTTagCompound getCustomData(); + /** + * Get the crop's plant custom data, stored alongside the crop. + * Can be modified in place. + * + * @return Plant custom data + */ + public NBTTagCompound getCustomData(); - /** - * Get the crop's nutrient storage. - * Ranges from 0 to 100. - * - * @return Crop nutrient storage - */ - public int getNutrientStorage(); + /** + * Get the crop's nutrient storage. + * Ranges from 0 to 100. + * + * @return Crop nutrient storage + */ + public int getNutrientStorage(); - /** - * Set the crop's nutrient storage. - * - * @param nutrientStorage Crop nutrient storage - */ - public void setNutrientStorage(int nutrientStorage); + /** + * Set the crop's nutrient storage. + * + * @param nutrientStorage Crop nutrient storage + */ + public void setNutrientStorage(int nutrientStorage); - /** - * Get the crop's hydration storage. - * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. - * - * @return Crop hydration storage - */ - public int getHydrationStorage(); + /** + * Get the crop's hydration storage. + * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. + * + * @return Crop hydration storage + */ + public int getHydrationStorage(); - /** - * Set the crop's hydration storage. - * - * @param hydrationStorage Crop hydration storage - */ - public void setHydrationStorage(int hydrationStorage); + /** + * Set the crop's hydration storage. + * + * @param hydrationStorage Crop hydration storage + */ + public void setHydrationStorage(int hydrationStorage); - /** - * Get the crop's Weed-Ex storage. - * - * @return Crop Weed-Ex storage - */ - public int getWeedExStorage(); + /** + * Get the crop's Weed-Ex storage. + * + * @return Crop Weed-Ex storage + */ + public int getWeedExStorage(); - /** - * Set the crop's Weed-Ex storage. - * - * @param weedExStorage Crop Weed-Ex storage - */ - public void setWeedExStorage(int weedExStorage); + /** + * Set the crop's Weed-Ex storage. + * + * @param weedExStorage Crop Weed-Ex storage + */ + public void setWeedExStorage(int weedExStorage); - /** - * Get the crop's humidity. - * Ranges from 0 (dry) to 10 (humid). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop humidity level - */ - public byte getHumidity(); + /** + * Get the crop's humidity. + * Ranges from 0 (dry) to 10 (humid). + * Updates every couple of seconds or when an update is requested. + * + * @return Crop humidity level + * @see #updateState() + */ + public byte getHumidity(); - /** - * Get the crop's nutrient level. - * Ranges from 0 (empty) to 10 (full). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop nutrient level - */ - public byte getNutrients(); + /** + * Get the crop's nutrient level. + * Ranges from 0 (empty) to 10 (full). + * Updates every couple of seconds or when an update is requested. + * + * @return Crop nutrient level + * @see #updateState() + */ + public byte getNutrients(); - /** - * Get the crop's air quality. - * Ranges from 0 (cluttered) to 10 (fresh). - * Updates every couple of seconds or when an update is requested. - * - * @see #updateState() - * - * @return Crop air quality - */ - public byte getAirQuality(); + /** + * Get the crop's air quality. + * Ranges from 0 (cluttered) to 10 (fresh). + * Updates every couple of seconds or when an update is requested. + * + * @return Crop air quality + * @see #updateState() + */ + public byte getAirQuality(); - /** - * Get the crop's world. - * - * @return Crop world - */ - public World getWorld(); + /** + * Get the crop's world. + * + * @return Crop world + */ + public World getWorld(); - /** - * Get the crop's location. - * - * @return Crop location - */ - public ChunkCoordinates getLocation(); + /** + * Get the crop's location. + * + * @return Crop location + */ + public ChunkCoordinates getLocation(); - /** - * Get the crop's light level. - * - * @return Crop light level - */ - public int getLightLevel(); + /** + * Get the crop's light level. + * + * @return Crop light level + */ + public int getLightLevel(); - /** - * Pick the crop, removing and giving seeds for the plant. - * - * @param manual whether it was done by hand (not automated) - * @return true if successfully picked - */ - public boolean pick(boolean manual); + /** + * Pick the crop, removing and giving seeds for the plant. + * + * @param manual whether it was done by hand (not automated) + * @return true if successfully picked + */ + public boolean pick(boolean manual); - /** - * Harvest the crop, turning it into gain and resetting its size. - * drop output on ground - * @param manual - * @return true if successfully harvested - */ - public boolean harvest(boolean manual); + /** + * Harvest the crop, turning it into gain and resetting its size. + * drop output on ground + * + * @param manual + * @return true if successfully harvested + */ + public boolean harvest(boolean manual); - /** - * Harvest the crop, turning it into gain and resetting its size. - * drop output on ground - * @param Optimal force check getOptimalHavestSize() for harvest - * @return ItemStack[] of harvest output - */ + /** + * Harvest the crop, turning it into gain and resetting its size. + * drop output on ground + * + * @param Optimal force check getOptimalHavestSize() for harvest + * @return ItemStack[] of harvest output + */ - ItemStack[] harvest_automated(boolean Optimal); + ItemStack[] harvest_automated(boolean Optimal); - /** - * Fully clears the crop without dropping anything. - */ - public void reset(); + /** + * Fully clears the crop without dropping anything. + */ + public void reset(); - /** - * Request a texture and lighting update. - */ - public void updateState(); + /** + * Request a texture and lighting update. + */ + public void updateState(); - /** - * Check if a block is under the farmland containing the crop. - * Searches up to 2 blocks below the farmland or an air space, whichever appears first. - * - * @param block block to search - * @return Whether the block was found - */ - public boolean isBlockBelow(Block block); + /** + * Check if a block is under the farmland containing the crop. + * Searches up to 2 blocks below the farmland or an air space, whichever appears first. + * + * @param block block to search + * @return Whether the block was found + */ + public boolean isBlockBelow(Block block); - /** - * Generate plant seeds with the given parameters. - * - * @param plant plant ID - * @param growth plant growth stat - * @param gain plant gain stat - * @param resis plant resistance stat - * @param scan plant scan level - * @return Plant seed item - */ - public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan); + /** + * Generate plant seeds with the given parameters. + * + * @param plant plant ID + * @param growth plant growth stat + * @param gain plant gain stat + * @param resis plant resistance stat + * @param scan plant scan level + * @return Plant seed item + */ + public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan); } diff --git a/src/main/java/ic2/api/crops/package-info.java b/src/main/java/ic2/api/crops/package-info.java index 04b8253..f5041cd 100644 --- a/src/main/java/ic2/api/crops/package-info.java +++ b/src/main/java/ic2/api/crops/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.crops; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.crops; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/energy/EnergyNet.java b/src/main/java/ic2/api/energy/EnergyNet.java index 822bfc2..9ddf6b8 100644 --- a/src/main/java/ic2/api/energy/EnergyNet.java +++ b/src/main/java/ic2/api/energy/EnergyNet.java @@ -3,16 +3,16 @@ package ic2.api.energy; /** * Provides access to the energy network. - * + *

* The old EnergyNet methods missing in IEnergyNet have been migrated to events (load, unload) or * removed (tiles no longer emit energy actively, the energy net implementation requests it). - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public final class EnergyNet { - /** - * Instance of the global EnergyNet class. - */ - public static IEnergyNet instance; + /** + * Instance of the global EnergyNet class. + */ + public static IEnergyNet instance; } diff --git a/src/main/java/ic2/api/energy/IEnergyNet.java b/src/main/java/ic2/api/energy/IEnergyNet.java index 8f656e5..c21241b 100644 --- a/src/main/java/ic2/api/energy/IEnergyNet.java +++ b/src/main/java/ic2/api/energy/IEnergyNet.java @@ -2,85 +2,82 @@ package ic2.api.energy; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; - import net.minecraftforge.common.util.ForgeDirection; /** * Interface representing the methods provided by the global EnergyNet class. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyNet { - /** - * Get the EnergyNet-registered tile entity at the specified position. - * - * This is not the same as World.getTileEntity(), it's possible to register delegate tile - * entities with the energy net which are different from what's actually in the world. Those - * delegates allow to use separate TileEntity objects just for the EnergyNet interfaces, - * simplifying cross-mod dependencies and multi-blocks. - * - * @param world World containing the tile entity - * @param x x-coordinate - * @param y y-coordinate - * @param z z-coordinate - * @return tile entity registered to the energy net or null if none is registered - */ - TileEntity getTileEntity(World world, int x, int y, int z); + /** + * Get the EnergyNet-registered tile entity at the specified position. + *

+ * This is not the same as World.getTileEntity(), it's possible to register delegate tile + * entities with the energy net which are different from what's actually in the world. Those + * delegates allow to use separate TileEntity objects just for the EnergyNet interfaces, + * simplifying cross-mod dependencies and multi-blocks. + * + * @param world World containing the tile entity + * @param x x-coordinate + * @param y y-coordinate + * @param z z-coordinate + * @return tile entity registered to the energy net or null if none is registered + */ + TileEntity getTileEntity(World world, int x, int y, int z); - /** - * Get the EnergyNet-registered neighbor tile entity at the specified position. - * - * @param te TileEntity indicating the world and position to search from - * @param dir direction the neighbor is to be found - * @return neighbor tile entity registered to the energy net or null if none is registered - */ - TileEntity getNeighbor(TileEntity te, ForgeDirection dir); + /** + * Get the EnergyNet-registered neighbor tile entity at the specified position. + * + * @param te TileEntity indicating the world and position to search from + * @param dir direction the neighbor is to be found + * @return neighbor tile entity registered to the energy net or null if none is registered + */ + TileEntity getNeighbor(TileEntity te, ForgeDirection dir); - /** - * determine how much energy has been emitted by the EnergyEmitter specified - * - * @note call this twice with x ticks delay to get the avg. emitted power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - * @deprecated Discontinued, use getNodeStats instead. - */ - @Deprecated - double getTotalEnergyEmitted(TileEntity tileEntity); + /** + * determine how much energy has been emitted by the EnergyEmitter specified + * + * @param tileEntity energy emitter + * @note call this twice with x ticks delay to get the avg. emitted power p = (call2 - call1) / x EU/tick + * @deprecated Discontinued, use getNodeStats instead. + */ + @Deprecated + double getTotalEnergyEmitted(TileEntity tileEntity); - /** - * determine how much energy has been sunken by the EnergySink specified - * - * @note call this twice with x ticks delay to get the avg. sunken power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - * @deprecated Discontinued, use getNodeStats instead. - */ - @Deprecated - double getTotalEnergySunken(TileEntity tileEntity); + /** + * determine how much energy has been sunken by the EnergySink specified + * + * @param tileEntity energy emitter + * @note call this twice with x ticks delay to get the avg. sunken power p = (call2 - call1) / x EU/tick + * @deprecated Discontinued, use getNodeStats instead. + */ + @Deprecated + double getTotalEnergySunken(TileEntity tileEntity); - /** - * Retrieve statistics for the tile entity specified. - * - * The statistics apply to the last simulated tick. - * - * @param te Tile entity to check. - * @return Statistics for the tile entity. - */ - NodeStats getNodeStats(TileEntity te); + /** + * Retrieve statistics for the tile entity specified. + *

+ * The statistics apply to the last simulated tick. + * + * @param te Tile entity to check. + * @return Statistics for the tile entity. + */ + NodeStats getNodeStats(TileEntity te); - /** - * Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2. - * - * @param tier tier - * @return power in eu/t - */ - double getPowerFromTier(int tier); + /** + * Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2. + * + * @param tier tier + * @return power in eu/t + */ + double getPowerFromTier(int tier); - /** - * Determine minimum tier required to handle the specified power, e.g. tier 2 for 128 eu/t. - * - * @param power in eu/t - * @return tier - */ - int getTierFromPower(double power); + /** + * Determine minimum tier required to handle the specified power, e.g. tier 2 for 128 eu/t. + * + * @param power in eu/t + * @return tier + */ + int getTierFromPower(double power); } diff --git a/src/main/java/ic2/api/energy/NodeStats.java b/src/main/java/ic2/api/energy/NodeStats.java index db33da7..b30a0f1 100644 --- a/src/main/java/ic2/api/energy/NodeStats.java +++ b/src/main/java/ic2/api/energy/NodeStats.java @@ -1,25 +1,25 @@ package ic2.api.energy; public class NodeStats { - public NodeStats(double energyIn, double energyOut, double voltage) { - this.energyIn = energyIn; - this.energyOut = energyOut; - this.voltage = voltage; - } + public NodeStats(double energyIn, double energyOut, double voltage) { + this.energyIn = energyIn; + this.energyOut = energyOut; + this.voltage = voltage; + } - public double getEnergyIn() { - return energyIn; - } + public double getEnergyIn() { + return energyIn; + } - public double getEnergyOut() { - return energyOut; - } + public double getEnergyOut() { + return energyOut; + } - public double getVoltage() { - return voltage; - } + public double getVoltage() { + return voltage; + } - protected double energyIn; - protected double energyOut; - protected double voltage; + protected double energyIn; + protected double energyOut; + protected double voltage; } diff --git a/src/main/java/ic2/api/energy/event/EnergyTileEvent.java b/src/main/java/ic2/api/energy/event/EnergyTileEvent.java index 2182e49..4979e4b 100644 --- a/src/main/java/ic2/api/energy/event/EnergyTileEvent.java +++ b/src/main/java/ic2/api/energy/event/EnergyTileEvent.java @@ -1,23 +1,21 @@ package ic2.api.energy.event; -import net.minecraft.tileentity.TileEntity; - -import net.minecraftforge.event.world.WorldEvent; - import ic2.api.energy.tile.IEnergyTile; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.event.world.WorldEvent; /** * Base class for energy net events, don't use it directly. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public class EnergyTileEvent extends WorldEvent { - public final IEnergyTile energyTile; + public final IEnergyTile energyTile; - public EnergyTileEvent(IEnergyTile energyTile1) { - super(((TileEntity) energyTile1).getWorldObj()); + public EnergyTileEvent(IEnergyTile energyTile1) { + super(((TileEntity) energyTile1).getWorldObj()); - this.energyTile = energyTile1; - } + this.energyTile = energyTile1; + } } diff --git a/src/main/java/ic2/api/energy/event/EnergyTileLoadEvent.java b/src/main/java/ic2/api/energy/event/EnergyTileLoadEvent.java index bf019ae..d302f89 100644 --- a/src/main/java/ic2/api/energy/event/EnergyTileLoadEvent.java +++ b/src/main/java/ic2/api/energy/event/EnergyTileLoadEvent.java @@ -4,23 +4,23 @@ import ic2.api.energy.tile.IEnergyTile; /** * Event announcing new energy tiles. - * + *

* This event notifies subscribers of loaded energy tiles, e.g. after getting * loaded through the chunk they are in or after being placed down by the * player or another deployer mechanism. - * + *

* Every energy tile which wants to get connected to the IC2 Energy Network has * to either post this event or alternatively call EnergyNet.addTileEntity(). - * + *

* You may use this event to build a static representation of energy tiles for * your own energy grid implementation if you need to. It's not required if you * always lookup energy paths on demand. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public class EnergyTileLoadEvent extends EnergyTileEvent { - public EnergyTileLoadEvent(IEnergyTile energyTile1) { - super(energyTile1); - } + public EnergyTileLoadEvent(IEnergyTile energyTile1) { + super(energyTile1); + } } diff --git a/src/main/java/ic2/api/energy/event/EnergyTileUnloadEvent.java b/src/main/java/ic2/api/energy/event/EnergyTileUnloadEvent.java index 2b22ae3..727c8a1 100644 --- a/src/main/java/ic2/api/energy/event/EnergyTileUnloadEvent.java +++ b/src/main/java/ic2/api/energy/event/EnergyTileUnloadEvent.java @@ -4,24 +4,24 @@ import ic2.api.energy.tile.IEnergyTile; /** * Event announcing terminated energy tiles. - * + *

* This event notifies subscribers of unloaded energy tiles, e.g. after getting * unloaded through the chunk they are in or after being destroyed by the * player or another block pick/destruction mechanism. - * + *

* Every energy tile which wants to get disconnected from the IC2 Energy * Network has to either post this event or alternatively call * EnergyNet.removeTileEntity(). - * + *

* You may use this event to build a static representation of energy tiles for * your own energy grid implementation if you need to. It's not required if you * always lookup energy paths on demand. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public class EnergyTileUnloadEvent extends EnergyTileEvent { - public EnergyTileUnloadEvent(IEnergyTile energyTile1) { - super(energyTile1); - } + public EnergyTileUnloadEvent(IEnergyTile energyTile1) { + super(energyTile1); + } } diff --git a/src/main/java/ic2/api/energy/event/package-info.java b/src/main/java/ic2/api/energy/event/package-info.java index 40db6f8..f1cc9ea 100644 --- a/src/main/java/ic2/api/energy/event/package-info.java +++ b/src/main/java/ic2/api/energy/event/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.energy.event; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.energy.event; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/energy/package-info.java b/src/main/java/ic2/api/energy/package-info.java index 81d0bfe..a92380f 100644 --- a/src/main/java/ic2/api/energy/package-info.java +++ b/src/main/java/ic2/api/energy/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.energy; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.energy; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/energy/prefab/BasicSink.java b/src/main/java/ic2/api/energy/prefab/BasicSink.java index 48de061..042f368 100644 --- a/src/main/java/ic2/api/energy/prefab/BasicSink.java +++ b/src/main/java/ic2/api/energy/prefab/BasicSink.java @@ -1,373 +1,360 @@ package ic2.api.energy.prefab; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - import cpw.mods.fml.common.FMLCommonHandler; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergySink; import ic2.api.info.Info; import ic2.api.item.ElectricItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; /** * BasicSink is a simple adapter to provide an ic2 energy sink. - * + *

* It's designed to be attached to a tile entity as a delegate. Functionally BasicSink acts as a * one-time configurable input energy buffer, thus providing a common use case for machines. - * + *

* Sub-classing BasicSink instead of using it as a delegate works as well, but isn't recommended. * The delegate can be extended with additional functionality through a sub class though. - * + *

* The constraints set by BasicSink like the strict tank-like energy buffering should provide a * more easy to use and stable interface than using IEnergySink directly while aiming for * optimal performance. - * + *

* Using BasicSink involves the following steps: * - create a BasicSink instance in your TileEntity, typically in a field * - forward invalidate, onChunkUnload, readFromNBT, writeToNBT and updateEntity to the BasicSink - * instance. - * If you have other means of determining when the tile entity is fully loaded, notify onLoaded - * that way instead of forwarding updateEntity. + * instance. + * If you have other means of determining when the tile entity is fully loaded, notify onLoaded + * that way instead of forwarding updateEntity. * - call useEnergy whenever appropriate. canUseEnergy determines if enough energy is available - * without consuming the energy. + * without consuming the energy. * - optionally use getEnergyStored to display the output buffer charge level * - optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container) - * + *

* Example implementation code: - * @code{.java} - * public class SomeTileEntity extends TileEntity { - * // new basic energy sink, 1000 EU buffer, tier 1 (32 EU/t, LV) - * private BasicSink ic2EnergySink = new BasicSink(this, 1000, 1); - * - * @Override - * public void invalidate() { - * ic2EnergySink.invalidate(); // notify the energy sink - * ... - * super.invalidate(); // this is important for mc! - * } - * - * @Override - * public void onChunkUnload() { - * ic2EnergySink.onChunkUnload(); // notify the energy sink - * ... - * } - * - * @Override - * public void readFromNBT(NBTTagCompound tag) { - * super.readFromNBT(tag); - * - * ic2EnergySink.readFromNBT(tag); - * ... - * } - * - * @Override - * public void writeToNBT(NBTTagCompound tag) { - * super.writeToNBT(tag); - * - * ic2EnergySink.writeToNBT(tag); - * ... - * } - * - * @Override - * public void updateEntity() { - * ic2EnergySink.updateEntity(); // notify the energy sink - * ... - * if (ic2EnergySink.useEnergy(5)) { // use 5 eu from the sink's buffer this tick - * ... // do something with the energy - * } - * ... - * } - * - * ... + * + * @code{.java} public class SomeTileEntity extends TileEntity { + * // new basic energy sink, 1000 EU buffer, tier 1 (32 EU/t, LV) + * private BasicSink ic2EnergySink = new BasicSink(this, 1000, 1); + * @Override public void invalidate() { + * ic2EnergySink.invalidate(); // notify the energy sink + * ... + * super.invalidate(); // this is important for mc! + * } + * @Override public void onChunkUnload() { + * ic2EnergySink.onChunkUnload(); // notify the energy sink + * ... + * } + * @Override public void readFromNBT(NBTTagCompound tag) { + * super.readFromNBT(tag); + *

+ * ic2EnergySink.readFromNBT(tag); + * ... + * } + * @Override public void writeToNBT(NBTTagCompound tag) { + * super.writeToNBT(tag); + *

+ * ic2EnergySink.writeToNBT(tag); + * ... + * } + * @Override public void updateEntity() { + * ic2EnergySink.updateEntity(); // notify the energy sink + * ... + * if (ic2EnergySink.useEnergy(5)) { // use 5 eu from the sink's buffer this tick + * ... // do something with the energy + * } + * ... + * } + *

+ * ... * } * @endcode */ public class BasicSink extends TileEntity implements IEnergySink { - // ********************************** - // *** Methods for use by the mod *** - // ********************************** + // ********************************** + // *** Methods for use by the mod *** + // ********************************** - /** - * Constructor for a new BasicSink delegate. - * - * @param parent1 TileEntity represented by this energy sink. - * @param capacity1 Maximum amount of eu to store. - * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... - */ - public BasicSink(TileEntity parent1, int capacity1, int tier1) { - this.parent = parent1; - this.capacity = capacity1; - this.tier = tier1; - } + /** + * Constructor for a new BasicSink delegate. + * + * @param parent1 TileEntity represented by this energy sink. + * @param capacity1 Maximum amount of eu to store. + * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... + */ + public BasicSink(TileEntity parent1, int capacity1, int tier1) { + this.parent = parent1; + this.capacity = capacity1; + this.tier = tier1; + } - // in-world te forwards >> + // in-world te forwards >> - /** - * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. - * Either updateEntity or onLoaded have to be used. - */ - @Override - public void updateEntity() { - if (!addedToEnet) onLoaded(); - } + /** + * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. + * Either updateEntity or onLoaded have to be used. + */ + @Override + public void updateEntity() { + if (!addedToEnet) onLoaded(); + } - /** - * Notification that the base TileEntity finished loaded, for advanced uses. - * Either updateEntity or onLoaded have to be used. - */ - public void onLoaded() { - if (!addedToEnet && - !FMLCommonHandler.instance().getEffectiveSide().isClient() && - Info.isIc2Available()) { - worldObj = parent.getWorldObj(); - xCoord = parent.xCoord; - yCoord = parent.yCoord; - zCoord = parent.zCoord; + /** + * Notification that the base TileEntity finished loaded, for advanced uses. + * Either updateEntity or onLoaded have to be used. + */ + public void onLoaded() { + if (!addedToEnet && + !FMLCommonHandler.instance().getEffectiveSide().isClient() && + Info.isIc2Available()) { + worldObj = parent.getWorldObj(); + xCoord = parent.xCoord; + yCoord = parent.yCoord; + zCoord = parent.zCoord; - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - addedToEnet = true; - } - } + addedToEnet = true; + } + } - /** - * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void invalidate() { - super.invalidate(); + /** + * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void invalidate() { + super.invalidate(); - onChunkUnload(); - } + onChunkUnload(); + } - /** - * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void onChunkUnload() { - if (addedToEnet && - Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + /** + * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void onChunkUnload() { + if (addedToEnet && + Info.isIc2Available()) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - addedToEnet = false; - } - } + addedToEnet = false; + } + } - /** - * Forward for the base TileEntity's readFromNBT(), used for loading the state. - * - * @param tag Compound tag as supplied by TileEntity.readFromNBT() - */ - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); + /** + * Forward for the base TileEntity's readFromNBT(), used for loading the state. + * + * @param tag Compound tag as supplied by TileEntity.readFromNBT() + */ + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); - NBTTagCompound data = tag.getCompoundTag("IC2BasicSink"); + NBTTagCompound data = tag.getCompoundTag("IC2BasicSink"); - energyStored = data.getDouble("energy"); - } + energyStored = data.getDouble("energy"); + } - /** - * Forward for the base TileEntity's writeToNBT(), used for saving the state. - * - * @param tag Compound tag as supplied by TileEntity.writeToNBT() - */ - @Override - public void writeToNBT(NBTTagCompound tag) { - try { - super.writeToNBT(tag); - } catch (RuntimeException e) { - // happens if this is a delegate, ignore - } + /** + * Forward for the base TileEntity's writeToNBT(), used for saving the state. + * + * @param tag Compound tag as supplied by TileEntity.writeToNBT() + */ + @Override + public void writeToNBT(NBTTagCompound tag) { + try { + super.writeToNBT(tag); + } catch (RuntimeException e) { + // happens if this is a delegate, ignore + } - NBTTagCompound data = new NBTTagCompound(); + NBTTagCompound data = new NBTTagCompound(); - data.setDouble("energy", energyStored); + data.setDouble("energy", energyStored); - tag.setTag("IC2BasicSink", data); - } + tag.setTag("IC2BasicSink", data); + } - // << in-world te forwards - // methods for using this adapter >> + // << in-world te forwards + // methods for using this adapter >> - /** - * Get the maximum amount of energy this sink can hold in its buffer. - * - * @return Capacity in EU. - */ - public int getCapacity() { - return capacity; - } + /** + * Get the maximum amount of energy this sink can hold in its buffer. + * + * @return Capacity in EU. + */ + public int getCapacity() { + return capacity; + } - /** - * Set the maximum amount of energy this sink can hold in its buffer. - * - * @param capacity1 Capacity in EU. - */ - public void setCapacity(int capacity1) { - this.capacity = capacity1; - } + /** + * Set the maximum amount of energy this sink can hold in its buffer. + * + * @param capacity1 Capacity in EU. + */ + public void setCapacity(int capacity1) { + this.capacity = capacity1; + } - /** - * Get the IC2 energy tier for this sink. - * - * @return IC2 Tier. - */ - public int getTier() { - return tier; - } + /** + * Get the IC2 energy tier for this sink. + * + * @return IC2 Tier. + */ + public int getTier() { + return tier; + } - /** - * Set the IC2 energy tier for this sink. - * - * @param tier1 IC2 Tier. - */ - public void setTier(int tier1) { - this.tier = tier1; - } + /** + * Set the IC2 energy tier for this sink. + * + * @param tier1 IC2 Tier. + */ + public void setTier(int tier1) { + this.tier = tier1; + } - /** - * Determine the energy stored in the sink's input buffer. - * - * @return amount in EU, may be above capacity - */ - public double getEnergyStored() { - return energyStored; - } + /** + * Determine the energy stored in the sink's input buffer. + * + * @return amount in EU, may be above capacity + */ + public double getEnergyStored() { + return energyStored; + } - /** - * Set the stored energy to the specified amount. - * - * This is intended for server -> client synchronization, e.g. to display the stored energy in - * a GUI through getEnergyStored(). - * - * @param amount - */ - public void setEnergyStored(double amount) { - energyStored = amount; - } + /** + * Set the stored energy to the specified amount. + *

+ * This is intended for server -> client synchronization, e.g. to display the stored energy in + * a GUI through getEnergyStored(). + * + * @param amount + */ + public void setEnergyStored(double amount) { + energyStored = amount; + } - /** - * Determine if the specified amount of energy is available. - * - * @param amount in EU - * @return true if the amount is available - */ - public boolean canUseEnergy(double amount) { - return energyStored >= amount; - } + /** + * Determine if the specified amount of energy is available. + * + * @param amount in EU + * @return true if the amount is available + */ + public boolean canUseEnergy(double amount) { + return energyStored >= amount; + } - /** - * Use the specified amount of energy, if available. - * - * @param amount amount to use - * @return true if the amount was available - */ - public boolean useEnergy(double amount) { - if (canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient()) { - energyStored -= amount; + /** + * Use the specified amount of energy, if available. + * + * @param amount amount to use + * @return true if the amount was available + */ + public boolean useEnergy(double amount) { + if (canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient()) { + energyStored -= amount; - return true; - } - return false; - } + return true; + } + return false; + } - /** - * Discharge the supplied ItemStack into this sink's energy buffer. - * - * @param stack ItemStack to discharge (null is ignored) - * @param limit Transfer limit, values <= 0 will use the battery's limit - * @return true if energy was transferred - */ - public boolean discharge(ItemStack stack, int limit) { - if (stack == null || !Info.isIc2Available()) return false; + /** + * Discharge the supplied ItemStack into this sink's energy buffer. + * + * @param stack ItemStack to discharge (null is ignored) + * @param limit Transfer limit, values <= 0 will use the battery's limit + * @return true if energy was transferred + */ + public boolean discharge(ItemStack stack, int limit) { + if (stack == null || !Info.isIc2Available()) return false; - double amount = capacity - energyStored; - if (amount <= 0) return false; + double amount = capacity - energyStored; + if (amount <= 0) return false; - if (limit > 0 && limit < amount) amount = limit; + if (limit > 0 && limit < amount) amount = limit; - amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false); + amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false); - energyStored += amount; + energyStored += amount; - return amount > 0; - } + return amount > 0; + } - // << methods for using this adapter + // << methods for using this adapter - // backwards compatibility (ignore these) >> + // backwards compatibility (ignore these) >> - @Deprecated - public void onUpdateEntity() { - updateEntity(); - } + @Deprecated + public void onUpdateEntity() { + updateEntity(); + } - @Deprecated - public void onInvalidate() { - invalidate(); - } + @Deprecated + public void onInvalidate() { + invalidate(); + } - @Deprecated - public void onOnChunkUnload() { - onChunkUnload(); - } + @Deprecated + public void onOnChunkUnload() { + onChunkUnload(); + } - @Deprecated - public void onReadFromNbt(NBTTagCompound tag) { - readFromNBT(tag); - } + @Deprecated + public void onReadFromNbt(NBTTagCompound tag) { + readFromNBT(tag); + } - @Deprecated - public void onWriteToNbt(NBTTagCompound tag) { - writeToNBT(tag); - } + @Deprecated + public void onWriteToNbt(NBTTagCompound tag) { + writeToNBT(tag); + } - // << backwards compatibility + // << backwards compatibility - // ****************************** - // *** Methods for use by ic2 *** - // ****************************** + // ****************************** + // *** Methods for use by ic2 *** + // ****************************** - // energy net interface >> + // energy net interface >> - @Override - public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { - return true; - } + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + return true; + } - @Override - public double getDemandedEnergy() { - return Math.max(0, capacity - energyStored); - } + @Override + public double getDemandedEnergy() { + return Math.max(0, capacity - energyStored); + } - @Override - public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { - energyStored += amount; + @Override + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { + energyStored += amount; - return 0; - } + return 0; + } - @Override - public int getSinkTier() { - return tier; - } + @Override + public int getSinkTier() { + return tier; + } - // << energy net interface + // << energy net interface - public final TileEntity parent; + public final TileEntity parent; - protected int capacity; - protected int tier; - protected double energyStored; - protected boolean addedToEnet; + protected int capacity; + protected int tier; + protected double energyStored; + protected boolean addedToEnet; } diff --git a/src/main/java/ic2/api/energy/prefab/BasicSource.java b/src/main/java/ic2/api/energy/prefab/BasicSource.java index 011e8cd..e78e48b 100644 --- a/src/main/java/ic2/api/energy/prefab/BasicSource.java +++ b/src/main/java/ic2/api/energy/prefab/BasicSource.java @@ -1,375 +1,362 @@ package ic2.api.energy.prefab; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - import cpw.mods.fml.common.FMLCommonHandler; - -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - import ic2.api.energy.EnergyNet; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergySource; import ic2.api.info.Info; import ic2.api.item.ElectricItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; /** * BasicSource is a simple adapter to provide an ic2 energy source. - * + *

* It's designed to be attached to a tile entity as a delegate. Functionally BasicSource acts as a * one-time configurable output energy buffer, thus providing a common use case for generators. - * + *

* Sub-classing BasicSource instead of using it as a delegate works as well, but isn't recommended. * The delegate can be extended with additional functionality through a sub class though. - * + *

* The constraints set by BasicSource like the strict tank-like energy buffering should provide a * more easy to use and stable interface than using IEnergySource directly while aiming for * optimal performance. - * + *

* Using BasicSource involves the following steps: * - create a BasicSource instance in your TileEntity, typically in a field * - forward invalidate, onChunkUnload, readFromNBT, writeToNBT and updateEntity to the BasicSource - * instance. - * If you have other means of determining when the tile entity is fully loaded, notify onLoaded - * that way instead of forwarding updateEntity. + * instance. + * If you have other means of determining when the tile entity is fully loaded, notify onLoaded + * that way instead of forwarding updateEntity. * - call addEnergy whenever appropriate, using getFreeCapacity may determine if e.g. the generator - * should run + * should run * - optionally use getEnergyStored to display the output buffer charge level * - optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container) - * + *

* Example implementation code: - * @code{.java} - * public class SomeTileEntity extends TileEntity { - * // new basic energy source, 1000 EU buffer, tier 1 (32 EU/t, LV) - * private BasicSource ic2EnergySource = new BasicSource(this, 1000, 1); - * - * @Override - * public void invalidate() { - * ic2EnergySource.invalidate(); // notify the energy source - * ... - * super.invalidate(); // this is important for mc! - * } - * - * @Override - * public void onChunkUnload() { - * ic2EnergySource.onChunkUnload(); // notify the energy source - * ... - * } - * - * @Override - * public void readFromNBT(NBTTagCompound tag) { - * super.readFromNBT(tag); - * - * ic2EnergySource.readFromNBT(tag); - * ... - * } - * - * @Override - * public void writeToNBT(NBTTagCompound tag) { - * super.writeToNBT(tag); - * - * ic2EnergySource.writeToNBT(tag); - * ... - * } - * - * @Override - * public void updateEntity() { - * ic2EnergySource.updateEntity(); // notify the energy source - * ... - * ic2EnergySource.addEnergy(5); // add 5 eu to the source's buffer this tick - * ... - * } - * - * ... + * + * @code{.java} public class SomeTileEntity extends TileEntity { + * // new basic energy source, 1000 EU buffer, tier 1 (32 EU/t, LV) + * private BasicSource ic2EnergySource = new BasicSource(this, 1000, 1); + * @Override public void invalidate() { + * ic2EnergySource.invalidate(); // notify the energy source + * ... + * super.invalidate(); // this is important for mc! + * } + * @Override public void onChunkUnload() { + * ic2EnergySource.onChunkUnload(); // notify the energy source + * ... + * } + * @Override public void readFromNBT(NBTTagCompound tag) { + * super.readFromNBT(tag); + *

+ * ic2EnergySource.readFromNBT(tag); + * ... + * } + * @Override public void writeToNBT(NBTTagCompound tag) { + * super.writeToNBT(tag); + *

+ * ic2EnergySource.writeToNBT(tag); + * ... + * } + * @Override public void updateEntity() { + * ic2EnergySource.updateEntity(); // notify the energy source + * ... + * ic2EnergySource.addEnergy(5); // add 5 eu to the source's buffer this tick + * ... + * } + *

+ * ... * } * @endcode */ public class BasicSource extends TileEntity implements IEnergySource { - // ********************************** - // *** Methods for use by the mod *** - // ********************************** + // ********************************** + // *** Methods for use by the mod *** + // ********************************** - /** - * Constructor for a new BasicSource delegate. - * - * @param parent1 Base TileEntity represented by this energy source. - * @param capacity1 Maximum amount of eu to store. - * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... - */ - public BasicSource(TileEntity parent1, double capacity1, int tier1) { - double power = EnergyNet.instance.getPowerFromTier(tier1); + /** + * Constructor for a new BasicSource delegate. + * + * @param parent1 Base TileEntity represented by this energy source. + * @param capacity1 Maximum amount of eu to store. + * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... + */ + public BasicSource(TileEntity parent1, double capacity1, int tier1) { + double power = EnergyNet.instance.getPowerFromTier(tier1); - this.parent = parent1; - this.capacity = capacity1 < power ? power : capacity1; - this.tier = tier1; - this.power = power; - } + this.parent = parent1; + this.capacity = capacity1 < power ? power : capacity1; + this.tier = tier1; + this.power = power; + } - // in-world te forwards >> + // in-world te forwards >> - /** - * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. - * Either updateEntity or onLoaded have to be used. - */ - @Override - public void updateEntity() { - if (!addedToEnet) onLoaded(); - } + /** + * Forward for the base TileEntity's updateEntity(), used for creating the energy net link. + * Either updateEntity or onLoaded have to be used. + */ + @Override + public void updateEntity() { + if (!addedToEnet) onLoaded(); + } - /** - * Notification that the base TileEntity finished loading, for advanced uses. - * Either updateEntity or onLoaded have to be used. - */ - public void onLoaded() { - if (!addedToEnet && - !FMLCommonHandler.instance().getEffectiveSide().isClient() && - Info.isIc2Available()) { - worldObj = parent.getWorldObj(); - xCoord = parent.xCoord; - yCoord = parent.yCoord; - zCoord = parent.zCoord; + /** + * Notification that the base TileEntity finished loading, for advanced uses. + * Either updateEntity or onLoaded have to be used. + */ + public void onLoaded() { + if (!addedToEnet && + !FMLCommonHandler.instance().getEffectiveSide().isClient() && + Info.isIc2Available()) { + worldObj = parent.getWorldObj(); + xCoord = parent.xCoord; + yCoord = parent.yCoord; + zCoord = parent.zCoord; - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - addedToEnet = true; - } - } + addedToEnet = true; + } + } - /** - * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void invalidate() { - super.invalidate(); + /** + * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void invalidate() { + super.invalidate(); - onChunkUnload(); - } + onChunkUnload(); + } - /** - * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. - * Both invalidate and onChunkUnload have to be used. - */ - @Override - public void onChunkUnload() { - if (addedToEnet && - Info.isIc2Available()) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + /** + * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void onChunkUnload() { + if (addedToEnet && + Info.isIc2Available()) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - addedToEnet = false; - } - } + addedToEnet = false; + } + } - /** - * Forward for the base TileEntity's readFromNBT(), used for loading the state. - * - * @param tag Compound tag as supplied by TileEntity.readFromNBT() - */ - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); + /** + * Forward for the base TileEntity's readFromNBT(), used for loading the state. + * + * @param tag Compound tag as supplied by TileEntity.readFromNBT() + */ + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); - NBTTagCompound data = tag.getCompoundTag("IC2BasicSource"); + NBTTagCompound data = tag.getCompoundTag("IC2BasicSource"); - energyStored = data.getDouble("energy"); - } + energyStored = data.getDouble("energy"); + } - /** - * Forward for the base TileEntity's writeToNBT(), used for saving the state. - * - * @param tag Compound tag as supplied by TileEntity.writeToNBT() - */ - @Override - public void writeToNBT(NBTTagCompound tag) { - try { - super.writeToNBT(tag); - } catch (RuntimeException e) { - // happens if this is a delegate, ignore - } + /** + * Forward for the base TileEntity's writeToNBT(), used for saving the state. + * + * @param tag Compound tag as supplied by TileEntity.writeToNBT() + */ + @Override + public void writeToNBT(NBTTagCompound tag) { + try { + super.writeToNBT(tag); + } catch (RuntimeException e) { + // happens if this is a delegate, ignore + } - NBTTagCompound data = new NBTTagCompound(); + NBTTagCompound data = new NBTTagCompound(); - data.setDouble("energy", energyStored); + data.setDouble("energy", energyStored); - tag.setTag("IC2BasicSource", data); - } + tag.setTag("IC2BasicSource", data); + } - // << in-world te forwards - // methods for using this adapter >> + // << in-world te forwards + // methods for using this adapter >> - /** - * Get the maximum amount of energy this source can hold in its buffer. - * - * @return Capacity in EU. - */ - public double getCapacity() { - return capacity; - } + /** + * Get the maximum amount of energy this source can hold in its buffer. + * + * @return Capacity in EU. + */ + public double getCapacity() { + return capacity; + } - /** - * Set the maximum amount of energy this source can hold in its buffer. - * - * @param capacity1 Capacity in EU. - */ - public void setCapacity(double capacity1) { - if (capacity1 < power) capacity1 = power; + /** + * Set the maximum amount of energy this source can hold in its buffer. + * + * @param capacity1 Capacity in EU. + */ + public void setCapacity(double capacity1) { + if (capacity1 < power) capacity1 = power; - this.capacity = capacity1; - } + this.capacity = capacity1; + } - /** - * Get the IC2 energy tier for this source. - * - * @return IC2 Tier. - */ - public int getTier() { - return tier; - } + /** + * Get the IC2 energy tier for this source. + * + * @return IC2 Tier. + */ + public int getTier() { + return tier; + } - /** - * Set the IC2 energy tier for this source. - * - * @param tier1 IC2 Tier. - */ - public void setTier(int tier1) { - double power = EnergyNet.instance.getPowerFromTier(tier1); + /** + * Set the IC2 energy tier for this source. + * + * @param tier1 IC2 Tier. + */ + public void setTier(int tier1) { + double power = EnergyNet.instance.getPowerFromTier(tier1); - if (capacity < power) capacity = power; + if (capacity < power) capacity = power; - this.tier = tier1; - this.power = power; - } + this.tier = tier1; + this.power = power; + } - /** - * Determine the energy stored in the source's output buffer. - * - * @return amount in EU - */ - public double getEnergyStored() { - return energyStored; - } + /** + * Determine the energy stored in the source's output buffer. + * + * @return amount in EU + */ + public double getEnergyStored() { + return energyStored; + } - /** - * Set the stored energy to the specified amount. - * - * This is intended for server -> client synchronization, e.g. to display the stored energy in - * a GUI through getEnergyStored(). - * - * @param amount - */ - public void setEnergyStored(double amount) { - energyStored = amount; - } + /** + * Set the stored energy to the specified amount. + *

+ * This is intended for server -> client synchronization, e.g. to display the stored energy in + * a GUI through getEnergyStored(). + * + * @param amount + */ + public void setEnergyStored(double amount) { + energyStored = amount; + } - /** - * Determine the free capacity in the source's output buffer. - * - * @return amount in EU - */ - public double getFreeCapacity() { - return capacity - energyStored; - } + /** + * Determine the free capacity in the source's output buffer. + * + * @return amount in EU + */ + public double getFreeCapacity() { + return capacity - energyStored; + } - /** - * Add some energy to the output buffer. - * - * @param amount maximum amount of energy to add - * @return amount added/used, NOT remaining - */ - public double addEnergy(double amount) { - if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return 0; - if (amount > capacity - energyStored) amount = capacity - energyStored; + /** + * Add some energy to the output buffer. + * + * @param amount maximum amount of energy to add + * @return amount added/used, NOT remaining + */ + public double addEnergy(double amount) { + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return 0; + if (amount > capacity - energyStored) amount = capacity - energyStored; - energyStored += amount; + energyStored += amount; - return amount; - } + return amount; + } - /** - * Charge the supplied ItemStack from this source's energy buffer. - * - * @param stack ItemStack to charge (null is ignored) - * @return true if energy was transferred - */ - public boolean charge(ItemStack stack) { - if (stack == null || !Info.isIc2Available()) return false; + /** + * Charge the supplied ItemStack from this source's energy buffer. + * + * @param stack ItemStack to charge (null is ignored) + * @return true if energy was transferred + */ + public boolean charge(ItemStack stack) { + if (stack == null || !Info.isIc2Available()) return false; - double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false); + double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false); - energyStored -= amount; + energyStored -= amount; - return amount > 0; - } + return amount > 0; + } - // << methods for using this adapter + // << methods for using this adapter - // backwards compatibility (ignore these) >> + // backwards compatibility (ignore these) >> - @Deprecated - public void onUpdateEntity() { - updateEntity(); - } + @Deprecated + public void onUpdateEntity() { + updateEntity(); + } - @Deprecated - public void onInvalidate() { - invalidate(); - } + @Deprecated + public void onInvalidate() { + invalidate(); + } - @Deprecated - public void onOnChunkUnload() { - onChunkUnload(); - } + @Deprecated + public void onOnChunkUnload() { + onChunkUnload(); + } - @Deprecated - public void onReadFromNbt(NBTTagCompound tag) { - readFromNBT(tag); - } + @Deprecated + public void onReadFromNbt(NBTTagCompound tag) { + readFromNBT(tag); + } - @Deprecated - public void onWriteToNbt(NBTTagCompound tag) { - writeToNBT(tag); - } + @Deprecated + public void onWriteToNbt(NBTTagCompound tag) { + writeToNBT(tag); + } - // << backwards compatibility + // << backwards compatibility - // ****************************** - // *** Methods for use by ic2 *** - // ****************************** + // ****************************** + // *** Methods for use by ic2 *** + // ****************************** - // energy net interface >> + // energy net interface >> - @Override - public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { - return true; - } + @Override + public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) { + return true; + } - @Override - public double getOfferedEnergy() { - return Math.min(energyStored, power); - } + @Override + public double getOfferedEnergy() { + return Math.min(energyStored, power); + } - @Override - public void drawEnergy(double amount) { - energyStored -= amount; - } + @Override + public void drawEnergy(double amount) { + energyStored -= amount; + } - @Override - public int getSourceTier() { - return tier; - } + @Override + public int getSourceTier() { + return tier; + } - // << energy net interface + // << energy net interface - public final TileEntity parent; + public final TileEntity parent; - protected double capacity; - protected int tier; - protected double power; - protected double energyStored; - protected boolean addedToEnet; + protected double capacity; + protected int tier; + protected double power; + protected double energyStored; + protected boolean addedToEnet; } diff --git a/src/main/java/ic2/api/energy/prefab/package-info.java b/src/main/java/ic2/api/energy/prefab/package-info.java index c38f7e0..b244b0f 100644 --- a/src/main/java/ic2/api/energy/prefab/package-info.java +++ b/src/main/java/ic2/api/energy/prefab/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.energy.prefab; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.energy.prefab; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/energy/tile/IEnergyAcceptor.java b/src/main/java/ic2/api/energy/tile/IEnergyAcceptor.java index 1735ff5..38ae91f 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergyAcceptor.java +++ b/src/main/java/ic2/api/energy/tile/IEnergyAcceptor.java @@ -1,7 +1,6 @@ package ic2.api.energy.tile; import net.minecraft.tileentity.TileEntity; - import net.minecraftforge.common.util.ForgeDirection; /** @@ -9,19 +8,19 @@ import net.minecraftforge.common.util.ForgeDirection; * * @see IEnergySink * @see IEnergyConductor - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyAcceptor extends IEnergyTile { - /** - * Determine if this acceptor can accept current from an adjacent emitter in a direction. - * - * The TileEntity in the emitter parameter is what was originally added to the energy net, - * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. - * - * @param emitter energy emitter, may also be null or an IMetaDelegate - * @param direction direction the energy is being received from - */ - boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction); + /** + * Determine if this acceptor can accept current from an adjacent emitter in a direction. + *

+ * The TileEntity in the emitter parameter is what was originally added to the energy net, + * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. + * + * @param emitter energy emitter, may also be null or an IMetaDelegate + * @param direction direction the energy is being received from + */ + boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction); } diff --git a/src/main/java/ic2/api/energy/tile/IEnergyConductor.java b/src/main/java/ic2/api/energy/tile/IEnergyConductor.java index 08dab88..6d91754 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergyConductor.java +++ b/src/main/java/ic2/api/energy/tile/IEnergyConductor.java @@ -3,51 +3,51 @@ package ic2.api.energy.tile; /** * Tile entities which conduct energy pulses without buffering (mostly cables) have to implement this * interface. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyConductor extends IEnergyAcceptor, IEnergyEmitter { - /** - * Energy loss for the conductor in EU per block. - * - * @return Energy loss - */ - double getConductionLoss(); + /** + * Energy loss for the conductor in EU per block. + * + * @return Energy loss + */ + double getConductionLoss(); - /** - * Amount of energy the insulation will handle before shocking nearby players and mobs. - * - * @return Insulation energy absorption in EU - */ - double getInsulationEnergyAbsorption(); + /** + * Amount of energy the insulation will handle before shocking nearby players and mobs. + * + * @return Insulation energy absorption in EU + */ + double getInsulationEnergyAbsorption(); - /** - * Amount of energy the insulation will handle before it is destroyed. - * Ensure that this value is greater than the insulation energy absorption + 64. - * - * @return Insulation-destroying energy in EU - */ - double getInsulationBreakdownEnergy(); + /** + * Amount of energy the insulation will handle before it is destroyed. + * Ensure that this value is greater than the insulation energy absorption + 64. + * + * @return Insulation-destroying energy in EU + */ + double getInsulationBreakdownEnergy(); - /** - * Amount of energy the conductor will handle before it melts. - * - * @return Conductor-destroying energy in EU - */ - double getConductorBreakdownEnergy(); + /** + * Amount of energy the conductor will handle before it melts. + * + * @return Conductor-destroying energy in EU + */ + double getConductorBreakdownEnergy(); - /** - * Remove the conductor's insulation if the insulation breakdown energy was exceeded. - * - * @see #getInsulationBreakdownEnergy() - */ - void removeInsulation(); + /** + * Remove the conductor's insulation if the insulation breakdown energy was exceeded. + * + * @see #getInsulationBreakdownEnergy() + */ + void removeInsulation(); - /** - * Remove the conductor if the conductor breakdown energy was exceeded. - * - * @see #getConductorBreakdownEnergy() - */ - void removeConductor(); + /** + * Remove the conductor if the conductor breakdown energy was exceeded. + * + * @see #getConductorBreakdownEnergy() + */ + void removeConductor(); } diff --git a/src/main/java/ic2/api/energy/tile/IEnergyEmitter.java b/src/main/java/ic2/api/energy/tile/IEnergyEmitter.java index 013865e..85526d9 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergyEmitter.java +++ b/src/main/java/ic2/api/energy/tile/IEnergyEmitter.java @@ -1,7 +1,6 @@ package ic2.api.energy.tile; import net.minecraft.tileentity.TileEntity; - import net.minecraftforge.common.util.ForgeDirection; /** @@ -9,20 +8,20 @@ import net.minecraftforge.common.util.ForgeDirection; * * @see IEnergySource * @see IEnergyConductor - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyEmitter extends IEnergyTile { - /** - * Determine if this emitter can emit energy to an adjacent receiver. - * - * The TileEntity in the receiver parameter is what was originally added to the energy net, - * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. - * - * @param receiver receiver, may also be null or an IMetaDelegate - * @param direction direction the receiver is from the emitter - * @return Whether energy should be emitted - */ - boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction); + /** + * Determine if this emitter can emit energy to an adjacent receiver. + *

+ * The TileEntity in the receiver parameter is what was originally added to the energy net, + * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. + * + * @param receiver receiver, may also be null or an IMetaDelegate + * @param direction direction the receiver is from the emitter + * @return Whether energy should be emitted + */ + boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction); } diff --git a/src/main/java/ic2/api/energy/tile/IEnergySink.java b/src/main/java/ic2/api/energy/tile/IEnergySink.java index 4ae8e79..4a943f0 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergySink.java +++ b/src/main/java/ic2/api/energy/tile/IEnergySink.java @@ -4,42 +4,40 @@ import net.minecraftforge.common.util.ForgeDirection; /** * Allows a tile entity (mostly a machine) to receive energy. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergySink extends IEnergyAcceptor { - /** - * Determine how much energy the sink accepts. - * - * Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0. - * - * @note Modifying the energy net from this method is disallowed. - * - * @return max accepted input in eu - */ - double getDemandedEnergy(); + /** + * Determine how much energy the sink accepts. + *

+ * Make sure that injectEnergy() does accepts energy if demandsEnergy() returns anything > 0. + * + * @return max accepted input in eu + * @note Modifying the energy net from this method is disallowed. + */ + double getDemandedEnergy(); - /** - * Determine the tier of this energy sink. - * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. - * - * @note Modifying the energy net from this method is disallowed. - * @note Return Integer.MAX_VALUE to allow any voltage. - * - * @return tier of this energy sink - */ - int getSinkTier(); + /** + * Determine the tier of this energy sink. + * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. + * + * @return tier of this energy sink + * @note Modifying the energy net from this method is disallowed. + * @note Return Integer.MAX_VALUE to allow any voltage. + */ + int getSinkTier(); - /** - * Transfer energy to the sink. - * - * It's highly recommended to accept all energy by letting the internal buffer overflow to - * increase the performance and accuracy of the distribution simulation. - * - * @param directionFrom direction from which the energy comes from - * @param amount energy to be transferred - * @return Energy not consumed (leftover) - */ - double injectEnergy(ForgeDirection directionFrom, double amount, double voltage); + /** + * Transfer energy to the sink. + *

+ * It's highly recommended to accept all energy by letting the internal buffer overflow to + * increase the performance and accuracy of the distribution simulation. + * + * @param directionFrom direction from which the energy comes from + * @param amount energy to be transferred + * @return Energy not consumed (leftover) + */ + double injectEnergy(ForgeDirection directionFrom, double amount, double voltage); } diff --git a/src/main/java/ic2/api/energy/tile/IEnergySource.java b/src/main/java/ic2/api/energy/tile/IEnergySource.java index 44b952a..7964e68 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergySource.java +++ b/src/main/java/ic2/api/energy/tile/IEnergySource.java @@ -2,37 +2,35 @@ package ic2.api.energy.tile; /** * Allows a tile entity (mostly a generator) to emit energy. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergySource extends IEnergyEmitter { - /** - * Energy output provided by the source this tick. - * This is typically Math.min(stored energy, max output/tick). - * - * @note Modifying the energy net from this method is disallowed. - * - * @return Energy offered this tick - */ - double getOfferedEnergy(); + /** + * Energy output provided by the source this tick. + * This is typically Math.min(stored energy, max output/tick). + * + * @return Energy offered this tick + * @note Modifying the energy net from this method is disallowed. + */ + double getOfferedEnergy(); - /** - * Draw energy from this source's buffer. - * - * If the source doesn't have a buffer, this is a no-op. - * - * @param amount amount of EU to draw, may be negative - */ - void drawEnergy(double amount); + /** + * Draw energy from this source's buffer. + *

+ * If the source doesn't have a buffer, this is a no-op. + * + * @param amount amount of EU to draw, may be negative + */ + void drawEnergy(double amount); - /** - * Determine the tier of this energy source. - * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. - * - * @note Modifying the energy net from this method is disallowed. - * - * @return tier of this energy source - */ - int getSourceTier(); + /** + * Determine the tier of this energy source. + * 1 = LV, 2 = MV, 3 = HV, 4 = EV etc. + * + * @return tier of this energy source + * @note Modifying the energy net from this method is disallowed. + */ + int getSourceTier(); } diff --git a/src/main/java/ic2/api/energy/tile/IEnergyTile.java b/src/main/java/ic2/api/energy/tile/IEnergyTile.java index 3938190..2c8973a 100644 --- a/src/main/java/ic2/api/energy/tile/IEnergyTile.java +++ b/src/main/java/ic2/api/energy/tile/IEnergyTile.java @@ -6,10 +6,10 @@ package ic2.api.energy.tile; * @see IEnergySink * @see IEnergySource * @see IEnergyConductor - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyTile { - // + // } diff --git a/src/main/java/ic2/api/energy/tile/IHeatSource.java b/src/main/java/ic2/api/energy/tile/IHeatSource.java index 2e5db41..bfcb8b3 100644 --- a/src/main/java/ic2/api/energy/tile/IHeatSource.java +++ b/src/main/java/ic2/api/energy/tile/IHeatSource.java @@ -3,12 +3,12 @@ package ic2.api.energy.tile; import net.minecraftforge.common.util.ForgeDirection; public interface IHeatSource { - - /* - * Return max heat transmission peer Tick (only theoretical bandwidth not available amount) - */ - int maxrequestHeatTick(ForgeDirection directionFrom); - + + /* + * Return max heat transmission peer Tick (only theoretical bandwidth not available amount) + */ + int maxrequestHeatTick(ForgeDirection directionFrom); + /* * @param requested amount of heat to transfer * @@ -18,6 +18,6 @@ public interface IHeatSource { * * requestHeat(100) : return 50 : so 50 units of heat remove from HeatSource */ - - int requestHeat(ForgeDirection directionFrom, int requestheat); + + int requestHeat(ForgeDirection directionFrom, int requestheat); } diff --git a/src/main/java/ic2/api/energy/tile/IKineticSource.java b/src/main/java/ic2/api/energy/tile/IKineticSource.java index a651408..2276f2c 100644 --- a/src/main/java/ic2/api/energy/tile/IKineticSource.java +++ b/src/main/java/ic2/api/energy/tile/IKineticSource.java @@ -3,13 +3,13 @@ package ic2.api.energy.tile; import net.minecraftforge.common.util.ForgeDirection; public interface IKineticSource { - /* - * Return max kinetic energy transmission peer Tick (only theoretical bandwidth not available amount) - */ - int maxrequestkineticenergyTick(ForgeDirection directionFrom); + /* + * Return max kinetic energy transmission peer Tick (only theoretical bandwidth not available amount) + */ + int maxrequestkineticenergyTick(ForgeDirection directionFrom); /* - * @param requested amount of kinetic energy to transfer + * @param requested amount of kinetic energy to transfer * * @return transmitted amount of kineticenergy * @@ -18,5 +18,5 @@ public interface IKineticSource { * requestkineticenergy(100) : return 50 : so 50 units of kinetic energy remove from KineticSource */ - int requestkineticenergy(ForgeDirection directionFrom, int requestkineticenergy); + int requestkineticenergy(ForgeDirection directionFrom, int requestkineticenergy); } diff --git a/src/main/java/ic2/api/energy/tile/IMetaDelegate.java b/src/main/java/ic2/api/energy/tile/IMetaDelegate.java index f7319d0..a79cd9b 100644 --- a/src/main/java/ic2/api/energy/tile/IMetaDelegate.java +++ b/src/main/java/ic2/api/energy/tile/IMetaDelegate.java @@ -1,36 +1,35 @@ package ic2.api.energy.tile; -import java.util.List; - import net.minecraft.tileentity.TileEntity; +import java.util.List; + /** * Interface for grouping multi-block structures to a single energy net delegate. - * + *

* The energy net uses TileEntity to refer to a specific xyz+world position. If multiple of those * positions should belong to the same functional structure, i.e. they consume or produce energy * only once for the whole multi-block instead of once per every single block, this interface * allows to do so. - * + *

* The tile entity implementing IMetaDelegate has to be added/removed to/from the energy net * instead of every single sub-TileEntity. The energy net interaction will be handled by the * IMetaDelegate TileEntity as well. - * + *

* The sub tile array TileEntity[] just provides optional connectivity (IEnergyAcceptor, * IEnergyEmitter) and mandatory position (x, y, z, World) data. * If the connectivity data on the sub tile is missing, the meta delegate is queried instead. - * + *

* See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IMetaDelegate extends IEnergyTile { - /** - * Get the sub-TileEntities belonging to this Meta TileEntity. - * - * @note The list has to be consistent between the EnergyNet Load and Unload events. - * @note The list must have at least 1 element. - * @note The parent te implementing IMetaDelegate isn't automatically included. - * - * @return sub-TileEntity array - */ - List getSubTiles(); + /** + * Get the sub-TileEntities belonging to this Meta TileEntity. + * + * @return sub-TileEntity array + * @note The list has to be consistent between the EnergyNet Load and Unload events. + * @note The list must have at least 1 element. + * @note The parent te implementing IMetaDelegate isn't automatically included. + */ + List getSubTiles(); } diff --git a/src/main/java/ic2/api/energy/tile/package-info.java b/src/main/java/ic2/api/energy/tile/package-info.java index 3c60323..a166739 100644 --- a/src/main/java/ic2/api/energy/tile/package-info.java +++ b/src/main/java/ic2/api/energy/tile/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.energy.tile; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.energy.tile; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/event/LaserEvent.java b/src/main/java/ic2/api/event/LaserEvent.java index 6d5ea28..7d83d57 100644 --- a/src/main/java/ic2/api/event/LaserEvent.java +++ b/src/main/java/ic2/api/event/LaserEvent.java @@ -1,12 +1,10 @@ package ic2.api.event; +import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.world.World; - -import cpw.mods.fml.common.eventhandler.Cancelable; - import net.minecraftforge.event.world.WorldEvent; /** @@ -14,101 +12,101 @@ import net.minecraftforge.event.world.WorldEvent; */ @Cancelable public class LaserEvent extends WorldEvent { - // the Laser Entity - public final Entity lasershot; + // the Laser Entity + public final Entity lasershot; - // the following variables can be changed and the Laser will adjust to them + // the following variables can be changed and the Laser will adjust to them - // the Player firing the Laser. If the Laser gets "reflected" the Player could change. - public EntityLivingBase owner; - // Range of the Laser Shot. Determine the amount of broken blocks, as well, as each broken block will subtract ~1F from range. - public float range, power; - public int blockBreaks; - // Determines whether the laser will explode upon hitting something - public boolean explosive, smelt; + // the Player firing the Laser. If the Laser gets "reflected" the Player could change. + public EntityLivingBase owner; + // Range of the Laser Shot. Determine the amount of broken blocks, as well, as each broken block will subtract ~1F from range. + public float range, power; + public int blockBreaks; + // Determines whether the laser will explode upon hitting something + public boolean explosive, smelt; - public LaserEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1) { - super(world1); - this.lasershot = lasershot1; - this.owner = owner1; - this.range = range1; - this.power = power1; - this.blockBreaks = blockBreaks1; - this.explosive = explosive1; - this.smelt = smelt1; - } + public LaserEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1) { + super(world1); + this.lasershot = lasershot1; + this.owner = owner1; + this.range = range1; + this.power = power1; + this.blockBreaks = blockBreaks1; + this.explosive = explosive1; + this.smelt = smelt1; + } - /** - * Event when the Laser is getting shot by a Player. - * - * The Item is the Laser Gun which the "Player" has shot - */ - public static class LaserShootEvent extends LaserEvent { - ItemStack laseritem; + /** + * Event when the Laser is getting shot by a Player. + *

+ * The Item is the Laser Gun which the "Player" has shot + */ + public static class LaserShootEvent extends LaserEvent { + ItemStack laseritem; - public LaserShootEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, ItemStack laseritem1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.laseritem = laseritem1; - } - } + public LaserShootEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, ItemStack laseritem1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.laseritem = laseritem1; + } + } - /** - * Event when the Laser is exploding for some Reason. - * - * The Laser will no longer exist after this Event is posted as it either Explodes or despawns after the Event is fired. - */ - public static class LaserExplodesEvent extends LaserEvent { - // explosion strength, even that can be changed! - public float explosionpower, explosiondroprate, explosionentitydamage; + /** + * Event when the Laser is exploding for some Reason. + *

+ * The Laser will no longer exist after this Event is posted as it either Explodes or despawns after the Event is fired. + */ + public static class LaserExplodesEvent extends LaserEvent { + // explosion strength, even that can be changed! + public float explosionpower, explosiondroprate, explosionentitydamage; - public LaserExplodesEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, float explosionpower1, float explosiondroprate1, float explosionentitydamage1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.explosionpower = explosionpower1; - this.explosiondroprate = explosiondroprate1; - this.explosionentitydamage = explosionentitydamage1; - } - } + public LaserExplodesEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, float explosionpower1, float explosiondroprate1, float explosionentitydamage1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.explosionpower = explosionpower1; + this.explosiondroprate = explosiondroprate1; + this.explosionentitydamage = explosionentitydamage1; + } + } - /** - * Event when the Laser is hitting a Block - * x, y and z are the Coords of the Block. - * - * Canceling this Event stops the Laser from attempting to break the Block, what is very useful for Glass. - * Use lasershot.setDead() to remove the Shot entirely. - */ - public static class LaserHitsBlockEvent extends LaserEvent { - // targeted block, even that can be changed! - public int x, y, z; - public int side; - // removeBlock determines if the Block will be removed. dropBlock determines if the Block should drop something. - public boolean removeBlock, dropBlock; - public float dropChance; + /** + * Event when the Laser is hitting a Block + * x, y and z are the Coords of the Block. + *

+ * Canceling this Event stops the Laser from attempting to break the Block, what is very useful for Glass. + * Use lasershot.setDead() to remove the Shot entirely. + */ + public static class LaserHitsBlockEvent extends LaserEvent { + // targeted block, even that can be changed! + public int x, y, z; + public int side; + // removeBlock determines if the Block will be removed. dropBlock determines if the Block should drop something. + public boolean removeBlock, dropBlock; + public float dropChance; - public LaserHitsBlockEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, int x1, int y1, int z1, int side1, float dropChance1, boolean removeBlock1, boolean dropBlock1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.removeBlock = removeBlock1; - this.dropBlock = dropBlock1; - this.dropChance = dropChance1; - } - } + public LaserHitsBlockEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, int x1, int y1, int z1, int side1, float dropChance1, boolean removeBlock1, boolean dropBlock1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.removeBlock = removeBlock1; + this.dropBlock = dropBlock1; + this.dropChance = dropChance1; + } + } - /** - * Event when the Laser is getting at a Living Entity - * - * Canceling this Event ignores the Entity - * Use lasershot.setDead() to remove the Shot entirely. - */ - public static class LaserHitsEntityEvent extends LaserEvent { - // the Entity which the Laser has shot at, even the target can be changed! - public Entity hitentity; + /** + * Event when the Laser is getting at a Living Entity + *

+ * Canceling this Event ignores the Entity + * Use lasershot.setDead() to remove the Shot entirely. + */ + public static class LaserHitsEntityEvent extends LaserEvent { + // the Entity which the Laser has shot at, even the target can be changed! + public Entity hitentity; - public LaserHitsEntityEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, Entity hitentity1) { - super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); - this.hitentity = hitentity1; - } - } + public LaserHitsEntityEvent(World world1, Entity lasershot1, EntityLivingBase owner1, float range1, float power1, int blockBreaks1, boolean explosive1, boolean smelt1, Entity hitentity1) { + super(world1, lasershot1, owner1, range1, power1, blockBreaks1, explosive1, smelt1); + this.hitentity = hitentity1; + } + } } diff --git a/src/main/java/ic2/api/event/PaintEvent.java b/src/main/java/ic2/api/event/PaintEvent.java index c6565c2..a5b32f2 100644 --- a/src/main/java/ic2/api/event/PaintEvent.java +++ b/src/main/java/ic2/api/event/PaintEvent.java @@ -1,32 +1,30 @@ package ic2.api.event; -import net.minecraft.world.World; - import cpw.mods.fml.common.eventhandler.Cancelable; - +import net.minecraft.world.World; import net.minecraftforge.event.world.WorldEvent; @Cancelable public class PaintEvent extends WorldEvent { - // target block - public final int x; - public final int y; - public final int z; - public final int side; + // target block + public final int x; + public final int y; + public final int z; + public final int side; - // color to paint the block - public final int color; + // color to paint the block + public final int color; - // set to true to confirm the operation - public boolean painted = false; + // set to true to confirm the operation + public boolean painted = false; - public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) { - super(world1); + public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) { + super(world1); - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.color = color1; - } + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.color = color1; + } } diff --git a/src/main/java/ic2/api/event/RetextureEvent.java b/src/main/java/ic2/api/event/RetextureEvent.java index d530578..221438e 100644 --- a/src/main/java/ic2/api/event/RetextureEvent.java +++ b/src/main/java/ic2/api/event/RetextureEvent.java @@ -1,37 +1,35 @@ package ic2.api.event; +import cpw.mods.fml.common.eventhandler.Cancelable; import net.minecraft.block.Block; import net.minecraft.world.World; - -import cpw.mods.fml.common.eventhandler.Cancelable; - import net.minecraftforge.event.world.WorldEvent; @Cancelable public class RetextureEvent extends WorldEvent { - // target block - public final int x; - public final int y; - public final int z; - public final int side; + // target block + public final int x; + public final int y; + public final int z; + public final int side; - // referenced block (to grab the texture from) - public final Block referencedBlock; - public final int referencedMeta; - public final int referencedSide; + // referenced block (to grab the texture from) + public final Block referencedBlock; + public final int referencedMeta; + public final int referencedSide; - // set to true to confirm the operation - public boolean applied = false; + // set to true to confirm the operation + public boolean applied = false; - public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1) { - super(world1); + public RetextureEvent(World world1, int x1, int y1, int z1, int side1, Block referencedBlock, int referencedMeta1, int referencedSide1) { + super(world1); - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.referencedBlock = referencedBlock; - this.referencedMeta = referencedMeta1; - this.referencedSide = referencedSide1; - } + this.x = x1; + this.y = y1; + this.z = z1; + this.side = side1; + this.referencedBlock = referencedBlock; + this.referencedMeta = referencedMeta1; + this.referencedSide = referencedSide1; + } } diff --git a/src/main/java/ic2/api/event/package-info.java b/src/main/java/ic2/api/event/package-info.java index d331b92..58e5bdf 100644 --- a/src/main/java/ic2/api/event/package-info.java +++ b/src/main/java/ic2/api/event/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.event; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.event; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/info/IEnergyValueProvider.java b/src/main/java/ic2/api/info/IEnergyValueProvider.java index 1e7b2cc..14a6db9 100644 --- a/src/main/java/ic2/api/info/IEnergyValueProvider.java +++ b/src/main/java/ic2/api/info/IEnergyValueProvider.java @@ -3,15 +3,15 @@ package ic2.api.info; import net.minecraft.item.ItemStack; public interface IEnergyValueProvider { - /** - * Determine the energy value for a single item in the supplied stack. - * The value is used by most machines in the discharge slot. - * - * This only applies to basic single use items, others are to be queried - * through e.g. ElectricItem.manager.getCharge(). - * - * @param itemStack ItemStack containing the item to evaluate. - * @return energy in EU - */ - double getEnergyValue(ItemStack itemStack); + /** + * Determine the energy value for a single item in the supplied stack. + * The value is used by most machines in the discharge slot. + *

+ * This only applies to basic single use items, others are to be queried + * through e.g. ElectricItem.manager.getCharge(). + * + * @param itemStack ItemStack containing the item to evaluate. + * @return energy in EU + */ + double getEnergyValue(ItemStack itemStack); } diff --git a/src/main/java/ic2/api/info/IFuelValueProvider.java b/src/main/java/ic2/api/info/IFuelValueProvider.java index 7c7fe0f..21fee29 100644 --- a/src/main/java/ic2/api/info/IFuelValueProvider.java +++ b/src/main/java/ic2/api/info/IFuelValueProvider.java @@ -3,13 +3,13 @@ package ic2.api.info; import net.minecraft.item.ItemStack; public interface IFuelValueProvider { - /** - * Determine the fuel value for a single item in the supplied stack. - * The information currently applies to Generators and the Iron Furnace. - * - * @param itemStack ItemStack containing the item to evaluate. - * @param allowLava Determine if lava has a fuel value, currently only true for the Iron Furnace. - * @return fuel value - */ - int getFuelValue(ItemStack itemStack, boolean allowLava); + /** + * Determine the fuel value for a single item in the supplied stack. + * The information currently applies to Generators and the Iron Furnace. + * + * @param itemStack ItemStack containing the item to evaluate. + * @param allowLava Determine if lava has a fuel value, currently only true for the Iron Furnace. + * @return fuel value + */ + int getFuelValue(ItemStack itemStack, boolean allowLava); } diff --git a/src/main/java/ic2/api/info/Info.java b/src/main/java/ic2/api/info/Info.java index 3b5a544..da25567 100644 --- a/src/main/java/ic2/api/info/Info.java +++ b/src/main/java/ic2/api/info/Info.java @@ -1,32 +1,31 @@ package ic2.api.info; -import net.minecraft.util.DamageSource; - import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.LoaderState; +import net.minecraft.util.DamageSource; public class Info { - public static IEnergyValueProvider itemEnergy; - public static IFuelValueProvider itemFuel; - public static Object ic2ModInstance; + public static IEnergyValueProvider itemEnergy; + public static IFuelValueProvider itemFuel; + public static Object ic2ModInstance; - /** - * Damage Sources used by IC2. - * Getting assigned in preload. - */ - public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION; + /** + * Damage Sources used by IC2. + * Getting assigned in preload. + */ + public static DamageSource DMG_ELECTRIC, DMG_NUKE_EXPLOSION, DMG_RADIATION; - public static boolean isIc2Available() { - if (ic2Available != null) return ic2Available; + public static boolean isIc2Available() { + if (ic2Available != null) return ic2Available; - boolean loaded = Loader.isModLoaded("IC2"); + boolean loaded = Loader.isModLoaded("IC2"); - if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) { - ic2Available = loaded; - } + if (Loader.instance().hasReachedState(LoaderState.CONSTRUCTING)) { + ic2Available = loaded; + } - return loaded; - } + return loaded; + } - private static Boolean ic2Available = null; + private static Boolean ic2Available = null; } \ No newline at end of file diff --git a/src/main/java/ic2/api/info/package-info.java b/src/main/java/ic2/api/info/package-info.java index 59936e5..7714e22 100644 --- a/src/main/java/ic2/api/info/package-info.java +++ b/src/main/java/ic2/api/info/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.info; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.info; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/item/ElectricItem.java b/src/main/java/ic2/api/item/ElectricItem.java index 19e5fc1..f865862 100644 --- a/src/main/java/ic2/api/item/ElectricItem.java +++ b/src/main/java/ic2/api/item/ElectricItem.java @@ -1,59 +1,59 @@ package ic2.api.item; +import net.minecraft.item.ItemStack; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; - /** * Allows for charging, discharging and using electric items (IElectricItem). */ public final class ElectricItem { - /** - * IElectricItemManager to use for interacting with IElectricItem ItemStacks. - * - * This manager will act as a gateway and delegate the tasks to the final implementation - * (rawManager or a custom one) as necessary. - */ - public static IElectricItemManager manager; + /** + * IElectricItemManager to use for interacting with IElectricItem ItemStacks. + *

+ * This manager will act as a gateway and delegate the tasks to the final implementation + * (rawManager or a custom one) as necessary. + */ + public static IElectricItemManager manager; - /** - * Standard IElectricItemManager implementation, only call it directly from another - * IElectricItemManager. Use manager instead. - */ - public static IElectricItemManager rawManager; + /** + * Standard IElectricItemManager implementation, only call it directly from another + * IElectricItemManager. Use manager instead. + */ + public static IElectricItemManager rawManager; - /** - * Register an electric item manager for items not implementing IElectricItem. - * - * This method is only designed for special purposes, implementing IElectricItem or - * ISpecialElectricItem instead of using this is faster. - * - * Managers used with ISpecialElectricItem shouldn't be registered. - * - * @param manager Manager to register. - */ - public static void registerBackupManager(IBackupElectricItemManager manager) { - backupManagers.add(manager); - } + /** + * Register an electric item manager for items not implementing IElectricItem. + *

+ * This method is only designed for special purposes, implementing IElectricItem or + * ISpecialElectricItem instead of using this is faster. + *

+ * Managers used with ISpecialElectricItem shouldn't be registered. + * + * @param manager Manager to register. + */ + public static void registerBackupManager(IBackupElectricItemManager manager) { + backupManagers.add(manager); + } - /** - * Get the electric item manager suitable for the supplied item stack. - * - * This method is for internal use only. - * - * @param stack ItemStack to be handled. - * @return First suitable electric item manager. - */ - public static IBackupElectricItemManager getBackupManager(ItemStack stack) { - for (IBackupElectricItemManager manager : backupManagers) { - if (manager.handles(stack)) return manager; - } + /** + * Get the electric item manager suitable for the supplied item stack. + *

+ * This method is for internal use only. + * + * @param stack ItemStack to be handled. + * @return First suitable electric item manager. + */ + public static IBackupElectricItemManager getBackupManager(ItemStack stack) { + for (IBackupElectricItemManager manager : backupManagers) { + if (manager.handles(stack)) return manager; + } - return null; - } + return null; + } - private static final List backupManagers = new ArrayList(); + private static final List backupManagers = new ArrayList(); } diff --git a/src/main/java/ic2/api/item/IBackupElectricItemManager.java b/src/main/java/ic2/api/item/IBackupElectricItemManager.java index 2ae254a..e3fa60d 100644 --- a/src/main/java/ic2/api/item/IBackupElectricItemManager.java +++ b/src/main/java/ic2/api/item/IBackupElectricItemManager.java @@ -4,9 +4,9 @@ import net.minecraft.item.ItemStack; /** * This interface specifies a manager applicable to items not implementing IElectricItem. - * + *

* The manager implementing this has to be registered with ElectricItem.registerBackupManager(). */ public interface IBackupElectricItemManager extends IElectricItemManager { - boolean handles(ItemStack stack); + boolean handles(ItemStack stack); } diff --git a/src/main/java/ic2/api/item/IBlockCuttingBlade.java b/src/main/java/ic2/api/item/IBlockCuttingBlade.java index 24a8f00..b53c461 100644 --- a/src/main/java/ic2/api/item/IBlockCuttingBlade.java +++ b/src/main/java/ic2/api/item/IBlockCuttingBlade.java @@ -2,5 +2,5 @@ package ic2.api.item; public interface IBlockCuttingBlade { - int gethardness(); + int gethardness(); } diff --git a/src/main/java/ic2/api/item/IBoxable.java b/src/main/java/ic2/api/item/IBoxable.java index bca2cc0..7b26863 100644 --- a/src/main/java/ic2/api/item/IBoxable.java +++ b/src/main/java/ic2/api/item/IBoxable.java @@ -4,11 +4,11 @@ import net.minecraft.item.ItemStack; public interface IBoxable { - /** - * Determine whether an item can be stored in a toolbox or not. - * - * @param itemstack item to be stored - * @return Whether to store the item in the toolbox or not - */ - public abstract boolean canBeStoredInToolbox(ItemStack itemstack); + /** + * Determine whether an item can be stored in a toolbox or not. + * + * @param itemstack item to be stored + * @return Whether to store the item in the toolbox or not + */ + public abstract boolean canBeStoredInToolbox(ItemStack itemstack); } diff --git a/src/main/java/ic2/api/item/IC2Items.java b/src/main/java/ic2/api/item/IC2Items.java index 9b8c7df..bd9305a 100644 --- a/src/main/java/ic2/api/item/IC2Items.java +++ b/src/main/java/ic2/api/item/IC2Items.java @@ -4,40 +4,40 @@ import net.minecraft.item.ItemStack; /** * Provides access to IC2 blocks and items. - * + *

* Some items can be acquired through the ore dictionary which is the recommended way. * The items are initialized while IC2 is being loaded - try to use ModsLoaded() or load your mod after IC2. * Some blocks/items can be disabled by a config setting, so it's recommended to check if they're null first. - * + *

* Getting the associated Block/Item for an ItemStack x: - * Blocks: Block.blocksList[x.itemID] - * Items: x.getItem() + * Blocks: Block.blocksList[x.itemID] + * Items: x.getItem() */ public final class IC2Items { - /** - * Get an ItemStack for a specific item name, example: Items.getItem("resin") - * See the list below for item names. - * Make sure to copy() the ItemStack if you want to modify it. - * - * @param name item name - * @return The item or null if the item does not exist or an error occurred - */ - public static ItemStack getItem(String name) { - try { - if (Ic2Items == null) Ic2Items = Class.forName(getPackage() + ".core.Ic2Items"); + /** + * Get an ItemStack for a specific item name, example: Items.getItem("resin") + * See the list below for item names. + * Make sure to copy() the ItemStack if you want to modify it. + * + * @param name item name + * @return The item or null if the item does not exist or an error occurred + */ + public static ItemStack getItem(String name) { + try { + if (Ic2Items == null) Ic2Items = Class.forName(getPackage() + ".core.Ic2Items"); - Object ret = Ic2Items.getField(name).get(null); + Object ret = Ic2Items.getField(name).get(null); - if (ret instanceof ItemStack) { - return (ItemStack) ret; - } - return null; - } catch (Exception e) { - System.out.println("IC2 API: Call getItem failed for "+name); + if (ret instanceof ItemStack) { + return (ItemStack) ret; + } + return null; + } catch (Exception e) { + System.out.println("IC2 API: Call getItem failed for " + name); - return null; - } - } + return null; + } + } /* Possible values: @@ -576,23 +576,23 @@ public final class IC2Items { */ - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 - */ - private static String getPackage() { - Package pkg = IC2Items.class.getPackage(); + /** + * Get the base IC2 package name, used internally. + * + * @return IC2 package name, if unable to be determined defaults to ic2 + */ + private static String getPackage() { + Package pkg = IC2Items.class.getPackage(); - if (pkg != null) { - String packageName = pkg.getName(); + if (pkg != null) { + String packageName = pkg.getName(); - return packageName.substring(0, packageName.length() - ".api.item".length()); - } + return packageName.substring(0, packageName.length() - ".api.item".length()); + } - return "ic2"; - } + return "ic2"; + } - private static Class Ic2Items; + private static Class Ic2Items; } diff --git a/src/main/java/ic2/api/item/IElectricItem.java b/src/main/java/ic2/api/item/IElectricItem.java index 5525e00..ceaa260 100644 --- a/src/main/java/ic2/api/item/IElectricItem.java +++ b/src/main/java/ic2/api/item/IElectricItem.java @@ -5,51 +5,51 @@ import net.minecraft.item.ItemStack; /** * Provides the ability to store energy on the implementing item. - * + *

* The item should have a maximum damage of 13. */ public interface IElectricItem { - /** - * Determine if the item can be used in a machine or as an armor part to supply energy. - * - * @return Whether the item can supply energy - */ - boolean canProvideEnergy(ItemStack itemStack); + /** + * Determine if the item can be used in a machine or as an armor part to supply energy. + * + * @return Whether the item can supply energy + */ + boolean canProvideEnergy(ItemStack itemStack); - /** - * Get the item ID to use for a charge energy greater than 0. - * - * @return Item ID to use - */ - Item getChargedItem(ItemStack itemStack); + /** + * Get the item ID to use for a charge energy greater than 0. + * + * @return Item ID to use + */ + Item getChargedItem(ItemStack itemStack); - /** - * Get the item ID to use for a charge energy of 0. - * - * @return Item ID to use - */ - Item getEmptyItem(ItemStack itemStack); + /** + * Get the item ID to use for a charge energy of 0. + * + * @return Item ID to use + */ + Item getEmptyItem(ItemStack itemStack); - /** - * Get the item's maximum charge energy in EU. - * - * @return Maximum charge energy - */ - double getMaxCharge(ItemStack itemStack); + /** + * Get the item's maximum charge energy in EU. + * + * @return Maximum charge energy + */ + double getMaxCharge(ItemStack itemStack); - /** - * Get the item's tier, lower tiers can't send energy to higher ones. - * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. - * - * @return Item's tier - */ - int getTier(ItemStack itemStack); + /** + * Get the item's tier, lower tiers can't send energy to higher ones. + * Batteries are Tier 1, Energy Crystals are Tier 2, Lapotron Crystals are Tier 3. + * + * @return Item's tier + */ + int getTier(ItemStack itemStack); - /** - * Get the item's transfer limit in EU per transfer operation. - * - * @return Transfer limit - */ - double getTransferLimit(ItemStack itemStack); + /** + * Get the item's transfer limit in EU per transfer operation. + * + * @return Transfer limit + */ + double getTransferLimit(ItemStack itemStack); } diff --git a/src/main/java/ic2/api/item/IElectricItemManager.java b/src/main/java/ic2/api/item/IElectricItemManager.java index 5de43d7..c2d1205 100644 --- a/src/main/java/ic2/api/item/IElectricItemManager.java +++ b/src/main/java/ic2/api/item/IElectricItemManager.java @@ -5,91 +5,91 @@ import net.minecraft.item.ItemStack; /** * This interface specifies a manager to handle the various tasks for electric items. - * + *

* The default implementation does the following: * - store and retrieve the charge * - handle charging, taking amount, tier, transfer limit, canProvideEnergy and simulate into account * - replace item IDs if appropriate (getChargedItemId() and getEmptyItemId()) * - update and manage the damage value for the visual charge indicator - * + * * @note If you're implementing your own variant (ISpecialElectricItem), you can delegate to the * default implementations through ElectricItem.rawManager. The default implementation is designed * to minimize its dependency on its own constraints/structure and delegates most work back to the * more atomic features in the gateway manager. */ public interface IElectricItemManager { - /** - * Charge an item with a specified amount of energy. - * - * @param itemStack electric item's stack - * @param amount amount of energy to charge in EU - * @param tier tier of the charging device, has to be at least as high as the item to charge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param simulate don't actually change the item, just determine the return value - * @return Energy transferred into the electric item - */ - double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); + /** + * Charge an item with a specified amount of energy. + * + * @param itemStack electric item's stack + * @param amount amount of energy to charge in EU + * @param tier tier of the charging device, has to be at least as high as the item to charge + * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() + * @param simulate don't actually change the item, just determine the return value + * @return Energy transferred into the electric item + */ + double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate); - /** - * Discharge an item by a specified amount of energy - * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param tier tier of the discharging device, has to be at least as high as the item to discharge - * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() - * @param externally use the supplied item externally, i.e. to power something else as if it was a battery - * @param simulate don't actually discharge the item, just determine the return value - * @return Energy retrieved from the electric item - */ - double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate); + /** + * Discharge an item by a specified amount of energy + * + * @param itemStack electric item's stack + * @param amount amount of energy to discharge in EU + * @param tier tier of the discharging device, has to be at least as high as the item to discharge + * @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit() + * @param externally use the supplied item externally, i.e. to power something else as if it was a battery + * @param simulate don't actually discharge the item, just determine the return value + * @return Energy retrieved from the electric item + */ + double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate); - /** - * Determine the charge level for the specified item. - * - * @param itemStack ItemStack containing the electric item - * @return charge level in EU - */ - double getCharge(ItemStack stack); + /** + * Determine the charge level for the specified item. + * + * @param itemStack ItemStack containing the electric item + * @return charge level in EU + */ + double getCharge(ItemStack stack); - /** - * Determine if the specified electric item has at least a specific amount of EU. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * BatPacks are not taken into account. - * - * @param itemStack electric item's stack - * @param amount minimum amount of energy required - * @return true if there's enough energy - */ - boolean canUse(ItemStack stack, double amount); + /** + * Determine if the specified electric item has at least a specific amount of EU. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * BatPacks are not taken into account. + * + * @param itemStack electric item's stack + * @param amount minimum amount of energy required + * @return true if there's enough energy + */ + boolean canUse(ItemStack stack, double amount); - /** - * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * - * @param itemStack electric item's stack - * @param amount amount of energy to discharge in EU - * @param entity entity holding the item - * @return true if the operation succeeded - */ - boolean use(ItemStack stack, double amount, EntityLivingBase entity); + /** + * Try to retrieve a specific amount of energy from an Item, and if applicable, a BatPack. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * + * @param itemStack electric item's stack + * @param amount amount of energy to discharge in EU + * @param entity entity holding the item + * @return true if the operation succeeded + */ + boolean use(ItemStack stack, double amount, EntityLivingBase entity); - /** - * Charge an item from the BatPack a player is wearing. - * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. - * use() already contains this functionality. - * - * @param itemStack electric item's stack - * @param entity entity holding the item - */ - void chargeFromArmor(ItemStack stack, EntityLivingBase entity); + /** + * Charge an item from the BatPack a player is wearing. + * This is supposed to be used in the item code during operation, for example if you want to implement your own electric item. + * use() already contains this functionality. + * + * @param itemStack electric item's stack + * @param entity entity holding the item + */ + void chargeFromArmor(ItemStack stack, EntityLivingBase entity); - /** - * Get the tool tip to display for electric items. - * - * @param itemStack ItemStack to determine the tooltip for - * @return tool tip string or null for none - */ - String getToolTip(ItemStack stack); + /** + * Get the tool tip to display for electric items. + * + * @param itemStack ItemStack to determine the tooltip for + * @return tool tip string or null for none + */ + String getToolTip(ItemStack stack); - // TODO: add tier getter + // TODO: add tier getter } diff --git a/src/main/java/ic2/api/item/IItemHudInfo.java b/src/main/java/ic2/api/item/IItemHudInfo.java index da97318..177a7ff 100644 --- a/src/main/java/ic2/api/item/IItemHudInfo.java +++ b/src/main/java/ic2/api/item/IItemHudInfo.java @@ -1,11 +1,11 @@ package ic2.api.item; -import java.util.List; - import net.minecraft.item.ItemStack; +import java.util.List; + public interface IItemHudInfo { - /* + /* Add Info to Nano- and Quantum-Suit Helm Hud for itemStack @@ -20,5 +20,5 @@ public interface IItemHudInfo { */ - public List getHudInfo(ItemStack itemStack); + public List getHudInfo(ItemStack itemStack); } diff --git a/src/main/java/ic2/api/item/IKineticWindRotor.java b/src/main/java/ic2/api/item/IKineticWindRotor.java index 62f1fdc..9052280 100644 --- a/src/main/java/ic2/api/item/IKineticWindRotor.java +++ b/src/main/java/ic2/api/item/IKineticWindRotor.java @@ -3,13 +3,13 @@ package ic2.api.item; import net.minecraft.util.ResourceLocation; public interface IKineticWindRotor { - public int getDiameter(); + public int getDiameter(); - public ResourceLocation getRotorRenderTexture(); + public ResourceLocation getRotorRenderTexture(); - public float getefficiency(); + public float getefficiency(); - int getminWindStrength(); + int getminWindStrength(); - int getmaxWindStrength(); + int getmaxWindStrength(); } diff --git a/src/main/java/ic2/api/item/IMetalArmor.java b/src/main/java/ic2/api/item/IMetalArmor.java index 16ffd24..e4a85db 100644 --- a/src/main/java/ic2/api/item/IMetalArmor.java +++ b/src/main/java/ic2/api/item/IMetalArmor.java @@ -5,16 +5,16 @@ import net.minecraft.item.ItemStack; /** * Armor items implementing this can be considered metal armor. - * + *

* Currently used for determining which boots can be used to slide up a magnetic pole. */ public interface IMetalArmor { - /** - * Determine if the given armor piece is metal armor. - * - * @param itemstack Armor piece as worn by the player - * @param player The player - * @return Whether the armor piece is metal armor - */ - public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player); + /** + * Determine if the given armor piece is metal armor. + * + * @param itemstack Armor piece as worn by the player + * @param player The player + * @return Whether the armor piece is metal armor + */ + public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player); } diff --git a/src/main/java/ic2/api/item/ISpecialElectricItem.java b/src/main/java/ic2/api/item/ISpecialElectricItem.java index a7302f5..d3497a7 100644 --- a/src/main/java/ic2/api/item/ISpecialElectricItem.java +++ b/src/main/java/ic2/api/item/ISpecialElectricItem.java @@ -3,11 +3,11 @@ package ic2.api.item; import net.minecraft.item.ItemStack; public interface ISpecialElectricItem extends IElectricItem { - /** - * Supply a custom IElectricItemManager. - * - * @param itemStack ItemStack to get the manager for - * @return IElectricItemManager instance - */ - IElectricItemManager getManager(ItemStack itemStack); + /** + * Supply a custom IElectricItemManager. + * + * @param itemStack ItemStack to get the manager for + * @return IElectricItemManager instance + */ + IElectricItemManager getManager(ItemStack itemStack); } diff --git a/src/main/java/ic2/api/item/ITerraformingBP.java b/src/main/java/ic2/api/item/ITerraformingBP.java index 59b46ba..5c9bf7c 100644 --- a/src/main/java/ic2/api/item/ITerraformingBP.java +++ b/src/main/java/ic2/api/item/ITerraformingBP.java @@ -6,29 +6,29 @@ import net.minecraft.world.World; * Allows an item to act as a terraformer blueprint. */ public interface ITerraformingBP { - /** - * Get the energy consumption per operation of the blueprint. - * - * @return Energy consumption in EU - */ - public abstract int getConsume(); - - /** - * Get the maximum range of the blueprint. - * Should be a divisor of 5. - * - * @return Maximum range in blocks - */ - public abstract int getRange(); - - /** - * Perform the terraforming operation. - * - * @param world world to terraform - * @param x X position to terraform - * @param z Z position to terraform - * @param yCoord Y position of the terraformer - * @return Whether the operation was successful and the terraformer should consume energy. - */ - public abstract boolean terraform(World world, int x, int z, int yCoord); + /** + * Get the energy consumption per operation of the blueprint. + * + * @return Energy consumption in EU + */ + public abstract int getConsume(); + + /** + * Get the maximum range of the blueprint. + * Should be a divisor of 5. + * + * @return Maximum range in blocks + */ + public abstract int getRange(); + + /** + * Perform the terraforming operation. + * + * @param world world to terraform + * @param x X position to terraform + * @param z Z position to terraform + * @param yCoord Y position of the terraformer + * @return Whether the operation was successful and the terraformer should consume energy. + */ + public abstract boolean terraform(World world, int x, int z, int yCoord); } diff --git a/src/main/java/ic2/api/item/ItemWrapper.java b/src/main/java/ic2/api/item/ItemWrapper.java index 58f8073..31ae9c1 100644 --- a/src/main/java/ic2/api/item/ItemWrapper.java +++ b/src/main/java/ic2/api/item/ItemWrapper.java @@ -1,50 +1,49 @@ package ic2.api.item; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; - /** * Wrapper for inserting interfaces into items you don't own. - * + * * @author Richard */ public class ItemWrapper { - private static final Multimap boxableItems = ArrayListMultimap.create(); - private static final Multimap metalArmorItems = ArrayListMultimap.create(); - - public static void registerBoxable(Item item, IBoxable boxable) { - boxableItems.put(item, boxable); - } - - public static boolean canBeStoredInToolbox(ItemStack stack) { - Item item = stack.getItem(); - // use customs first to allow for overriding behavior - for (IBoxable boxable : boxableItems.get(item)) { - if (boxable.canBeStoredInToolbox(stack)) return true; - } - - if (item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack)) return true; - - return false; - } - - public static void registerMetalArmor(Item item, IMetalArmor armor) { - metalArmorItems.put(item, armor); - } - - public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) { - Item item = stack.getItem(); - // use customs first to allow for overriding behavior - for (IMetalArmor metalArmor : metalArmorItems.get(item)) { - if (metalArmor.isMetalArmor(stack, player)) return true; - } - - if (item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player)) return true; - - return false; - } + private static final Multimap boxableItems = ArrayListMultimap.create(); + private static final Multimap metalArmorItems = ArrayListMultimap.create(); + + public static void registerBoxable(Item item, IBoxable boxable) { + boxableItems.put(item, boxable); + } + + public static boolean canBeStoredInToolbox(ItemStack stack) { + Item item = stack.getItem(); + // use customs first to allow for overriding behavior + for (IBoxable boxable : boxableItems.get(item)) { + if (boxable.canBeStoredInToolbox(stack)) return true; + } + + if (item instanceof IBoxable && ((IBoxable) item).canBeStoredInToolbox(stack)) return true; + + return false; + } + + public static void registerMetalArmor(Item item, IMetalArmor armor) { + metalArmorItems.put(item, armor); + } + + public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) { + Item item = stack.getItem(); + // use customs first to allow for overriding behavior + for (IMetalArmor metalArmor : metalArmorItems.get(item)) { + if (metalArmor.isMetalArmor(stack, player)) return true; + } + + if (item instanceof IMetalArmor && ((IMetalArmor) item).isMetalArmor(stack, player)) return true; + + return false; + } } diff --git a/src/main/java/ic2/api/item/package-info.java b/src/main/java/ic2/api/item/package-info.java index 44ecdce..d814f54 100644 --- a/src/main/java/ic2/api/item/package-info.java +++ b/src/main/java/ic2/api/item/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.item; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.item; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java b/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java index ed3ea38..53cca72 100644 --- a/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java +++ b/src/main/java/ic2/api/network/INetworkClientTileEntityEventListener.java @@ -6,12 +6,12 @@ import net.minecraft.entity.player.EntityPlayer; * Allows a tile entity to receive network events received from clients. */ public interface INetworkClientTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param player client which sent the event - * @param event event ID - */ - void onNetworkEvent(EntityPlayer player, int event); + /** + * Called when a network event is received. + * + * @param player client which sent the event + * @param event event ID + */ + void onNetworkEvent(EntityPlayer player, int event); } diff --git a/src/main/java/ic2/api/network/INetworkDataProvider.java b/src/main/java/ic2/api/network/INetworkDataProvider.java index c3f283e..cc59205 100644 --- a/src/main/java/ic2/api/network/INetworkDataProvider.java +++ b/src/main/java/ic2/api/network/INetworkDataProvider.java @@ -4,15 +4,15 @@ import java.util.List; /** * Tile entities which want to synchronized specific fields between client and server have to implement this. - * + *

* The fields don't update themselves, a field update must be sent every time a synchronized field changes. */ public interface INetworkDataProvider { - /** - * Get the list of synchronized fields. - * - * @return Names of the synchronized fields - */ - List getNetworkedFields(); + /** + * Get the list of synchronized fields. + * + * @return Names of the synchronized fields + */ + List getNetworkedFields(); } diff --git a/src/main/java/ic2/api/network/INetworkItemEventListener.java b/src/main/java/ic2/api/network/INetworkItemEventListener.java index 5f3228c..85ac2a9 100644 --- a/src/main/java/ic2/api/network/INetworkItemEventListener.java +++ b/src/main/java/ic2/api/network/INetworkItemEventListener.java @@ -7,13 +7,13 @@ import net.minecraft.item.ItemStack; * Allows an item to receive network events received from the server. */ public interface INetworkItemEventListener { - /** - * Called when a network event is received. - * - * @param itemStack item stack - * @param player player containing the item - * @param event event ID - */ - void onNetworkEvent(ItemStack stack, EntityPlayer player, int event); + /** + * Called when a network event is received. + * + * @param itemStack item stack + * @param player player containing the item + * @param event event ID + */ + void onNetworkEvent(ItemStack stack, EntityPlayer player, int event); } diff --git a/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java b/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java index fbb4753..23b11c5 100644 --- a/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java +++ b/src/main/java/ic2/api/network/INetworkTileEntityEventListener.java @@ -4,11 +4,11 @@ package ic2.api.network; * Allows a tile entity to receive network events received from the server. */ public interface INetworkTileEntityEventListener { - /** - * Called when a network event is received. - * - * @param event Event ID - */ - void onNetworkEvent(int event); + /** + * Called when a network event is received. + * + * @param event Event ID + */ + void onNetworkEvent(int event); } diff --git a/src/main/java/ic2/api/network/INetworkUpdateListener.java b/src/main/java/ic2/api/network/INetworkUpdateListener.java index 09414ae..05548de 100644 --- a/src/main/java/ic2/api/network/INetworkUpdateListener.java +++ b/src/main/java/ic2/api/network/INetworkUpdateListener.java @@ -1,14 +1,14 @@ package ic2.api.network; /** - * Allows a tile entity to receive field sync updates received from the server. + * Allows a tile entity to receive field sync updates received from the server. */ public interface INetworkUpdateListener { - /** - * Called when a field is synchronized. - * - * @param field field synchronized - */ - void onNetworkUpdate(String field); + /** + * Called when a field is synchronized. + * + * @param field field synchronized + */ + void onNetworkUpdate(String field); } diff --git a/src/main/java/ic2/api/network/NetworkHelper.java b/src/main/java/ic2/api/network/NetworkHelper.java index 5f9138d..150e046 100644 --- a/src/main/java/ic2/api/network/NetworkHelper.java +++ b/src/main/java/ic2/api/network/NetworkHelper.java @@ -1,194 +1,199 @@ package ic2.api.network; -import java.lang.reflect.Method; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import java.lang.reflect.Method; + /** * Provides methods to initiate events and synchronize tile entity fields in SMP. - * + *

* The methods are transparent between singleplayer and multiplayer - if a method is called in * singleplayer, the associated callback will be locally executed. The implementation is different * between the client and server versions of IC2. - * + *

* You'll usually want to use the server->client methods defined here to synchronize information * which is needed by the clients outside the GUI, such as rendering the block, playing sounds or * producing effects. Anything which is only visible inside the GUI should be synchronized through * the Container class associated to the GUI in Container.updateProgressBar(). */ public final class NetworkHelper { - // server -> client + // server -> client - /** - * Schedule a TileEntity's field to be updated to the clients in range. - * - * The updater will query the field's value during the next update, updates happen usually - * every 2 ticks. If low latency is important use initiateTileEntityEvent instead. - * - * IC2's network updates have to get triggered every time, it doesn't continuously poll/send - * the field value. Just call updateTileEntityField after every change to a field which needs - * network synchronization. - * - * The following field data types are currently supported: - * - int, int[], short, short[], byte, byte[], long, long[] - * - float, float[], double, double[] - * - boolean, boolean[] - * - String, String[] - * - ItemStack - * - NBTBase (includes NBTTagCompound) - * - Block, Item, Achievement, Potion, Enchantment - * - ChunkCoordinates, ChunkCoordIntPair - * - TileEntity (does not sync the actual tile entity, instead looks up the tile entity by its position in the client world) - * - World (does not sync the actual world, instead looks up the world by its dimension ID) - * - * Once the update has been processed by the client, it'll call onNetworkUpdate on the client- - * side TileEntity if it implements INetworkUpdateListener. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkUpdateListener.onNetworkUpdate (if implemented by the te). - * - * @param te TileEntity to update - * @param field Name of the field to update - */ - public static void updateTileEntityField(TileEntity te, String field) { - try { - if (NetworkManager_updateTileEntityField == null) NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class); - if (instance == null) instance = getInstance(); + /** + * Schedule a TileEntity's field to be updated to the clients in range. + *

+ * The updater will query the field's value during the next update, updates happen usually + * every 2 ticks. If low latency is important use initiateTileEntityEvent instead. + *

+ * IC2's network updates have to get triggered every time, it doesn't continuously poll/send + * the field value. Just call updateTileEntityField after every change to a field which needs + * network synchronization. + *

+ * The following field data types are currently supported: + * - int, int[], short, short[], byte, byte[], long, long[] + * - float, float[], double, double[] + * - boolean, boolean[] + * - String, String[] + * - ItemStack + * - NBTBase (includes NBTTagCompound) + * - Block, Item, Achievement, Potion, Enchantment + * - ChunkCoordinates, ChunkCoordIntPair + * - TileEntity (does not sync the actual tile entity, instead looks up the tile entity by its position in the client world) + * - World (does not sync the actual world, instead looks up the world by its dimension ID) + *

+ * Once the update has been processed by the client, it'll call onNetworkUpdate on the client- + * side TileEntity if it implements INetworkUpdateListener. + *

+ * If this method is being executed on the client (i.e. Singleplayer), it'll just call + * INetworkUpdateListener.onNetworkUpdate (if implemented by the te). + * + * @param te TileEntity to update + * @param field Name of the field to update + */ + public static void updateTileEntityField(TileEntity te, String field) { + try { + if (NetworkManager_updateTileEntityField == null) + NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class); + if (instance == null) instance = getInstance(); - NetworkManager_updateTileEntityField.invoke(instance, te, field); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + NetworkManager_updateTileEntityField.invoke(instance, te, field); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - /** - * Immediately send an event for the specified TileEntity to the clients in range. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkTileEntityEventListener.onNetworkEvent (if implemented by the te). - * - * @param te TileEntity to notify, should implement INetworkTileEntityEventListener - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @param limitRange Limit the notification range to (currently) 20 blocks instead of the - * tracking distance if true - */ - public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange) { - try { - if (NetworkManager_initiateTileEntityEvent == null) NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); + /** + * Immediately send an event for the specified TileEntity to the clients in range. + *

+ * If this method is being executed on the client (i.e. Singleplayer), it'll just call + * INetworkTileEntityEventListener.onNetworkEvent (if implemented by the te). + * + * @param te TileEntity to notify, should implement INetworkTileEntityEventListener + * @param event Arbitrary integer to represent the event, choosing the values is up to you + * @param limitRange Limit the notification range to (currently) 20 blocks instead of the + * tracking distance if true + */ + public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange) { + try { + if (NetworkManager_initiateTileEntityEvent == null) + NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE); + if (instance == null) instance = getInstance(); - NetworkManager_initiateTileEntityEvent.invoke(instance, te, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + NetworkManager_initiateTileEntityEvent.invoke(instance, te, event, limitRange); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * If this method is being executed on the client (i.e. Singleplayer), it'll just call - * INetworkItemEventListener.onNetworkEvent (if implemented by the item). - * - * @param player EntityPlayer holding the item - * @param itemStack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - * @param limitRange Limit the notification range to (currently) 20 blocks instead of the - * tracking distance if true - */ - public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange) { - try { - if (NetworkManager_initiateItemEvent == null) NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); + /** + * Immediately send an event for the specified Item to the clients in range. + *

+ * The item should implement INetworkItemEventListener to receive the event. + *

+ * If this method is being executed on the client (i.e. Singleplayer), it'll just call + * INetworkItemEventListener.onNetworkEvent (if implemented by the item). + * + * @param player EntityPlayer holding the item + * @param itemStack ItemStack containing the item + * @param event Arbitrary integer to represent the event, choosing the values is up to you + * @param limitRange Limit the notification range to (currently) 20 blocks instead of the + * tracking distance if true + */ + public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange) { + try { + if (NetworkManager_initiateItemEvent == null) + NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE); + if (instance == null) instance = getInstance(); - NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - // client -> server + // client -> server - /** - * Immediately send an event for the specified TileEntity to the server. - * - * This method doesn't do anything if executed on the server. - * - * @param te TileEntity to notify, should implement INetworkClientTileEntityEventListener - * @param event Arbitrary integer to represent the event, choosing the values is up to you - */ - public static void initiateClientTileEntityEvent(TileEntity te, int event) { - try { - if (NetworkManager_initiateClientTileEntityEvent == null) NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE); - if (instance == null) instance = getInstance(); + /** + * Immediately send an event for the specified TileEntity to the server. + *

+ * This method doesn't do anything if executed on the server. + * + * @param te TileEntity to notify, should implement INetworkClientTileEntityEventListener + * @param event Arbitrary integer to represent the event, choosing the values is up to you + */ + public static void initiateClientTileEntityEvent(TileEntity te, int event) { + try { + if (NetworkManager_initiateClientTileEntityEvent == null) + NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE); + if (instance == null) instance = getInstance(); - NetworkManager_initiateClientTileEntityEvent.invoke(instance, te, event); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + NetworkManager_initiateClientTileEntityEvent.invoke(instance, te, event); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - /** - * Immediately send an event for the specified Item to the clients in range. - * - * The item should implement INetworkItemEventListener to receive the event. - * - * This method doesn't do anything if executed on the server. - * - * @param itemStack ItemStack containing the item - * @param event Arbitrary integer to represent the event, choosing the values is up to you - */ - public static void initiateClientItemEvent(ItemStack itemStack, int event) { - try { - if (NetworkManager_initiateClientItemEvent == null) NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE); - if (instance == null) instance = getInstance(); + /** + * Immediately send an event for the specified Item to the clients in range. + *

+ * The item should implement INetworkItemEventListener to receive the event. + *

+ * This method doesn't do anything if executed on the server. + * + * @param itemStack ItemStack containing the item + * @param event Arbitrary integer to represent the event, choosing the values is up to you + */ + public static void initiateClientItemEvent(ItemStack itemStack, int event) { + try { + if (NetworkManager_initiateClientItemEvent == null) + NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE); + if (instance == null) instance = getInstance(); - NetworkManager_initiateClientItemEvent.invoke(instance, itemStack, event); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + NetworkManager_initiateClientItemEvent.invoke(instance, itemStack, event); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 - */ - private static String getPackage() { - Package pkg = NetworkHelper.class.getPackage(); + /** + * Get the base IC2 package name, used internally. + * + * @return IC2 package name, if unable to be determined defaults to ic2 + */ + private static String getPackage() { + Package pkg = NetworkHelper.class.getPackage(); - if (pkg != null) { - String packageName = pkg.getName(); + if (pkg != null) { + String packageName = pkg.getName(); - return packageName.substring(0, packageName.length() - ".api.network".length()); - } + return packageName.substring(0, packageName.length() - ".api.network".length()); + } - return "ic2"; - } + return "ic2"; + } - /** - * Get the NetworkManager instance, used internally. - * - * @return NetworkManager instance - */ - private static Object getInstance() { - try { - return Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null); - } catch (Throwable e) { - throw new RuntimeException(e); - } - } + /** + * Get the NetworkManager instance, used internally. + * + * @return NetworkManager instance + */ + private static Object getInstance() { + try { + return Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null); + } catch (Throwable e) { + throw new RuntimeException(e); + } + } - private static Object instance; - private static Method NetworkManager_updateTileEntityField; - private static Method NetworkManager_initiateTileEntityEvent; - private static Method NetworkManager_initiateItemEvent; - private static Method NetworkManager_initiateClientTileEntityEvent; - private static Method NetworkManager_initiateClientItemEvent; + private static Object instance; + private static Method NetworkManager_updateTileEntityField; + private static Method NetworkManager_initiateTileEntityEvent; + private static Method NetworkManager_initiateItemEvent; + private static Method NetworkManager_initiateClientTileEntityEvent; + private static Method NetworkManager_initiateClientItemEvent; } diff --git a/src/main/java/ic2/api/network/package-info.java b/src/main/java/ic2/api/network/package-info.java index 25ea29e..d925e4a 100644 --- a/src/main/java/ic2/api/network/package-info.java +++ b/src/main/java/ic2/api/network/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.network; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.network; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/package-info.java b/src/main/java/ic2/api/package-info.java index e6f1522..3440426 100644 --- a/src/main/java/ic2/api/package-info.java +++ b/src/main/java/ic2/api/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/reactor/IReactor.java b/src/main/java/ic2/api/reactor/IReactor.java index 55191cc..c7a7a60 100644 --- a/src/main/java/ic2/api/reactor/IReactor.java +++ b/src/main/java/ic2/api/reactor/IReactor.java @@ -8,151 +8,151 @@ import net.minecraft.world.World; * Interface implemented by the tile entity of nuclear reactors. */ public interface IReactor { - /** - * Get the reactor's position in the world. - * - * @return Position of the reactor - */ - public ChunkCoordinates getPosition(); + /** + * Get the reactor's position in the world. + * + * @return Position of the reactor + */ + public ChunkCoordinates getPosition(); - /** - * Get the reactor's corresponding world. - * - * @return The reactor's world - */ - public World getWorld(); + /** + * Get the reactor's corresponding world. + * + * @return The reactor's world + */ + public World getWorld(); - /** - * Get the reactor's heat. - * - * @return The reactor's heat - */ - public int getHeat(); + /** + * Get the reactor's heat. + * + * @return The reactor's heat + */ + public int getHeat(); - /** - * Set the reactor's heat. - * - * @param heat reactor heat - */ - public void setHeat(int heat); + /** + * Set the reactor's heat. + * + * @param heat reactor heat + */ + public void setHeat(int heat); - /** - * Increase the reactor's heat. - * - * Use negative values to decrease. - * - * @param amount amount of heat to add - * @return The reactor's heat after adding the specified amount - */ - public int addHeat(int amount); + /** + * Increase the reactor's heat. + *

+ * Use negative values to decrease. + * + * @param amount amount of heat to add + * @return The reactor's heat after adding the specified amount + */ + public int addHeat(int amount); - /** - * Get the reactor's maximum heat before exploding. - * - * @return Maximum heat value - */ - public int getMaxHeat(); + /** + * Get the reactor's maximum heat before exploding. + * + * @return Maximum heat value + */ + public int getMaxHeat(); - /** - * Set the reactor's stored maxHeat variable. - * Used by plating to increase the reactors MaxHeat capacity. - * Needs to be called during each cycle process. - */ - public void setMaxHeat(int newMaxHeat); + /** + * Set the reactor's stored maxHeat variable. + * Used by plating to increase the reactors MaxHeat capacity. + * Needs to be called during each cycle process. + */ + public void setMaxHeat(int newMaxHeat); - /** - * add Heat to a EmitHeat Buffer - * for use in Reactor operation.. need to be use - * for all Componetents with self-cooling - * no more magic heat disappear - */ + /** + * add Heat to a EmitHeat Buffer + * for use in Reactor operation.. need to be use + * for all Componetents with self-cooling + * no more magic heat disappear + */ - public void addEmitHeat(int heat); + public void addEmitHeat(int heat); - /** - * Get's the reactor's HEM (Heat Effect Modifier) - * Basic value is 1.0F. - * Reducing the value causes a weakening/reduction of the heat-based sideeffects of reactors - * (F.e. water evaporation, melting, damaging entitys, etc) - * - * @return HEM - */ - public float getHeatEffectModifier(); + /** + * Get's the reactor's HEM (Heat Effect Modifier) + * Basic value is 1.0F. + * Reducing the value causes a weakening/reduction of the heat-based sideeffects of reactors + * (F.e. water evaporation, melting, damaging entitys, etc) + * + * @return HEM + */ + public float getHeatEffectModifier(); - /** - * Set's the reactor's HEM - * Needs to be called during each cycle process. - */ - public void setHeatEffectModifier(float newHEM); + /** + * Set's the reactor's HEM + * Needs to be called during each cycle process. + */ + public void setHeatEffectModifier(float newHEM); - /** - * Get the reactor's energy output. - * - * @return Energy output, not multiplied by the base EU/t value - */ - public float getReactorEnergyOutput(); + /** + * Get the reactor's energy output. + * + * @return Energy output, not multiplied by the base EU/t value + */ + public float getReactorEnergyOutput(); - /** - * Get the reactor's energy output. - * - * @return Energy output, multiplied with base EU/t value and MainConfig.get().getFloat("balance/energy/generator/nuclear") - */ - public double getReactorEUEnergyOutput(); + /** + * Get the reactor's energy output. + * + * @return Energy output, multiplied with base EU/t value and MainConfig.get().getFloat("balance/energy/generator/nuclear") + */ + public double getReactorEUEnergyOutput(); - /** - * Add's the given amount of energy to the Reactor's output. - * - * @return Energy output after adding the value, not multiplied by the base EU/t value - */ - public float addOutput(float energy); + /** + * Add's the given amount of energy to the Reactor's output. + * + * @return Energy output after adding the value, not multiplied by the base EU/t value + */ + public float addOutput(float energy); - /** - * Get the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds returns null - * @param y Y position of the item, out of bounds returns null - * @return The item or null if there is no item - */ - public ItemStack getItemAt(int x, int y); + /** + * Get the item at the specified grid coordinates. + * + * @param x X position of the item, out of bounds returns null + * @param y Y position of the item, out of bounds returns null + * @return The item or null if there is no item + */ + public ItemStack getItemAt(int x, int y); - /** - * Set the item at the specified grid coordinates. - * - * @param x X position of the item, out of bounds is a no-op - * @param y Y position of the item, out of bounds is a no-op - * @param item The item to set. - */ - public void setItemAt(int x, int y, ItemStack item); + /** + * Set the item at the specified grid coordinates. + * + * @param x X position of the item, out of bounds is a no-op + * @param y Y position of the item, out of bounds is a no-op + * @param item The item to set. + */ + public void setItemAt(int x, int y, ItemStack item); - /** - * Explode the reactor. - */ - public void explode(); + /** + * Explode the reactor. + */ + public void explode(); - /** - * Get the reactor's tick rate (game ticks per reactor tick). - * - * @return Tick rate - */ - public int getTickRate(); + /** + * Get the reactor's tick rate (game ticks per reactor tick). + * + * @return Tick rate + */ + public int getTickRate(); - /** - * Get whether the reactor is active and supposed to produce energy - * @return Whether the reactor is active - */ - public boolean produceEnergy(); + /** + * Get whether the reactor is active and supposed to produce energy + * + * @return Whether the reactor is active + */ + public boolean produceEnergy(); - /** - * Set Redstone Signal without direct contact - * - */ + /** + * Set Redstone Signal without direct contact + */ - public void setRedstoneSignal(boolean redstone); + public void setRedstoneSignal(boolean redstone); - /** - * @return true if the reactor is FluidCooled - */ + /** + * @return true if the reactor is FluidCooled + */ - public boolean isFluidCooled(); + public boolean isFluidCooled(); } diff --git a/src/main/java/ic2/api/reactor/IReactorChamber.java b/src/main/java/ic2/api/reactor/IReactorChamber.java index 4611a6a..7199c43 100644 --- a/src/main/java/ic2/api/reactor/IReactorChamber.java +++ b/src/main/java/ic2/api/reactor/IReactorChamber.java @@ -4,17 +4,16 @@ package ic2.api.reactor; * Interface implemented by the reactor chamber tile entity. */ public interface IReactorChamber { - /** - * Get the chamber's reactor. - * - * @return The reactor - */ - public IReactor getReactor(); + /** + * Get the chamber's reactor. + * + * @return The reactor + */ + public IReactor getReactor(); - /** - * Set Redstone Signal without direct contact - * - */ - - public void setRedstoneSignal(boolean redstone); + /** + * Set Redstone Signal without direct contact + */ + + public void setRedstoneSignal(boolean redstone); } diff --git a/src/main/java/ic2/api/reactor/IReactorComponent.java b/src/main/java/ic2/api/reactor/IReactorComponent.java index 84e011c..80bfa65 100644 --- a/src/main/java/ic2/api/reactor/IReactorComponent.java +++ b/src/main/java/ic2/api/reactor/IReactorComponent.java @@ -6,93 +6,96 @@ import net.minecraft.item.ItemStack; * Design custom Reactor components by implementing this Interface * Items implementing the interface will not be ejected from Reactors in their clean-up * and can/will be interacted with by other elements, f.e. Uranium Cells. - * + *

* All IC2 ReactorComponents implement and use this Interface - * */ public interface IReactorComponent { - /** - * Called by reactor upon iterating through it's inventory (every cycle). - * Perform all necessary calculation/interaction here - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heatrun every Stack will cycle 2 time (true, false) first run for heat, sec for Eu calculation - */ - public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y, boolean heatrun); + /** + * Called by reactor upon iterating through it's inventory (every cycle). + * Perform all necessary calculation/interaction here + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @param x X-coordinate of the stack in the grid + * @param y Y-coordinate of the stack in the grid + * @param heatrun every Stack will cycle 2 time (true, false) first run for heat, sec for Eu calculation + */ + public void processChamber(IReactor reactor, ItemStack yourStack, int x, int y, boolean heatrun); - /** - * Can be called by Uranium-Components who attempt to generate energy by pulsing to other components. - * Uranium-Uranium interaction (f.e.) uses this method. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of called ItemStack - * @param pulsingStack Reference to the specific instance of pulsing ItemStack - * @param youX X-coordinate of your stack in the grid - * @param youY Y-coordinate of your stack in the grid - * @param pulseX X-coordinate of pulsing stack in the grid - * @param pulseY Y-coordinate of pulsing stack in the grid - * @param heatrun true for only create heat not EU, false for only EU not heat - * @return true if this component reacts to the pulse (and pulse is therefore meant to produce heat) - */ - public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun); + /** + * Can be called by Uranium-Components who attempt to generate energy by pulsing to other components. + * Uranium-Uranium interaction (f.e.) uses this method. + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of called ItemStack + * @param pulsingStack Reference to the specific instance of pulsing ItemStack + * @param youX X-coordinate of your stack in the grid + * @param youY Y-coordinate of your stack in the grid + * @param pulseX X-coordinate of pulsing stack in the grid + * @param pulseY Y-coordinate of pulsing stack in the grid + * @param heatrun true for only create heat not EU, false for only EU not heat + * @return true if this component reacts to the pulse (and pulse is therefore meant to produce heat) + */ + public boolean acceptUraniumPulse(IReactor reactor, ItemStack yourStack, ItemStack pulsingStack, int youX, int youY, int pulseX, int pulseY, boolean heatrun); - /** - * Called by components to determine whether your component can be heated. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return true if your component can take heat - */ - public boolean canStoreHeat(IReactor reactor, ItemStack yourStack, int x, int y); + /** + * Called by components to determine whether your component can be heated. + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @param x X-coordinate of the stack in the grid + * @param y Y-coordinate of the stack in the grid + * @return true if your component can take heat + */ + public boolean canStoreHeat(IReactor reactor, ItemStack yourStack, int x, int y); - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the maximum capacity of your heat-containing component here. - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Maximum heat - */ - public int getMaxHeat(IReactor reactor, ItemStack yourStack, int x, int y); + /** + * Called by heat-switches to determine how much heat to distribute into which direction. + * Please return the maximum capacity of your heat-containing component here. + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @param x X-coordinate of the stack in the grid + * @param y Y-coordinate of the stack in the grid + * @return Maximum heat + */ + public int getMaxHeat(IReactor reactor, ItemStack yourStack, int x, int y); - /** - * Called by heat-switches to determine how much heat to distribute into which direction. - * Please return the current amount of heat stored in this component - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @return Current Heat - */ - public int getCurrentHeat(IReactor reactor, ItemStack yourStack, int x, int y); + /** + * Called by heat-switches to determine how much heat to distribute into which direction. + * Please return the current amount of heat stored in this component + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @param x X-coordinate of the stack in the grid + * @param y Y-coordinate of the stack in the grid + * @return Current Heat + */ + public int getCurrentHeat(IReactor reactor, ItemStack yourStack, int x, int y); - /** - * Called by components to distribute heat to your component. - * Perform heating-calculations and increase your heat (dmg) level accordingly. - * This method will as well be called to REDUCE heat, by providing a negative amount. - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @param x X-coordinate of the stack in the grid - * @param y Y-coordinate of the stack in the grid - * @param heat Amount of heat to be added (may be negative to subtract heat) - * @return 0 if the 'order' was accepted, return >0 to indicate the 'remaining' heat which couldn't be absorbed (and vice versa for <0) - */ - public int alterHeat(IReactor reactor, ItemStack yourStack, int x, int y, int heat); + /** + * Called by components to distribute heat to your component. + * Perform heating-calculations and increase your heat (dmg) level accordingly. + * This method will as well be called to REDUCE heat, by providing a negative amount. + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @param x X-coordinate of the stack in the grid + * @param y Y-coordinate of the stack in the grid + * @param heat Amount of heat to be added (may be negative to subtract heat) + * @return 0 if the 'order' was accepted, return >0 to indicate the 'remaining' heat which couldn't be absorbed (and vice versa for <0) + */ + public int alterHeat(IReactor reactor, ItemStack yourStack, int x, int y, int heat); - /** - * Called upon reactor explosion - * Alter the explosion size. - * Returning a float 0 < f < 1 will be counted as multiplier. - * Anything else will be counted as a flat addition (in case of <0 = reduction). - * - * @param reactor Reference to the Reactor - * @param yourStack Reference to the specific instance of iterated ItemStack - * @return your explosion modifier - */ - public float influenceExplosion(IReactor reactor, ItemStack yourStack); + /** + * Called upon reactor explosion + * Alter the explosion size. + * Returning a float 0 < f < 1 will be counted as multiplier. + * Anything else will be counted as a flat addition (in case of <0 = reduction). + * + * @param reactor Reference to the Reactor + * @param yourStack Reference to the specific instance of iterated ItemStack + * @return your explosion modifier + */ + public float influenceExplosion(IReactor reactor, ItemStack yourStack); } diff --git a/src/main/java/ic2/api/reactor/package-info.java b/src/main/java/ic2/api/reactor/package-info.java index 5194aee..43a0822 100644 --- a/src/main/java/ic2/api/reactor/package-info.java +++ b/src/main/java/ic2/api/reactor/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.reactor; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.reactor; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/recipe/ICannerBottleRecipeManager.java b/src/main/java/ic2/api/recipe/ICannerBottleRecipeManager.java index 415b3c3..45c8444 100644 --- a/src/main/java/ic2/api/recipe/ICannerBottleRecipeManager.java +++ b/src/main/java/ic2/api/recipe/ICannerBottleRecipeManager.java @@ -1,51 +1,51 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraft.item.ItemStack; +import java.util.Map; + public interface ICannerBottleRecipeManager { - /** - * Adds a recipe to the machine. - * - * @param container Container to be filled - * @param fill Item to fill into the container - * @param output Filled container - */ - public void addRecipe(IRecipeInput container, IRecipeInput fill, ItemStack output); + /** + * Adds a recipe to the machine. + * + * @param container Container to be filled + * @param fill Item to fill into the container + * @param output Filled container + */ + public void addRecipe(IRecipeInput container, IRecipeInput fill, ItemStack output); - /** - * Gets the recipe output for the given input. - * - * @param container Container to be filled - * @param fill Item to fill into the container - * @param adjustInput modify the input according to the recipe's requirements - * @param acceptTest allow either container or fill to be null to see if either of them is part of a recipe - * @return Recipe output, or null if none - */ - public RecipeOutput getOutputFor(ItemStack container, ItemStack fill, boolean adjustInput, boolean acceptTest); + /** + * Gets the recipe output for the given input. + * + * @param container Container to be filled + * @param fill Item to fill into the container + * @param adjustInput modify the input according to the recipe's requirements + * @param acceptTest allow either container or fill to be null to see if either of them is part of a recipe + * @return Recipe output, or null if none + */ + public RecipeOutput getOutputFor(ItemStack container, ItemStack fill, boolean adjustInput, boolean acceptTest); - /** - * Gets a list of recipes. - * - * You're a mad evil scientist if you ever modify this. - * - * @return List of recipes - */ - public Map getRecipes(); + /** + * Gets a list of recipes. + *

+ * You're a mad evil scientist if you ever modify this. + * + * @return List of recipes + */ + public Map getRecipes(); - public static class Input { - public Input(IRecipeInput container1, IRecipeInput fill1) { - this.container = container1; - this.fill = fill1; - } + public static class Input { + public Input(IRecipeInput container1, IRecipeInput fill1) { + this.container = container1; + this.fill = fill1; + } - public boolean matches(ItemStack container1, ItemStack fill1) { - return this.container.matches(container1) && this.fill.matches(fill1); - } + public boolean matches(ItemStack container1, ItemStack fill1) { + return this.container.matches(container1) && this.fill.matches(fill1); + } - public final IRecipeInput container; - public final IRecipeInput fill; - } + public final IRecipeInput container; + public final IRecipeInput fill; + } } diff --git a/src/main/java/ic2/api/recipe/ICannerEnrichRecipeManager.java b/src/main/java/ic2/api/recipe/ICannerEnrichRecipeManager.java index 5eba1b6..cbd4f9c 100644 --- a/src/main/java/ic2/api/recipe/ICannerEnrichRecipeManager.java +++ b/src/main/java/ic2/api/recipe/ICannerEnrichRecipeManager.java @@ -1,54 +1,53 @@ package ic2.api.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import java.util.Map; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.fluids.FluidStack; - public interface ICannerEnrichRecipeManager { - /** - * Adds a recipe to the machine. - * - * @param input Fluid input - * @param additive Item to enrich the fluid with - * @param output Output fluid - */ - public void addRecipe(FluidStack input, IRecipeInput additive, FluidStack output); + /** + * Adds a recipe to the machine. + * + * @param input Fluid input + * @param additive Item to enrich the fluid with + * @param output Output fluid + */ + public void addRecipe(FluidStack input, IRecipeInput additive, FluidStack output); - /** - * Gets the recipe output for the given input. - * - * @param input Fluid input - * @param additive Item to enrich the fluid with - * @param adjustInput modify the input according to the recipe's requirements - * @param acceptTest allow input or additive to be null to see if either of them is part of a recipe - * @return Recipe output, or null if none, output fluid in nbt - */ - public RecipeOutput getOutputFor(FluidStack input, ItemStack additive, boolean adjustInput, boolean acceptTest); + /** + * Gets the recipe output for the given input. + * + * @param input Fluid input + * @param additive Item to enrich the fluid with + * @param adjustInput modify the input according to the recipe's requirements + * @param acceptTest allow input or additive to be null to see if either of them is part of a recipe + * @return Recipe output, or null if none, output fluid in nbt + */ + public RecipeOutput getOutputFor(FluidStack input, ItemStack additive, boolean adjustInput, boolean acceptTest); - /** - * Gets a list of recipes. - * - * You're a mad evil scientist if you ever modify this. - * - * @return List of recipes - */ - public Map getRecipes(); + /** + * Gets a list of recipes. + *

+ * You're a mad evil scientist if you ever modify this. + * + * @return List of recipes + */ + public Map getRecipes(); - public static class Input { - public Input(FluidStack fluid1, IRecipeInput additive1) { - this.fluid = fluid1; - this.additive = additive1; - } + public static class Input { + public Input(FluidStack fluid1, IRecipeInput additive1) { + this.fluid = fluid1; + this.additive = additive1; + } - public boolean matches(FluidStack fluid1, ItemStack additive1) { - return (this.fluid == null || this.fluid.isFluidEqual(fluid1)) && - this.additive.matches(additive1); - } + public boolean matches(FluidStack fluid1, ItemStack additive1) { + return (this.fluid == null || this.fluid.isFluidEqual(fluid1)) && + this.additive.matches(additive1); + } - public final FluidStack fluid; - public final IRecipeInput additive; - } + public final FluidStack fluid; + public final IRecipeInput additive; + } } diff --git a/src/main/java/ic2/api/recipe/ICraftingRecipeManager.java b/src/main/java/ic2/api/recipe/ICraftingRecipeManager.java index 756eaf6..b70c7e1 100644 --- a/src/main/java/ic2/api/recipe/ICraftingRecipeManager.java +++ b/src/main/java/ic2/api/recipe/ICraftingRecipeManager.java @@ -4,23 +4,23 @@ import net.minecraft.item.ItemStack; /** * Recipe manager interface for crafting recipes. - * + * * @author Richard */ public interface ICraftingRecipeManager { - /** - * Adds a shaped crafting recipe. - * - * @param output Recipe output - * @param input Recipe input format - */ - public void addRecipe(ItemStack output, Object... input); - - /** - * Adds a shapeless crafting recipe. - * - * @param output Recipe output - * @param input Recipe input - */ - public void addShapelessRecipe(ItemStack output, Object... input); + /** + * Adds a shaped crafting recipe. + * + * @param output Recipe output + * @param input Recipe input format + */ + public void addRecipe(ItemStack output, Object... input); + + /** + * Adds a shapeless crafting recipe. + * + * @param output Recipe output + * @param input Recipe input + */ + public void addShapelessRecipe(ItemStack output, Object... input); } diff --git a/src/main/java/ic2/api/recipe/IFluidHeatManager.java b/src/main/java/ic2/api/recipe/IFluidHeatManager.java index 7ddecdc..fa43980 100644 --- a/src/main/java/ic2/api/recipe/IFluidHeatManager.java +++ b/src/main/java/ic2/api/recipe/IFluidHeatManager.java @@ -1,32 +1,32 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraftforge.fluids.Fluid; +import java.util.Map; + public interface IFluidHeatManager extends ILiquidAcceptManager { - /** - * Add a new fluid to the Fluid Heat Generator. - * - * @param fluidName the fluid to burn - * @param amount amount of fluid to consume per tick - * @param heat amount of heat generated per tick - */ - void addFluid(String fluidName, int amount, int heat); + /** + * Add a new fluid to the Fluid Heat Generator. + * + * @param fluidName the fluid to burn + * @param amount amount of fluid to consume per tick + * @param heat amount of heat generated per tick + */ + void addFluid(String fluidName, int amount, int heat); - BurnProperty getBurnProperty(Fluid fluid); + BurnProperty getBurnProperty(Fluid fluid); - Map getBurnProperties(); + Map getBurnProperties(); - public static class BurnProperty { - public BurnProperty(int amount1, int heat1) { - this.amount = amount1; - this.heat = heat1; - } + public static class BurnProperty { + public BurnProperty(int amount1, int heat1) { + this.amount = amount1; + this.heat = heat1; + } - public final int amount; - public final int heat; - } + public final int amount; + public final int heat; + } } diff --git a/src/main/java/ic2/api/recipe/ILiquidAcceptManager.java b/src/main/java/ic2/api/recipe/ILiquidAcceptManager.java index 4f377b9..c2212c2 100644 --- a/src/main/java/ic2/api/recipe/ILiquidAcceptManager.java +++ b/src/main/java/ic2/api/recipe/ILiquidAcceptManager.java @@ -1,10 +1,11 @@ package ic2.api.recipe; -import java.util.Set; - import net.minecraftforge.fluids.Fluid; +import java.util.Set; + public interface ILiquidAcceptManager { - boolean acceptsFluid(Fluid fluid); - Set getAcceptedFluids(); + boolean acceptsFluid(Fluid fluid); + + Set getAcceptedFluids(); } diff --git a/src/main/java/ic2/api/recipe/IListRecipeManager.java b/src/main/java/ic2/api/recipe/IListRecipeManager.java index adc2291..f00dcad 100644 --- a/src/main/java/ic2/api/recipe/IListRecipeManager.java +++ b/src/main/java/ic2/api/recipe/IListRecipeManager.java @@ -1,41 +1,41 @@ package ic2.api.recipe; -import java.util.List; - import net.minecraft.item.ItemStack; +import java.util.List; + /** * Recipe manager interface for basic lists. - * + * * @author Richard */ public interface IListRecipeManager extends Iterable { - /** - * Adds a stack to the list. - * - * @param stack Stack to add - */ - public void add(IRecipeInput input); + /** + * Adds a stack to the list. + * + * @param stack Stack to add + */ + public void add(IRecipeInput input); - /** - * Checks whether the specified stack is in the list. - * - * @param stack Stack to check - * @return Whether the stack is in the list - */ - public boolean contains(ItemStack stack); + /** + * Checks whether the specified stack is in the list. + * + * @param stack Stack to check + * @return Whether the stack is in the list + */ + public boolean contains(ItemStack stack); - /** - * @return if the List is Empty - */ - public boolean isEmpty(); + /** + * @return if the List is Empty + */ + public boolean isEmpty(); - /** - * Gets the list of stacks. - * - * You're a mad evil scientist if you ever modify this. - * - * @return List of stacks - */ - public List getInputs(); + /** + * Gets the list of stacks. + *

+ * You're a mad evil scientist if you ever modify this. + * + * @return List of stacks + */ + public List getInputs(); } diff --git a/src/main/java/ic2/api/recipe/IMachineRecipeManager.java b/src/main/java/ic2/api/recipe/IMachineRecipeManager.java index 388e394..b0800fe 100644 --- a/src/main/java/ic2/api/recipe/IMachineRecipeManager.java +++ b/src/main/java/ic2/api/recipe/IMachineRecipeManager.java @@ -1,44 +1,43 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import java.util.Map; + /** * Recipe manager interface for basic machines. - * + * * @author RichardG, Player */ public interface IMachineRecipeManager { - /** - * Adds a recipe to the machine. - * - * @param input Recipe input - * @param metadata meta data for additional recipe properties, may be null - * @param outputs Recipe outputs, zero or more depending on the machine - * - * For the thermal centrifuge @param metadata meta data {"minHeat": 1-xxx} - * For the ore washing plant @param metadata meta data {"amount": 1-8000} - * - */ - public void addRecipe(IRecipeInput input, NBTTagCompound metadata, ItemStack... outputs); + /** + * Adds a recipe to the machine. + * + * @param input Recipe input + * @param metadata meta data for additional recipe properties, may be null + * @param outputs Recipe outputs, zero or more depending on the machine + *

+ * For the thermal centrifuge @param metadata meta data {"minHeat": 1-xxx} + * For the ore washing plant @param metadata meta data {"amount": 1-8000} + */ + public void addRecipe(IRecipeInput input, NBTTagCompound metadata, ItemStack... outputs); - /** - * Gets the recipe output for the given input. - * - * @param input Recipe input - * @param adjustInput modify the input according to the recipe's requirements - * @return Recipe output, or null if none - */ - public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput); + /** + * Gets the recipe output for the given input. + * + * @param input Recipe input + * @param adjustInput modify the input according to the recipe's requirements + * @return Recipe output, or null if none + */ + public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput); - /** - * Gets a list of recipes. - * - * You're a mad evil scientist if you ever modify this. - * - * @return List of recipes - */ - public Map getRecipes(); + /** + * Gets a list of recipes. + *

+ * You're a mad evil scientist if you ever modify this. + * + * @return List of recipes + */ + public Map getRecipes(); } diff --git a/src/main/java/ic2/api/recipe/IPatternStorage.java b/src/main/java/ic2/api/recipe/IPatternStorage.java index c9dbd8d..1632052 100644 --- a/src/main/java/ic2/api/recipe/IPatternStorage.java +++ b/src/main/java/ic2/api/recipe/IPatternStorage.java @@ -1,11 +1,11 @@ package ic2.api.recipe; -import java.util.List; - import net.minecraft.item.ItemStack; -public interface IPatternStorage { - boolean addPattern(ItemStack itemstack); +import java.util.List; - List getPatterns(); +public interface IPatternStorage { + boolean addPattern(ItemStack itemstack); + + List getPatterns(); } diff --git a/src/main/java/ic2/api/recipe/IRecipeInput.java b/src/main/java/ic2/api/recipe/IRecipeInput.java index 0c842d6..61c193c 100644 --- a/src/main/java/ic2/api/recipe/IRecipeInput.java +++ b/src/main/java/ic2/api/recipe/IRecipeInput.java @@ -1,31 +1,31 @@ package ic2.api.recipe; -import java.util.List; - import net.minecraft.item.ItemStack; +import java.util.List; + public interface IRecipeInput { - /** - * Check if subject matches this recipe input, ignoring the amount. - * - * @param subject ItemStack to check - * @return true if it matches the requirement - */ - boolean matches(ItemStack subject); + /** + * Check if subject matches this recipe input, ignoring the amount. + * + * @param subject ItemStack to check + * @return true if it matches the requirement + */ + boolean matches(ItemStack subject); - /** - * Determine the minimum input stack size. - * - * @return input amount required - */ - int getAmount(); + /** + * Determine the minimum input stack size. + * + * @return input amount required + */ + int getAmount(); - /** - * List all possible inputs (best effort). - * - * The stack size is undefined, use getAmount to get the correct one. - * - * @return list of inputs, may be incomplete - */ - List getInputs(); + /** + * List all possible inputs (best effort). + *

+ * The stack size is undefined, use getAmount to get the correct one. + * + * @return list of inputs, may be incomplete + */ + List getInputs(); } diff --git a/src/main/java/ic2/api/recipe/IScrapboxManager.java b/src/main/java/ic2/api/recipe/IScrapboxManager.java index 41b694d..d37d0a4 100644 --- a/src/main/java/ic2/api/recipe/IScrapboxManager.java +++ b/src/main/java/ic2/api/recipe/IScrapboxManager.java @@ -1,13 +1,13 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraft.item.ItemStack; +import java.util.Map; + public interface IScrapboxManager { - void addDrop(ItemStack drop, float rawChance); + void addDrop(ItemStack drop, float rawChance); - ItemStack getDrop(ItemStack input, boolean adjustInput); + ItemStack getDrop(ItemStack input, boolean adjustInput); - Map getDrops(); + Map getDrops(); } diff --git a/src/main/java/ic2/api/recipe/ISemiFluidFuelManager.java b/src/main/java/ic2/api/recipe/ISemiFluidFuelManager.java index 87c3427..ac13229 100644 --- a/src/main/java/ic2/api/recipe/ISemiFluidFuelManager.java +++ b/src/main/java/ic2/api/recipe/ISemiFluidFuelManager.java @@ -1,32 +1,32 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraftforge.fluids.Fluid; +import java.util.Map; + public interface ISemiFluidFuelManager extends ILiquidAcceptManager { - /** - * Add a new fluid to the semi fluid generator. - * - * @param fluidName the fluid to burn - * @param amount amount of fluid to consume per tick - * @param power amount of energy generated per tick - */ - void addFluid(String fluidName, int amount, double power); + /** + * Add a new fluid to the semi fluid generator. + * + * @param fluidName the fluid to burn + * @param amount amount of fluid to consume per tick + * @param power amount of energy generated per tick + */ + void addFluid(String fluidName, int amount, double power); - BurnProperty getBurnProperty(Fluid fluid); + BurnProperty getBurnProperty(Fluid fluid); - Map getBurnProperties(); + Map getBurnProperties(); - public static class BurnProperty { - public BurnProperty(int amount1, double power1) { - this.amount = amount1; - this.power = power1; - } + public static class BurnProperty { + public BurnProperty(int amount1, double power1) { + this.amount = amount1; + this.power = power1; + } - public final int amount; - public final double power; - } + public final int amount; + public final double power; + } } diff --git a/src/main/java/ic2/api/recipe/RecipeInputFluidContainer.java b/src/main/java/ic2/api/recipe/RecipeInputFluidContainer.java index 103d293..10b45f0 100644 --- a/src/main/java/ic2/api/recipe/RecipeInputFluidContainer.java +++ b/src/main/java/ic2/api/recipe/RecipeInputFluidContainer.java @@ -1,54 +1,53 @@ package ic2.api.recipe; -import java.util.ArrayList; -import java.util.List; - import net.minecraft.item.ItemStack; - import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; import net.minecraftforge.fluids.FluidStack; +import java.util.ArrayList; +import java.util.List; + public class RecipeInputFluidContainer implements IRecipeInput { - public RecipeInputFluidContainer(Fluid fluid) { - this(fluid, FluidContainerRegistry.BUCKET_VOLUME); - } + public RecipeInputFluidContainer(Fluid fluid) { + this(fluid, FluidContainerRegistry.BUCKET_VOLUME); + } - public RecipeInputFluidContainer(Fluid fluid, int amount) { - this.fluid = fluid; - this.amount = amount; - } + public RecipeInputFluidContainer(Fluid fluid, int amount) { + this.fluid = fluid; + this.amount = amount; + } - @Override - public boolean matches(ItemStack subject) { - FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject); - if (fs == null) return false; + @Override + public boolean matches(ItemStack subject) { + FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject); + if (fs == null) return false; - return fs.getFluid() == fluid; - } + return fs.getFluid() == fluid; + } - @Override - public int getAmount() { - return amount; - } + @Override + public int getAmount() { + return amount; + } - @Override - public List getInputs() { - List ret = new ArrayList(); + @Override + public List getInputs() { + List ret = new ArrayList(); - for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) { - if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer); - } + for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) { + if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer); + } - return ret; - } + return ret; + } - @Override - public String toString() { - return "RInputFluidContainer<"+amount+"x"+fluid.getName()+">"; - } + @Override + public String toString() { + return "RInputFluidContainer<" + amount + "x" + fluid.getName() + ">"; + } - public final Fluid fluid; - public final int amount; + public final Fluid fluid; + public final int amount; } diff --git a/src/main/java/ic2/api/recipe/RecipeInputItemStack.java b/src/main/java/ic2/api/recipe/RecipeInputItemStack.java index e1b65f9..1e05691 100644 --- a/src/main/java/ic2/api/recipe/RecipeInputItemStack.java +++ b/src/main/java/ic2/api/recipe/RecipeInputItemStack.java @@ -1,46 +1,45 @@ package ic2.api.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import java.util.Arrays; import java.util.List; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.oredict.OreDictionary; - public class RecipeInputItemStack implements IRecipeInput { - public RecipeInputItemStack(ItemStack aInput) { - this(aInput, aInput.stackSize); - } + public RecipeInputItemStack(ItemStack aInput) { + this(aInput, aInput.stackSize); + } - public RecipeInputItemStack(ItemStack aInput, int aAmount) { - if (aInput.getItem() == null) throw new IllegalArgumentException("Invalid item stack specfied"); + public RecipeInputItemStack(ItemStack aInput, int aAmount) { + if (aInput.getItem() == null) throw new IllegalArgumentException("Invalid item stack specfied"); - input = aInput.copy(); // Never forget to copy. - amount = aAmount; - } + input = aInput.copy(); // Never forget to copy. + amount = aAmount; + } - @Override - public boolean matches(ItemStack subject) { - return subject.getItem() == input.getItem() && (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE); - } + @Override + public boolean matches(ItemStack subject) { + return subject.getItem() == input.getItem() && (subject.getItemDamage() == input.getItemDamage() || input.getItemDamage() == OreDictionary.WILDCARD_VALUE); + } - @Override - public int getAmount() { - return amount; - } + @Override + public int getAmount() { + return amount; + } - @Override - public List getInputs() { - return Arrays.asList(input); - } + @Override + public List getInputs() { + return Arrays.asList(input); + } - @Override - public String toString() { - ItemStack stack = input.copy(); - input.stackSize = amount; - return "RInputItemStack<"+stack+">"; - } + @Override + public String toString() { + ItemStack stack = input.copy(); + input.stackSize = amount; + return "RInputItemStack<" + stack + ">"; + } - public final ItemStack input; - public final int amount; + public final ItemStack input; + public final int amount; } diff --git a/src/main/java/ic2/api/recipe/RecipeInputOreDict.java b/src/main/java/ic2/api/recipe/RecipeInputOreDict.java index 89f73dc..cda4998 100644 --- a/src/main/java/ic2/api/recipe/RecipeInputOreDict.java +++ b/src/main/java/ic2/api/recipe/RecipeInputOreDict.java @@ -1,71 +1,70 @@ package ic2.api.recipe; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import java.util.ArrayList; import java.util.List; -import net.minecraft.item.ItemStack; - -import net.minecraftforge.oredict.OreDictionary; - public class RecipeInputOreDict implements IRecipeInput { - public RecipeInputOreDict(String input1) { - this(input1, 1); - } + public RecipeInputOreDict(String input1) { + this(input1, 1); + } - public RecipeInputOreDict(String input1, int amount1) { - this(input1, amount1, null); - } + public RecipeInputOreDict(String input1, int amount1) { + this(input1, amount1, null); + } - public RecipeInputOreDict(String input1, int amount1, Integer meta) { - this.input = input1; - this.amount = amount1; - this.meta = meta; - } + public RecipeInputOreDict(String input1, int amount1, Integer meta) { + this.input = input1; + this.amount = amount1; + this.meta = meta; + } - @Override - public boolean matches(ItemStack subject) { - List inputs = OreDictionary.getOres(input); + @Override + public boolean matches(ItemStack subject) { + List inputs = OreDictionary.getOres(input); - for (ItemStack input1 : inputs) { - if (input1.getItem() == null) continue; // ignore invalid - int metaRequired = meta == null ? input1.getItemDamage() : meta; + for (ItemStack input1 : inputs) { + if (input1.getItem() == null) continue; // ignore invalid + int metaRequired = meta == null ? input1.getItemDamage() : meta; - if (subject.getItem() == input1.getItem() && - (subject.getItemDamage() == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) { - return true; - } - } + if (subject.getItem() == input1.getItem() && + (subject.getItemDamage() == metaRequired || metaRequired == OreDictionary.WILDCARD_VALUE)) { + return true; + } + } - return false; - } + return false; + } - @Override - public int getAmount() { - return amount; - } + @Override + public int getAmount() { + return amount; + } - @Override - public List getInputs() { - List ores = OreDictionary.getOres(input); - List ret = new ArrayList(ores.size()); + @Override + public List getInputs() { + List ores = OreDictionary.getOres(input); + List ret = new ArrayList(ores.size()); - for (ItemStack stack : ores) { - if (stack.getItem() != null) ret.add(stack); // ignore invalid - } + for (ItemStack stack : ores) { + if (stack.getItem() != null) ret.add(stack); // ignore invalid + } - return ret; - } + return ret; + } - @Override - public String toString() { - if (meta == null) { - return "RInputOreDict<"+amount+"x"+input+">"; - } else { - return "RInputOreDict<"+amount+"x"+input+"@"+meta+">"; - } - } + @Override + public String toString() { + if (meta == null) { + return "RInputOreDict<" + amount + "x" + input + ">"; + } else { + return "RInputOreDict<" + amount + "x" + input + "@" + meta + ">"; + } + } - public final String input; - public final int amount; - public final Integer meta; + public final String input; + public final int amount; + public final Integer meta; } diff --git a/src/main/java/ic2/api/recipe/RecipeOutput.java b/src/main/java/ic2/api/recipe/RecipeOutput.java index 867cfa2..51ea33b 100644 --- a/src/main/java/ic2/api/recipe/RecipeOutput.java +++ b/src/main/java/ic2/api/recipe/RecipeOutput.java @@ -1,28 +1,28 @@ package ic2.api.recipe; -import java.util.Arrays; -import java.util.List; - import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import java.util.Arrays; +import java.util.List; + public final class RecipeOutput { - public RecipeOutput(NBTTagCompound metadata1, List items1) { - assert !items1.contains(null); + public RecipeOutput(NBTTagCompound metadata1, List items1) { + assert !items1.contains(null); - this.metadata = metadata1; - this.items = items1; - } + this.metadata = metadata1; + this.items = items1; + } - public RecipeOutput(NBTTagCompound metadata1, ItemStack... items1) { - this(metadata1, Arrays.asList(items1)); - } + public RecipeOutput(NBTTagCompound metadata1, ItemStack... items1) { + this(metadata1, Arrays.asList(items1)); + } - @Override - public String toString() { - return "ROutput<"+items+","+metadata+">"; - } + @Override + public String toString() { + return "ROutput<" + items + "," + metadata + ">"; + } - public final List items; - public final NBTTagCompound metadata; + public final List items; + public final NBTTagCompound metadata; } diff --git a/src/main/java/ic2/api/recipe/Recipes.java b/src/main/java/ic2/api/recipe/Recipes.java index 4c12597..fae2cd6 100644 --- a/src/main/java/ic2/api/recipe/Recipes.java +++ b/src/main/java/ic2/api/recipe/Recipes.java @@ -3,58 +3,58 @@ package ic2.api.recipe; /** * General recipe registry. - * + * * @author Richard */ public class Recipes { - public static IMachineRecipeManager macerator; - public static IMachineRecipeManager extractor; - public static IMachineRecipeManager compressor; - public static IMachineRecipeManager centrifuge; - public static IMachineRecipeManager blockcutter; - public static IMachineRecipeManager blastfurance; - public static IMachineRecipeManager recycler; - public static IMachineRecipeManager metalformerExtruding; - public static IMachineRecipeManager metalformerCutting; - public static IMachineRecipeManager metalformerRolling; - public static IMachineRecipeManager oreWashing; - public static ICannerBottleRecipeManager cannerBottle; - public static ICannerEnrichRecipeManager cannerEnrich; + public static IMachineRecipeManager macerator; + public static IMachineRecipeManager extractor; + public static IMachineRecipeManager compressor; + public static IMachineRecipeManager centrifuge; + public static IMachineRecipeManager blockcutter; + public static IMachineRecipeManager blastfurance; + public static IMachineRecipeManager recycler; + public static IMachineRecipeManager metalformerExtruding; + public static IMachineRecipeManager metalformerCutting; + public static IMachineRecipeManager metalformerRolling; + public static IMachineRecipeManager oreWashing; + public static ICannerBottleRecipeManager cannerBottle; + public static ICannerEnrichRecipeManager cannerEnrich; - /** - * Reference amplifier values: - * - * 5000: Scrap - * 45000: Scrapbox - * - * As Parameter for the Amplification Value you have to use the NBTTagCompound - * - * NBTTagCompound nbt = new NBTTagCompound(); - * nbt.setInteger("amplification", aValue); - * matterAmplifier.addRecipe(yourStack, nbt); - */ - public static IMachineRecipeManager matterAmplifier; - /** - * Reference scrap box chance values: - * - * 0.1: Diamond - * 0.5: Cake, Gold Helmet, Iron Ore, Gold Ore - * 1.0: Wooden tools, Soul Sand, Sign, Leather, Feather, Bone - * 1.5: Apple, Bread - * 2.0: Netherrack, Rotten Flesh - * 3.0: Grass, Gravel - * 4.0: Stick - * 5.0: Dirt, Wooden Hoe - */ - public static IScrapboxManager scrapboxDrops; - public static IListRecipeManager recyclerBlacklist; - /** - * Do not add anything to this Whitelist. This is for Configuration only. - * You may need this if you have an own Recycler in your Mod, just to check if something can be recycled. but don't add anything to this List - */ - public static IListRecipeManager recyclerWhitelist; - public static ICraftingRecipeManager advRecipes; + /** + * Reference amplifier values: + *

+ * 5000: Scrap + * 45000: Scrapbox + *

+ * As Parameter for the Amplification Value you have to use the NBTTagCompound + *

+ * NBTTagCompound nbt = new NBTTagCompound(); + * nbt.setInteger("amplification", aValue); + * matterAmplifier.addRecipe(yourStack, nbt); + */ + public static IMachineRecipeManager matterAmplifier; + /** + * Reference scrap box chance values: + *

+ * 0.1: Diamond + * 0.5: Cake, Gold Helmet, Iron Ore, Gold Ore + * 1.0: Wooden tools, Soul Sand, Sign, Leather, Feather, Bone + * 1.5: Apple, Bread + * 2.0: Netherrack, Rotten Flesh + * 3.0: Grass, Gravel + * 4.0: Stick + * 5.0: Dirt, Wooden Hoe + */ + public static IScrapboxManager scrapboxDrops; + public static IListRecipeManager recyclerBlacklist; + /** + * Do not add anything to this Whitelist. This is for Configuration only. + * You may need this if you have an own Recycler in your Mod, just to check if something can be recycled. but don't add anything to this List + */ + public static IListRecipeManager recyclerWhitelist; + public static ICraftingRecipeManager advRecipes; - public static ISemiFluidFuelManager semiFluidGenerator; - public static IFluidHeatManager FluidHeatGenerator; + public static ISemiFluidFuelManager semiFluidGenerator; + public static IFluidHeatManager FluidHeatGenerator; } diff --git a/src/main/java/ic2/api/recipe/package-info.java b/src/main/java/ic2/api/recipe/package-info.java index 44e70e7..7526ce3 100644 --- a/src/main/java/ic2/api/recipe/package-info.java +++ b/src/main/java/ic2/api/recipe/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.recipe; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.recipe; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/tile/ExplosionWhitelist.java b/src/main/java/ic2/api/tile/ExplosionWhitelist.java index fa4a474..d1f8a45 100644 --- a/src/main/java/ic2/api/tile/ExplosionWhitelist.java +++ b/src/main/java/ic2/api/tile/ExplosionWhitelist.java @@ -1,47 +1,47 @@ package ic2.api.tile; +import net.minecraft.block.Block; + import java.util.HashSet; import java.util.Set; -import net.minecraft.block.Block; - /** * Blocks on this whitelist will not resist an explosion but won't be destroyed. - * + *

* The explosion code by default ignores blocks which absorb more than 1000 explosion power to * prevent abusing personal safes, Trade-O-Mats and other blocks to serve as a cheap and * invulnerable reactor chambers. Said blocks will not shield the explosion and won't get * destroyed. */ public final class ExplosionWhitelist { - /** - * Add a block to the whitelist. - * - * @param block block to add - */ - public static void addWhitelistedBlock(Block block) { - whitelist.add(block); - } - - /** - * Remove a block from the whitelist. - * - * @param block block to remove - */ - public static void removeWhitelistedBlock(Block block) { - whitelist.remove(block); - } - - /** - * Check if a block is on the whitelist. - * - * @param block block to check if whitelisted - * @return Whether the block is whitelisted - */ - public static boolean isBlockWhitelisted(Block block) { - return whitelist.contains(block); - } + /** + * Add a block to the whitelist. + * + * @param block block to add + */ + public static void addWhitelistedBlock(Block block) { + whitelist.add(block); + } - private static Set whitelist = new HashSet(); + /** + * Remove a block from the whitelist. + * + * @param block block to remove + */ + public static void removeWhitelistedBlock(Block block) { + whitelist.remove(block); + } + + /** + * Check if a block is on the whitelist. + * + * @param block block to check if whitelisted + * @return Whether the block is whitelisted + */ + public static boolean isBlockWhitelisted(Block block) { + return whitelist.contains(block); + } + + private static Set whitelist = new HashSet(); } diff --git a/src/main/java/ic2/api/tile/IEnergyStorage.java b/src/main/java/ic2/api/tile/IEnergyStorage.java index 68f4270..bf80b00 100644 --- a/src/main/java/ic2/api/tile/IEnergyStorage.java +++ b/src/main/java/ic2/api/tile/IEnergyStorage.java @@ -6,56 +6,56 @@ import net.minecraftforge.common.util.ForgeDirection; * Interface implemented by the tile entity of energy storage blocks. */ public interface IEnergyStorage { - /** - * Get the amount of energy currently stored in the block. - * - * @return Energy stored in the block - */ - public int getStored(); + /** + * Get the amount of energy currently stored in the block. + * + * @return Energy stored in the block + */ + public int getStored(); - /** - * Set the amount of energy currently stored in the block. - * - * @param energy stored energy - */ - public void setStored(int energy); + /** + * Set the amount of energy currently stored in the block. + * + * @param energy stored energy + */ + public void setStored(int energy); - /** - * Add the specified amount of energy. - * - * Use negative values to decrease. - * - * @param amount of energy to add - * @return Energy stored in the block after adding the specified amount - */ - public int addEnergy(int amount); + /** + * Add the specified amount of energy. + *

+ * Use negative values to decrease. + * + * @param amount of energy to add + * @return Energy stored in the block after adding the specified amount + */ + public int addEnergy(int amount); - /** - * Get the maximum amount of energy the block can store. - * - * @return Maximum energy stored - */ - public int getCapacity(); + /** + * Get the maximum amount of energy the block can store. + * + * @return Maximum energy stored + */ + public int getCapacity(); - /** - * Get the block's energy output. - * - * @return Energy output in EU/t - */ - public int getOutput(); + /** + * Get the block's energy output. + * + * @return Energy output in EU/t + */ + public int getOutput(); - /** - * Get the block's energy output. - * - * @return Energy output in EU/t - */ - public double getOutputEnergyUnitsPerTick(); + /** + * Get the block's energy output. + * + * @return Energy output in EU/t + */ + public double getOutputEnergyUnitsPerTick(); - /** - * Get whether this block can have its energy used by an adjacent teleporter. - * - * @param side side the teleporter is draining energy from - * @return Whether the block is teleporter compatible - */ - public boolean isTeleporterCompatible(ForgeDirection side); + /** + * Get whether this block can have its energy used by an adjacent teleporter. + * + * @param side side the teleporter is draining energy from + * @return Whether the block is teleporter compatible + */ + public boolean isTeleporterCompatible(ForgeDirection side); } diff --git a/src/main/java/ic2/api/tile/IWrenchable.java b/src/main/java/ic2/api/tile/IWrenchable.java index 8fcbea5..0cbaba6 100644 --- a/src/main/java/ic2/api/tile/IWrenchable.java +++ b/src/main/java/ic2/api/tile/IWrenchable.java @@ -7,55 +7,55 @@ import net.minecraft.item.ItemStack; * Allows a tile entity to make use of the wrench's removal and rotation functions. */ public interface IWrenchable { - /** - * Determine if the wrench can be used to set the block's facing. - * Called before wrenchCanRemove(). - * - * @param entityPlayer player using the wrench, may be null - * @param side block's side the wrench was clicked on - * @return Whether the wrenching was done and the wrench should be damaged - */ - boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side); + /** + * Determine if the wrench can be used to set the block's facing. + * Called before wrenchCanRemove(). + * + * @param entityPlayer player using the wrench, may be null + * @param side block's side the wrench was clicked on + * @return Whether the wrenching was done and the wrench should be damaged + */ + boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side); - /** - * Get the block's facing. - * - * @return Block facing - */ - short getFacing(); + /** + * Get the block's facing. + * + * @return Block facing + */ + short getFacing(); - /** - * Set the block's facing - * - * @param facing facing to set the block to - */ - void setFacing(short facing); + /** + * Set the block's facing + * + * @param facing facing to set the block to + */ + void setFacing(short facing); - /** - * Determine if the wrench can be used to remove the block. - * Called if wrenchSetFacing fails. - * - * @param entityPlayer player using the wrench, may be null - * @return Whether the wrenching was done and the wrench should be damaged - */ - boolean wrenchCanRemove(EntityPlayer entityPlayer); + /** + * Determine if the wrench can be used to remove the block. + * Called if wrenchSetFacing fails. + * + * @param entityPlayer player using the wrench, may be null + * @return Whether the wrenching was done and the wrench should be damaged + */ + boolean wrenchCanRemove(EntityPlayer entityPlayer); - /** - * Determine the probability to drop the block as it is. - * The first entry in getDrops will be replaced by blockid:meta if the drop is successful. - * - * @return Probability from 0 to 1 - */ - float getWrenchDropRate(); + /** + * Determine the probability to drop the block as it is. + * The first entry in getDrops will be replaced by blockid:meta if the drop is successful. + * + * @return Probability from 0 to 1 + */ + float getWrenchDropRate(); - /** - * Determine the item the block will drop when the wrenching is successful. - * - * The ItemStack will be copied before creating the EntityItem. - * - * @param entityPlayer player using the wrench, may be null - * @return ItemStack to drop, may be null - */ - ItemStack getWrenchDrop(EntityPlayer entityPlayer); + /** + * Determine the item the block will drop when the wrenching is successful. + *

+ * The ItemStack will be copied before creating the EntityItem. + * + * @param entityPlayer player using the wrench, may be null + * @return ItemStack to drop, may be null + */ + ItemStack getWrenchDrop(EntityPlayer entityPlayer); } diff --git a/src/main/java/ic2/api/tile/package-info.java b/src/main/java/ic2/api/tile/package-info.java index 5ebc76e..08fa88b 100644 --- a/src/main/java/ic2/api/tile/package-info.java +++ b/src/main/java/ic2/api/tile/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.tile; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.tile; + import cpw.mods.fml.common.API; diff --git a/src/main/java/ic2/api/util/IKeyboard.java b/src/main/java/ic2/api/util/IKeyboard.java index ff6eaea..a5a77d6 100644 --- a/src/main/java/ic2/api/util/IKeyboard.java +++ b/src/main/java/ic2/api/util/IKeyboard.java @@ -3,12 +3,19 @@ package ic2.api.util; import net.minecraft.entity.player.EntityPlayer; public interface IKeyboard { - boolean isAltKeyDown(EntityPlayer player); - boolean isBoostKeyDown(EntityPlayer player); - boolean isForwardKeyDown(EntityPlayer player); - boolean isJumpKeyDown(EntityPlayer player); - boolean isModeSwitchKeyDown(EntityPlayer player); - boolean isSideinventoryKeyDown(EntityPlayer player); - boolean isHudModeKeyDown(EntityPlayer player); - boolean isSneakKeyDown(EntityPlayer player); + boolean isAltKeyDown(EntityPlayer player); + + boolean isBoostKeyDown(EntityPlayer player); + + boolean isForwardKeyDown(EntityPlayer player); + + boolean isJumpKeyDown(EntityPlayer player); + + boolean isModeSwitchKeyDown(EntityPlayer player); + + boolean isSideinventoryKeyDown(EntityPlayer player); + + boolean isHudModeKeyDown(EntityPlayer player); + + boolean isSneakKeyDown(EntityPlayer player); } diff --git a/src/main/java/ic2/api/util/Keys.java b/src/main/java/ic2/api/util/Keys.java index 84d1756..1db739b 100644 --- a/src/main/java/ic2/api/util/Keys.java +++ b/src/main/java/ic2/api/util/Keys.java @@ -2,5 +2,5 @@ package ic2.api.util; public class Keys { - public static IKeyboard instance; + public static IKeyboard instance; } \ No newline at end of file diff --git a/src/main/java/ic2/api/util/package-info.java b/src/main/java/ic2/api/util/package-info.java index 4dd2d93..b014181 100644 --- a/src/main/java/ic2/api/util/package-info.java +++ b/src/main/java/ic2/api/util/package-info.java @@ -1,4 +1,4 @@ -@API(apiVersion="1.0", owner="IC2", provides="IC2API") -package ic2.api.util; +@API(apiVersion = "1.0", owner = "IC2", provides = "IC2API") package ic2.api.util; + import cpw.mods.fml.common.API; diff --git a/src/main/java/tombenpotter/emt/ElectroMagicTools.java b/src/main/java/tombenpotter/emt/ElectroMagicTools.java index c84a109..46db384 100644 --- a/src/main/java/tombenpotter/emt/ElectroMagicTools.java +++ b/src/main/java/tombenpotter/emt/ElectroMagicTools.java @@ -40,67 +40,65 @@ import static tombenpotter.emt.common.util.TextHelper.localize; public class ElectroMagicTools { - @SidedProxy(clientSide = ModInformation.clientProxy, serverSide = ModInformation.commonProxy) - public static CommonProxy proxy; + @SidedProxy(clientSide = ModInformation.clientProxy, serverSide = ModInformation.commonProxy) + public static CommonProxy proxy; - public static CreativeTabs tabEMT = new CreativeTabEMT(ModInformation.modid + ".creativeTab"); - public static Logger logger = LogManager.getLogger(ModInformation.name); + public static CreativeTabs tabEMT = new CreativeTabEMT(ModInformation.modid + ".creativeTab"); + public static Logger logger = LogManager.getLogger(ModInformation.name); - @Instance(ModInformation.modid) - public static ElectroMagicTools instance; + @Instance(ModInformation.modid) + public static ElectroMagicTools instance; - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - ElectroMagicTools.logger.info(localize("console.EMT.preInit.begin")); + @EventHandler + public void preInit(FMLPreInitializationEvent event) { + ElectroMagicTools.logger.info(localize("console.EMT.preInit.begin")); - ElectroMagicTools.logger.info(localize("console.EMT.preInit.configRead")); - ConfigHandler.init(event.getSuggestedConfigurationFile()); + ElectroMagicTools.logger.info(localize("console.EMT.preInit.configRead")); + ConfigHandler.init(event.getSuggestedConfigurationFile()); + FMLCommonHandler.instance().bus().register(new EventHandlerEMT()); + RegistryHandler.registerIc2Registrys(); + RegistryHandler.registerVanillaRegistrys(); + EssentiasOutputs.addPrimalOutputs(); + EssentiasOutputs.addOutputs(); - FMLCommonHandler.instance().bus().register(new EventHandlerEMT()); - RegistryHandler.registerIc2Registrys(); + ElectroMagicTools.logger.info(localize("console.EMT.preInit.end")); + } - EssentiasOutputs.addPrimalOutputs(); - EssentiasOutputs.addOutputs(); + @EventHandler + public void load(FMLInitializationEvent event) { + ElectroMagicTools.logger.info(localize("console.EMT.init.begin")); - ElectroMagicTools.logger.info(localize("console.EMT.preInit.end")); - } + ElectroMagicTools.logger.info(localize("console.EMT.init.loadProxies")); + proxy.load(); + ElectroMagicTools.logger.info(localize("console.EMT.init.mobDrops")); + MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); + ElectroMagicTools.logger.info(localize("console.EMT.init.loot")); + DungeonChestGenerator.generateLoot(); + ElectroMagicTools.logger.info(localize("console.EMT.init.recipes")); + EMTInitRecipes.add(); + ElectroMagicTools.logger.info(localize("console.EMT.init.entities")); + EMTEntityRegistry.registerEMTEntities(); + ElectroMagicTools.logger.info(localize("console.EMT.init.guiHandler")); + NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy); - @EventHandler - public void load(FMLInitializationEvent event) { - ElectroMagicTools.logger.info(localize("console.EMT.init.begin")); + ElectroMagicTools.logger.info(localize("console.EMT.init.end")); + } - ElectroMagicTools.logger.info(localize("console.EMT.init.loadProxies")); - proxy.load(); - ElectroMagicTools.logger.info(localize("console.EMT.init.mobDrops")); - MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); - ElectroMagicTools.logger.info(localize("console.EMT.init.loot")); - DungeonChestGenerator.generateLoot(); - ElectroMagicTools.logger.info(localize("console.EMT.init.recipes")); - EMTInitRecipes.add(); - ElectroMagicTools.logger.info(localize("console.EMT.init.entities")); - EMTEntityRegistry.registerEMTEntities(); - ElectroMagicTools.logger.info(localize("console.EMT.init.guiHandler")); - NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy); + @EventHandler + public void postInit(FMLPostInitializationEvent event) { + ElectroMagicTools.logger.info(localize("console.EMT.postInit.begin")); - ElectroMagicTools.logger.info(localize("console.EMT.init.end")); - } + ElectroMagicTools.logger.info(localize("console.EMT.postInit.recipes")); + EMTPostInitRecipes.add(); + ElectroMagicTools.logger.info(localize("console.EMT.postInit.uumatter")); + UuMInfusionRecipes.add(); + RegistryHandler.registerIc2PostRegistrys(); - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - ElectroMagicTools.logger.info(localize("console.EMT.postInit.begin")); + ElectroMagicTools.logger.info(localize("console.EMT.postInit.end")); + } - ElectroMagicTools.logger.info(localize("console.EMT.postInit.recipes")); - EMTPostInitRecipes.add(); - ElectroMagicTools.logger.info(localize("console.EMT.postInit.uumatter")); - UuMInfusionRecipes.add(); - - RegistryHandler.registerIc2PostRegistrys(); - - ElectroMagicTools.logger.info(localize("console.EMT.postInit.end")); - } - - @EventHandler - public void onFMLServerStart(FMLServerStartingEvent event) { - event.registerServerCommand(new CommandOutputs()); - } + @EventHandler + public void onFMLServerStart(FMLServerStartingEvent event) { + event.registerServerCommand(new CommandOutputs()); + } } diff --git a/src/main/java/tombenpotter/emt/ModInformation.java b/src/main/java/tombenpotter/emt/ModInformation.java index d053368..0b1b59e 100644 --- a/src/main/java/tombenpotter/emt/ModInformation.java +++ b/src/main/java/tombenpotter/emt/ModInformation.java @@ -2,13 +2,13 @@ package tombenpotter.emt; public class ModInformation { - public static final String name = "Electro-Magic Tools"; - public static final String modid = "EMT"; - public static final String version = "2.0.0Alpha3"; - public static final String texturePath = "electromagictools"; - public static final String guiFactory = "tombenpotter.emt.client.gui.config.EMTGuiFactory"; - public static final String clientProxy = "tombenpotter.emt.proxies.ClientProxy"; - public static final String commonProxy = "tombenpotter.emt.proxies.CommonProxy"; - public static final String channel = "ElectroMagicTools"; - public static final String depend = "required-after:Thaumcraft ; required-after:IC2"; + public static final String name = "Electro-Magic Tools"; + public static final String modid = "EMT"; + public static final String version = "2.0.0Alpha3"; + public static final String texturePath = "electromagictools"; + public static final String guiFactory = "tombenpotter.emt.client.gui.config.EMTGuiFactory"; + public static final String clientProxy = "tombenpotter.emt.proxies.ClientProxy"; + public static final String commonProxy = "tombenpotter.emt.proxies.CommonProxy"; + public static final String channel = "ElectroMagicTools"; + public static final String depend = "required-after:Thaumcraft ; required-after:IC2"; } diff --git a/src/main/java/tombenpotter/emt/client/gui/GuiEtherealMacerator.java b/src/main/java/tombenpotter/emt/client/gui/GuiEtherealMacerator.java index 6ef8259..0c1f87e 100644 --- a/src/main/java/tombenpotter/emt/client/gui/GuiEtherealMacerator.java +++ b/src/main/java/tombenpotter/emt/client/gui/GuiEtherealMacerator.java @@ -24,23 +24,23 @@ import tombenpotter.emt.common.util.TextHelper; public class GuiEtherealMacerator extends GuiContainer { - public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) { - super(new ContainerEtheralMacerator(inventory, te)); - xSize = 176; - ySize = 165; - } + public GuiEtherealMacerator(InventoryPlayer inventory, TileEntityEtherealMacerator te) { + super(new ContainerEtheralMacerator(inventory, te)); + xSize = 176; + ySize = 165; + } - public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/etherealmacerator.png"); + public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/etherealmacerator.png"); - @Override - public void drawGuiContainerBackgroundLayer(float f, int j, int i) { - GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - } + @Override + public void drawGuiContainerBackgroundLayer(float f, int j, int i) { + GL11.glColor4f(1F, 1F, 1F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752); - this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.etherealMacerator.title"), 6, 6, 4210752); + this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/tombenpotter/emt/client/gui/GuiIndustrialWandRecharger.java b/src/main/java/tombenpotter/emt/client/gui/GuiIndustrialWandRecharger.java index 3e8c94e..bc87c48 100644 --- a/src/main/java/tombenpotter/emt/client/gui/GuiIndustrialWandRecharger.java +++ b/src/main/java/tombenpotter/emt/client/gui/GuiIndustrialWandRecharger.java @@ -24,23 +24,23 @@ import tombenpotter.emt.common.util.TextHelper; public class GuiIndustrialWandRecharger extends GuiContainer { - public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) { - super(new ContainerIndustrialWandRecharge(inventory, te)); - xSize = 176; - ySize = 165; - } + public GuiIndustrialWandRecharger(InventoryPlayer inventory, TileEntityIndustrialWandRecharge te) { + super(new ContainerIndustrialWandRecharge(inventory, te)); + xSize = 176; + ySize = 165; + } - public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/wandcharger.png"); + public static final ResourceLocation texture = new ResourceLocation(ModInformation.texturePath, "textures/guis/wandcharger.png"); - @Override - public void drawGuiContainerBackgroundLayer(float f, int j, int i) { - GL11.glColor4f(1F, 1F, 1F, 1F); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - } + @Override + public void drawGuiContainerBackgroundLayer(float f, int j, int i) { + GL11.glColor4f(1F, 1F, 1F, 1F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + } - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752); - this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.wandRecharge.title"), 6, 6, 4210752); + this.fontRendererObj.drawString(TextHelper.localize("gui.EMT.inventory"), 8, this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiConfig.java b/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiConfig.java index 092c97e..5b8d439 100644 --- a/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiConfig.java +++ b/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiConfig.java @@ -15,18 +15,19 @@ import static tombenpotter.emt.common.util.ConfigHandler.*; public class EMTGuiConfig extends GuiConfig { - public EMTGuiConfig(GuiScreen parentScreen) { - super(parentScreen, getConfigElements(parentScreen), ModInformation.modid, false, false, StatCollector.translateToLocal("gui." + ModInformation.modid + ".config.title")); - } + public EMTGuiConfig(GuiScreen parentScreen) { + super(parentScreen, getConfigElements(parentScreen), ModInformation.modid, false, false, StatCollector.translateToLocal("gui." + ModInformation.modid + ".config.title")); + } - @SuppressWarnings("rawtypes") - private static List getConfigElements(GuiScreen parent) { - List list = new ArrayList(); + @SuppressWarnings("rawtypes") + private static List getConfigElements(GuiScreen parent) { + List list = new ArrayList(); - list.add(new ConfigElement(config.getCategory(CATEGORY_VALUES.toLowerCase()))); - list.add(new ConfigElement(config.getCategory(CATEGORY_RESEARCH.toLowerCase()))); - list.add(new ConfigElement(config.getCategory(CATEGORY_OUTPUTS.toLowerCase()))); + list.add(new ConfigElement(config.getCategory(CATEGORY_RANDOM.toLowerCase()))); + list.add(new ConfigElement(config.getCategory(CATEGORY_VALUES.toLowerCase()))); + list.add(new ConfigElement(config.getCategory(CATEGORY_RESEARCH.toLowerCase()))); + list.add(new ConfigElement(config.getCategory(CATEGORY_OUTPUTS.toLowerCase()))); - return list; - } + return list; + } } diff --git a/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiFactory.java b/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiFactory.java index ba527be..232e7f9 100644 --- a/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiFactory.java +++ b/src/main/java/tombenpotter/emt/client/gui/config/EMTGuiFactory.java @@ -8,23 +8,23 @@ import java.util.Set; public class EMTGuiFactory implements IModGuiFactory { - @Override - public void initialize(Minecraft minecraftInstance) { + @Override + public void initialize(Minecraft minecraftInstance) { - } + } - @Override - public Class mainConfigGuiClass() { - return EMTGuiConfig.class; - } + @Override + public Class mainConfigGuiClass() { + return EMTGuiConfig.class; + } - @Override - public Set runtimeGuiCategories() { - return null; - } + @Override + public Set runtimeGuiCategories() { + return null; + } - @Override - public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { - return null; - } + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { + return null; + } } diff --git a/src/main/java/tombenpotter/emt/client/gui/container/ContainerEtheralMacerator.java b/src/main/java/tombenpotter/emt/client/gui/container/ContainerEtheralMacerator.java index e9fb59e..305e1f5 100644 --- a/src/main/java/tombenpotter/emt/client/gui/container/ContainerEtheralMacerator.java +++ b/src/main/java/tombenpotter/emt/client/gui/container/ContainerEtheralMacerator.java @@ -24,72 +24,72 @@ import tombenpotter.emt.common.module.ic2.tile.TileEntityEtherealMacerator; public class ContainerEtheralMacerator extends Container { - TileEntityEtherealMacerator te; + TileEntityEtherealMacerator te; - public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) { - this.te = ((TileEntityEtherealMacerator) te); - addSlotToContainer(new Slot(this.te, 0, 56, 26)); - addSlotToContainer(new SlotOutput(this.te, 2, 116, 26)); - addSlotToContainer(new SlotOutput(this.te, 1, 116, 53)); - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); - } - } + public ContainerEtheralMacerator(InventoryPlayer inventory, TileEntity te) { + this.te = ((TileEntityEtherealMacerator) te); + addSlotToContainer(new Slot(this.te, 0, 56, 26)); + addSlotToContainer(new SlotOutput(this.te, 2, 116, 26)); + addSlotToContainer(new SlotOutput(this.te, 1, 116, 53)); + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return this.te.isUseableByPlayer(player); - } + @Override + public boolean canInteractWith(EntityPlayer player) { + return this.te.isUseableByPlayer(player); + } - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(par2); - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); - if (par2 == 1) { - if (!this.mergeItemStack(itemstack1, 2, 38, true)) { - return null; - } + if (par2 == 1) { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) { + return null; + } - slot.onSlotChange(itemstack1, itemstack); - } else if (par2 != 0) { - if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { - if (!this.mergeItemStack(itemstack1, 0, 1, false)) { - return null; - } - } else if (par2 >= 2 && par2 < 29) { - if (!this.mergeItemStack(itemstack1, 29, 38, false)) { - return null; - } - } else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, 3, 38, false)) { - return null; - } + slot.onSlotChange(itemstack1, itemstack); + } else if (par2 != 0) { + if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return null; + } + } else if (par2 >= 2 && par2 < 29) { + if (!this.mergeItemStack(itemstack1, 29, 38, false)) { + return null; + } + } else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 3, 38, false)) { + return null; + } - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } + slot.onPickupFromSlot(par1EntityPlayer, itemstack1); + } - return itemstack; - } + return itemstack; + } } diff --git a/src/main/java/tombenpotter/emt/client/gui/container/ContainerIndustrialWandRecharge.java b/src/main/java/tombenpotter/emt/client/gui/container/ContainerIndustrialWandRecharge.java index 23ee72c..025ad59 100644 --- a/src/main/java/tombenpotter/emt/client/gui/container/ContainerIndustrialWandRecharge.java +++ b/src/main/java/tombenpotter/emt/client/gui/container/ContainerIndustrialWandRecharge.java @@ -22,73 +22,73 @@ import tombenpotter.emt.common.module.ic2.tile.TileEntityIndustrialWandRecharge; public class ContainerIndustrialWandRecharge extends Container { - TileEntityIndustrialWandRecharge charger; + TileEntityIndustrialWandRecharge charger; - public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) { - this.charger = entity; + public ContainerIndustrialWandRecharge(InventoryPlayer invPlayer, TileEntityIndustrialWandRecharge entity) { + this.charger = entity; - for (int x = 0; x < 9; x++) { - this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142)); - } + for (int x = 0; x < 9; x++) { + this.addSlotToContainer(new Slot(invPlayer, x, 8 + x * 18, 142)); + } - for (int y = 0; y < 3; y++) { - for (int x = 0; x < 9; x++) { - this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18)); - } - } + for (int y = 0; y < 3; y++) { + for (int x = 0; x < 9; x++) { + this.addSlotToContainer(new Slot(invPlayer, 9 + x + y * 9, 8 + x * 18, 84 + y * 18)); + } + } - this.addSlotToContainer(new Slot(charger, 0, 80, 35)); - } + this.addSlotToContainer(new Slot(charger, 0, 80, 35)); + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return charger.isUseableByPlayer(player); - } + @Override + public boolean canInteractWith(EntityPlayer player) { + return charger.isUseableByPlayer(player); + } - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(par2); - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); - if (par2 == 1) { - if (!this.mergeItemStack(itemstack1, 2, 38, true)) { - return null; - } + if (par2 == 1) { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) { + return null; + } - slot.onSlotChange(itemstack1, itemstack); - } else if (par2 != 0) { - if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { - if (!this.mergeItemStack(itemstack1, 0, 1, false)) { - return null; - } - } else if (par2 >= 2 && par2 < 29) { - if (!this.mergeItemStack(itemstack1, 29, 38, false)) { - return null; - } - } else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, 2, 38, false)) { - return null; - } + slot.onSlotChange(itemstack1, itemstack); + } else if (par2 != 0) { + if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return null; + } + } else if (par2 >= 2 && par2 < 29) { + if (!this.mergeItemStack(itemstack1, 29, 38, false)) { + return null; + } + } else if (par2 >= 29 && par2 < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) { + return null; + } + } else if (!this.mergeItemStack(itemstack1, 2, 38, false)) { + return null; + } - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } + if (itemstack1.stackSize == 0) { + slot.putStack((ItemStack) null); + } else { + slot.onSlotChanged(); + } - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } + if (itemstack1.stackSize == itemstack.stackSize) { + return null; + } - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } + slot.onPickupFromSlot(par1EntityPlayer, itemstack1); + } - return itemstack; - } + return itemstack; + } } diff --git a/src/main/java/tombenpotter/emt/client/renderer/RenderLaser.java b/src/main/java/tombenpotter/emt/client/renderer/RenderLaser.java index a56f850..1102389 100644 --- a/src/main/java/tombenpotter/emt/client/renderer/RenderLaser.java +++ b/src/main/java/tombenpotter/emt/client/renderer/RenderLaser.java @@ -23,70 +23,70 @@ import tombenpotter.emt.common.module.base.entities.EntityLaser; public class RenderLaser extends Render { - private static final ResourceLocation laserTexture = new ResourceLocation(ModInformation.texturePath, "textures/models/lasermodel.png"); + private static final ResourceLocation laserTexture = new ResourceLocation(ModInformation.texturePath, "textures/models/lasermodel.png"); - public void renderArrow(EntityLaser entityLaser, double par2, double par4, double par6, float par8, float par9) { + public void renderArrow(EntityLaser entityLaser, double par2, double par4, double par6, float par8, float par9) { - this.bindEntityTexture(entityLaser); - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glRotatef(entityLaser.prevRotationYaw + (entityLaser.rotationYaw - entityLaser.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(entityLaser.prevRotationPitch + (entityLaser.rotationPitch - entityLaser.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); - Tessellator tessellator = Tessellator.instance; - byte b0 = 0; - float f2 = 0.4F; - float f3 = 0.7F; - float f4 = (float) (0 + b0 * 10) / 32.0F; - float f5 = (float) (5 + b0 * 10) / 32.0F; - float f6 = 0.0F; - float f7 = 0.15625F; - float f8 = (float) (5 + b0 * 10) / 32.0F; - float f9 = (float) (10 + b0 * 10) / 32.0F; - float f10 = 0.05625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.bindEntityTexture(entityLaser); + GL11.glPushMatrix(); + GL11.glTranslatef((float) par2, (float) par4, (float) par6); + GL11.glRotatef(entityLaser.prevRotationYaw + (entityLaser.rotationYaw - entityLaser.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(entityLaser.prevRotationPitch + (entityLaser.rotationPitch - entityLaser.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); + Tessellator tessellator = Tessellator.instance; + byte b0 = 0; + float f2 = 0.4F; + float f3 = 0.7F; + float f4 = (float) (0 + b0 * 10) / 32.0F; + float f5 = (float) (5 + b0 * 10) / 32.0F; + float f6 = 0.0F; + float f7 = 0.15625F; + float f8 = (float) (5 + b0 * 10) / 32.0F; + float f9 = (float) (10 + b0 * 10) / 32.0F; + float f10 = 0.05625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); - GL11.glScalef(f10, f10, f10); - GL11.glTranslatef(-4.0F, 0.0F, 0.0F); - GL11.glNormal3f(f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9); - tessellator.draw(); - GL11.glNormal3f(-f10, 0.0F, 0.0F); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8); - tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8); - tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9); - tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9); - tessellator.draw(); + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9); + tessellator.draw(); + GL11.glNormal3f(-f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9); + tessellator.draw(); - for (int i = 0; i < 4; ++i) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, f10); - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4); - tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4); - tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5); - tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5); - tessellator.draw(); - } + for (int i = 0; i < 4; ++i) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4); + tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4); + tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5); + tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5); + tessellator.draw(); + } - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } - protected ResourceLocation getArrowTextures(EntityLaser entityLaser) { - return laserTexture; - } + protected ResourceLocation getArrowTextures(EntityLaser entityLaser) { + return laserTexture; + } - protected ResourceLocation getEntityTexture(Entity par1Entity) { - return this.getArrowTextures((EntityLaser) par1Entity); - } + protected ResourceLocation getEntityTexture(Entity par1Entity) { + return this.getArrowTextures((EntityLaser) par1Entity); + } - public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - this.renderArrow((EntityLaser) par1Entity, par2, par4, par6, par8, par9); - } + public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + this.renderArrow((EntityLaser) par1Entity, par2, par4, par6, par8, par9); + } } diff --git a/src/main/java/tombenpotter/emt/common/commands/CommandOutputs.java b/src/main/java/tombenpotter/emt/common/commands/CommandOutputs.java index cb25f9c..4c7442e 100644 --- a/src/main/java/tombenpotter/emt/common/commands/CommandOutputs.java +++ b/src/main/java/tombenpotter/emt/common/commands/CommandOutputs.java @@ -16,71 +16,71 @@ import java.util.List; public class CommandOutputs extends CommandBase { - public String text; + public String text; - @Override - public String getCommandName() { - return "emt_outputs"; - } + @Override + public String getCommandName() { + return "emt_outputs"; + } - @Override - public String getCommandUsage(ICommandSender p_71518_1_) { - return "/emt_outputs"; - } + @Override + public String getCommandUsage(ICommandSender p_71518_1_) { + return "/emt_outputs"; + } - @Override - public boolean canCommandSenderUseCommand(ICommandSender par1iCommandSender) { - return true; - } + @Override + public boolean canCommandSenderUseCommand(ICommandSender par1iCommandSender) { + return true; + } - @Override - public List addTabCompletionOptions(ICommandSender command, String[] stringArray) { - return null; - } + @Override + public List addTabCompletionOptions(ICommandSender command, String[] stringArray) { + return null; + } - @Override - public int compareTo(Object object) { - if (object instanceof ICommand) { - return this.compareTo((ICommand) object); - } else { - return 0; - } - } + @Override + public int compareTo(Object object) { + if (object instanceof ICommand) { + return this.compareTo((ICommand) object); + } else { + return 0; + } + } - @Override - public void processCommand(ICommandSender command, String[] astring) { - text = "EU Ouput per Essentia: "; - Collection aspectCollection = Aspect.aspects.values(); - for (Aspect aspect : aspectCollection) { - String text2 = addStrings(text, (aspect.getTag() + ": " + String.valueOf(EssentiasOutputs.outputs.get(aspect.getTag())) + "\n")); - text = text2; - } - addOutputsBook("Essentia Outputs Book", text, command, astring); - } + @Override + public void processCommand(ICommandSender command, String[] astring) { + text = "EU Ouput per Essentia: "; + Collection aspectCollection = Aspect.aspects.values(); + for (Aspect aspect : aspectCollection) { + String text2 = addStrings(text, (aspect.getTag() + ": " + String.valueOf(EssentiasOutputs.outputs.get(aspect.getTag())) + "\n")); + text = text2; + } + addOutputsBook("Essentia Outputs Book", text, command, astring); + } - public void addOutputsBook(String title, String text, ICommandSender command, String[] astring) { - ItemStack book = new ItemStack(Items.written_book); - book.setTagInfo("author", new NBTTagString("Tombenpotter")); - book.setTagInfo("title", new NBTTagString(title)); - NBTTagCompound nbttagcompound = book.getTagCompound(); - NBTTagList bookPages = new NBTTagList(); + public void addOutputsBook(String title, String text, ICommandSender command, String[] astring) { + ItemStack book = new ItemStack(Items.written_book); + book.setTagInfo("author", new NBTTagString("Tombenpotter")); + book.setTagInfo("title", new NBTTagString(title)); + NBTTagCompound nbttagcompound = book.getTagCompound(); + NBTTagList bookPages = new NBTTagList(); - bookPages.appendTag(new NBTTagString(text.substring(0, 237))); - bookPages.appendTag(new NBTTagString(text.substring(237, 476))); - bookPages.appendTag(new NBTTagString(text.substring(476, 709))); - bookPages.appendTag(new NBTTagString(text.substring(709))); + bookPages.appendTag(new NBTTagString(text.substring(0, 237))); + bookPages.appendTag(new NBTTagString(text.substring(237, 476))); + bookPages.appendTag(new NBTTagString(text.substring(476, 709))); + bookPages.appendTag(new NBTTagString(text.substring(709))); - nbttagcompound.setTag("pages", bookPages); + nbttagcompound.setTag("pages", bookPages); - System.out.println(text.length()); + System.out.println(text.length()); - if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory.addItemStackToInventory(book)) - command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0); - } + if (!command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).inventory.addItemStackToInventory(book)) + command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName()).entityDropItem(book, 0); + } - public String addStrings(String string1, String string2) { - String result = string1 + string2; - return result; - } + public String addStrings(String string1, String string2) { + String result = string1 + string2; + return result; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/EMTEntityRegistry.java b/src/main/java/tombenpotter/emt/common/module/base/EMTEntityRegistry.java index feb2f69..f699e5e 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/EMTEntityRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/base/EMTEntityRegistry.java @@ -23,30 +23,30 @@ import tombenpotter.emt.common.module.base.entities.EntityLaser; public class EMTEntityRegistry { - private static int startEID = 300; - private static int entityIDs = 0; - private static final Class ARCHER_CLASS = EntityArcher.class; + private static int startEID = 300; + private static int entityIDs = 0; + private static final Class ARCHER_CLASS = EntityArcher.class; - private static int getUniqueEntityID() { + private static int getUniqueEntityID() { - do { - startEID++; - } while (EntityList.getStringFromID(startEID) != null); - return startEID; - } + do { + startEID++; + } while (EntityList.getStringFromID(startEID) != null); + return startEID; + } - @SuppressWarnings("unchecked") - public static void registerEntityEgg(Class entity, int colPrim, int colSec) { - int id = getUniqueEntityID(); - EntityList.IDtoClassMapping.put(id, entity); - EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec)); - return; - } + @SuppressWarnings("unchecked") + public static void registerEntityEgg(Class entity, int colPrim, int colSec) { + int id = getUniqueEntityID(); + EntityList.IDtoClassMapping.put(id, entity); + EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec)); + return; + } - public static void registerEMTEntities() { + public static void registerEMTEntities() { - EntityRegistry.registerModEntity(EntityLaser.class, "entityLaser", entityIDs++, ElectroMagicTools.instance, 80, 3, true); - EntityRegistry.registerModEntity(EntityArcher.class, "entityArcher", entityIDs++, ElectroMagicTools.instance, 80, 3, true); - registerEntityEgg(ARCHER_CLASS, 0x99111F, 0xE5685); - } + EntityRegistry.registerModEntity(EntityLaser.class, "entityLaser", entityIDs++, ElectroMagicTools.instance, 80, 3, true); + EntityRegistry.registerModEntity(EntityArcher.class, "entityArcher", entityIDs++, ElectroMagicTools.instance, 80, 3, true); + registerEntityEgg(ARCHER_CLASS, 0x99111F, 0xE5685); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/entities/EntityArcher.java b/src/main/java/tombenpotter/emt/common/module/base/entities/EntityArcher.java index df01bd9..44ca599 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/entities/EntityArcher.java +++ b/src/main/java/tombenpotter/emt/common/module/base/entities/EntityArcher.java @@ -37,93 +37,93 @@ import net.minecraftforge.common.IExtendedEntityProperties; public class EntityArcher extends EntitySnowman implements IExtendedEntityProperties { - public EntityArcher(World par1World) { - super(par1World); - this.isImmuneToFire = true; - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); - this.tasks.addTask(4, new EntityAIWander(this, 0.30D)); - } + public EntityArcher(World par1World) { + super(par1World); + this.isImmuneToFire = true; + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); + this.tasks.addTask(4, new EntityAIWander(this, 0.30D)); + } - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); - } + @Override + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.30D); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40.0D); + } - @Override - public void onDeath(DamageSource par1DamageSource) { - super.onDeath(par1DamageSource); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true); - this.setDead(); - } + @Override + public void onDeath(DamageSource par1DamageSource) { + super.onDeath(par1DamageSource); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1, true); + this.setDead(); + } - @Override - protected Item getDropItem() { - return Items.arrow; - } + @Override + protected Item getDropItem() { + return Items.arrow; + } - @Override - protected void dropFewItems(boolean par1, int par2) { - int j; - int k; + @Override + protected void dropFewItems(boolean par1, int par2) { + int j; + int k; - j = this.rand.nextInt(3 + par2); + j = this.rand.nextInt(3 + par2); - for (k = 0; k < j; ++k) { - this.dropItem(Items.arrow, 1); - } - j = this.rand.nextInt(3 + par2); + for (k = 0; k < j; ++k) { + this.dropItem(Items.arrow, 1); + } + j = this.rand.nextInt(3 + par2); - for (k = 0; k < j; ++k) { - this.dropItem(Items.bone, 1); - } - } + for (k = 0; k < j; ++k) { + this.dropItem(Items.bone, 1); + } + } - @Override - protected void dropRareDrop(int par1) { - this.entityDropItem(new ItemStack(Blocks.web, 1, 1), 0.0F); - } + @Override + protected void dropRareDrop(int par1) { + this.entityDropItem(new ItemStack(Blocks.web, 1, 1), 0.0F); + } - protected void addRandomArmor() { - super.addRandomArmor(); - this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); - } + protected void addRandomArmor() { + super.addRandomArmor(); + this.setCurrentItemOrArmor(0, new ItemStack(Items.bow)); + } - @Override - public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { - EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); - int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); - int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); - entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); + @Override + public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { + EntityArrow entityarrow = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float) (14 - this.worldObj.difficultySetting.getDifficultyId() * 4)); + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); + entityarrow.setDamage((double) (par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.difficultySetting.getDifficultyId() * 0.11F)); - if (i > 0) { - entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D); - } + if (i > 0) { + entityarrow.setDamage(entityarrow.getDamage() + (double) i * 0.5D + 0.5D); + } - if (j > 0) { - entityarrow.setKnockbackStrength(j); - } + if (j > 0) { + entityarrow.setKnockbackStrength(j); + } - if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) { - entityarrow.setFire(100); - } + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) { + entityarrow.setFire(100); + } - this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - this.worldObj.spawnEntityInWorld(entityarrow); - } + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entityarrow); + } - @Override - public void saveNBTData(NBTTagCompound compound) { - } + @Override + public void saveNBTData(NBTTagCompound compound) { + } - @Override - public void loadNBTData(NBTTagCompound compound) { - } + @Override + public void loadNBTData(NBTTagCompound compound) { + } - @Override - public void init(Entity entity, World world) { - } + @Override + public void init(Entity entity, World world) { + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/entities/EntityLaser.java b/src/main/java/tombenpotter/emt/common/module/base/entities/EntityLaser.java index ef21ed2..4c36f9f 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/entities/EntityLaser.java +++ b/src/main/java/tombenpotter/emt/common/module/base/entities/EntityLaser.java @@ -31,320 +31,320 @@ import java.util.List; public class EntityLaser extends Entity implements IProjectile { - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private int inData; - private boolean inGround; + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile; + private int inData; + private boolean inGround; - public Entity shootingEntity; - private int ticksInGround; - private int ticksInAir; + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; - public EntityLaser(World par1World) { - super(par1World); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - } + public EntityLaser(World par1World) { + super(par1World); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } - public EntityLaser(World par1World, double par2, double par4, double par6) { - super(par1World); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - this.setPosition(par2, par4, par6); - this.yOffset = 0.0F; - } + public EntityLaser(World par1World, double par2, double par4, double par6) { + super(par1World); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + } - public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) { - super(par1World); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = par2EntityLivingBase; + public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) { + super(par1World); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = par2EntityLivingBase; - this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; - double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; - double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 3.0F) - this.posY; - double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; - double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); + this.posY = par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; + double d0 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; + double d1 = par3EntityLivingBase.boundingBox.minY + (double) (par3EntityLivingBase.height / 3.0F) - this.posY; + double d2 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; + double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2); - if (d3 >= 1.0E-7D) { - float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; - float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); - double d4 = d0 / d3; - double d5 = d2 / d3; - this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); - this.yOffset = 0.0F; - float f4 = (float) d3 * 0.2F; - this.setThrowableHeading(d0, d1 + (double) f4, d2, par4, par5); - } - } + if (d3 >= 1.0E-7D) { + float f2 = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F; + float f3 = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI)); + double d4 = d0 / d3; + double d5 = d2 / d3; + this.setLocationAndAngles(par2EntityLivingBase.posX + d4, this.posY, par2EntityLivingBase.posZ + d5, f2, f3); + this.yOffset = 0.0F; + float f4 = (float) d3 * 0.2F; + this.setThrowableHeading(d0, d1 + (double) f4, d2, par4, par5); + } + } - public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3) { - super(par1World); - this.renderDistanceWeight = 10.0D; - this.shootingEntity = par2EntityLivingBase; + public EntityLaser(World par1World, EntityLivingBase par2EntityLivingBase, float par3) { + super(par1World); + this.renderDistanceWeight = 10.0D; + this.shootingEntity = par2EntityLivingBase; - this.setSize(0.5F, 0.5F); - this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); - this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - this.posY -= 0.10000000149011612D; - this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); - this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); - this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); - this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F); - } + this.setSize(0.5F, 0.5F); + this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double) par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); + this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + this.posY -= 0.10000000149011612D; + this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); + this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI)); + this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI)); + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F); + } - protected void entityInit() { - this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); - } + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte) 0)); + } - public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { - float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); - par1 /= (double) f2; - par3 /= (double) f2; - par5 /= (double) f2; - par1 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; - par3 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; - par5 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; - par1 *= (double) par7; - par3 *= (double) par7; - par5 *= (double) par7; - this.motionX = par1; - this.motionY = par3; - this.motionZ = par5; - float f3 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); - this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f3) * 180.0D / Math.PI); - this.ticksInGround = 0; - } + public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { + float f2 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); + par1 /= (double) f2; + par3 /= (double) f2; + par5 /= (double) f2; + par1 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; + par3 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; + par5 += this.rand.nextGaussian() * (double) (this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double) par8; + par1 *= (double) par7; + par3 *= (double) par7; + par5 *= (double) par7; + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + float f3 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f3) * 180.0D / Math.PI); + this.ticksInGround = 0; + } - @SideOnly(Side.CLIENT) - public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { - this.setPosition(par1, par3, par5); - this.setRotation(par7, par8); - } + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { + this.setPosition(par1, par3, par5); + this.setRotation(par7, par8); + } - @SideOnly(Side.CLIENT) - public void setVelocity(double par1, double par3, double par5) { - this.motionX = par1; - this.motionY = par3; - this.motionZ = par5; + @SideOnly(Side.CLIENT) + public void setVelocity(double par1, double par3, double par5) { + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { - float f = MathHelper.sqrt_double(par1 + par5); - this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f) / Math.PI); - this.prevRotationPitch = this.rotationPitch; - this.prevRotationYaw = this.rotationYaw; - this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - this.ticksInGround = 0; - } - } + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(par1 + par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, (double) f) / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } - @SuppressWarnings("rawtypes") - public void onUpdate() { - super.onUpdate(); + @SuppressWarnings("rawtypes") + public void onUpdate() { + super.onUpdate(); - if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { - float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f) * 180.0D / Math.PI); - } + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f) * 180.0D / Math.PI); + } - Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); - if (block.getMaterial() != Material.air) { - block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); - AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); + Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + if (block.getMaterial() != Material.air) { + block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB axisalignedbb = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); - if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { - this.inGround = true; - } - } - Block i = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } + Block i = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); - i.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); - AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); + i.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB axisalignedbb = i.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); - if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { - this.inGround = true; - } + if (axisalignedbb != null && axisalignedbb.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } - if (this.inGround) { - Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); - int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true); - this.setDead(); - if (j == this.inTile && k == this.inData) { - ++this.ticksInGround; + if (this.inGround) { + Block j = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + int k = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true); + this.setDead(); + if (j == this.inTile && k == this.inData) { + ++this.ticksInGround; - if (this.ticksInGround == 1200) { - this.setDead(); - } - } else { - this.inGround = false; - this.motionX *= (double) (this.rand.nextFloat() * 0.2F); - this.motionY *= (double) (this.rand.nextFloat() * 0.2F); - this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); - this.ticksInGround = 0; - this.ticksInAir = 0; - } - } else { - ++this.ticksInAir; - Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); - vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + if (this.ticksInGround == 1200) { + this.setDead(); + } + } else { + this.inGround = false; + this.motionX *= (double) (this.rand.nextFloat() * 0.2F); + this.motionY *= (double) (this.rand.nextFloat() * 0.2F); + this.motionZ *= (double) (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } else { + ++this.ticksInAir; + Vec3 vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingobjectposition = this.worldObj.func_147447_a(vec31, vec3, false, true, false); + vec31 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + vec3 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - if (movingobjectposition != null) { - vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - } + if (movingobjectposition != null) { + vec3 = Vec3.createVectorHelper(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); + } - Entity entity = null; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double d0 = 0.0D; - int l; - float f1; + Entity entity = null; + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double d0 = 0.0D; + int l; + float f1; - for (l = 0; l < list.size(); ++l) { - Entity entity1 = (Entity) list.get(l); + for (l = 0; l < list.size(); ++l) { + Entity entity1 = (Entity) list.get(l); - if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { - f1 = 0.3F; - AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) f1, (double) f1, (double) f1); - MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31); + if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) { + f1 = 0.3F; + AxisAlignedBB axisalignedbb1 = entity1.boundingBox.expand((double) f1, (double) f1, (double) f1); + MovingObjectPosition movingobjectposition1 = axisalignedbb1.calculateIntercept(vec3, vec31); - if (movingobjectposition1 != null) { - double d1 = vec3.distanceTo(movingobjectposition1.hitVec); + if (movingobjectposition1 != null) { + double d1 = vec3.distanceTo(movingobjectposition1.hitVec); - if (d1 < d0 || d0 == 0.0D) { - entity = entity1; - d0 = d1; - } - } - } - } + if (d1 < d0 || d0 == 0.0D) { + entity = entity1; + d0 = d1; + } + } + } + } - if (entity != null) { - movingobjectposition = new MovingObjectPosition(entity); - } + if (entity != null) { + movingobjectposition = new MovingObjectPosition(entity); + } - if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { - EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; + if (movingobjectposition != null && movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityPlayer) { + EntityPlayer entityplayer = (EntityPlayer) movingobjectposition.entityHit; - if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { - movingobjectposition = null; - } - } + if (entityplayer.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer) this.shootingEntity).canAttackPlayer(entityplayer)) { + movingobjectposition = null; + } + } - float f2; - float f3; + float f2; + float f3; - if (movingobjectposition != null) { - if (movingobjectposition.entityHit != null) { - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + if (movingobjectposition != null) { + if (movingobjectposition.entityHit != null) { + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - { - this.motionX *= -0.10000000149011612D; - this.motionY *= -0.10000000149011612D; - this.motionZ *= -0.10000000149011612D; - this.rotationYaw += 180.0F; - this.prevRotationYaw += 180.0F; - this.ticksInAir = 0; - } - } else { - this.xTile = movingobjectposition.blockX; - this.yTile = movingobjectposition.blockY; - this.zTile = movingobjectposition.blockZ; - this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); - this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); - this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX)); - this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY)); - this.motionZ = (double) ((float) (movingobjectposition.hitVec.zCoord - this.posZ)); - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - this.posX -= this.motionX / (double) f2 * 0.05000000074505806D; - this.posY -= this.motionY / (double) f2 * 0.05000000074505806D; - this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D; - this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); - this.inGround = true; - } - } + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } else { + this.xTile = movingobjectposition.blockX; + this.yTile = movingobjectposition.blockY; + this.zTile = movingobjectposition.blockZ; + this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + this.motionX = (double) ((float) (movingobjectposition.hitVec.xCoord - this.posX)); + this.motionY = (double) ((float) (movingobjectposition.hitVec.yCoord - this.posY)); + this.motionZ = (double) ((float) (movingobjectposition.hitVec.zCoord - this.posZ)); + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / (double) f2 * 0.05000000074505806D; + this.posY -= this.motionY / (double) f2 * 0.05000000074505806D; + this.posZ -= this.motionZ / (double) f2 * 0.05000000074505806D; + this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + } + } - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; - f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { - ; - } + for (this.rotationPitch = (float) (Math.atan2(this.motionY, (double) f2) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { + ; + } - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } + while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } - while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } + while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } + while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f4 = 0.99F; - f1 = 0.05F; + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float f4 = 0.99F; + f1 = 0.05F; - if (this.isInWater()) { - for (int j1 = 0; j1 < 4; ++j1) { - f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ); - } + if (this.isInWater()) { + for (int j1 = 0; j1 < 4; ++j1) { + f3 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double) f3, this.posY - this.motionY * (double) f3, this.posZ - this.motionZ * (double) f3, this.motionX, this.motionY, this.motionZ); + } - f4 = 0.8F; - } + f4 = 0.8F; + } - this.motionX *= (double) f4; - this.motionY *= (double) f4; - this.motionZ *= (double) f4; - this.motionY -= (double) f1; - this.setPosition(this.posX, this.posY, this.posZ); - } - } + this.motionX *= (double) f4; + this.motionY *= (double) f4; + this.motionZ *= (double) f4; + this.motionY -= (double) f1; + this.setPosition(this.posX, this.posY, this.posZ); + } + } - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setShort("xTile", (short) this.xTile); - par1NBTTagCompound.setShort("yTile", (short) this.yTile); - par1NBTTagCompound.setShort("zTile", (short) this.zTile); - par1NBTTagCompound.setByte("inTile", (byte) Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inData", (byte) this.inData); - par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); - } + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { + par1NBTTagCompound.setShort("xTile", (short) this.xTile); + par1NBTTagCompound.setShort("yTile", (short) this.yTile); + par1NBTTagCompound.setShort("zTile", (short) this.zTile); + par1NBTTagCompound.setByte("inTile", (byte) Block.getIdFromBlock(this.inTile)); + par1NBTTagCompound.setByte("inData", (byte) this.inData); + par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + } - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inData = par1NBTTagCompound.getByte("inData") & 255; - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - } + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { + this.xTile = par1NBTTagCompound.getShort("xTile"); + this.yTile = par1NBTTagCompound.getShort("yTile"); + this.zTile = par1NBTTagCompound.getShort("zTile"); + this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); + this.inData = par1NBTTagCompound.getByte("inData") & 255; + this.inGround = par1NBTTagCompound.getByte("inGround") == 1; + } - public void onCollide(Entity par1Entity) { - if (!this.worldObj.isRemote) - ; - { - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true); - } - } + public void onCollide(Entity par1Entity) { + if (!this.worldObj.isRemote) + ; + { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 3, true); + } + } - @SideOnly(Side.CLIENT) - public float getShadowSize() { - return 0.0F; - } + @SideOnly(Side.CLIENT) + public float getShadowSize() { + return 0.0F; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/ItemEMTBaubles.java b/src/main/java/tombenpotter/emt/common/module/base/items/ItemEMTBaubles.java index 4658573..4189753 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/items/ItemEMTBaubles.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/ItemEMTBaubles.java @@ -28,186 +28,186 @@ import java.util.Random; public class ItemEMTBaubles extends Item implements IBauble { - public IIcon[] icon = new IIcon[16]; - public static int wornTick; - public Random random = new Random(); + public IIcon[] icon = new IIcon[16]; + public static int wornTick; + public Random random = new Random(); - public ItemEMTBaubles() { - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(0); - this.setMaxStackSize(1); - this.setUnlocalizedName(ModInformation.modid); - setHasSubtypes(true); + public ItemEMTBaubles() { + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(0); + this.setMaxStackSize(1); + this.setUnlocalizedName(ModInformation.modid); + setHasSubtypes(true); - wornTick = 0; - } + wornTick = 0; + } - @Override - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "euMaker.armor"; - break; - } - case 1: { - name = "euMaker.inventory"; - break; - } - case 2: { - name = "oneRing"; - break; - } - default: - name = "nothing"; - break; - } - return getUnlocalizedName() + "." + name; - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + String name = ""; + switch (itemstack.getItemDamage()) { + case 0: { + name = "euMaker.armor"; + break; + } + case 1: { + name = "euMaker.inventory"; + break; + } + case 2: { + name = "oneRing"; + break; + } + default: + name = "nothing"; + break; + } + return getUnlocalizedName() + "." + name; + } - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister ri) { - this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":armoreumaker"); - this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":inventoryeumaker"); - this.icon[2] = ri.registerIcon(ModInformation.texturePath + ":onering"); - } + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister ri) { + this.icon[0] = ri.registerIcon(ModInformation.texturePath + ":armoreumaker"); + this.icon[1] = ri.registerIcon(ModInformation.texturePath + ":inventoryeumaker"); + this.icon[2] = ri.registerIcon(ModInformation.texturePath + ":onering"); + } - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int meta) { - return this.icon[meta]; - } + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int meta) { + return this.icon[meta]; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { - list.add(new ItemStack(this, 1, 0)); - list.add(new ItemStack(this, 1, 1)); - list.add(new ItemStack(this, 1, 2)); - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List list) { + list.add(new ItemStack(this, 1, 0)); + list.add(new ItemStack(this, 1, 1)); + list.add(new ItemStack(this, 1, 2)); + } - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack stack) { - if (stack.getItemDamage() == 2) { - return true; - } else { - return false; - } - } + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack stack) { + if (stack.getItemDamage() == 2) { + return true; + } else { + return false; + } + } - @Override - public BaubleType getBaubleType(ItemStack stack) { - if (stack.getItemDamage() <= 2) { - return BaubleType.RING; - } else { - return null; - } - } + @Override + public BaubleType getBaubleType(ItemStack stack) { + if (stack.getItemDamage() <= 2) { + return BaubleType.RING; + } else { + return null; + } + } - @Override - public void onWornTick(ItemStack stack, EntityLivingBase player) { - if (!player.worldObj.isRemote) { - if (stack != null) { - if (stack.getItemDamage() == 0) { - if (player instanceof EntityPlayer) { - int energyLeft = ConfigHandler.armorBaubleProduction; - for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) { - if (energyLeft > 0) { - if ((((EntityPlayer) player).inventory.armorInventory[i] != null) && (((EntityPlayer) player).inventory.armorInventory[i].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.armorInventory[i], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } - } - } - } - } - if (stack != null) { - if (stack.getItemDamage() == 1) { - if (player instanceof EntityPlayer) { - int energyLeft = ConfigHandler.inventoryBaubleProdution; - for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) { - if (energyLeft > 0) { - if ((((EntityPlayer) player).inventory.mainInventory[i] != null) && (((EntityPlayer) player).inventory.mainInventory[i].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.mainInventory[i], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } - } - } - } - } + @Override + public void onWornTick(ItemStack stack, EntityLivingBase player) { + if (!player.worldObj.isRemote) { + if (stack != null) { + if (stack.getItemDamage() == 0) { + if (player instanceof EntityPlayer) { + int energyLeft = ConfigHandler.armorBaubleProduction; + for (int i = 0; i < ((EntityPlayer) player).inventory.armorInventory.length; i++) { + if (energyLeft > 0) { + if ((((EntityPlayer) player).inventory.armorInventory[i] != null) && (((EntityPlayer) player).inventory.armorInventory[i].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.armorInventory[i], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } + } + } + } + } + if (stack != null) { + if (stack.getItemDamage() == 1) { + if (player instanceof EntityPlayer) { + int energyLeft = ConfigHandler.inventoryBaubleProdution; + for (int i = 0; i < ((EntityPlayer) player).inventory.mainInventory.length; i++) { + if (energyLeft > 0) { + if ((((EntityPlayer) player).inventory.mainInventory[i] != null) && (((EntityPlayer) player).inventory.mainInventory[i].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(((EntityPlayer) player).inventory.mainInventory[i], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } + } + } + } + } - if (stack != null && stack.getItemDamage() == 2) { - if (player instanceof EntityPlayer) { - ((EntityPlayer) player).capabilities.disableDamage = true; + if (stack != null && stack.getItemDamage() == 2) { + if (player instanceof EntityPlayer) { + ((EntityPlayer) player).capabilities.disableDamage = true; - wornTick++; + wornTick++; - NBTTagCompound tag = new NBTTagCompound(); - tag.setInteger("MindCorruption", wornTick); - ((EntityPlayer) player).writeToNBT(tag); - int corruption = tag.getInteger("MindCorruption"); - if (tag != null && corruption != wornTick) { - wornTick = corruption; - } + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("MindCorruption", wornTick); + ((EntityPlayer) player).writeToNBT(tag); + int corruption = tag.getInteger("MindCorruption"); + if (tag != null && corruption != wornTick) { + wornTick = corruption; + } - if (corruption == 0) - ((EntityPlayer) player).addChatMessage(new ChatComponentText(TextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever " + TextHelper.PURPLE + "tainted. " + TextHelper.RED + TextHelper.ITALIC + "Beware of wearing the ring. The tainting will only " + TextHelper.RED + TextHelper.ITALIC + "increase, and strange things will start happening.")); + if (corruption == 0) + ((EntityPlayer) player).addChatMessage(new ChatComponentText(TextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever " + TextHelper.PURPLE + "tainted. " + TextHelper.RED + TextHelper.ITALIC + "Beware of wearing the ring. The tainting will only " + TextHelper.RED + TextHelper.ITALIC + "increase, and strange things will start happening.")); - if (corruption > 6000 && corruption < 24000 && random.nextInt(2000) == 0) - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false)); + if (corruption > 6000 && corruption < 24000 && random.nextInt(2000) == 0) + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 500, 2, false)); - if (corruption >= 6000 && corruption < 24000 && random.nextInt(2000) == 0) - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false)); + if (corruption >= 6000 && corruption < 24000 && random.nextInt(2000) == 0) + player.addPotionEffect(new PotionEffect(Potion.confusion.id, 500, 2, false)); - if (corruption >= 24000 && corruption < 72000 && random.nextInt(2000) == 0) { - for (int i = 0; i <= 5; i++) - ((EntityPlayer) player).capabilities.disableDamage = false; + if (corruption >= 24000 && corruption < 72000 && random.nextInt(2000) == 0) { + for (int i = 0; i <= 5; i++) + ((EntityPlayer) player).capabilities.disableDamage = false; - player.attackEntityFrom(DamageSource.magic, 5); - } + player.attackEntityFrom(DamageSource.magic, 5); + } - if (corruption >= 72000 && corruption < 120000 && random.nextInt(4000) == 0) { - for (int i = 0; i <= 100; i++) - ((EntityPlayer) player).capabilities.disableDamage = false; + if (corruption >= 72000 && corruption < 120000 && random.nextInt(4000) == 0) { + for (int i = 0; i <= 100; i++) + ((EntityPlayer) player).capabilities.disableDamage = false; - player.motionY = 2; - } + player.motionY = 2; + } - if (corruption >= 120000 && random.nextInt(10000) == 0) { - for (int i = 0; i <= 510; i++) - ((EntityPlayer) player).capabilities.disableDamage = false; + if (corruption >= 120000 && random.nextInt(10000) == 0) { + for (int i = 0; i <= 510; i++) + ((EntityPlayer) player).capabilities.disableDamage = false; - player.addPotionEffect(new PotionEffect(Potion.wither.id, 5000, 4, false)); - } - } - } - } - } + player.addPotionEffect(new PotionEffect(Potion.wither.id, 5000, 4, false)); + } + } + } + } + } - @Override - public void onEquipped(ItemStack stack, EntityLivingBase player) { - if (stack != null && stack.getItemDamage() == 2) { - player.setInvisible(true); - } - } + @Override + public void onEquipped(ItemStack stack, EntityLivingBase player) { + if (stack != null && stack.getItemDamage() == 2) { + player.setInvisible(true); + } + } - @Override - public void onUnequipped(ItemStack stack, EntityLivingBase player) { - if (stack != null && stack.getItemDamage() == 2) { - player.setInvisible(false); - if (player instanceof EntityPlayer && !((EntityPlayer) player).capabilities.isCreativeMode) - ((EntityPlayer) player).capabilities.disableDamage = false; - } - } + @Override + public void onUnequipped(ItemStack stack, EntityLivingBase player) { + if (stack != null && stack.getItemDamage() == 2) { + player.setInvisible(false); + if (player instanceof EntityPlayer && !((EntityPlayer) player).capabilities.isCreativeMode) + ((EntityPlayer) player).capabilities.disableDamage = false; + } + } - @Override - public boolean canEquip(ItemStack stack, EntityLivingBase player) { - return true; - } + @Override + public boolean canEquip(ItemStack stack, EntityLivingBase player) { + return true; + } - @Override - public boolean canUnequip(ItemStack stack, EntityLivingBase player) { - return true; - } + @Override + public boolean canUnequip(ItemStack stack, EntityLivingBase player) { + return true; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/ItemTaintedThorHammer.java b/src/main/java/tombenpotter/emt/common/module/base/items/ItemTaintedThorHammer.java new file mode 100644 index 0000000..2a14941 --- /dev/null +++ b/src/main/java/tombenpotter/emt/common/module/base/items/ItemTaintedThorHammer.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2014 Tombenpotter. + * All rights reserved. + * + * This program and the accompanying materials are made available under the terms of the GNU Public License v3.0 + * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html + * + * This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod. + * Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012. + * http://www.minecraftforum.net/topic/1585216- + ******************************************************************************/ + +package tombenpotter.emt.common.module.base.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import org.lwjgl.input.Keyboard; +import thaumcraft.common.entities.projectile.EntityAlumentum; +import tombenpotter.emt.ModInformation; +import tombenpotter.emt.common.module.base.items.ItemThorHammer; +import tombenpotter.emt.common.util.TextHelper; + +import java.util.List; + +public class ItemTaintedThorHammer extends ItemThorHammer { + + public ItemTaintedThorHammer() { + this.setMaxDamage(1000); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/taintedthorhammer"); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { + player.swingItem(); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ)); + world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ)); + + if (player.capabilities.isCreativeMode) { + return itemstack; + } else { + itemstack.damageItem(20, player); + return itemstack; + } + } + + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F); + itemstack.damageItem(1, attacker); + return true; + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) { + list.add(TextHelper.localize("tooltip.EMT.hammer.broken.thor")); + list.add(TextHelper.localize("tooltip.EMT.hammer.broken.danger")); + if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick")); + } else { + list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick")); + } + } +} diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/ItemThorHammer.java b/src/main/java/tombenpotter/emt/common/module/base/items/ItemThorHammer.java new file mode 100644 index 0000000..4ed4594 --- /dev/null +++ b/src/main/java/tombenpotter/emt/common/module/base/items/ItemThorHammer.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2014 Tombenpotter. + * All rights reserved. + * + * This program and the accompanying materials are made available under the terms of the GNU Public License v3.0 + * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html + * + * This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod. + * Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012. + * http://www.minecraftforum.net/topic/1585216- + ******************************************************************************/ + +package tombenpotter.emt.common.module.base.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import thaumcraft.api.IRepairable; +import tombenpotter.emt.ElectroMagicTools; +import tombenpotter.emt.ModInformation; + +import java.util.List; + +public class ItemThorHammer extends ItemSword implements IRepairable { + + public ItemThorHammer() { + super(ToolMaterial.EMERALD); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(2000); + // OreDictionary.registerOre("craftingToolForgeHammer", this); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/thorhammer"); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { + player.swingItem(); + float f = 1.0F; + float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f); + float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f); + double d = player.prevPosX + ((player.posX - player.prevPosX) * f); + double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset; + double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f); + Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2); + float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F); + float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F); + float f5 = -MathHelper.cos(-f1 * 0.01745329F); + float f6 = MathHelper.sin(-f1 * 0.01745329F); + float f7 = f4 * f5; + float f8 = f6; + float f9 = f3 * f5; + double d3 = 5000D; + Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3); + MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true); + if (movingobjectposition == null) { + return itemstack; + } + if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k)); + } else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) { + Entity entityhit = movingobjectposition.entityHit; + double x = entityhit.posX; + double y = entityhit.posY; + double z = entityhit.posZ; + world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z)); + } + if (player.capabilities.isCreativeMode) { + return itemstack; + } else { + itemstack.damageItem(20, player); + return itemstack; + } + } + + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); + itemstack.damageItem(1, attacker); + return true; + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { + list.add("The Hammer of Thor"); + } +} diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemBaseFocus.java b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemBaseFocus.java index f71b456..a8ed931 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemBaseFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemBaseFocus.java @@ -29,114 +29,114 @@ import java.util.List; public abstract class ItemBaseFocus extends Item implements IWandFocus { - private IIcon ornament, depth; + private IIcon ornament, depth; - public ItemBaseFocus() { - super(); - this.setMaxDamage(1); - this.setNoRepair(); - this.setMaxStackSize(1); - this.setCreativeTab(ElectroMagicTools.tabEMT); - } + public ItemBaseFocus() { + super(); + this.setMaxDamage(1); + this.setNoRepair(); + this.setMaxStackSize(1); + this.setCreativeTab(ElectroMagicTools.tabEMT); + } - boolean hasOrnament() { - return false; - } + boolean hasOrnament() { + return false; + } - boolean hasDepth() { - return false; - } + boolean hasDepth() { + return false; + } - @Override - public int getFocusColor() { - return 0; - } + @Override + public int getFocusColor() { + return 0; + } - @Override - public boolean isItemTool(ItemStack par1ItemStack) { - return true; - } + @Override + public boolean isItemTool(ItemStack par1ItemStack) { + return true; + } - @Override - public EnumRarity getRarity(ItemStack itemstack) { - return EnumRarity.rare; - } + @Override + public EnumRarity getRarity(ItemStack itemstack) { + return EnumRarity.rare; + } - @Override - public IIcon getFocusDepthLayerIcon() { - return depth; - } + @Override + public IIcon getFocusDepthLayerIcon() { + return depth; + } - @Override - public IIcon getOrnament() { - return ornament; - } + @Override + public IIcon getOrnament() { + return ornament; + } - @Override - public WandFocusAnimation getAnimation() { - return WandFocusAnimation.WAVE; - } + @Override + public WandFocusAnimation getAnimation() { + return WandFocusAnimation.WAVE; + } - @Override - public AspectList getVisCost() { - return null; - } + @Override + public AspectList getVisCost() { + return null; + } - public boolean isUseItem() { - return isVisCostPerTick(); - } + public boolean isUseItem() { + return isVisCostPerTick(); + } - @Override - public boolean isVisCostPerTick() { - return false; - } + @Override + public boolean isVisCostPerTick() { + return false; + } - @Override - public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) { - if (isUseItem()) - paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); - return paramItemStack; - } + @Override + public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) { + if (isUseItem()) + paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); + return paramItemStack; + } - @Override - public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) { + @Override + public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) { - } + } - @Override - public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) { - } + @Override + public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) { + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "00"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "00"; + } - @Override - public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { - return false; - } + @Override + public boolean onFocusBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { + return false; + } - @Override - public boolean acceptsEnchant(int id) { - return false; - } + @Override + public boolean acceptsEnchant(int id) { + return false; + } - @Override - public int getItemEnchantability() { - return 5; - } + @Override + public int getItemEnchantability() { + return 5; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - AspectList cost = getVisCost(); - if (cost != null && cost.size() > 0) { - list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1")); - for (Aspect aspect : cost.getAspectsSorted()) { - float amount = cost.getAmount(aspect) / 100.0F; - list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount); - } - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + AspectList cost = getVisCost(); + if (cost != null && cost.size() > 0) { + list.add(StatCollector.translateToLocal(isVisCostPerTick() ? "item.Focus.cost2" : "item.Focus.cost1")); + for (Aspect aspect : cost.getAspectsSorted()) { + float amount = cost.getAmount(aspect) / 100.0F; + list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount); + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemChristmasFocus.java b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemChristmasFocus.java index 7452f9f..b17ca6b 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemChristmasFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemChristmasFocus.java @@ -27,50 +27,50 @@ import tombenpotter.emt.ModInformation; public class ItemChristmasFocus extends ItemBaseFocus { - private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500); + private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 500).add(Aspect.AIR, 500); - public ItemChristmasFocus() { - super(); - } + public ItemChristmasFocus() { + super(); + } - @Override - public int getFocusColor() { - return 99999999; - } + @Override + public int getFocusColor() { + return 99999999; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":christmasfocus"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":christmasfocus"); + } - @Override - public AspectList getVisCost() { - return visCost; - } + @Override + public AspectList getVisCost() { + return visCost; + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "CHRISTMAS"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "CHRISTMAS"; + } - @Override - public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { - ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); - if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) { - int x = mop.blockX; - int y = mop.blockY + 1; - int z = mop.blockZ; - if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { - if (!world.isRemote) { - EntitySnowman snowman; - snowman = new EntitySnowman(world); - snowman.setPosition(x, y, z); - world.spawnEntityInWorld(snowman); - } - } - player.swingItem(); - } - return itemstack; - } + @Override + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { + ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); + if ((mop != null) && (mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)) { + int x = mop.blockX; + int y = mop.blockY + 1; + int z = mop.blockZ; + if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { + if (!world.isRemote) { + EntitySnowman snowman; + snowman = new EntitySnowman(world); + snowman.setPosition(x, y, z); + world.spawnEntityInWorld(snowman); + } + } + player.swingItem(); + } + return itemstack; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemExplosionFocus.java b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemExplosionFocus.java index 4f96a6a..69f18ec 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemExplosionFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemExplosionFocus.java @@ -27,43 +27,43 @@ import tombenpotter.emt.common.module.base.entities.EntityLaser; public class ItemExplosionFocus extends ItemBaseFocus { - private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200); + private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 200).add(Aspect.ENTROPY, 200); - public ItemExplosionFocus() { - super(); - } + public ItemExplosionFocus() { + super(); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":explosionfocus"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":explosionfocus"); + } - @Override - public int getFocusColor() { - return 9990; - } + @Override + public int getFocusColor() { + return 9990; + } - @Override - public AspectList getVisCost() { - return visCost; - } + @Override + public AspectList getVisCost() { + return visCost; + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "EXPLOSION"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "EXPLOSION"; + } - @Override - public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { - ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); - if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { - if (!world.isRemote) { - EntityLaser laser; - laser = new EntityLaser(world, player, 2); - world.spawnEntityInWorld(laser); - } - } - return itemstack; - } + @Override + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { + ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); + if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { + if (!world.isRemote) { + EntityLaser laser; + laser = new EntityLaser(world, player, 2); + world.spawnEntityInWorld(laser); + } + } + return itemstack; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemShieldFocus.java b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemShieldFocus.java index 9b119e2..407ab71 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemShieldFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/foci/ItemShieldFocus.java @@ -28,91 +28,91 @@ import tombenpotter.emt.common.module.ic2.IC2ModuleBlockRegistry; public class ItemShieldFocus extends ItemBaseFocus { - private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10); + private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10); - public ItemShieldFocus() { - super(); - } + public ItemShieldFocus() { + super(); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shieldfocus"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shieldfocus"); + } - @Override - public int getFocusColor() { - return 555555555; - } + @Override + public int getFocusColor() { + return 555555555; + } - @Override - public boolean isUseItem() { - return true; - } + @Override + public boolean isUseItem() { + return true; + } - @Override - public AspectList getVisCost() { - return visCost; - } + @Override + public AspectList getVisCost() { + return visCost; + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "SHIELD"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "SHIELD"; + } - @Override - public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int time) { - player.motionX = 0.0D; - player.motionY = 0.0D; - player.motionZ = 0.0D; + @Override + public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int time) { + player.motionX = 0.0D; + player.motionY = 0.0D; + player.motionZ = 0.0D; - ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); - if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { - int x = MathHelper.floor_double(player.posX); - int y = MathHelper.floor_double(player.posY); - int z = MathHelper.floor_double(player.posZ); + ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); + if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { + int x = MathHelper.floor_double(player.posX); + int y = MathHelper.floor_double(player.posY); + int z = MathHelper.floor_double(player.posZ); - // Player Level - if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) { - player.worldObj.setBlock(x + 1, y, z, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x - 1, y, z, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x, y, z + 1, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x, y, z - 1, IC2ModuleBlockRegistry.shield); - } + // Player Level + if (player.worldObj.isAirBlock(x + 1, y, z) && player.worldObj.isAirBlock(x - 1, y, z) && player.worldObj.isAirBlock(x, y, z + 1) && player.worldObj.isAirBlock(x, y, z - 1)) { + player.worldObj.setBlock(x + 1, y, z, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x - 1, y, z, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x, y, z + 1, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x, y, z - 1, IC2ModuleBlockRegistry.shield); + } - // Above the player - if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) { - player.worldObj.setBlock(x + 1, y + 1, z, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x - 1, y + 1, z, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x, y + 1, z + 1, IC2ModuleBlockRegistry.shield); - player.worldObj.setBlock(x, y + 1, z - 1, IC2ModuleBlockRegistry.shield); - } - } - } + // Above the player + if (player.worldObj.isAirBlock(x + 1, y + 1, z) && player.worldObj.isAirBlock(x - 1, y + 1, z) && player.worldObj.isAirBlock(x, y + 1, z + 1) && player.worldObj.isAirBlock(x, y + 1, z - 1)) { + player.worldObj.setBlock(x + 1, y + 1, z, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x - 1, y + 1, z, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x, y + 1, z + 1, IC2ModuleBlockRegistry.shield); + player.worldObj.setBlock(x, y + 1, z - 1, IC2ModuleBlockRegistry.shield); + } + } + } - @Override - public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) { - int x = MathHelper.floor_double(player.posX); - int y = MathHelper.floor_double(player.posY); - int z = MathHelper.floor_double(player.posZ); + @Override + public void onPlayerStoppedUsingFocus(ItemStack itemstack, World world, EntityPlayer player, int count) { + int x = MathHelper.floor_double(player.posX); + int y = MathHelper.floor_double(player.posY); + int z = MathHelper.floor_double(player.posZ); - // Player Level - if ((player.worldObj.getBlock(x + 1, y, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y, z + 1) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y, z - 1) == IC2ModuleBlockRegistry.shield)) { - player.worldObj.setBlockToAir(x + 1, y, z); - player.worldObj.setBlockToAir(x - 1, y, z); - player.worldObj.setBlockToAir(x, y, z + 1); - player.worldObj.setBlockToAir(x, y, z - 1); - } + // Player Level + if ((player.worldObj.getBlock(x + 1, y, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y, z + 1) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y, z - 1) == IC2ModuleBlockRegistry.shield)) { + player.worldObj.setBlockToAir(x + 1, y, z); + player.worldObj.setBlockToAir(x - 1, y, z); + player.worldObj.setBlockToAir(x, y, z + 1); + player.worldObj.setBlockToAir(x, y, z - 1); + } - // Above the player - if ((player.worldObj.getBlock(x + 1, y + 1, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y + 1, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z + 1) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z - 1) == IC2ModuleBlockRegistry.shield)) { - player.worldObj.setBlockToAir(x + 1, y + 1, z); - player.worldObj.setBlockToAir(x - 1, y + 1, z); - player.worldObj.setBlockToAir(x, y + 1, z + 1); - player.worldObj.setBlockToAir(x, y + 1, z - 1); - } + // Above the player + if ((player.worldObj.getBlock(x + 1, y + 1, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x - 1, y + 1, z) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z + 1) == IC2ModuleBlockRegistry.shield) && (player.worldObj.getBlock(x, y + 1, z - 1) == IC2ModuleBlockRegistry.shield)) { + player.worldObj.setBlockToAir(x + 1, y + 1, z); + player.worldObj.setBlockToAir(x - 1, y + 1, z); + player.worldObj.setBlockToAir(x, y + 1, z + 1); + player.worldObj.setBlockToAir(x, y + 1, z - 1); + } - ItemStack milk = (new ItemStack(Items.milk_bucket)); - player.curePotionEffects(milk); - } + ItemStack milk = (new ItemStack(Items.milk_bucket)); + player.curePotionEffects(milk); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseChainsaw.java b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseChainsaw.java new file mode 100644 index 0000000..a7bbc06 --- /dev/null +++ b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseChainsaw.java @@ -0,0 +1,127 @@ +package tombenpotter.emt.common.module.base.items.tools; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; +import tombenpotter.emt.ElectroMagicTools; +import tombenpotter.emt.ModInformation; +import tombenpotter.emt.common.util.ConfigHandler; +import tombenpotter.emt.common.util.RandomHelper; + +import java.util.ArrayList; +import java.util.Random; + +public class ItemBaseChainsaw extends ItemAxe { + + public String textureName; + + public ItemBaseChainsaw(ToolMaterial material, int maxDamage, String textureName) { + super(material); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxStackSize(1); + this.setMaxDamage(maxDamage); + this.textureName = textureName; + this.efficiencyOnProperMaterial = this.toolMaterial.getEfficiencyOnProperMaterial(); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + textureName); + } + + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { + if ((double) block.getBlockHardness(world, x, y, z) != 0.0D) stack.damageItem(1, entityLiving); + return true; + } + + @Override + public boolean canHarvestBlock(Block block, ItemStack stack) { + return false; + } + + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) { + if (block.getHarvestTool(meta) == null) { + return efficiencyOnProperMaterial; + } else { + if ((canHarvestBlock(block, stack) && (block.getHarvestTool(meta).equals("axe")) || Items.shears.canHarvestBlock(block, stack))) { + return efficiencyOnProperMaterial; + } + } + return super.getDigSpeed(stack, block, meta); + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + return RandomHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public boolean getIsRepairable(ItemStack stack1, ItemStack stack2) { + return false; + } + + @Override + public int getItemEnchantability() { + if (ConfigHandler.enchanting == false) return 0; + else return toolMaterial.getEnchantability(); + } + + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return ConfigHandler.enchanting; + } + + @Override + public boolean hitEntity(ItemStack stack, EntityLivingBase entityliving, EntityLivingBase attacker) { + stack.damageItem(1, attacker); + return true; + } + + @Override + public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) { + if (player.worldObj.isRemote) { + return false; + } + Block block = player.worldObj.getBlock(x, y, z); + if (block instanceof IShearable) { + IShearable target = (IShearable) block; + if (target.isShearable(stack, player.worldObj, x, y, z)) { + ArrayList drops = target.onSheared(stack, player.worldObj, x, y, z, + EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack)); + Random rand = new Random(); + for (ItemStack drop : drops) { + float f = 0.7F; + double d = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d1 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + double d2 = (double) (rand.nextFloat() * f) + (double) (1.0F - f) * 0.5D; + EntityItem entityitem = new EntityItem(player.worldObj, (double) x + d, (double) y + d1, (double) z + d2, drop); + entityitem.delayBeforeCanPickup = 10; + player.worldObj.spawnEntityInWorld(entityitem); + } + stack.damageItem(1, player); + player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1); + } + } + return false; + } +} diff --git a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseDrill.java b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseDrill.java similarity index 71% rename from src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseDrill.java rename to src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseDrill.java index edf21b7..8ff2202 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseDrill.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseDrill.java @@ -1,23 +1,20 @@ -package tombenpotter.emt.common.module.base.tools; +package tombenpotter.emt.common.module.base.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import tombenpotter.emt.ElectroMagicTools; import tombenpotter.emt.ModInformation; import tombenpotter.emt.common.util.ConfigHandler; -import tombenpotter.emt.common.util.IRefillable; import tombenpotter.emt.common.util.RandomHelper; -public class ItemBaseDrill extends ItemPickaxe implements IRefillable { +public class ItemBaseDrill extends ItemPickaxe { public String textureName; @@ -37,27 +34,26 @@ public class ItemBaseDrill extends ItemPickaxe implements IRefillable { } @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { - if (stack.getItemDamage() < 1) stack.setItemDamage(1); - } - - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - if (stack.getItemDamage() > 1) stack.damageItem(1, entityLiving); + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { + if ((double) block.getBlockHardness(world, x, y, z) != 0.0D) stack.damageItem(1, entityLiving); return true; } @Override public boolean canHarvestBlock(Block block, ItemStack stack) { - return Items.diamond_pickaxe.canHarvestBlock(block, stack) || Items.diamond_shovel.canHarvestBlock(block, stack); + return false; } @Override public float getDigSpeed(ItemStack stack, Block block, int meta) { - if (stack.getItemDamage() <= 1) return 1.0F; - if (Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F) { + if (block.getHarvestTool(meta) == null) { return efficiencyOnProperMaterial; - } else return super.getDigSpeed(stack, block, meta); + } else { + if (canHarvestBlock(block, stack) && (block.getHarvestTool(meta).equals("pickaxe") || block.getHarvestTool(meta).equals("shovel"))) { + return efficiencyOnProperMaterial; + } + } + return super.getDigSpeed(stack, block, meta); } @Override @@ -75,6 +71,11 @@ public class ItemBaseDrill extends ItemPickaxe implements IRefillable { return false; } + @Override + public boolean getIsRepairable(ItemStack stack1, ItemStack stack2) { + return false; + } + @Override public int getItemEnchantability() { if (ConfigHandler.enchanting == false) return 0; diff --git a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseOmnitool.java b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseOmnitool.java similarity index 75% rename from src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseOmnitool.java rename to src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseOmnitool.java index 2ba02d7..3726daa 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseOmnitool.java +++ b/src/main/java/tombenpotter/emt/common/module/base/items/tools/ItemBaseOmnitool.java @@ -1,4 +1,4 @@ -package tombenpotter.emt.common.module.base.tools; +package tombenpotter.emt.common.module.base.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -7,7 +7,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; @@ -15,10 +14,9 @@ import net.minecraft.world.World; import tombenpotter.emt.ElectroMagicTools; import tombenpotter.emt.ModInformation; import tombenpotter.emt.common.util.ConfigHandler; -import tombenpotter.emt.common.util.IRefillable; import tombenpotter.emt.common.util.RandomHelper; -public class ItemBaseOmnitool extends ItemPickaxe implements IRefillable { +public class ItemBaseOmnitool extends ItemPickaxe { public String textureName; @@ -38,7 +36,7 @@ public class ItemBaseOmnitool extends ItemPickaxe implements IRefillable { } @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean currentItem) { if (stack.getItemDamage() < 1) stack.setItemDamage(1); } @@ -50,15 +48,13 @@ public class ItemBaseOmnitool extends ItemPickaxe implements IRefillable { @Override public boolean canHarvestBlock(Block block, ItemStack stack) { - return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); + return false; } @Override public float getDigSpeed(ItemStack stack, Block block, int meta) { if (stack.getItemDamage() <= 1) return 1.0F; - if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { - return efficiencyOnProperMaterial; - } else return super.getDigSpeed(stack, block, meta); + else return super.getDigSpeed(stack, block, meta); } @Override diff --git a/src/main/java/tombenpotter/emt/common/module/base/tile/TileEntityPortableNode.java b/src/main/java/tombenpotter/emt/common/module/base/tile/TileEntityPortableNode.java index 5a20bad..a70b363 100644 --- a/src/main/java/tombenpotter/emt/common/module/base/tile/TileEntityPortableNode.java +++ b/src/main/java/tombenpotter/emt/common/module/base/tile/TileEntityPortableNode.java @@ -18,17 +18,17 @@ import thaumcraft.common.tiles.TileNode; public class TileEntityPortableNode extends TileNode { - public TileEntityPortableNode() { - super(); - } + public TileEntityPortableNode() { + super(); + } - @Override - public NodeModifier getNodeModifier() { - return NodeModifier.FADING; - } + @Override + public NodeModifier getNodeModifier() { + return NodeModifier.FADING; + } - @Override - public NodeType getNodeType() { - return NodeType.UNSTABLE; - } + @Override + public NodeType getNodeType() { + return NodeType.UNSTABLE; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseChainsaw.java b/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseChainsaw.java deleted file mode 100644 index d652d2e..0000000 --- a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemBaseChainsaw.java +++ /dev/null @@ -1,94 +0,0 @@ -package tombenpotter.emt.common.module.base.tools; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import tombenpotter.emt.ElectroMagicTools; -import tombenpotter.emt.ModInformation; -import tombenpotter.emt.common.util.ConfigHandler; -import tombenpotter.emt.common.util.IRefillable; -import tombenpotter.emt.common.util.RandomHelper; - -public class ItemBaseChainsaw extends ItemAxe implements IRefillable { - - public String textureName; - - public ItemBaseChainsaw(ToolMaterial material, int maxDamage, String textureName) { - super(material); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxStackSize(1); - this.setMaxDamage(maxDamage); - this.textureName = textureName; - this.efficiencyOnProperMaterial = this.toolMaterial.getEfficiencyOnProperMaterial(); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + textureName); - } - - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int p_77663_4_, boolean p_77663_5_) { - if (stack.getItemDamage() < 1) stack.setItemDamage(1); - } - - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - if (stack.getItemDamage() > 1) stack.damageItem(1, entityLiving); - return true; - } - - @Override - public boolean canHarvestBlock(Block block, ItemStack stack) { - return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); - } - - @Override - public float getDigSpeed(ItemStack stack, Block block, int meta) { - if (stack.getItemDamage() <= 1) return 1.0F; - if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) { - return efficiencyOnProperMaterial; - } else return super.getDigSpeed(stack, block, meta); - - } - - @Override - public boolean hitEntity(ItemStack stack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (stack.getItemDamage() <= 1) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); - stack.damageItem(1, attacker); - } - return true; - } - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - return RandomHelper.placeTorch(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } - - @Override - public boolean isRepairable() { - return false; - } - - @Override - public int getItemEnchantability() { - if (ConfigHandler.enchanting == false) return 0; - else return toolMaterial.getEnchantability(); - } - - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - return ConfigHandler.enchanting; - } -} diff --git a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemTaintedThorHammer.java b/src/main/java/tombenpotter/emt/common/module/base/tools/ItemTaintedThorHammer.java deleted file mode 100644 index d7d6aea..0000000 --- a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemTaintedThorHammer.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Tombenpotter. - * All rights reserved. - * - * This program and the accompanying materials are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html - * - * This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod. - * Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012. - * http://www.minecraftforum.net/topic/1585216- - ******************************************************************************/ - -package tombenpotter.emt.common.module.base.tools; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import org.lwjgl.input.Keyboard; -import thaumcraft.common.entities.projectile.EntityAlumentum; -import tombenpotter.emt.ModInformation; -import tombenpotter.emt.common.util.TextHelper; - -import java.util.List; - -public class ItemTaintedThorHammer extends ItemThorHammer { - - public ItemTaintedThorHammer() { - this.setMaxDamage(1000); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/taintedthorhammer"); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - player.swingItem(); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX - 8, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX + 8, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 4, player.posZ)); - world.spawnEntityInWorld(new EntityAlumentum(world, player.posX, player.posY + 8, player.posZ)); - - if (player.capabilities.isCreativeMode) { - return itemstack; - } else { - itemstack.damageItem(20, player); - return itemstack; - } - } - - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 2F); - itemstack.damageItem(1, attacker); - return true; - } - - @SuppressWarnings({"rawtypes", "unchecked"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer entityPlayer, List list, boolean par4) { - list.add(TextHelper.localize("tooltip.EMT.hammer.broken.thor")); - list.add(TextHelper.localize("tooltip.EMT.hammer.broken.danger")); - if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsNoRightClick")); - } else { - list.add(TextHelper.localize("tooltip.EMT.hammer.broken.plsRightClick")); - } - } -} diff --git a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemThorHammer.java b/src/main/java/tombenpotter/emt/common/module/base/tools/ItemThorHammer.java deleted file mode 100644 index c702406..0000000 --- a/src/main/java/tombenpotter/emt/common/module/base/tools/ItemThorHammer.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Tombenpotter. - * All rights reserved. - * - * This program and the accompanying materials are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html - * - * This class was made by Tombenpotter and is distributed as a part of the Electro-Magic Tools mod. - * Electro-Magic Tools is a derivative work on Thaumcraft 4 (c) Azanor 2012. - * http://www.minecraftforum.net/topic/1585216- - ******************************************************************************/ - -package tombenpotter.emt.common.module.base.tools; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.util.MovingObjectPosition.MovingObjectType; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import thaumcraft.api.IRepairable; -import tombenpotter.emt.ElectroMagicTools; -import tombenpotter.emt.ModInformation; - -import java.util.List; - -public class ItemThorHammer extends ItemSword implements IRepairable { - - public ItemThorHammer() { - super(ToolMaterial.EMERALD); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(2000); - // OreDictionary.registerOre("craftingToolForgeHammer", this); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/thorhammer"); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - player.swingItem(); - float f = 1.0F; - float f1 = player.prevRotationPitch + ((player.rotationPitch - player.prevRotationPitch) * f); - float f2 = player.prevRotationYaw + ((player.rotationYaw - player.prevRotationYaw) * f); - double d = player.prevPosX + ((player.posX - player.prevPosX) * f); - double d1 = (player.prevPosY + ((player.posY - player.prevPosY) * f) + 1.6200000000000001D) - player.yOffset; - double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * f); - Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2); - float f3 = MathHelper.cos((-f2 * 0.01745329F) - 3.141593F); - float f4 = MathHelper.sin((-f2 * 0.01745329F) - 3.141593F); - float f5 = -MathHelper.cos(-f1 * 0.01745329F); - float f6 = MathHelper.sin(-f1 * 0.01745329F); - float f7 = f4 * f5; - float f8 = f6; - float f9 = f3 * f5; - double d3 = 5000D; - Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3); - MovingObjectPosition movingobjectposition = player.worldObj.rayTraceBlocks(vec3d, vec3d1, true); - if (movingobjectposition == null) { - return itemstack; - } - if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { - int i = movingobjectposition.blockX; - int j = movingobjectposition.blockY; - int k = movingobjectposition.blockZ; - world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k)); - } else if (movingobjectposition.typeOfHit == MovingObjectType.ENTITY) { - Entity entityhit = movingobjectposition.entityHit; - double x = entityhit.posX; - double y = entityhit.posY; - double z = entityhit.posZ; - world.spawnEntityInWorld(new EntityLightningBolt(world, x, y, z)); - } - if (player.capabilities.isCreativeMode) { - return itemstack; - } else { - itemstack.damageItem(20, player); - return itemstack; - } - } - - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); - itemstack.damageItem(1, attacker); - return true; - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { - list.add("The Hammer of Thor"); - } -} diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleBlockRegistry.java b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleBlockRegistry.java index fd554bb..60f3fb2 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleBlockRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleBlockRegistry.java @@ -20,29 +20,29 @@ import tombenpotter.emt.common.module.ic2.items.blocks.*; public class IC2ModuleBlockRegistry { - public static Block essentiaGens; - public static Block shield; - public static Block emtSolars; - public static Block emtMachines; - public static Block emtSolars2; - public static Block portableNode; - public static Block essentiaGenerator; + public static Block essentiaGens; + public static Block shield; + public static Block emtSolars; + public static Block emtMachines; + public static Block emtSolars2; + public static Block portableNode; + public static Block essentiaGenerator; - public static void registerBlocks() { - shield = new BlockShield().setBlockName(ModInformation.modid + ".shield"); - portableNode = new BlockPortableNode().setBlockName(ModInformation.modid + ".portablenode"); - emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars"); - emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2"); - emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines"); - essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens"); - essentiaGenerator = new BlockEssentiaGenerator().setBlockName(ModInformation.modid + ".essentiaGenerator"); + public static void registerBlocks() { + shield = new BlockShield().setBlockName(ModInformation.modid + ".shield"); + portableNode = new BlockPortableNode().setBlockName(ModInformation.modid + ".portablenode"); + emtSolars = new BlockEMTSolars().setBlockName(ModInformation.modid + ".emtsolars"); + emtSolars2 = new BlockEMTSolars2().setBlockName(ModInformation.modid + ".emtsolars2"); + emtMachines = new BlockEMTMachines().setBlockName(ModInformation.modid + ".emtmachines"); + essentiaGens = new BlockEssentiaGenerators().setBlockName(ModInformation.modid + ".essentiaGens"); + essentiaGenerator = new BlockEssentiaGenerator().setBlockName(ModInformation.modid + ".essentiaGenerator"); - GameRegistry.registerBlock(shield, "Shield Block"); - GameRegistry.registerBlock(portableNode, "Portable Node"); - GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMT Solar Panels"); - GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMT Solars 2"); - GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMT Machines"); - GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "Essentia Generators"); - GameRegistry.registerBlock(essentiaGenerator, ItemBlockEssentiaGenerator.class, "Essentia Generator"); - } + GameRegistry.registerBlock(shield, "Shield Block"); + GameRegistry.registerBlock(portableNode, "Portable Node"); + GameRegistry.registerBlock(emtSolars, ItemBlockEMTSolars.class, "EMT Solar Panels"); + GameRegistry.registerBlock(emtSolars2, ItemBlockEMTSolars2.class, "EMT Solars 2"); + GameRegistry.registerBlock(emtMachines, ItemBlockEMTMachines.class, "EMT Machines"); + GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "Essentia Generators"); + GameRegistry.registerBlock(essentiaGenerator, ItemBlockEssentiaGenerator.class, "Essentia Generator"); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleItemRegistry.java b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleItemRegistry.java index 68287ec..10e76bc 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleItemRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleItemRegistry.java @@ -19,12 +19,15 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import thaumcraft.api.ThaumcraftApi; import tombenpotter.emt.ModInformation; -import tombenpotter.emt.common.module.base.items.*; +import tombenpotter.emt.common.module.base.items.ItemEMTBaubles; +import tombenpotter.emt.common.module.base.items.ItemEMTItems; +import tombenpotter.emt.common.module.base.items.ItemFeatherWing; +import tombenpotter.emt.common.module.base.items.ItemThaumiumReinforcedWing; import tombenpotter.emt.common.module.base.items.foci.ItemChristmasFocus; import tombenpotter.emt.common.module.base.items.foci.ItemExplosionFocus; import tombenpotter.emt.common.module.base.items.foci.ItemShieldFocus; -import tombenpotter.emt.common.module.base.tools.ItemTaintedThorHammer; -import tombenpotter.emt.common.module.base.tools.ItemThorHammer; +import tombenpotter.emt.common.module.base.items.ItemTaintedThorHammer; +import tombenpotter.emt.common.module.base.items.ItemThorHammer; import tombenpotter.emt.common.module.ic2.items.ItemElectricScribingTools; import tombenpotter.emt.common.module.ic2.items.armor.boots.ItemElectricBootsTraveller; import tombenpotter.emt.common.module.ic2.items.armor.boots.ItemNanoBootsTraveller; @@ -50,107 +53,107 @@ import tombenpotter.emt.common.module.ic2.items.tools.omnitools.ItemOmnitoolThau public class IC2ModuleItemRegistry { - public static Item thaumiumDrill; - public static Item thaumiumChainsaw; - public static Item quantumThaumicHelmet; - public static Item diamondChainsaw; - public static Item ironOmnitool; - public static Item diamondOmnitool; - public static Item thaumiumOmnitool; - public static Item nanoThaumicHelmet; - public static Item explosionFocus; - public static Item christmasFocus; - public static Item shieldFocus; - public static Item electricGoggles; - public static Item streamChainsaw; - public static Item rockbreakerDrill; - public static Item solarHelmetRevealing; - public static Item thorHammer; - public static Item taintedThorHammer; - public static Item electricThorHammer; - public static Item electricBootsTraveller; - public static Item quantumBootsTraveller; - public static Item nanoBootsTraveller; - public static Item electricScribingTools; - public static Item itemEMTItems; - public static Item electricHoeGrowth; - public static Item chargeFocus; - public static Item emtBauble; - public static Item wandChargeFocus; - public static Item featherWing; - public static Item thaumiumWing; - public static Item nanoWing; - public static Item quantumWing; + public static Item thaumiumDrill; + public static Item thaumiumChainsaw; + public static Item quantumThaumicHelmet; + public static Item diamondChainsaw; + public static Item ironOmnitool; + public static Item diamondOmnitool; + public static Item thaumiumOmnitool; + public static Item nanoThaumicHelmet; + public static Item explosionFocus; + public static Item christmasFocus; + public static Item shieldFocus; + public static Item electricGoggles; + public static Item streamChainsaw; + public static Item rockbreakerDrill; + public static Item solarHelmetRevealing; + public static Item thorHammer; + public static Item taintedThorHammer; + public static Item electricThorHammer; + public static Item electricBootsTraveller; + public static Item quantumBootsTraveller; + public static Item nanoBootsTraveller; + public static Item electricScribingTools; + public static Item itemEMTItems; + public static Item electricHoeGrowth; + public static Item chargeFocus; + public static Item emtBauble; + public static Item wandChargeFocus; + public static Item featherWing; + public static Item thaumiumWing; + public static Item nanoWing; + public static Item quantumWing; - public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[]{2, 2, 2, 2}, 6); + public static ItemArmor.ArmorMaterial featherWingMaterial = EnumHelper.addArmorMaterial("FEATEHRWiNG", 1, new int[]{2, 2, 2, 2}, 6); - public static void registerItems() { - itemEMTItems = new ItemEMTItems().setUnlocalizedName(ModInformation.modid + ".emtitems"); - emtBauble = new ItemEMTBaubles().setUnlocalizedName(ModInformation.modid + ".emtbauble"); - electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".electricgoggles"); - nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".nanothaumichelmet"); - quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".quantumthaumichelmet"); - solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".solarhelmetrevealing"); - electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".electricboots"); - nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".nanobootstraveller"); - quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".quantumbootstraveller"); - electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(ModInformation.modid + ".electricscribingtools"); - featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(ModInformation.modid + ".featherwing"); - thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(ModInformation.modid + ".thaumiumwing"); - nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".nanowing"); - quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".quantumwing"); - taintedThorHammer = new ItemTaintedThorHammer().setUnlocalizedName(ModInformation.modid + ".taintedthorhammer"); - thorHammer = new ItemThorHammer().setUnlocalizedName(ModInformation.modid + ".hammerthor"); - electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(ModInformation.modid + ".electricthorhammer"); - thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(ModInformation.modid + ".thaumiumdrill"); - thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(ModInformation.modid + ".thaumiumchainsaw"); - diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(ModInformation.modid + ".diamondchainsaw"); - ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(ModInformation.modid + ".ironomnitool"); - thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(ModInformation.modid + ".thaumiumomnitool"); - diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(ModInformation.modid + ".diamondomnitool"); - streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(ModInformation.modid + ".streamchainsaw"); - rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(ModInformation.modid + ".rockbreakerdrill"); - electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(ModInformation.modid + ".electrichoeofgrowth"); - explosionFocus = new ItemExplosionFocus().setUnlocalizedName(ModInformation.modid + ".laserfocus"); - christmasFocus = new ItemChristmasFocus().setUnlocalizedName(ModInformation.modid + ".christmasfocus"); - shieldFocus = new ItemShieldFocus().setUnlocalizedName(ModInformation.modid + ".shieldfocus"); - chargeFocus = new ItemChargeFocus().setUnlocalizedName(ModInformation.modid + ".chargefocus"); - wandChargeFocus = new ItemWandChargingFocus().setUnlocalizedName(ModInformation.modid + ".wandchargefocus"); + public static void registerItems() { + itemEMTItems = new ItemEMTItems().setUnlocalizedName(ModInformation.modid + ".emtitems"); + emtBauble = new ItemEMTBaubles().setUnlocalizedName(ModInformation.modid + ".emtbauble"); + electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".electricgoggles"); + nanoThaumicHelmet = new ItemNanoGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".nanothaumichelmet"); + quantumThaumicHelmet = new ItemQuantumGoggles(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".quantumthaumichelmet"); + solarHelmetRevealing = new ItemSolarHelmetRevealing(ItemArmor.ArmorMaterial.DIAMOND, 3, 0).setUnlocalizedName(ModInformation.modid + ".solarhelmetrevealing"); + electricBootsTraveller = new ItemElectricBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".electricboots"); + nanoBootsTraveller = new ItemNanoBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".nanobootstraveller"); + quantumBootsTraveller = new ItemQuantumBootsTraveller(3, 3).setUnlocalizedName(ModInformation.modid + ".quantumbootstraveller"); + electricScribingTools = new ItemElectricScribingTools().setUnlocalizedName(ModInformation.modid + ".electricscribingtools"); + featherWing = new ItemFeatherWing(featherWingMaterial, 7, 1).setUnlocalizedName(ModInformation.modid + ".featherwing"); + thaumiumWing = new ItemThaumiumReinforcedWing(ThaumcraftApi.armorMatThaumium, 7, 1).setUnlocalizedName(ModInformation.modid + ".thaumiumwing"); + nanoWing = new ItemNanoWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".nanowing"); + quantumWing = new ItemQuantumWing(ItemArmor.ArmorMaterial.DIAMOND, 7, 1).setUnlocalizedName(ModInformation.modid + ".quantumwing"); + taintedThorHammer = new ItemTaintedThorHammer().setUnlocalizedName(ModInformation.modid + ".taintedthorhammer"); + thorHammer = new ItemThorHammer().setUnlocalizedName(ModInformation.modid + ".hammerthor"); + electricThorHammer = new ItemElectricThorHammer().setUnlocalizedName(ModInformation.modid + ".electricthorhammer"); + thaumiumDrill = new ItemThaumiumDrill().setUnlocalizedName(ModInformation.modid + ".thaumiumdrill"); + thaumiumChainsaw = new ItemThaumiumChainsaw().setUnlocalizedName(ModInformation.modid + ".thaumiumchainsaw"); + diamondChainsaw = new ItemDiamondChainsaw().setUnlocalizedName(ModInformation.modid + ".diamondchainsaw"); + ironOmnitool = new ItemOmnitoolIron().setUnlocalizedName(ModInformation.modid + ".ironomnitool"); + thaumiumOmnitool = new ItemOmnitoolThaumium().setUnlocalizedName(ModInformation.modid + ".thaumiumomnitool"); + diamondOmnitool = new ItemOmnitoolDiamond().setUnlocalizedName(ModInformation.modid + ".diamondomnitool"); + streamChainsaw = new ItemStreamChainsaw().setUnlocalizedName(ModInformation.modid + ".streamchainsaw"); + rockbreakerDrill = new ItemRockbreakerDrill().setUnlocalizedName(ModInformation.modid + ".rockbreakerdrill"); + electricHoeGrowth = new ItemElectricHoeGrowth().setUnlocalizedName(ModInformation.modid + ".electrichoeofgrowth"); + explosionFocus = new ItemExplosionFocus().setUnlocalizedName(ModInformation.modid + ".laserfocus"); + christmasFocus = new ItemChristmasFocus().setUnlocalizedName(ModInformation.modid + ".christmasfocus"); + shieldFocus = new ItemShieldFocus().setUnlocalizedName(ModInformation.modid + ".shieldfocus"); + chargeFocus = new ItemChargeFocus().setUnlocalizedName(ModInformation.modid + ".chargefocus"); + wandChargeFocus = new ItemWandChargingFocus().setUnlocalizedName(ModInformation.modid + ".wandchargefocus"); - GameRegistry.registerItem(itemEMTItems, "EMT Items"); - GameRegistry.registerItem(emtBauble, "EMT Baubles"); - GameRegistry.registerItem(electricGoggles, "Electric Goggles of Revealing"); - GameRegistry.registerItem(nanoThaumicHelmet, "Nanosuit Goggles of Revealing"); - GameRegistry.registerItem(quantumThaumicHelmet, "Quantum Goggles of Revealing"); - GameRegistry.registerItem(solarHelmetRevealing, "Quantum Solar Helmet of Revealing"); - GameRegistry.registerItem(electricBootsTraveller, "Electric Boots of the Traveller"); - GameRegistry.registerItem(nanoBootsTraveller, "Nano Boots of the Traveller"); - GameRegistry.registerItem(quantumBootsTraveller, "Quantum Boots of the Traveller"); - GameRegistry.registerItem(electricScribingTools, "Electric Scribing Tools"); - GameRegistry.registerItem(featherWing, "Feather Wing"); - GameRegistry.registerItem(thaumiumWing, "Thaumium Reinforced Wing"); - GameRegistry.registerItem(nanoWing, "Nanosuit Wing"); - GameRegistry.registerItem(quantumWing, "Quantum Wing"); - GameRegistry.registerItem(taintedThorHammer, "Broken Relic of Mjolnir"); - GameRegistry.registerItem(thorHammer, "Mjolnir"); - GameRegistry.registerItem(electricThorHammer, "Supercharged Mjolnir"); - GameRegistry.registerItem(thaumiumDrill, "Thaumium Drill"); - GameRegistry.registerItem(thaumiumChainsaw, "Thaumium Chainsaw"); - GameRegistry.registerItem(diamondChainsaw, "Diamond Chainsaw"); - GameRegistry.registerItem(ironOmnitool, "Omnitool"); - GameRegistry.registerItem(thaumiumOmnitool, "Thaumium Omnitool"); - GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool"); - GameRegistry.registerItem(streamChainsaw, "Chainsaw of the Stream"); - GameRegistry.registerItem(rockbreakerDrill, "Drill of the Rockbreaker"); - GameRegistry.registerItem(electricHoeGrowth, "Electric Hoe of Growth"); - GameRegistry.registerItem(explosionFocus, "Wand Focus: Explosion"); - GameRegistry.registerItem(christmasFocus, "Wand Focus: Kris-tmas"); - GameRegistry.registerItem(shieldFocus, "Wand Focus: Shield"); - GameRegistry.registerItem(chargeFocus, "Wand Focus: Charging"); - GameRegistry.registerItem(wandChargeFocus, "Wand Focus: Wand Charging"); - } + GameRegistry.registerItem(itemEMTItems, "EMT Items"); + GameRegistry.registerItem(emtBauble, "EMT Baubles"); + GameRegistry.registerItem(electricGoggles, "Electric Goggles of Revealing"); + GameRegistry.registerItem(nanoThaumicHelmet, "Nanosuit Goggles of Revealing"); + GameRegistry.registerItem(quantumThaumicHelmet, "Quantum Goggles of Revealing"); + GameRegistry.registerItem(solarHelmetRevealing, "Quantum Solar Helmet of Revealing"); + GameRegistry.registerItem(electricBootsTraveller, "Electric Boots of the Traveller"); + GameRegistry.registerItem(nanoBootsTraveller, "Nano Boots of the Traveller"); + GameRegistry.registerItem(quantumBootsTraveller, "Quantum Boots of the Traveller"); + GameRegistry.registerItem(electricScribingTools, "Electric Scribing Tools"); + GameRegistry.registerItem(featherWing, "Feather Wing"); + GameRegistry.registerItem(thaumiumWing, "Thaumium Reinforced Wing"); + GameRegistry.registerItem(nanoWing, "Nanosuit Wing"); + GameRegistry.registerItem(quantumWing, "Quantum Wing"); + GameRegistry.registerItem(taintedThorHammer, "Broken Relic of Mjolnir"); + GameRegistry.registerItem(thorHammer, "Mjolnir"); + GameRegistry.registerItem(electricThorHammer, "Supercharged Mjolnir"); + GameRegistry.registerItem(thaumiumDrill, "Thaumium Drill"); + GameRegistry.registerItem(thaumiumChainsaw, "Thaumium Chainsaw"); + GameRegistry.registerItem(diamondChainsaw, "Diamond Chainsaw"); + GameRegistry.registerItem(ironOmnitool, "Omnitool"); + GameRegistry.registerItem(thaumiumOmnitool, "Thaumium Omnitool"); + GameRegistry.registerItem(diamondOmnitool, "Diamond Omnitool"); + GameRegistry.registerItem(streamChainsaw, "Chainsaw of the Stream"); + GameRegistry.registerItem(rockbreakerDrill, "Drill of the Rockbreaker"); + GameRegistry.registerItem(electricHoeGrowth, "Electric Hoe of Growth"); + GameRegistry.registerItem(explosionFocus, "Wand Focus: Explosion"); + GameRegistry.registerItem(christmasFocus, "Wand Focus: Kris-tmas"); + GameRegistry.registerItem(shieldFocus, "Wand Focus: Shield"); + GameRegistry.registerItem(chargeFocus, "Wand Focus: Charging"); + GameRegistry.registerItem(wandChargeFocus, "Wand Focus: Wand Charging"); + } - public static ItemStack armorEuMaker = new ItemStack(emtBauble, 1, 0); - public static ItemStack inventoryEuMaker = new ItemStack(emtBauble, 1, 1); - public static ItemStack oneRing = new ItemStack(emtBauble, 1, 2); + public static ItemStack armorEuMaker = new ItemStack(emtBauble, 1, 0); + public static ItemStack inventoryEuMaker = new ItemStack(emtBauble, 1, 1); + public static ItemStack oneRing = new ItemStack(emtBauble, 1, 2); } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleTERegistry.java b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleTERegistry.java index 2180e74..af74a39 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleTERegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/IC2ModuleTERegistry.java @@ -41,37 +41,37 @@ import tombenpotter.emt.common.module.ic2.tile.solars.water.TileEntityWaterSolar public class IC2ModuleTERegistry { - public static void registerTEs() { + public static void registerTEs() { - GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator"); - GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator"); - GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator"); - GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator"); - GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator"); - GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge"); - GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar"); - GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar"); - GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar"); - GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator"); - GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar"); - GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar"); - GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar"); - GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar"); - GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar"); - GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar"); - GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar"); - GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar"); - GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar"); - GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar"); - GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar"); - GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar"); - GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar"); - GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar"); - GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar"); - GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar"); - GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar"); - GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar"); - GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode"); - GameRegistry.registerTileEntity(TileEntityEssentiaGenerator.class, "tileentityessentiagenerator"); - } + GameRegistry.registerTileEntity(TileEntityPotentiaGenerator.class, "tileentitypotentiagenerator"); + GameRegistry.registerTileEntity(TileEntityIgnisGenerator.class, "tileentityignisgenerator"); + GameRegistry.registerTileEntity(TileEntityAuramGenerator.class, "tileentityauramgenerator"); + GameRegistry.registerTileEntity(TileEntityArborGenerator.class, "tileentityarborgenerator"); + GameRegistry.registerTileEntity(TileEntityAerGenerator.class, "tileentityaergenerator"); + GameRegistry.registerTileEntity(TileEntityIndustrialWandRecharge.class, "tileentityindustrialwandrecharge"); + GameRegistry.registerTileEntity(TileEntityCompressedSolar.class, "tileentitycompressedsolar"); + GameRegistry.registerTileEntity(TileEntityDoubleCompressedSolar.class, "tileentitydoublecompressedsolar"); + GameRegistry.registerTileEntity(TileEntityTripleCompressedSolar.class, "tileentitytriplecompressedsolar"); + GameRegistry.registerTileEntity(TileEntityEtherealMacerator.class, "tileentityetherealmacerator"); + GameRegistry.registerTileEntity(TileEntityWaterSolar.class, "tileentitywatersolar"); + GameRegistry.registerTileEntity(TileEntityDoubleWaterSolar.class, "tileentitydoublewatersolar"); + GameRegistry.registerTileEntity(TileEntityTripleWaterSolar.class, "tileentitytriplewatersolar"); + GameRegistry.registerTileEntity(TileEntityDarkSolar.class, "tileentitydarksolar"); + GameRegistry.registerTileEntity(TileEntityDoubleDarkSolar.class, "tileentitydoubledarksolar"); + GameRegistry.registerTileEntity(TileEntityTripleDarkSolar.class, "tileentitytripledarksolar"); + GameRegistry.registerTileEntity(TileEntityOrderSolar.class, "tileentityordersolar"); + GameRegistry.registerTileEntity(TileEntityDoubleOrderSolar.class, "tileentitydoubleordersolar"); + GameRegistry.registerTileEntity(TileEntityTripleOrderSolar.class, "tileentitytripleordersolar"); + GameRegistry.registerTileEntity(TileEntityFireSolar.class, "tileentityfiresolar"); + GameRegistry.registerTileEntity(TileEntityDoubleFireSolar.class, "tileentitydoublefiresolar"); + GameRegistry.registerTileEntity(TileEntityTripleFireSolar.class, "tileentitytriplefiresolar"); + GameRegistry.registerTileEntity(TileEntityAirSolar.class, "tileentityairsolar"); + GameRegistry.registerTileEntity(TileEntityDoubleAirSolar.class, "tileentitydoubleairsolar"); + GameRegistry.registerTileEntity(TileEntityTripleAirSolar.class, "tileentitytripleairsolar"); + GameRegistry.registerTileEntity(TileEntityEarthSolar.class, "tileentityearthsolar"); + GameRegistry.registerTileEntity(TileEntityDoubleEarthSolar.class, "tileentitydoubleearthsolar"); + GameRegistry.registerTileEntity(TileEntityTripleEarthSolar.class, "tileentitytripleearthsolar"); + GameRegistry.registerTileEntity(TileEntityPortableNode.class, "tileentityportablenode"); + GameRegistry.registerTileEntity(TileEntityEssentiaGenerator.class, "tileentityessentiagenerator"); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMT.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMT.java index 3b6e395..86a1fe3 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMT.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMT.java @@ -15,71 +15,71 @@ import tombenpotter.emt.common.module.ic2.tile.TileEntityEMT; public abstract class BlockEMT extends BlockContainer { - public IIcon[] top = new IIcon[16]; - public IIcon[] bottom = new IIcon[16]; - public IIcon[] side = new IIcon[16]; - public IIcon[] frontOff = new IIcon[16]; - public IIcon[] frontOn = new IIcon[16]; + public IIcon[] top = new IIcon[16]; + public IIcon[] bottom = new IIcon[16]; + public IIcon[] side = new IIcon[16]; + public IIcon[] frontOff = new IIcon[16]; + public IIcon[] frontOn = new IIcon[16]; - protected BlockEMT(Material material) { - super(material); - } + protected BlockEMT(Material material) { + super(material); + } - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return null; - } + @Override + public TileEntity createNewTileEntity(World var1, int var2) { + return null; + } - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) { - TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z); - int i = access.getBlockMetadata(x, y, z); + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess access, int x, int y, int z, int side) { + TileEntityEMT tile = (TileEntityEMT) access.getTileEntity(x, y, z); + int i = access.getBlockMetadata(x, y, z); - if (side == 0) { - return this.bottom[i]; - } else if (side == 1) { - return this.top[i]; - } else if (side != tile.facing) { - return this.side[i]; - } else if (tile.isOn) { - return this.frontOn[i]; - } else { - return this.frontOff[i]; - } - } + if (side == 0) { + return this.bottom[i]; + } else if (side == 1) { + return this.top[i]; + } else if (side != tile.facing) { + return this.side[i]; + } else if (tile.isOn) { + return this.frontOn[i]; + } else { + return this.frontOff[i]; + } + } - @Override - public IIcon getIcon(int side, int meta) { - if (side < 1) { - return this.bottom[meta]; - } - if (side == 1) { - return this.top[meta]; - } - if (side == 3) { - return this.frontOff[meta]; - } - return this.side[meta]; - } + @Override + public IIcon getIcon(int side, int meta) { + if (side < 1) { + return this.bottom[meta]; + } + if (side == 1) { + return this.top[meta]; + } + if (side == 3) { + return this.frontOff[meta]; + } + return this.side[meta]; + } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { - int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z); + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack itemStack) { + int facing = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityEMT tile = (TileEntityEMT) world.getTileEntity(x, y, z); - if (facing == 0) - tile.facing = 2; - else if (facing == 1) - tile.facing = 5; - else if (facing == 2) - tile.facing = 3; - else if (facing == 3) - tile.facing = 4; - } + if (facing == 0) + tile.facing = 2; + else if (facing == 1) + tile.facing = 5; + else if (facing == 2) + tile.facing = 3; + else if (facing == 3) + tile.facing = 4; + } - @Override - public int damageDropped(int meta) { - return meta; - } + @Override + public int damageDropped(int meta) { + return meta; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTMachines.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTMachines.java index cc23414..18423c2 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTMachines.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTMachines.java @@ -36,98 +36,98 @@ import java.util.Random; public class BlockEMTMachines extends BlockEMT { - public BlockEMTMachines() { - super(Material.iron); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(4.0F); - } + public BlockEMTMachines() { + super(Material.iron); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(4.0F); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister ir) { - this.blockIcon = ir.registerIcon(ModInformation.texturePath + ":machines/top"); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ir) { + this.blockIcon = ir.registerIcon(ModInformation.texturePath + ":machines/top"); - this.top[0] = ir.registerIcon(ModInformation.texturePath + ":machines/top"); - this.top[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratortop"); + this.top[0] = ir.registerIcon(ModInformation.texturePath + ":machines/top"); + this.top[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratortop"); - this.bottom[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side"); - this.bottom[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator"); + this.bottom[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side"); + this.bottom[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator"); - this.side[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side"); - this.side[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator"); + this.side[0] = ir.registerIcon(ModInformation.texturePath + ":machines/side"); + this.side[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmacerator"); - this.frontOff[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger"); - this.frontOff[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfront"); + this.frontOff[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger"); + this.frontOff[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfront"); - this.frontOn[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger"); - this.frontOn[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfrontactive"); - } + this.frontOn[0] = ir.registerIcon(ModInformation.texturePath + ":machines/wandcharger"); + this.frontOn[1] = ir.registerIcon(ModInformation.texturePath + ":machines/etherealmaceratorfrontactive"); + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item id, CreativeTabs tab, List list) { - list.add(new ItemStack(id, 1, 0)); - list.add(new ItemStack(id, 1, 1)); - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + list.add(new ItemStack(id, 1, 0)); + list.add(new ItemStack(id, 1, 1)); + } - @Override - public TileEntity createTileEntity(World world, int meta) { - if (meta == 0) { - return new TileEntityIndustrialWandRecharge(); - } - if (meta == 1) { - return new TileEntityEtherealMacerator(); - } - return super.createTileEntity(world, meta); - } + @Override + public TileEntity createTileEntity(World world, int meta) { + if (meta == 0) { + return new TileEntityIndustrialWandRecharge(); + } + if (meta == 1) { + return new TileEntityEtherealMacerator(); + } + return super.createTileEntity(world, meta); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) { - player.openGui(ElectroMagicTools.instance, 0, world, x, y, z); - } else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) { - player.openGui(ElectroMagicTools.instance, 1, world, x, y, z); - } - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityIndustrialWandRecharge) { + player.openGui(ElectroMagicTools.instance, 0, world, x, y, z); + } else if (!world.isRemote && world.getTileEntity(x, y, z) instanceof TileEntityEtherealMacerator) { + player.openGui(ElectroMagicTools.instance, 1, world, x, y, z); + } + return true; + } - @Override - public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - dropItems(world, x, y, z); - world.removeTileEntity(x, y, z); - super.breakBlock(world, x, y, z, par5, par6); - } + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + dropItems(world, x, y, z); + world.removeTileEntity(x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } - private void dropItems(World world, int x, int y, int z) { - Random rand = new Random(); + private void dropItems(World world, int x, int y, int z) { + Random rand = new Random(); - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (!(tileEntity instanceof IInventory)) { - return; - } - IInventory inventory = (IInventory) tileEntity; + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (!(tileEntity instanceof IInventory)) { + return; + } + IInventory inventory = (IInventory) tileEntity; - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack item = inventory.getStackInSlot(i); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack item = inventory.getStackInSlot(i); - if (item != null && item.stackSize > 0) { - float rx = rand.nextFloat() * 0.8F + 0.1F; - float ry = rand.nextFloat() * 0.8F + 0.1F; - float rz = rand.nextFloat() * 0.8F + 0.1F; + if (item != null && item.stackSize > 0) { + float rx = rand.nextFloat() * 0.8F + 0.1F; + float ry = rand.nextFloat() * 0.8F + 0.1F; + float rz = rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); + EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); - if (item.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); - } + if (item.hasTagCompound()) { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); + } - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - item.stackSize = 0; - } - } - } + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + item.stackSize = 0; + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars.java index 13ae30d..18cc69e 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars.java @@ -45,148 +45,148 @@ import java.util.List; public class BlockEMTSolars extends BlockEMT { - public BlockEMTSolars() { - super(Material.iron); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(4.0F); - } + public BlockEMTSolars() { + super(Material.iron); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(4.0F); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister ri) { - this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop"); - this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop"); - this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop"); - this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/solartop"); - this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/doublesolartop"); - this.top[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/triplesolartop"); - this.top[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/solartop"); - this.top[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/doublesolartop"); - this.top[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/triplesolartop"); - this.top[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/solartop"); - this.top[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/doublesolartop"); - this.top[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/triplesolartop"); - this.top[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/solartop"); - this.top[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/doublesolartop"); - this.top[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/triplesolartop"); - this.top[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/solartop"); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ri) { + this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/solartop"); + this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/doublesolartop"); + this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/triplesolartop"); + this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/solartop"); + this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/doublesolartop"); + this.top[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/triplesolartop"); + this.top[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/solartop"); + this.top[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/doublesolartop"); + this.top[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/triplesolartop"); + this.top[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/solartop"); + this.top[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/doublesolartop"); + this.top[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/triplesolartop"); + this.top[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/solartop"); + this.top[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/doublesolartop"); + this.top[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/triplesolartop"); + this.top[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/solartop"); - this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); - this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); - this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); - this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); - this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); - this.bottom[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); - this.bottom[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); - this.bottom[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); - this.bottom[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); - this.bottom[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); - this.bottom[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); - this.bottom[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); - this.bottom[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); - this.bottom[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); - this.bottom[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); - this.bottom[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); + this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); + this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); + this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/bottom"); + this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); + this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); + this.bottom[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterbottom"); + this.bottom[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); + this.bottom[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); + this.bottom[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkbottom"); + this.bottom[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); + this.bottom[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); + this.bottom[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderbottom"); + this.bottom[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); + this.bottom[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); + this.bottom[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/firebottom"); + this.bottom[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); - this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.frontOff[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.frontOff[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.frontOff[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.frontOff[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.frontOff[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.frontOff[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.frontOff[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.frontOff[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.frontOff[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.frontOff[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.frontOff[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.frontOff[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.frontOff[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.frontOff[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.frontOff[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.frontOff[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.frontOff[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.frontOff[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.frontOff[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.frontOff[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.frontOff[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.frontOff[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); - this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.side[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); - this.side[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.side[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.side[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); - this.side[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.side[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.side[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); - this.side[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.side[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.side[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); - this.side[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - } + this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/side"); + this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.side[5] = ri.registerIcon(ModInformation.texturePath + ":solars/water/waterside"); + this.side[6] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.side[7] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.side[8] = ri.registerIcon(ModInformation.texturePath + ":solars/dark/darkside"); + this.side[9] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.side[10] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.side[11] = ri.registerIcon(ModInformation.texturePath + ":solars/order/orderside"); + this.side[12] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.side[13] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.side[14] = ri.registerIcon(ModInformation.texturePath + ":solars/fire/fireside"); + this.side[15] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + } - @SideOnly(Side.CLIENT) - @SuppressWarnings({"unchecked", "rawtypes"}) - public void getSubBlocks(Item id, CreativeTabs tab, List list) { - for (int i = 0; i <= 15; i++) { - list.add(new ItemStack(id, 1, i)); - } - } + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + for (int i = 0; i <= 15; i++) { + list.add(new ItemStack(id, 1, i)); + } + } - @Override - public TileEntity createTileEntity(World world, int meta) { - if (meta == 0) { - return new TileEntityCompressedSolar(); - } - if (meta == 1) { - return new TileEntityDoubleCompressedSolar(); - } - if (meta == 2) { - return new TileEntityTripleCompressedSolar(); - } - if (meta == 3) { - return new TileEntityWaterSolar(); - } - if (meta == 4) { - return new TileEntityDoubleWaterSolar(); - } - if (meta == 5) { - return new TileEntityTripleWaterSolar(); - } - if (meta == 6) { - return new TileEntityDarkSolar(); - } - if (meta == 7) { - return new TileEntityDoubleDarkSolar(); - } - if (meta == 8) { - return new TileEntityTripleDarkSolar(); - } - if (meta == 9) { - return new TileEntityOrderSolar(); - } - if (meta == 10) { - return new TileEntityDoubleOrderSolar(); - } - if (meta == 11) { - return new TileEntityTripleOrderSolar(); - } - if (meta == 12) { - return new TileEntityFireSolar(); - } - if (meta == 13) { - return new TileEntityDoubleFireSolar(); - } - if (meta == 14) { - return new TileEntityTripleFireSolar(); - } - if (meta == 15) { - return new TileEntityAirSolar(); - } - return super.createTileEntity(world, meta); - } + @Override + public TileEntity createTileEntity(World world, int meta) { + if (meta == 0) { + return new TileEntityCompressedSolar(); + } + if (meta == 1) { + return new TileEntityDoubleCompressedSolar(); + } + if (meta == 2) { + return new TileEntityTripleCompressedSolar(); + } + if (meta == 3) { + return new TileEntityWaterSolar(); + } + if (meta == 4) { + return new TileEntityDoubleWaterSolar(); + } + if (meta == 5) { + return new TileEntityTripleWaterSolar(); + } + if (meta == 6) { + return new TileEntityDarkSolar(); + } + if (meta == 7) { + return new TileEntityDoubleDarkSolar(); + } + if (meta == 8) { + return new TileEntityTripleDarkSolar(); + } + if (meta == 9) { + return new TileEntityOrderSolar(); + } + if (meta == 10) { + return new TileEntityDoubleOrderSolar(); + } + if (meta == 11) { + return new TileEntityTripleOrderSolar(); + } + if (meta == 12) { + return new TileEntityFireSolar(); + } + if (meta == 13) { + return new TileEntityDoubleFireSolar(); + } + if (meta == 14) { + return new TileEntityTripleFireSolar(); + } + if (meta == 15) { + return new TileEntityAirSolar(); + } + return super.createTileEntity(world, meta); + } - @Override - public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - world.removeTileEntity(x, y, z); - super.breakBlock(world, x, y, z, par5, par6); - } + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + world.removeTileEntity(x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars2.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars2.java index fda936c..c0f6d0d 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars2.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEMTSolars2.java @@ -34,71 +34,71 @@ import java.util.List; public class BlockEMTSolars2 extends BlockEMT { - public BlockEMTSolars2() { - super(Material.iron); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(4.0F); - } + public BlockEMTSolars2() { + super(Material.iron); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(4.0F); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister ri) { - this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/doublesolartop"); - this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/triplesolartop"); - this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/solartop"); - this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/doublesolartop"); - this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/triplesolartop"); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ri) { + this.top[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/doublesolartop"); + this.top[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/triplesolartop"); + this.top[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/solartop"); + this.top[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/doublesolartop"); + this.top[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/triplesolartop"); - this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); - this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); - this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); - this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); - this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); + this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); + this.bottom[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airbottom"); + this.bottom[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); + this.bottom[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); + this.bottom[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthbottom"); - this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); - this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); - } + this.side[0] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + this.side[1] = ri.registerIcon(ModInformation.texturePath + ":solars/air/airside"); + this.side[2] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + this.side[3] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + this.side[4] = ri.registerIcon(ModInformation.texturePath + ":solars/earth/earthside"); + } - @SideOnly(Side.CLIENT) - @SuppressWarnings({"unchecked", "rawtypes"}) - public void getSubBlocks(Item id, CreativeTabs tab, List list) { - for (int i = 0; i <= 4; i++) { - list.add(new ItemStack(id, 1, i)); - } - } + @SideOnly(Side.CLIENT) + @SuppressWarnings({"unchecked", "rawtypes"}) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + for (int i = 0; i <= 4; i++) { + list.add(new ItemStack(id, 1, i)); + } + } - @Override - public TileEntity createTileEntity(World world, int meta) { - if (meta == 0) { - return new TileEntityDoubleAirSolar(); - } - if (meta == 1) { - return new TileEntityTripleAirSolar(); - } - if (meta == 2) { - return new TileEntityEarthSolar(); - } - if (meta == 3) { - return new TileEntityDoubleEarthSolar(); - } - if (meta == 4) { - return new TileEntityTripleEarthSolar(); - } - return super.createTileEntity(world, meta); - } + @Override + public TileEntity createTileEntity(World world, int meta) { + if (meta == 0) { + return new TileEntityDoubleAirSolar(); + } + if (meta == 1) { + return new TileEntityTripleAirSolar(); + } + if (meta == 2) { + return new TileEntityEarthSolar(); + } + if (meta == 3) { + return new TileEntityDoubleEarthSolar(); + } + if (meta == 4) { + return new TileEntityTripleEarthSolar(); + } + return super.createTileEntity(world, meta); + } - @Override - public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { - world.removeTileEntity(x, y, z); - super.breakBlock(world, x, y, z, par5, par6); - } + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) { + world.removeTileEntity(x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerator.java index 7d9b2e0..b81f0c4 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerator.java @@ -15,54 +15,54 @@ import tombenpotter.emt.common.module.ic2.tile.generators.TileEntityEssentiaGene public class BlockEssentiaGenerator extends BlockEMT { - public BlockEssentiaGenerator() { - super(Material.iron); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(4.0F); - } + public BlockEssentiaGenerator() { + super(Material.iron); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(4.0F); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister ri) { - this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top"); - this.top[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); - this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); - this.side[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side"); - } + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ri) { + this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top"); + this.top[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); + this.bottom[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); + this.side[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side"); + } - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityEssentiaGenerator(); - } + @Override + public TileEntity createNewTileEntity(World var1, int var2) { + return new TileEntityEssentiaGenerator(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - TileEntityEssentiaGenerator tile = (TileEntityEssentiaGenerator) world.getTileEntity(x, y, z); - if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IEssentiaContainerItem) { - IEssentiaContainerItem item = (IEssentiaContainerItem) player.getHeldItem().getItem(); - Aspect aspect = item.getAspects(player.getHeldItem()).getAspects()[0]; - if (tile.isFree[0]) { - tile.aspects[0] = aspect.getTag(); - tile.isFree[0] = false; - } else if (tile.isFree[1]) { - tile.aspects[1] = aspect.getTag(); - tile.isFree[1] = false; - } else if (tile.isFree[2]) { - tile.aspects[2] = aspect.getTag(); - tile.isFree[2] = false; - } else if (tile.isFree[3]) { - tile.aspects[3] = aspect.getTag(); - tile.isFree[3] = false; - } - return true; - } else if (player.getHeldItem() == null && player.isSneaking()) { - for (int i = 0; i < tile.aspects.length; i++) { - if (!tile.isFree[i]) { - tile.isFree[i] = true; - } - } - return true; - } - return false; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + TileEntityEssentiaGenerator tile = (TileEntityEssentiaGenerator) world.getTileEntity(x, y, z); + if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IEssentiaContainerItem) { + IEssentiaContainerItem item = (IEssentiaContainerItem) player.getHeldItem().getItem(); + Aspect aspect = item.getAspects(player.getHeldItem()).getAspects()[0]; + if (tile.isFree[0]) { + tile.aspects[0] = aspect.getTag(); + tile.isFree[0] = false; + } else if (tile.isFree[1]) { + tile.aspects[1] = aspect.getTag(); + tile.isFree[1] = false; + } else if (tile.isFree[2]) { + tile.aspects[2] = aspect.getTag(); + tile.isFree[2] = false; + } else if (tile.isFree[3]) { + tile.aspects[3] = aspect.getTag(); + tile.isFree[3] = false; + } + return true; + } else if (player.getHeldItem() == null && player.isSneaking()) { + for (int i = 0; i < tile.aspects.length; i++) { + if (!tile.isFree[i]) { + tile.isFree[i] = true; + } + } + return true; + } + return false; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerators.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerators.java index a55cf24..0f650d0 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerators.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockEssentiaGenerators.java @@ -30,71 +30,71 @@ import java.util.Random; public class BlockEssentiaGenerators extends BlockEMT { - public BlockEssentiaGenerators() { - super(Material.iron); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(4.0F); - } + public BlockEssentiaGenerators() { + super(Material.iron); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(4.0F); + } - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister ri) { - this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top"); + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister ri) { + this.blockIcon = ri.registerIcon(ModInformation.texturePath + ":machines/top"); - for (int i = 0; i <= 5; i++) { - this.top[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); - } + for (int i = 0; i <= 5; i++) { + this.top[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); + } - for (int i = 0; i <= 5; i++) { - this.bottom[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); - } + for (int i = 0; i <= 5; i++) { + this.bottom[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/top"); + } - for (int i = 0; i <= 5; i++) { - this.side[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side"); - } + for (int i = 0; i <= 5; i++) { + this.side[i] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/side"); + } - this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/potentiafront"); - this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/ignisfront"); - this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/auramfront"); - this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/arborfront"); - this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/aerfront"); - } + this.frontOff[0] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/potentiafront"); + this.frontOff[1] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/ignisfront"); + this.frontOff[2] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/auramfront"); + this.frontOff[3] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/arborfront"); + this.frontOff[4] = ri.registerIcon(ModInformation.texturePath + ":essentiagenerator/aerfront"); + } - @SuppressWarnings({"unchecked", "rawtypes"}) - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item id, CreativeTabs tab, List list) { - list.add(new ItemStack(id, 1, 0)); - list.add(new ItemStack(id, 1, 1)); - list.add(new ItemStack(id, 1, 2)); - list.add(new ItemStack(id, 1, 3)); - list.add(new ItemStack(id, 1, 4)); - } + @SuppressWarnings({"unchecked", "rawtypes"}) + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + list.add(new ItemStack(id, 1, 0)); + list.add(new ItemStack(id, 1, 1)); + list.add(new ItemStack(id, 1, 2)); + list.add(new ItemStack(id, 1, 3)); + list.add(new ItemStack(id, 1, 4)); + } - @Override - public TileEntity createTileEntity(World world, int meta) { - if (meta == 0) { - return new TileEntityPotentiaGenerator(); - } - if (meta == 1) { - return new TileEntityIgnisGenerator(); - } - if (meta == 2) { - return new TileEntityAuramGenerator(); - } - if (meta == 3) { - return new TileEntityArborGenerator(); - } - if (meta == 4) { - return new TileEntityAerGenerator(); - } - return super.createTileEntity(world, meta); - } + @Override + public TileEntity createTileEntity(World world, int meta) { + if (meta == 0) { + return new TileEntityPotentiaGenerator(); + } + if (meta == 1) { + return new TileEntityIgnisGenerator(); + } + if (meta == 2) { + return new TileEntityAuramGenerator(); + } + if (meta == 3) { + return new TileEntityArborGenerator(); + } + if (meta == 4) { + return new TileEntityAerGenerator(); + } + return super.createTileEntity(world, meta); + } - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - float f = (float) par2 + 0.5F; - float f1 = (float) par3 + 1.0F; - float f2 = (float) par4 + 0.5F; - par1World.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); - } + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { + float f = (float) par2 + 0.5F; + float f1 = (float) par3 + 1.0F; + float f2 = (float) par4 + 0.5F; + par1World.spawnParticle("largesmoke", f, f1, f2, 0.0D, 0.0D, 0.0D); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockPortableNode.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockPortableNode.java index f38da74..8d95986 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockPortableNode.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockPortableNode.java @@ -34,73 +34,73 @@ import java.util.Random; public class BlockPortableNode extends BlockAiry { - public IIcon[] texture = new IIcon[1]; + public IIcon[] texture = new IIcon[1]; - public BlockPortableNode() { - this.setCreativeTab(ElectroMagicTools.tabEMT); - setBlockUnbreakable(); - } + public BlockPortableNode() { + this.setCreativeTab(ElectroMagicTools.tabEMT); + setBlockUnbreakable(); + } - @Override - public TileEntity createTileEntity(World world, int meta) { - return new TileEntityPortableNode(); - } + @Override + public TileEntity createTileEntity(World world, int meta) { + return new TileEntityPortableNode(); + } - @Override - public int quantityDropped(Random par1Random) { - return 0; - } + @Override + public int quantityDropped(Random par1Random) { + return 0; + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - protected boolean canSilkHarvest() { - return false; - } + @Override + protected boolean canSilkHarvest() { + return false; + } - public boolean canEntityDestroy(World world, int x, int y, int z, Entity entity) { - return false; - } + public boolean canEntityDestroy(World world, int x, int y, int z, Entity entity) { + return false; + } - public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { - } + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + } - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister ri) { - this.texture[0] = ri.registerIcon(ModInformation.texturePath + ":portablenode"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister ri) { + this.texture[0] = ri.registerIcon(ModInformation.texturePath + ":portablenode"); + } - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int meta) { - return this.texture[0]; - } + @SideOnly(Side.CLIENT) + public IIcon getIcon(int side, int meta) { + return this.texture[0]; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item id, CreativeTabs tab, List list) { - list.add(new ItemStack(id, 1, 0)); - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item id, CreativeTabs tab, List list) { + list.add(new ItemStack(id, 1, 0)); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { - if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) { - world.setBlockToAir(x, y, z); - world.removeTileEntity(x, y, z); - } - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + if (!world.isRemote && player.isSneaking() && player.getHeldItem() == null) { + world.setBlockToAir(x, y, z); + world.removeTileEntity(x, y, z); + } + return true; + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return null; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return null; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockShield.java b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockShield.java index 61f11c7..a56c594 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockShield.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/blocks/BlockShield.java @@ -29,61 +29,61 @@ import java.util.Random; public class BlockShield extends Block { - public BlockShield() { - super(Material.rock); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setHardness(1F); - this.setResistance(10000000000000000000000000000000000000F); - } + public BlockShield() { + super(Material.rock); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setHardness(1F); + this.setResistance(10000000000000000000000000000000000000F); + } - @Override - public int quantityDropped(Random par1Random) { - return 0; - } + @Override + public int quantityDropped(Random par1Random) { + return 0; + } - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 0; + } - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister iconRegister) { - this.blockIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shield"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconRegister) { + this.blockIcon = iconRegister.registerIcon(ModInformation.texturePath + ":shield"); + } - @Override - public boolean isOpaqueCube() { - return false; - } + @Override + public boolean isOpaqueCube() { + return false; + } - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override + public boolean renderAsNormalBlock() { + return false; + } - @Override - protected boolean canSilkHarvest() { - return false; - } + @Override + protected boolean canSilkHarvest() { + return false; + } - @Override - public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { - return false; - } + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } - @Override - public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { - return false; - } + @Override + public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { + return false; + } - @Override - public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { - return false; - } + @Override + public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) { + return false; + } - @Override - public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { - } + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/ItemElectricScribingTools.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/ItemElectricScribingTools.java index 6933eb5..44b84c5 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/ItemElectricScribingTools.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/ItemElectricScribingTools.java @@ -27,55 +27,55 @@ import java.util.List; public class ItemElectricScribingTools extends ItemInkwell implements IElectricItem, IScribeTools { - public static int maxCharge = 400; + public static int maxCharge = 400; - public ItemElectricScribingTools() { - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(400); - this.setMaxStackSize(1); - } + public ItemElectricScribingTools() { + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(400); + this.setMaxStackSize(1); + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return 1; - } + @Override + public int getTier(ItemStack itemStack) { + return 1; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return 5; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return 5; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemElectricGoggles.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemElectricGoggles.java index 84e06c3..7905139 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemElectricGoggles.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemElectricGoggles.java @@ -41,162 +41,162 @@ import java.util.List; public class ItemElectricGoggles extends ItemArmor implements IElectricItem, IVisDiscountGear, IGoggles, IRevealer, IMetalArmor, ISpecialArmor { - public double maxCharge = 10000; - public double transferLimit = 10; - public int tier = 2; - public int energyPerDamage = 100; - public int visDiscount = 5; + public double maxCharge = 10000; + public double transferLimit = 10; + public int tier = 2; + public int energyPerDamage = 100; + public int visDiscount = 5; - public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) { - super(material, par3, par4); - this.setCreativeTab(ElectroMagicTools.tabEMT); - } + public ItemElectricGoggles(ArmorMaterial material, int par3, int par4) { + super(material, par3, par4); + this.setCreativeTab(ElectroMagicTools.tabEMT); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":electricgoggles"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":electricgoggles"); + } - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return ModInformation.texturePath + ":textures/models/electricgoggles.png"; - } + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + return ModInformation.texturePath + ":textures/models/electricgoggles.png"; + } - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - } + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public boolean isRepairable() { + return false; + } - @Override - public int getItemEnchantability() { - if (ConfigHandler.enchanting == false) { - return 0; - } else { - return 4; - } - } + @Override + public int getItemEnchantability() { + if (ConfigHandler.enchanting == false) { + return 0; + } else { + return 4; + } + } - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - if (ConfigHandler.enchanting == false) { - return false; - } else { - return true; - } - } + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + if (ConfigHandler.enchanting == false) { + return false; + } else { + return true; + } + } - @Override - public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) { - return visDiscount; - } + @Override + public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) { + return visDiscount; + } - @Override - public boolean showNodes(ItemStack itemstack, EntityLivingBase player) { - return true; - } + @Override + public boolean showNodes(ItemStack itemstack, EntityLivingBase player) { + return true; + } - @Override - public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) { - return true; - } + @Override + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) { + return true; + } - @Override - public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) { - return true; - } + @Override + public boolean isMetalArmor(ItemStack itemstack, EntityPlayer player) { + return true; + } - @Override - public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { - if (source.isUnblockable()) { - return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0); - } else { - double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio(); - int energyPerDamage = getEnergyPerDamage(); - double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage; - return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit); - } - } + @Override + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { + if (source.isUnblockable()) { + return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, 0.0D, 0); + } else { + double absorptionRatio = getBaseAbsorptionRatio() * getDamageAbsorptionRatio(); + int energyPerDamage = getEnergyPerDamage(); + double damageLimit = energyPerDamage <= 0 ? 0 : (25 * ElectricItem.manager.getCharge(armor)) / energyPerDamage; + return new net.minecraftforge.common.ISpecialArmor.ArmorProperties(0, absorptionRatio, (int) damageLimit); + } + } - @Override - public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { - if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) { - return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio()); - } else { - return 0; - } - } + @Override + public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { + if (ElectricItem.manager.getCharge(armor) >= getEnergyPerDamage()) { + return (int) Math.round(20D * getBaseAbsorptionRatio() * getDamageAbsorptionRatio()); + } else { + return 0; + } + } - @SuppressWarnings({"unchecked", "rawtypes"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { - list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%"); - } + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { + list.add(TextHelper.localize("tooltip.EMT.visDiscount") + ": " + String.valueOf(visDiscount) + "%"); + } - @Override - public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) { - ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false); - } + @Override + public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) { + ElectricItem.manager.discharge(stack, damage * getEnergyPerDamage(), 0x7fffffff, true, false, false); + } - public double getDamageAbsorptionRatio() { - return 1.1000000000000001D; - } + public double getDamageAbsorptionRatio() { + return 1.1000000000000001D; + } - public int getEnergyPerDamage() { - return energyPerDamage; - } + public int getEnergyPerDamage() { + return energyPerDamage; + } - private double getBaseAbsorptionRatio() { - return 0.14999999999999999D; - } + private double getBaseAbsorptionRatio() { + return 0.14999999999999999D; + } /* IC2 API METHODS */ - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return 2; - } + @Override + public int getTier(ItemStack itemStack) { + return 2; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return transferLimit; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return transferLimit; + } - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemNanoGoggles.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemNanoGoggles.java index 5eab95e..ebdcc00 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemNanoGoggles.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemNanoGoggles.java @@ -29,45 +29,45 @@ import tombenpotter.emt.common.util.ConfigHandler; public class ItemNanoGoggles extends ItemElectricGoggles { - public ItemNanoGoggles(ArmorMaterial material, int par3, int par4) { - super(material, par3, par4); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(27); - this.setMaxStackSize(1); - visDiscount = 6; - tier = 3; - maxCharge = 100000; - energyPerDamage = 1000; - transferLimit = 100; - } + public ItemNanoGoggles(ArmorMaterial material, int par3, int par4) { + super(material, par3, par4); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(27); + this.setMaxStackSize(1); + visDiscount = 6; + tier = 3; + maxCharge = 100000; + energyPerDamage = 1000; + transferLimit = 100; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanothaumichelmet"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":nanothaumichelmet"); + } - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return ModInformation.texturePath + ":textures/models/thaumicnanohelmet.png"; - } + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + return ModInformation.texturePath + ":textures/models/thaumicnanohelmet.png"; + } - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if (ConfigHandler.nightVisionOff == false) { - if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + if (ConfigHandler.nightVisionOff == false) { + if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { - int x = MathHelper.floor_double(player.posX); - int z = MathHelper.floor_double(player.posZ); - int y = MathHelper.floor_double(player.posY); + int x = MathHelper.floor_double(player.posX); + int z = MathHelper.floor_double(player.posZ); + int y = MathHelper.floor_double(player.posY); - int lightlevel = player.worldObj.getBlockLightValue(x, y, z); - if (lightlevel >= 0) - player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); - ElectricItem.manager.use(itemStack, 1 / 1000, player); - } else { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); - } - } - } + int lightlevel = player.worldObj.getBlockLightValue(x, y, z); + if (lightlevel >= 0) + player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); + ElectricItem.manager.use(itemStack, 1 / 1000, player); + } else { + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemQuantumGoggles.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemQuantumGoggles.java index 5774ea1..77ba064 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemQuantumGoggles.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemQuantumGoggles.java @@ -35,76 +35,76 @@ import java.util.Map; public class ItemQuantumGoggles extends ItemNanoGoggles { - private static final Map potionCost = new HashMap(); + private static final Map potionCost = new HashMap(); - public ItemQuantumGoggles(ArmorMaterial material, int par3, int par4) { - super(material, par3, par4); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(27); - this.setMaxStackSize(1); - maxCharge = 10000000; - tier = 3; - visDiscount = 8; - transferLimit = 10000; - energyPerDamage = 1000; + public ItemQuantumGoggles(ArmorMaterial material, int par3, int par4) { + super(material, par3, par4); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(27); + this.setMaxStackSize(1); + maxCharge = 10000000; + tier = 3; + visDiscount = 8; + transferLimit = 10000; + energyPerDamage = 1000; - potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000)); - potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000)); - potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000)); - } + potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000)); + potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000)); + potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000)); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumthaumichelmet"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":quantumthaumichelmet"); + } - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return ModInformation.texturePath + ":textures/models/thaumicquantumhelmet.png"; - } + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + return ModInformation.texturePath + ":textures/models/thaumicquantumhelmet.png"; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - int refill = player.getAir(); - if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) { - player.setAir(refill + 200); - ElectricItem.manager.use(itemStack, 1000, null); - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + int refill = player.getAir(); + if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) { + player.setAir(refill + 200); + ElectricItem.manager.use(itemStack, 1000, null); + } - Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator(); - do { - if (!i$.hasNext()) { - break; - } - { - PotionEffect effect = (PotionEffect) i$.next(); - int id = effect.getPotionID(); - Integer cost = (Integer) potionCost.get(Integer.valueOf(id)); - if (cost != null) { - cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1)); - if (ElectricItem.manager.canUse(itemStack, cost.intValue())) { - ElectricItem.manager.use(itemStack, cost.intValue(), null); - ItemStack milk = (new ItemStack(Items.milk_bucket)); - player.curePotionEffects(milk); - } - } - } - } while (true); + Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator(); + do { + if (!i$.hasNext()) { + break; + } + { + PotionEffect effect = (PotionEffect) i$.next(); + int id = effect.getPotionID(); + Integer cost = (Integer) potionCost.get(Integer.valueOf(id)); + if (cost != null) { + cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1)); + if (ElectricItem.manager.canUse(itemStack, cost.intValue())) { + ElectricItem.manager.use(itemStack, cost.intValue(), null); + ItemStack milk = (new ItemStack(Items.milk_bucket)); + player.curePotionEffects(milk); + } + } + } + } while (true); - if (ConfigHandler.nightVisionOff == false) { - if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { - int x = MathHelper.floor_double(player.posX); - int z = MathHelper.floor_double(player.posZ); - int y = MathHelper.floor_double(player.posY); - int lightlevel = player.worldObj.getBlockLightValue(x, y, z); - if (lightlevel >= 0) - player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); - ElectricItem.manager.use(itemStack, 1 / 1000, player); - } else { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); - } - } - } + if (ConfigHandler.nightVisionOff == false) { + if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { + int x = MathHelper.floor_double(player.posX); + int z = MathHelper.floor_double(player.posZ); + int y = MathHelper.floor_double(player.posY); + int lightlevel = player.worldObj.getBlockLightValue(x, y, z); + if (lightlevel >= 0) + player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); + ElectricItem.manager.use(itemStack, 1 / 1000, player); + } else { + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemSolarHelmetRevealing.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemSolarHelmetRevealing.java index 054403c..63e7c05 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemSolarHelmetRevealing.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/armor/goggles/ItemSolarHelmetRevealing.java @@ -36,156 +36,156 @@ import java.util.Map; public class ItemSolarHelmetRevealing extends ItemQuantumGoggles { - private int ticker; - private int generating; - private int genDay; - private int genNight; - private boolean sunIsUp; - private boolean skyIsVisible; - private boolean noSunWorld; - private boolean dampPlace; + private int ticker; + private int generating; + private int genDay; + private int genNight; + private boolean sunIsUp; + private boolean skyIsVisible; + private boolean noSunWorld; + private boolean dampPlace; - @SuppressWarnings("rawtypes") - private static final Map potionCost = new HashMap(); + @SuppressWarnings("rawtypes") + private static final Map potionCost = new HashMap(); - @SuppressWarnings("unchecked") - public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) { - super(material, par3, par4); - this.setMaxDamage(27); - this.setMaxStackSize(1); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.maxCharge = 1000000; - this.genDay = 256; - this.genNight = 128; - maxCharge = 10000000; - visDiscount = 7; - tier = 3; - transferLimit = 10000; - energyPerDamage = 10000; + @SuppressWarnings("unchecked") + public ItemSolarHelmetRevealing(ArmorMaterial material, int par3, int par4) { + super(material, par3, par4); + this.setMaxDamage(27); + this.setMaxStackSize(1); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.maxCharge = 1000000; + this.genDay = 256; + this.genNight = 128; + maxCharge = 10000000; + visDiscount = 7; + tier = 3; + transferLimit = 10000; + energyPerDamage = 10000; - potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000)); - potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000)); - potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000)); - } + potionCost.put(Integer.valueOf(Potion.poison.id), Integer.valueOf(10000)); + potionCost.put(Integer.valueOf(Potion.wither.id), Integer.valueOf(15000)); + potionCost.put(Integer.valueOf(Potion.confusion.id), Integer.valueOf(5000)); + } - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) { - return ModInformation.texturePath + ":textures/models/solarrevealinghelmet.png"; - } + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layerType) { + return ModInformation.texturePath + ":textures/models/solarrevealinghelmet.png"; + } - @SuppressWarnings("unchecked") - @Override - public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) { - if (ConfigHandler.nightVisionOff == false) { - if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { + @SuppressWarnings("unchecked") + @Override + public void onArmorTick(World worldObj, EntityPlayer player, ItemStack itemStack) { + if (ConfigHandler.nightVisionOff == false) { + if (ElectricItem.manager.canUse(itemStack, 1 / 1000)) { - int x = MathHelper.floor_double(player.posX); - int z = MathHelper.floor_double(player.posZ); - int y = MathHelper.floor_double(player.posY); + int x = MathHelper.floor_double(player.posX); + int z = MathHelper.floor_double(player.posZ); + int y = MathHelper.floor_double(player.posY); - int lightlevel = player.worldObj.getBlockLightValue(x, y, z); - if (lightlevel >= 0) - player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); - ElectricItem.manager.use(itemStack, 1 / 1000, player); - } else { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); - } - } + int lightlevel = player.worldObj.getBlockLightValue(x, y, z); + if (lightlevel >= 0) + player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 300, -3)); + ElectricItem.manager.use(itemStack, 1 / 1000, player); + } else { + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 0, true)); + } + } - int refill = player.getAir(); - if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) { - player.setAir(refill + 200); - ElectricItem.manager.use(itemStack, 1000, null); - } + int refill = player.getAir(); + if (ElectricItem.manager.canUse(itemStack, 1000) && refill < 100) { + player.setAir(refill + 200); + ElectricItem.manager.use(itemStack, 1000, null); + } - @SuppressWarnings("rawtypes") Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator(); - do { - if (!i$.hasNext()) { - break; - } - { - PotionEffect effect = (PotionEffect) i$.next(); - int id = effect.getPotionID(); - Integer cost = (Integer) potionCost.get(Integer.valueOf(id)); - if (cost != null) { - cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1)); - if (ElectricItem.manager.canUse(itemStack, cost.intValue())) { - ElectricItem.manager.use(itemStack, cost.intValue(), null); - ItemStack milk = (new ItemStack(Items.milk_bucket)); - player.curePotionEffects(milk); - } - } - } - } while (true); + @SuppressWarnings("rawtypes") Iterator i$ = (new LinkedList(player.getActivePotionEffects())).iterator(); + do { + if (!i$.hasNext()) { + break; + } + { + PotionEffect effect = (PotionEffect) i$.next(); + int id = effect.getPotionID(); + Integer cost = (Integer) potionCost.get(Integer.valueOf(id)); + if (cost != null) { + cost = Integer.valueOf(cost.intValue() * (effect.getAmplifier() + 1)); + if (ElectricItem.manager.canUse(itemStack, cost.intValue())) { + ElectricItem.manager.use(itemStack, cost.intValue(), null); + ItemStack milk = (new ItemStack(Items.milk_bucket)); + player.curePotionEffects(milk); + } + } + } + } while (true); - if (worldObj.isRemote) { - return; - } - checkForSun(player); - if (this.generating > 0) { - int energyLeft = this.generating; - for (int i = 0; i < player.inventory.armorInventory.length; i++) { - if (energyLeft > 0) { - if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } else { - return; - } - } - for (int j = 0; j < player.inventory.mainInventory.length; j++) { - if (energyLeft > 0) { - if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } else { - return; - } - } - } - } + if (worldObj.isRemote) { + return; + } + checkForSun(player); + if (this.generating > 0) { + int energyLeft = this.generating; + for (int i = 0; i < player.inventory.armorInventory.length; i++) { + if (energyLeft > 0) { + if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } else { + return; + } + } + for (int j = 0; j < player.inventory.mainInventory.length; j++) { + if (energyLeft > 0) { + if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } else { + return; + } + } + } + } - public int checkForSun(EntityPlayer player) { - if (this.ticker++ % tickRate() == 0) { - updateVisibility(player); - } - if ((this.sunIsUp) && (this.skyIsVisible)) { - this.generating = (0 + this.genDay); - return this.generating; - } - if (this.skyIsVisible) { - this.generating = (0 + this.genNight); - return this.generating; - } - this.generating = 0; - return this.generating; - } + public int checkForSun(EntityPlayer player) { + if (this.ticker++ % tickRate() == 0) { + updateVisibility(player); + } + if ((this.sunIsUp) && (this.skyIsVisible)) { + this.generating = (0 + this.genDay); + return this.generating; + } + if (this.skyIsVisible) { + this.generating = (0 + this.genNight); + return this.generating; + } + this.generating = 0; + return this.generating; + } - public void updateVisibility(EntityPlayer player) { - this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0); - this.noSunWorld = player.worldObj.provider.hasNoSky; - Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering()))); - if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) { - this.sunIsUp = false; - } else { - this.sunIsUp = true; - } - if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) { - this.skyIsVisible = false; - } else { - this.skyIsVisible = true; - } - } + public void updateVisibility(EntityPlayer player) { + this.dampPlace = (player.worldObj.getWorldChunkManager().getBiomeGenAt((int) player.posX, (int) player.posZ).getIntRainfall() > 0); + this.noSunWorld = player.worldObj.provider.hasNoSky; + Boolean rainWeather = Boolean.valueOf((this.dampPlace) && ((player.worldObj.isRaining()) || (player.worldObj.isThundering()))); + if ((!player.worldObj.isDaytime()) || (rainWeather.booleanValue())) { + this.sunIsUp = false; + } else { + this.sunIsUp = true; + } + if ((!player.worldObj.canBlockSeeTheSky((int) player.posX, (int) player.posY + 1, (int) player.posZ)) || (this.noSunWorld)) { + this.skyIsVisible = false; + } else { + this.skyIsVisible = true; + } + } - public static int tickRate() { - return 128; - } + public static int tickRate() { + return 128; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":solarrevealinghelmet"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":solarrevealinghelmet"); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTMachines.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTMachines.java index 5f5d5af..a48af3d 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTMachines.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTMachines.java @@ -18,35 +18,35 @@ import net.minecraft.item.ItemStack; public class ItemBlockEMTMachines extends ItemBlock { - public ItemBlockEMTMachines(Block id) { - super(id); - setHasSubtypes(true); - } + public ItemBlockEMTMachines(Block id) { + super(id); + setHasSubtypes(true); + } - @Override - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "wandrecharge"; - break; - } - case 1: { - name = "etheralprocessor"; - break; - } - case 2: { - name = "raindispeller"; - break; - } - default: - name = "nothing"; - } - return getUnlocalizedName() + "." + name; - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + String name = ""; + switch (itemstack.getItemDamage()) { + case 0: { + name = "wandrecharge"; + break; + } + case 1: { + name = "etheralprocessor"; + break; + } + case 2: { + name = "raindispeller"; + break; + } + default: + name = "nothing"; + } + return getUnlocalizedName() + "." + name; + } - @Override - public int getMetadata(int par1) { - return par1; - } + @Override + public int getMetadata(int par1) { + return par1; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars.java index f8cbcff..7fcfa2c 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars.java @@ -25,172 +25,172 @@ import static tombenpotter.emt.common.util.TextHelper.localize; public class ItemBlockEMTSolars extends ItemBlock { - public ItemBlockEMTSolars(Block id) { - super(id); - setHasSubtypes(true); - } + public ItemBlockEMTSolars(Block id) { + super(id); + setHasSubtypes(true); + } - @Override - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "compressed"; - break; - } - case 1: { - name = "doublecompressed"; - break; - } - case 2: { - name = "triplecompressed"; - break; - } - case 3: { - name = "water"; - break; - } - case 4: { - name = "doublewater"; - break; - } - case 5: { - name = "triplewater"; - break; - } - case 6: { - name = "dark"; - break; - } - case 7: { - name = "doubledark"; - break; - } - case 8: { - name = "tripledark"; - break; - } - case 9: { - name = "order"; - break; - } - case 10: { - name = "doubleorder"; - break; - } - case 11: { - name = "tripleorder"; - break; - } - case 12: { - name = "fire"; - break; - } - case 13: { - name = "doublefire"; - break; - } - case 14: { - name = "triplefire"; - break; - } - case 15: { - name = "air"; - break; - } - default: - name = "nothing"; - break; - } - return getUnlocalizedName() + "." + name; - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + String name = ""; + switch (itemstack.getItemDamage()) { + case 0: { + name = "compressed"; + break; + } + case 1: { + name = "doublecompressed"; + break; + } + case 2: { + name = "triplecompressed"; + break; + } + case 3: { + name = "water"; + break; + } + case 4: { + name = "doublewater"; + break; + } + case 5: { + name = "triplewater"; + break; + } + case 6: { + name = "dark"; + break; + } + case 7: { + name = "doubledark"; + break; + } + case 8: { + name = "tripledark"; + break; + } + case 9: { + name = "order"; + break; + } + case 10: { + name = "doubleorder"; + break; + } + case 11: { + name = "tripleorder"; + break; + } + case 12: { + name = "fire"; + break; + } + case 13: { + name = "doublefire"; + break; + } + case 14: { + name = "triplefire"; + break; + } + case 15: { + name = "air"; + break; + } + default: + name = "nothing"; + break; + } + return getUnlocalizedName() + "." + name; + } - @Override - public int getMetadata(int par1) { - return par1; - } + @Override + public int getMetadata(int par1) { + return par1; + } - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) { - switch (itemstack.getItemDamage()) { - case 0: { - list.add(ConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick")); - break; - } - case 1: { - list.add(ConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); - break; - } - case 2: { - list.add(ConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); - break; - } - case 3: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); - break; - } - case 4: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); - break; - } - case 5: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); - break; - } - case 6: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); - break; - } - case 7: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); - break; - } - case 8: { - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); - break; - } - case 9: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); - break; - } - case 10: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); - break; - } + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) { + switch (itemstack.getItemDamage()) { + case 0: { + list.add(ConfigHandler.compressedSolarOutput + localize("tooltip.EMT.euPerTick")); + break; + } + case 1: { + list.add(ConfigHandler.doubleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); + break; + } + case 2: { + list.add(ConfigHandler.tripleCompressedSolarOutput + localize("tooltip.EMT.euPerTick")); + break; + } + case 3: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + break; + } + case 4: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + break; + } + case 5: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.raining")); + break; + } + case 6: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); + break; + } + case 7: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); + break; + } + case 8: { + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick") + " " + localize("tooltip.EMT.night")); + break; + } + case 9: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); + break; + } + case 10: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); + break; + } - case 11: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); - break; - } - case 12: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); - break; - } - case 13: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); - break; - } - case 14: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); - break; - } - case 15: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); - break; - } - default: { - list.add(localize("tooltip.EMT.forget")); - break; - } - } - } + case 11: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.triple")); + break; + } + case 12: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + break; + } + case 13: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + break; + } + case 14: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.lava")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double") + " " + localize("tooltip.EMT.output.double.nether")); + break; + } + case 15: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); + break; + } + default: { + list.add(localize("tooltip.EMT.forget")); + break; + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars2.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars2.java index 318d3f9..ddc4c4e 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars2.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEMTSolars2.java @@ -25,80 +25,80 @@ import static tombenpotter.emt.common.util.TextHelper.localize; public class ItemBlockEMTSolars2 extends ItemBlock { - public ItemBlockEMTSolars2(Block id) { - super(id); - setHasSubtypes(true); - } + public ItemBlockEMTSolars2(Block id) { + super(id); + setHasSubtypes(true); + } - @Override - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "doubleair"; - break; - } - case 1: { - name = "tripleair"; - break; - } - case 2: { - name = "earth"; - break; - } - case 3: { - name = "doubleearth"; - break; - } - case 4: { - name = "tripleearth"; - break; - } - default: - name = "nothing"; - break; - } - return getUnlocalizedName() + "." + name; - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + String name = ""; + switch (itemstack.getItemDamage()) { + case 0: { + name = "doubleair"; + break; + } + case 1: { + name = "tripleair"; + break; + } + case 2: { + name = "earth"; + break; + } + case 3: { + name = "doubleearth"; + break; + } + case 4: { + name = "tripleearth"; + break; + } + default: + name = "nothing"; + break; + } + return getUnlocalizedName() + "." + name; + } - @Override - public int getMetadata(int par1) { - return par1; - } + @Override + public int getMetadata(int par1) { + return par1; + } - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) { - switch (itemstack.getItemDamage()) { - case 0: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); - break; - } - case 1: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); - break; - } - case 2: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); - break; - } - case 3: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); - break; - } - case 4: { - list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); - list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); - break; - } - default: { - list.add(localize("tooltip.EMT.forget")); - break; - } - } - } + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4) { + switch (itemstack.getItemDamage()) { + case 0: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); + break; + } + case 1: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.height")); + break; + } + case 2: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.compressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); + break; + } + case 3: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.doubleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); + break; + } + case 4: { + list.add(TextHelper.BRIGHT_BLUE + localize("tooltip.EMT.normalConditions") + ": " + TextHelper.LIGHT_GRAY + ConfigHandler.tripleCompressedSolarOutput + " " + localize("tooltip.EMT.euPerTick")); + list.add(TextHelper.BRIGHT_GREEN + localize("tooltip.EMT.specialEffect") + ": " + TextHelper.LIGHT_GRAY + localize("tooltip.EMT.output.double.half") + " " + localize("tooltip.EMT.output.double.half.low")); + break; + } + default: { + list.add(localize("tooltip.EMT.forget")); + break; + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerator.java index 54ad65a..5bf0ea8 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerator.java @@ -9,12 +9,12 @@ import java.util.List; public class ItemBlockEssentiaGenerator extends ItemBlock { - public ItemBlockEssentiaGenerator(Block id) { - super(id); - } + public ItemBlockEssentiaGenerator(Block id) { + super(id); + } - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - // list.add(""); - } + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + // list.add(""); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerators.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerators.java index 50bb595..f789b95 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerators.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/blocks/ItemBlockEssentiaGenerators.java @@ -21,48 +21,48 @@ import java.util.List; public class ItemBlockEssentiaGenerators extends ItemBlock { - public ItemBlockEssentiaGenerators(Block id) { - super(id); - setHasSubtypes(true); - } + public ItemBlockEssentiaGenerators(Block id) { + super(id); + setHasSubtypes(true); + } - @Override - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "potentia"; - break; - } - case 1: { - name = "ignis"; - break; - } - case 2: { - name = "auram"; - break; - } - case 3: { - name = "arbor"; - break; - } - case 4: { - name = "aer"; - break; - } - default: - name = "nothing"; - } - return getUnlocalizedName() + "." + name; - } + @Override + public String getUnlocalizedName(ItemStack itemstack) { + String name = ""; + switch (itemstack.getItemDamage()) { + case 0: { + name = "potentia"; + break; + } + case 1: { + name = "ignis"; + break; + } + case 2: { + name = "auram"; + break; + } + case 3: { + name = "arbor"; + break; + } + case 4: { + name = "aer"; + break; + } + default: + name = "nothing"; + } + return getUnlocalizedName() + "." + name; + } - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - list.add("Going away next version."); - } + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + list.add("Going away next version."); + } - @Override - public int getMetadata(int meta) { - return meta; - } + @Override + public int getMetadata(int meta) { + return meta; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemChargeFocus.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemChargeFocus.java index da4af72..bb3051a 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemChargeFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemChargeFocus.java @@ -30,62 +30,62 @@ import tombenpotter.emt.common.util.ConfigHandler; public class ItemChargeFocus extends ItemBaseFocus { - private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10); + private static final AspectList visCost = new AspectList().add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10).add(Aspect.EARTH, 10).add(Aspect.ORDER, 10).add(Aspect.ENTROPY, 10); - public ItemChargeFocus() { - super(); - } + public ItemChargeFocus() { + super(); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":chargefocus"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":chargefocus"); + } - @Override - public int getFocusColor() { - return 0xFFFF00; - } + @Override + public int getFocusColor() { + return 0xFFFF00; + } - @Override - public AspectList getVisCost() { - return visCost; - } + @Override + public AspectList getVisCost() { + return visCost; + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "WANDCHARGING"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "WANDCHARGING"; + } - @Override - public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { - ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); - if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { - if (!world.isRemote) { + @Override + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { + ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); + if (wand.consumeAllVis(itemstack, player, getVisCost(), true, true)) { + if (!world.isRemote) { - int energyLeft = ConfigHandler.chargeFocusProduction; - for (int i = 0; i < player.inventory.armorInventory.length; i++) { - if (energyLeft > 0) { - if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } else { - return itemstack; - } - } - for (int j = 0; j < player.inventory.mainInventory.length; j++) { - if (energyLeft > 0) { - if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { - double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false); - energyLeft -= sentPacket; - } - } else { - return itemstack; - } - } - } - } - return itemstack; - } + int energyLeft = ConfigHandler.chargeFocusProduction; + for (int i = 0; i < player.inventory.armorInventory.length; i++) { + if (energyLeft > 0) { + if ((player.inventory.armorInventory[i] != null) && (player.inventory.armorInventory[i].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(player.inventory.armorInventory[i], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } else { + return itemstack; + } + } + for (int j = 0; j < player.inventory.mainInventory.length; j++) { + if (energyLeft > 0) { + if ((player.inventory.mainInventory[j] != null) && (player.inventory.mainInventory[j].getItem() instanceof IElectricItem)) { + double sentPacket = ElectricItem.manager.charge(player.inventory.mainInventory[j], energyLeft, 4, false, false); + energyLeft -= sentPacket; + } + } else { + return itemstack; + } + } + } + } + return itemstack; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemWandChargingFocus.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemWandChargingFocus.java index f1c806e..9b30539 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemWandChargingFocus.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/foci/ItemWandChargingFocus.java @@ -15,55 +15,55 @@ import tombenpotter.emt.common.util.ConfigHandler; public class ItemWandChargingFocus extends ItemBaseFocus { - AspectList visCost = new AspectList(); + AspectList visCost = new AspectList(); - public ItemWandChargingFocus() { - super(); - } + public ItemWandChargingFocus() { + super(); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":wandchargefocus"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":wandchargefocus"); + } - @Override - public int getFocusColor() { - return 0xFFFF450; - } + @Override + public int getFocusColor() { + return 0xFFFF450; + } - @Override - public String getSortingHelper(ItemStack itemstack) { - return "ELECTRICCHARGING"; - } + @Override + public String getSortingHelper(ItemStack itemstack) { + return "ELECTRICCHARGING"; + } - @Override - public boolean isVisCostPerTick() { - return true; - } + @Override + public boolean isVisCostPerTick() { + return true; + } - @Override - public AspectList getVisCost() { - return visCost; - } + @Override + public AspectList getVisCost() { + return visCost; + } - @Override - public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) { + @Override + public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int integer) { - if (!player.worldObj.isRemote) { - ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem(); + if (!player.worldObj.isRemote) { + ItemWandCasting wandItem = (ItemWandCasting) itemstack.getItem(); - ItemStack armor = player.inventory.armorInventory[1]; - if (armor != null) { - if ((ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)))) { - wandItem.addVis(itemstack, Aspect.ORDER, 1, true); - wandItem.addVis(itemstack, Aspect.FIRE, 1, true); - wandItem.addVis(itemstack, Aspect.ENTROPY, 1, true); - wandItem.addVis(itemstack, Aspect.WATER, 1, true); - wandItem.addVis(itemstack, Aspect.EARTH, 1, true); - wandItem.addVis(itemstack, Aspect.AIR, 1, true); - } - } - } - } + ItemStack armor = player.inventory.armorInventory[1]; + if (armor != null) { + if ((ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)) && (ElectricItem.manager.use(armor, ConfigHandler.wandChargeFocusCost / 4, player)))) { + wandItem.addVis(itemstack, Aspect.ORDER, 1, true); + wandItem.addVis(itemstack, Aspect.FIRE, 1, true); + wandItem.addVis(itemstack, Aspect.ENTROPY, 1, true); + wandItem.addVis(itemstack, Aspect.WATER, 1, true); + wandItem.addVis(itemstack, Aspect.EARTH, 1, true); + wandItem.addVis(itemstack, Aspect.AIR, 1, true); + } + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricHoeGrowth.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricHoeGrowth.java index f7e2ee7..d192d53 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricHoeGrowth.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricHoeGrowth.java @@ -27,72 +27,72 @@ import java.util.List; public class ItemElectricHoeGrowth extends ItemElementalHoe implements IElectricItem { - public IIcon icon; - public int maxCharge = 1000000; - public int growthCost = 1000; - public int tillCost = 100; + public IIcon icon; + public int maxCharge = 1000000; + public int growthCost = 1000; + public int tillCost = 100; - public ItemElectricHoeGrowth() { - super(ToolMaterial.EMERALD); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxStackSize(1); - } + public ItemElectricHoeGrowth() { + super(ToolMaterial.EMERALD); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxStackSize(1); + } - /** - * @SideOnly(Side.CLIENT) - * @Override public void registerIcons(IIconRegister iconRegister) { - * this.icon = iconRegister.registerIcon("electromagictools:electrichoegrowth"); - * } - */ + /** + * @SideOnly(Side.CLIENT) + * @Override public void registerIcons(IIconRegister iconRegister) { + * this.icon = iconRegister.registerIcon("electromagictools:electrichoegrowth"); + * } + */ - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public boolean isRepairable() { + return false; + } /* IC2 API METHODS */ - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return 3; - } + @Override + public int getTier(ItemStack itemStack) { + return 3; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return 1000; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return 1000; + } - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricThorHammer.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricThorHammer.java index d42c17a..a46761e 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricThorHammer.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/ItemElectricThorHammer.java @@ -38,167 +38,167 @@ import java.util.List; public class ItemElectricThorHammer extends ItemSword implements IElectricItem { - public int maxCharge = 1000000; - private final int hitCost = 5000; - private final int lightningCost = 75000; + public int maxCharge = 1000000; + private final int hitCost = 5000; + private final int lightningCost = 75000; - public ItemElectricThorHammer() { - super(ToolMaterial.EMERALD); - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(27); - this.setMaxStackSize(1); - // OreDictionary.registerOre("craftingToolForgeHammer", this); - } + public ItemElectricThorHammer() { + super(ToolMaterial.EMERALD); + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(27); + this.setMaxStackSize(1); + // OreDictionary.registerOre("craftingToolForgeHammer", this); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/electricthorhammer"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":hammer/electricthorhammer"); + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 19F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 19F); + } + return false; + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - list.add(player.getCommandSenderName() + TextHelper.localize("tooltip.EMT.hammer.electric")); - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + list.add(player.getCommandSenderName() + TextHelper.localize("tooltip.EMT.hammer.electric")); + } - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.capabilities.isCreativeMode) { - return itemstack; - } else if (ElectricItem.manager.canUse(itemstack, lightningCost)) { - player.swingItem(); - // Corners - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 8)); + @Override + public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { + if (player.capabilities.isCreativeMode) { + return itemstack; + } else if (ElectricItem.manager.canUse(itemstack, lightningCost)) { + player.swingItem(); + // Corners + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 8)); - // Fronts - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ + 8)); + // Fronts + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ + 8)); - // Others - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 1)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 2)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 3)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 4)); + // Others + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 1)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 2)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ + 3)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ + 4)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 1)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 2)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 3)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 4)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 1)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 2)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 8, player.posY, player.posZ - 3)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 8, player.posY, player.posZ - 4)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 1, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 2, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 3, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 4, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 1, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 2, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 3, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX + 4, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 1, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 2, player.posY, player.posZ - 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 3, player.posY, player.posZ + 8)); - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 4, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 1, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 2, player.posY, player.posZ - 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 3, player.posY, player.posZ + 8)); + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX - 4, player.posY, player.posZ - 8)); - EntityArcher archer; - archer = new EntityArcher(world); - archer.setPosition(player.posX + 8, player.posY + 2, player.posZ - 8); - world.spawnEntityInWorld(archer); + EntityArcher archer; + archer = new EntityArcher(world); + archer.setPosition(player.posX + 8, player.posY + 2, player.posZ - 8); + world.spawnEntityInWorld(archer); - EntityArcher archer1; - archer1 = new EntityArcher(world); - archer1.setPosition(player.posX - 8, player.posY + 2, player.posZ + 8); - world.spawnEntityInWorld(archer1); + EntityArcher archer1; + archer1 = new EntityArcher(world); + archer1.setPosition(player.posX - 8, player.posY + 2, player.posZ + 8); + world.spawnEntityInWorld(archer1); - EntityArcher archer2; - archer2 = new EntityArcher(world); - archer2.setPosition(player.posX - 8, player.posY + 2, player.posZ - 8); - world.spawnEntityInWorld(archer2); + EntityArcher archer2; + archer2 = new EntityArcher(world); + archer2.setPosition(player.posX - 8, player.posY + 2, player.posZ - 8); + world.spawnEntityInWorld(archer2); - EntityArcher archer3; - archer3 = new EntityArcher(world); - archer3.setPosition(player.posX + 8, player.posY + 2, player.posZ + 8); - world.spawnEntityInWorld(archer3); - ElectricItem.manager.use(itemstack, lightningCost, player); - return itemstack; - } else { - world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ)); - player.addPotionEffect(new PotionEffect(Potion.harm.getId(), 1, 1)); - return itemstack; - } - } + EntityArcher archer3; + archer3 = new EntityArcher(world); + archer3.setPosition(player.posX + 8, player.posY + 2, player.posZ + 8); + world.spawnEntityInWorld(archer3); + ElectricItem.manager.use(itemstack, lightningCost, player); + return itemstack; + } else { + world.spawnEntityInWorld(new EntityLightningBolt(world, player.posX, player.posY, player.posZ)); + player.addPotionEffect(new PotionEffect(Potion.harm.getId(), 1, 1)); + return itemstack; + } + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public boolean isRepairable() { + return false; + } - @Override - public int getItemEnchantability() { - if (ConfigHandler.enchanting == false) { - return 0; - } else { - return 4; - } - } + @Override + public int getItemEnchantability() { + if (ConfigHandler.enchanting == false) { + return 0; + } else { + return 4; + } + } - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - return ConfigHandler.enchanting; - } + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return ConfigHandler.enchanting; + } /* IC2 API METHODS */ - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return 2; - } + @Override + public int getTier(ItemStack itemStack) { + return 2; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return 100; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return 100; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemDiamondChainsaw.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemDiamondChainsaw.java index aedebcb..491df7f 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemDiamondChainsaw.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemDiamondChainsaw.java @@ -37,147 +37,147 @@ import java.util.List; public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem { - public int maxCharge = 40000; - public int cost = 200; - public int hitCost = 300; - public int tier = 2; + public int maxCharge = 40000; + public int cost = 200; + public int hitCost = 300; + public int tier = 2; - public ItemDiamondChainsaw() { - super(ToolMaterial.EMERALD); - this.efficiencyOnProperMaterial = 16F; - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(27); - this.setMaxStackSize(1); - } + public ItemDiamondChainsaw() { + super(ToolMaterial.EMERALD); + this.efficiencyOnProperMaterial = 16F; + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(27); + this.setMaxStackSize(1); + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":diamondchainsaw"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":diamondchainsaw"); + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - ElectricItem.manager.use(stack, cost, entityLiving); - return true; - } + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { + ElectricItem.manager.use(stack, cost, entityLiving); + return true; + } - @Override - public boolean canHarvestBlock(Block block, ItemStack stack) { - return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); - } + @Override + public boolean canHarvestBlock(Block block, ItemStack stack) { + return Items.diamond_axe.canHarvestBlock(block, stack) || Items.diamond_sword.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); + } - @Override - public float getDigSpeed(ItemStack stack, Block block, int meta) { - if (!ElectricItem.manager.canUse(stack, cost)) { - return 1.0F; - } + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) { + if (!ElectricItem.manager.canUse(stack, cost)) { + return 1.0F; + } - if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) { - return efficiencyOnProperMaterial; - } else { - return super.getDigSpeed(stack, block, meta); - } - } + if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F) { + return efficiencyOnProperMaterial; + } else { + return super.getDigSpeed(stack, block, meta); + } + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); + } + return false; + } - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - for (int i = 0; i < player.inventory.mainInventory.length; i++) { - ItemStack torchStack = player.inventory.mainInventory[i]; - if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { - continue; - } - Item item = torchStack.getItem(); - if (!(item instanceof ItemBlock)) { - continue; - } - int oldMeta = torchStack.getItemDamage(); - int oldSize = torchStack.stackSize; - boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); - if (player.capabilities.isCreativeMode) { - torchStack.setItemDamage(oldMeta); - torchStack.stackSize = oldSize; - } else if (torchStack.stackSize <= 0) { - ForgeEventFactory.onPlayerDestroyItem(player, torchStack); - player.inventory.mainInventory[i] = null; - } - if (result) { - return true; - } - } + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + for (int i = 0; i < player.inventory.mainInventory.length; i++) { + ItemStack torchStack = player.inventory.mainInventory[i]; + if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { + continue; + } + Item item = torchStack.getItem(); + if (!(item instanceof ItemBlock)) { + continue; + } + int oldMeta = torchStack.getItemDamage(); + int oldSize = torchStack.stackSize; + boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); + if (player.capabilities.isCreativeMode) { + torchStack.setItemDamage(oldMeta); + torchStack.stackSize = oldSize; + } else if (torchStack.stackSize <= 0) { + ForgeEventFactory.onPlayerDestroyItem(player, torchStack); + player.inventory.mainInventory[i] = null; + } + if (result) { + return true; + } + } - return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } + return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public boolean isRepairable() { + return false; + } - @Override - public int getItemEnchantability() { - if (ConfigHandler.enchanting == false) { - return 0; - } else { - return 4; - } - } + @Override + public int getItemEnchantability() { + if (ConfigHandler.enchanting == false) { + return 0; + } else { + return 4; + } + } - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - return ConfigHandler.enchanting; - } + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return ConfigHandler.enchanting; + } /* IC2 API METHODS */ - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return tier; - } + @Override + public int getTier(ItemStack itemStack) { + return tier; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return 300; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return 300; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemStreamChainsaw.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemStreamChainsaw.java index 7155306..65b55d1 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemStreamChainsaw.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemStreamChainsaw.java @@ -35,74 +35,74 @@ import java.util.ArrayList; public class ItemStreamChainsaw extends ItemThaumiumChainsaw { - boolean alternateServer; - boolean alternateClient; - @SuppressWarnings("rawtypes") - public static ArrayList oreDictLogs = new ArrayList(); + boolean alternateServer; + boolean alternateClient; + @SuppressWarnings("rawtypes") + public static ArrayList oreDictLogs = new ArrayList(); - public ItemStreamChainsaw() { - this.efficiencyOnProperMaterial = 25F; - alternateServer = false; - alternateClient = false; - setCreativeTab(ElectroMagicTools.tabEMT); - this.maxStackSize = 1; - this.setMaxDamage(27); - maxCharge = 900000; - cost = 400; - hitCost = 500; - tier = 3; - } + public ItemStreamChainsaw() { + this.efficiencyOnProperMaterial = 25F; + alternateServer = false; + alternateClient = false; + setCreativeTab(ElectroMagicTools.tabEMT); + this.maxStackSize = 1; + this.setMaxDamage(27); + maxCharge = 900000; + cost = 400; + hitCost = 500; + tier = 3; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":streamchainsaw"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":streamchainsaw"); + } - @Override - public EnumAction getItemUseAction(ItemStack itemstack) { - return EnumAction.bow; - } + @Override + public EnumAction getItemUseAction(ItemStack itemstack) { + return EnumAction.bow; + } - @Override - public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { - Block bi = world.getBlock(x, y, z); - if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) { - if (!world.isRemote) { - if (Utils.breakFurthestBlock(world, x, y, z, bi, player)) { - world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); - ElectricItem.manager.use(itemstack, cost, player); - this.alternateServer = (!this.alternateServer); - } - } else { - player.swingItem(); - ElectricItem.manager.use(itemstack, cost, player); - this.alternateClient = (!this.alternateClient); - } - } - return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10); - } + @Override + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) { + Block bi = world.getBlock(x, y, z); + if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) { + if (!world.isRemote) { + if (Utils.breakFurthestBlock(world, x, y, z, bi, player)) { + world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); + ElectricItem.manager.use(itemstack, cost, player); + this.alternateServer = (!this.alternateServer); + } + } else { + player.swingItem(); + ElectricItem.manager.use(itemstack, cost, player); + this.alternateClient = (!this.alternateClient); + } + } + return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10); + } - @Override - public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { - World world = player.worldObj; - Block bi = world.getBlock(x, y, z); - if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) { - if (!world.isRemote) { - Utils.breakFurthestBlock(world, x, y, z, bi, player); - PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D)); + @Override + public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) { + World world = player.worldObj; + Block bi = world.getBlock(x, y, z); + if ((!player.isSneaking()) && (Utils.isWoodLog(world, x, y, z))) { + if (!world.isRemote) { + Utils.breakFurthestBlock(world, x, y, z, bi, player); + PacketHandler.INSTANCE.sendToAllAround(new PacketFXBlockBubble(x, y, z, new Color(0.33F, 0.33F, 1.0F).getRGB()), new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D)); - world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); - } - ElectricItem.manager.use(itemstack, cost, player); - return true; - } - return super.onBlockStartBreak(itemstack, x, y, z, player); - } + world.playSoundEffect(x, y, z, "thaumcraft:bubble", 0.15F, 1.0F); + } + ElectricItem.manager.use(itemstack, cost, player); + return true; + } + return super.onBlockStartBreak(itemstack, x, y, z, player); + } - /* IC2 API METHODS */ - @Override - public double getTransferLimit(ItemStack itemStack) { - return 900; - } + /* IC2 API METHODS */ + @Override + public double getTransferLimit(ItemStack itemStack) { + return 900; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemThaumiumChainsaw.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemThaumiumChainsaw.java index 3e2e5f1..e6a5465 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemThaumiumChainsaw.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/chainsaws/ItemThaumiumChainsaw.java @@ -27,39 +27,39 @@ import tombenpotter.emt.ModInformation; public class ItemThaumiumChainsaw extends ItemDiamondChainsaw { - public ItemThaumiumChainsaw() { - this.efficiencyOnProperMaterial = 21F; - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxDamage(27); - this.setMaxStackSize(1); - maxCharge = 60000; - cost = 250; - hitCost = 350; - } + public ItemThaumiumChainsaw() { + this.efficiencyOnProperMaterial = 21F; + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxDamage(27); + this.setMaxStackSize(1); + maxCharge = 60000; + cost = 250; + hitCost = 350; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumchainsaw"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumchainsaw"); + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - ElectricItem.manager.use(stack, cost, entityLiving); - return true; - } + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { + ElectricItem.manager.use(stack, cost, entityLiving); + return true; + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); + } + return false; + } - /* IC2 API METHODS */ - @Override - public double getTransferLimit(ItemStack itemStack) { - return 600; - } + /* IC2 API METHODS */ + @Override + public double getTransferLimit(ItemStack itemStack) { + return 600; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/drills/ItemRockbreakerDrill.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/drills/ItemRockbreakerDrill.java index 62bc156..e8f2f49 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/drills/ItemRockbreakerDrill.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/drills/ItemRockbreakerDrill.java @@ -48,164 +48,164 @@ import java.util.Iterator; public class ItemRockbreakerDrill extends ItemThaumiumDrill { - private static final Block[] isEffective = {Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone}; - public Icon icon; - int side; - public int searchCost = 1000; - public int hitCost = 400; + private static final Block[] isEffective = {Blocks.nether_brick, Blocks.netherrack, Blocks.glowstone, Blocks.iron_block, Blocks.gold_block, Blocks.diamond_block, Blocks.lapis_block, Blocks.redstone_block, Blocks.redstone_ore, Blocks.emerald_ore, Blocks.emerald_block, Blocks.stonebrick, Blocks.glass, Blocks.stone, Blocks.gold_ore, Blocks.iron_ore, Blocks.coal_ore, Blocks.cobblestone, Blocks.diamond_ore, Blocks.lapis_ore, Blocks.dirt, Blocks.gravel, Blocks.sand, Blocks.sandstone, Blocks.soul_sand, Blocks.clay, Blocks.grass, Blocks.snow_layer, Blocks.snow, Blocks.farmland, Blocks.hardened_clay, Blocks.stained_hardened_clay, Blocks.mossy_cobblestone}; + public Icon icon; + int side; + public int searchCost = 1000; + public int hitCost = 400; - public ItemRockbreakerDrill() { - side = 0; - setCreativeTab(ElectroMagicTools.tabEMT); - this.efficiencyOnProperMaterial = 25F; - this.setMaxStackSize(1); - if (ConfigHandler.toolsInBore == false) { - this.setMaxDamage(27); - } else { - this.setMaxDamage(2571); - } - maxCharge = 900000; - transferLimit = 900; - tier = 3; - } + public ItemRockbreakerDrill() { + side = 0; + setCreativeTab(ElectroMagicTools.tabEMT); + this.efficiencyOnProperMaterial = 25F; + this.setMaxStackSize(1); + if (ConfigHandler.toolsInBore == false) { + this.setMaxDamage(27); + } else { + this.setMaxDamage(2571); + } + maxCharge = 900000; + transferLimit = 900; + tier = 3; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":rockbreakerdrill"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":rockbreakerdrill"); + } - private boolean isEffectiveAgainst(Block block) { - for (int var3 = 0; var3 < isEffective.length; var3++) { - if (isEffective[var3] == block) { - return true; - } - } - return false; - } + private boolean isEffectiveAgainst(Block block) { + for (int var3 = 0; var3 < isEffective.length; var3++) { + if (isEffective[var3] == block) { + return true; + } + } + return false; + } - @Override - public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) { - MovingObjectPosition movingobjectposition = Utils.getTargetBlock(((Entity) (player)).worldObj, player, true); - if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { - side = movingobjectposition.sideHit; - } - return super.onBlockStartBreak(itemstack, X, Y, Z, player); - } + @Override + public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) { + MovingObjectPosition movingobjectposition = Utils.getTargetBlock(((Entity) (player)).worldObj, player, true); + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectType.BLOCK) { + side = movingobjectposition.sideHit; + } + return super.onBlockStartBreak(itemstack, X, Y, Z, player); + } - @SuppressWarnings("rawtypes") - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { - if (ConfigHandler.toolsInBore == false) { - cost = 350; - } else { - cost = 1; - } - if (entityLiving.isSneaking()) { - if (ElectricItem.manager.canUse(stack, cost)) { - ElectricItem.manager.use(stack, cost, entityLiving); - } - return true; - } - int md = world.getBlockMetadata(x, y, z); - if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) { - for (int aa = -1; aa <= 1; aa++) { - for (int bb = -1; bb <= 1; bb++) { - int xx = 0; - int yy = 0; - int zz = 0; - if (side <= 1) { - xx = aa; - zz = bb; - } else if (side <= 3) { - xx = aa; - yy = bb; - } else { - zz = aa; - yy = bb; - } - Block bl = world.getBlock(x + xx, y + yy, z + zz); - md = world.getBlockMetadata(x + xx, y + yy, z + zz); - if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) { - continue; - } - if (ElectricItem.manager.canUse(stack, cost)) { - ElectricItem.manager.use(stack, cost, entityLiving); - } - int fortune = EnchantmentHelper.getFortuneModifier(entityLiving); - world.setBlockToAir(x + xx, y + yy, z + zz); - ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune); - boolean creative = false; - if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) { - creative = true; - } - if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) { - continue; - } - ItemStack is; - for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) { - is = (ItemStack) i$.next(); - } - } - } - } - return true; - } + @SuppressWarnings("rawtypes") + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase entityLiving) { + if (ConfigHandler.toolsInBore == false) { + cost = 350; + } else { + cost = 1; + } + if (entityLiving.isSneaking()) { + if (ElectricItem.manager.canUse(stack, cost)) { + ElectricItem.manager.use(stack, cost, entityLiving); + } + return true; + } + int md = world.getBlockMetadata(x, y, z); + if (ForgeHooks.isToolEffective(stack, block, md) || isEffectiveAgainst(block)) { + for (int aa = -1; aa <= 1; aa++) { + for (int bb = -1; bb <= 1; bb++) { + int xx = 0; + int yy = 0; + int zz = 0; + if (side <= 1) { + xx = aa; + zz = bb; + } else if (side <= 3) { + xx = aa; + yy = bb; + } else { + zz = aa; + yy = bb; + } + Block bl = world.getBlock(x + xx, y + yy, z + zz); + md = world.getBlockMetadata(x + xx, y + yy, z + zz); + if (!ForgeHooks.isToolEffective(stack, bl, md) && !isEffectiveAgainst(bl)) { + continue; + } + if (ElectricItem.manager.canUse(stack, cost)) { + ElectricItem.manager.use(stack, cost, entityLiving); + } + int fortune = EnchantmentHelper.getFortuneModifier(entityLiving); + world.setBlockToAir(x + xx, y + yy, z + zz); + ArrayList ret = bl.getDrops(world, x + xx, y + yy, z + zz, md, fortune); + boolean creative = false; + if ((entityLiving instanceof EntityPlayer) && ((EntityPlayer) entityLiving).capabilities.isCreativeMode) { + creative = true; + } + if (ret.size() <= 0 || creative || ((Entity) (entityLiving)).worldObj.isRemote) { + continue; + } + ItemStack is; + for (Iterator i$ = ret.iterator(); i$.hasNext(); world.spawnEntityInWorld(new EntityFollowingItem(world, (double) x + (double) xx + 0.5D, (double) y + (double) yy + 0.5D, (double) z + (double) zz + 0.5D, is, entityLiving, 3))) { + is = (ItemStack) i$.next(); + } + } + } + } + return true; + } - @SuppressWarnings("unused") - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - if (!player.isSneaking()) { - for (int i = 0; i < player.inventory.mainInventory.length; i++) { - ItemStack torchStack = player.inventory.mainInventory[i]; - if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { - continue; - } - Item item = torchStack.getItem(); - if (!(item instanceof ItemBlock)) { - continue; - } - int oldMeta = torchStack.getItemDamage(); - int oldSize = torchStack.stackSize; - boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); - if (player.capabilities.isCreativeMode) { - torchStack.setItemDamage(oldMeta); - torchStack.stackSize = oldSize; - } else if (torchStack.stackSize <= 0) { - ForgeEventFactory.onPlayerDestroyItem(player, torchStack); - player.inventory.mainInventory[i] = null; - } - if (result) { - return true; - } - } - } else { - ElectricItem.manager.use(stack, searchCost, player); - if (!world.isRemote) { - world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); - return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset); - } - Minecraft mc = Minecraft.getMinecraft(); - Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L); - player.swingItem(); - return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } + @SuppressWarnings("unused") + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + if (!player.isSneaking()) { + for (int i = 0; i < player.inventory.mainInventory.length; i++) { + ItemStack torchStack = player.inventory.mainInventory[i]; + if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { + continue; + } + Item item = torchStack.getItem(); + if (!(item instanceof ItemBlock)) { + continue; + } + int oldMeta = torchStack.getItemDamage(); + int oldSize = torchStack.stackSize; + boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); + if (player.capabilities.isCreativeMode) { + torchStack.setItemDamage(oldMeta); + torchStack.stackSize = oldSize; + } else if (torchStack.stackSize <= 0) { + ForgeEventFactory.onPlayerDestroyItem(player, torchStack); + player.inventory.mainInventory[i] = null; + } + if (result) { + return true; + } + } + } else { + ElectricItem.manager.use(stack, searchCost, player); + if (!world.isRemote) { + world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F); + return super.onItemUse(stack, player, world, x, y, z, side, xOffset, xOffset, zOffset); + } + Minecraft mc = Minecraft.getMinecraft(); + Thaumcraft.instance.renderEventHandler.startScan(player, x, y, z, System.currentTimeMillis() + 5000L); + player.swingItem(); + return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + } - return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } + return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + } - public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) { - entity.setFire(2); - } - return super.onLeftClickEntity(stack, player, entity); - } + public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { + if (!((Entity) (player)).worldObj.isRemote && (!(entity instanceof EntityPlayer) || MinecraftServer.getServer().isPVPEnabled())) { + entity.setFire(2); + } + return super.onLeftClickEntity(stack, player, entity); + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 12F); + } + return false; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolDiamond.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolDiamond.java index d49875a..4fcbf97 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolDiamond.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolDiamond.java @@ -28,48 +28,48 @@ import tombenpotter.emt.common.util.ConfigHandler; public class ItemOmnitoolDiamond extends ItemOmnitoolIron { - public ItemOmnitoolDiamond() { - super(); - this.efficiencyOnProperMaterial = 16F; - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxStackSize(1); - if (ConfigHandler.toolsInBore == false) { - this.setMaxDamage(27); - } else { - this.setMaxDamage(350); - } - maxCharge = 70000; - hitCost = 250; - } + public ItemOmnitoolDiamond() { + super(); + this.efficiencyOnProperMaterial = 16F; + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxStackSize(1); + if (ConfigHandler.toolsInBore == false) { + this.setMaxDamage(27); + } else { + this.setMaxDamage(350); + } + maxCharge = 70000; + hitCost = 250; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":diamondomnitool"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":diamondomnitool"); + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - if (ConfigHandler.toolsInBore == false) { - cost = 200; - } else { - cost = 1; - } - ElectricItem.manager.use(stack, cost, entityLiving); - return true; - } + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { + if (ConfigHandler.toolsInBore == false) { + cost = 200; + } else { + cost = 1; + } + ElectricItem.manager.use(stack, cost, entityLiving); + return true; + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F); + } + return false; + } - /* IC2 API METHODS */ - @Override - public double getTransferLimit(ItemStack itemStack) { - return 400; - } + /* IC2 API METHODS */ + @Override + public double getTransferLimit(ItemStack itemStack) { + return 400; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolIron.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolIron.java index 42427db..7465b6d 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolIron.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolIron.java @@ -37,158 +37,158 @@ import java.util.List; public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem { - public int maxCharge = 20000; - public int cost; - public int hitCost = 125; + public int maxCharge = 20000; + public int cost; + public int hitCost = 125; - public ItemOmnitoolIron() { - super(ToolMaterial.EMERALD); - this.efficiencyOnProperMaterial = 13F; - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxStackSize(1); - if (ConfigHandler.toolsInBore == false) { - this.setMaxDamage(27); - } else { - this.setMaxDamage(200); - } - } + public ItemOmnitoolIron() { + super(ToolMaterial.EMERALD); + this.efficiencyOnProperMaterial = 13F; + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxStackSize(1); + if (ConfigHandler.toolsInBore == false) { + this.setMaxDamage(27); + } else { + this.setMaxDamage(200); + } + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":ironomnitool"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":ironomnitool"); + } - @SuppressWarnings({"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - if (getChargedItem(itemStack) == this) { - ItemStack charged = new ItemStack(this, 1); - ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); - itemList.add(charged); - } - if (getEmptyItem(itemStack) == this) { - itemList.add(new ItemStack(this, 1, getMaxDamage())); - } - } + @SuppressWarnings({"rawtypes", "unchecked"}) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + ItemStack itemStack = new ItemStack(this, 1); + if (getChargedItem(itemStack) == this) { + ItemStack charged = new ItemStack(this, 1); + ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false); + itemList.add(charged); + } + if (getEmptyItem(itemStack) == this) { + itemList.add(new ItemStack(this, 1, getMaxDamage())); + } + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) - { - if (ConfigHandler.toolsInBore == false) { - cost = 100; - } else { - cost = 1; - } - ElectricItem.manager.use(stack, cost, entityLiving); - return true; - } + { + if (ConfigHandler.toolsInBore == false) { + cost = 100; + } else { + cost = 1; + } + ElectricItem.manager.use(stack, cost, entityLiving); + return true; + } - @Override - public boolean canHarvestBlock(Block block, ItemStack stack) { - return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); - } + @Override + public boolean canHarvestBlock(Block block, ItemStack stack) { + return Items.iron_axe.canHarvestBlock(block, stack) || Items.iron_sword.canHarvestBlock(block, stack) || Items.iron_pickaxe.canHarvestBlock(block, stack) || Items.iron_shovel.canHarvestBlock(block, stack) || Items.shears.canHarvestBlock(block, stack); + } - @Override - public float getDigSpeed(ItemStack stack, Block block, int meta) { - if (!ElectricItem.manager.canUse(stack, cost)) { - return 1.0F; - } + @Override + public float getDigSpeed(ItemStack stack, Block block, int meta) { + if (!ElectricItem.manager.canUse(stack, cost)) { + return 1.0F; + } - if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { - return efficiencyOnProperMaterial; - } else { - return super.getDigSpeed(stack, block, meta); - } - } + if (Items.wooden_axe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_sword.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_pickaxe.getDigSpeed(stack, block, meta) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, block, meta) > 1.0F || Items.shears.getDigSpeed(stack, block, meta) > 1.0F) { + return efficiencyOnProperMaterial; + } else { + return super.getDigSpeed(stack, block, meta); + } + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F); + } + return false; + } - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { - for (int i = 0; i < player.inventory.mainInventory.length; i++) { - ItemStack torchStack = player.inventory.mainInventory[i]; - if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { - continue; - } - Item item = torchStack.getItem(); - if (!(item instanceof ItemBlock)) { - continue; - } - int oldMeta = torchStack.getItemDamage(); - int oldSize = torchStack.stackSize; - boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); - if (player.capabilities.isCreativeMode) { - torchStack.setItemDamage(oldMeta); - torchStack.stackSize = oldSize; - } else if (torchStack.stackSize <= 0) { - ForgeEventFactory.onPlayerDestroyItem(player, torchStack); - player.inventory.mainInventory[i] = null; - } - if (result) { - return true; - } - } + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { + for (int i = 0; i < player.inventory.mainInventory.length; i++) { + ItemStack torchStack = player.inventory.mainInventory[i]; + if (torchStack == null || !torchStack.getUnlocalizedName().toLowerCase().contains("torch")) { + continue; + } + Item item = torchStack.getItem(); + if (!(item instanceof ItemBlock)) { + continue; + } + int oldMeta = torchStack.getItemDamage(); + int oldSize = torchStack.stackSize; + boolean result = torchStack.tryPlaceItemIntoWorld(player, world, x, y, z, side, xOffset, yOffset, zOffset); + if (player.capabilities.isCreativeMode) { + torchStack.setItemDamage(oldMeta); + torchStack.stackSize = oldSize; + } else if (torchStack.stackSize <= 0) { + ForgeEventFactory.onPlayerDestroyItem(player, torchStack); + player.inventory.mainInventory[i] = null; + } + if (result) { + return true; + } + } - return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); - } + return super.onItemUse(stack, player, world, x, y, z, side, xOffset, yOffset, zOffset); + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public boolean isRepairable() { + return false; + } - @Override - public int getItemEnchantability() { - if (ConfigHandler.enchanting == false) { - return 0; - } else { - return 4; - } - } + @Override + public int getItemEnchantability() { + if (ConfigHandler.enchanting == false) { + return 0; + } else { + return 4; + } + } - @Override - public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { - return ConfigHandler.enchanting; - } + @Override + public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) { + return ConfigHandler.enchanting; + } /* IC2 API METHODS */ - @Override - public Item getChargedItem(ItemStack itemStack) { - return this; - } + @Override + public Item getChargedItem(ItemStack itemStack) { + return this; + } - @Override - public Item getEmptyItem(ItemStack itemStack) { - return this; - } + @Override + public Item getEmptyItem(ItemStack itemStack) { + return this; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) { + return false; + } - @Override - public double getMaxCharge(ItemStack itemStack) { - return maxCharge; - } + @Override + public double getMaxCharge(ItemStack itemStack) { + return maxCharge; + } - @Override - public int getTier(ItemStack itemStack) { - return 2; - } + @Override + public int getTier(ItemStack itemStack) { + return 2; + } - @Override - public double getTransferLimit(ItemStack itemStack) { - return 200; - } + @Override + public double getTransferLimit(ItemStack itemStack) { + return 200; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolThaumium.java b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolThaumium.java index 4d16200..ec81a5f 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolThaumium.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/items/tools/omnitools/ItemOmnitoolThaumium.java @@ -28,48 +28,48 @@ import tombenpotter.emt.common.util.ConfigHandler; public class ItemOmnitoolThaumium extends ItemOmnitoolDiamond { - public ItemOmnitoolThaumium() { - super(); - this.efficiencyOnProperMaterial = 21F; - this.setCreativeTab(ElectroMagicTools.tabEMT); - this.setMaxStackSize(1); - if (ConfigHandler.toolsInBore == false) { - this.setMaxDamage(27); - } else { - this.setMaxDamage(467); - } - maxCharge = 140000; - hitCost = 650; - } + public ItemOmnitoolThaumium() { + super(); + this.efficiencyOnProperMaterial = 21F; + this.setCreativeTab(ElectroMagicTools.tabEMT); + this.setMaxStackSize(1); + if (ConfigHandler.toolsInBore == false) { + this.setMaxDamage(27); + } else { + this.setMaxDamage(467); + } + maxCharge = 140000; + hitCost = 650; + } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) { - this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumomnitool"); - } + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(ModInformation.texturePath + ":thaumiumomnitool"); + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { - if (ConfigHandler.toolsInBore == false) { - cost = 300; - } else { - cost = 1; - } - ElectricItem.manager.use(stack, cost, entityLiving); - return true; - } + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int par4, int par5, int par6, EntityLivingBase entityLiving) { + if (ConfigHandler.toolsInBore == false) { + cost = 300; + } else { + cost = 1; + } + ElectricItem.manager.use(stack, cost, entityLiving); + return true; + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F); - } - return false; - } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { + if (ElectricItem.manager.use(itemstack, hitCost, attacker)) { + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 10F); + } + return false; + } - /* IC2 API METHODS */ - @Override - public double getTransferLimit(ItemStack itemStack) { - return 800; - } + /* IC2 API METHODS */ + @Override + public double getTransferLimit(ItemStack itemStack) { + return 800; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEMT.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEMT.java index 4073b12..d49230d 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEMT.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEMT.java @@ -8,45 +8,45 @@ import net.minecraft.tileentity.TileEntity; public abstract class TileEntityEMT extends TileEntity { - public int facing; - public boolean isOn; + public int facing; + public boolean isOn; - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); - facing = tagCompound.getInteger("facing"); - isOn = tagCompound.getBoolean("isOn"); - } + facing = tagCompound.getInteger("facing"); + isOn = tagCompound.getBoolean("isOn"); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); - tagCompound.setInteger("facing", facing); - tagCompound.setBoolean("isOn", isOn); - } + tagCompound.setInteger("facing", facing); + tagCompound.setBoolean("isOn", isOn); + } - @Override - public final Packet getDescriptionPacket() { - NBTTagCompound nbt = new NBTTagCompound(); - writeToNBT(nbt); - S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt); - return packet; - } + @Override + public final Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + S35PacketUpdateTileEntity packet = new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbt); + return packet; + } - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound nbt = pkt.func_148857_g(); - readFromNBT(nbt); - } + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + readFromNBT(nbt); + } - @Override - public void markDirty() { - super.markDirty(); // Mark dirty for gamesave - if (worldObj.isRemote) { - return; - } - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Update block + TE via Network - } + @Override + public void markDirty() { + super.markDirty(); // Mark dirty for gamesave + if (worldObj.isRemote) { + return; + } + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); // Update block + TE via Network + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEtherealMacerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEtherealMacerator.java index eb7ec2a..96b5e5c 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEtherealMacerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityEtherealMacerator.java @@ -30,272 +30,272 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityEtherealMacerator extends TileEntityEMT implements ISidedInventory, IWrenchable { - private static final int[] slots_top = new int[]{0}; - private static final int[] slots_bottom = new int[]{2, 1}; - private static final int[] slots_sides = new int[]{1}; + private static final int[] slots_top = new int[]{0}; + private static final int[] slots_bottom = new int[]{2, 1}; + private static final int[] slots_sides = new int[]{1}; - private ItemStack[] slots = new ItemStack[3]; - public int maceratingSpeed = ConfigHandler.etherealProcessorBaseSpeed; - public int cookTime; + private ItemStack[] slots = new ItemStack[3]; + public int maceratingSpeed = ConfigHandler.etherealProcessorBaseSpeed; + public int cookTime; - public int getSizeInventory() { - return this.slots.length; - } + public int getSizeInventory() { + return this.slots.length; + } - public ItemStack getStackInSlot(int par1) { - return this.slots[par1]; - } + public ItemStack getStackInSlot(int par1) { + return this.slots[par1]; + } - public ItemStack decrStackSize(int par1, int par2) { - if (this.slots[par1] != null) { - ItemStack itemstack; + public ItemStack decrStackSize(int par1, int par2) { + if (this.slots[par1] != null) { + ItemStack itemstack; - if (this.slots[par1].stackSize <= par2) { - itemstack = this.slots[par1]; - this.slots[par1] = null; - return itemstack; - } else { - itemstack = this.slots[par1].splitStack(par2); + if (this.slots[par1].stackSize <= par2) { + itemstack = this.slots[par1]; + this.slots[par1] = null; + return itemstack; + } else { + itemstack = this.slots[par1].splitStack(par2); - if (this.slots[par1].stackSize == 0) { - this.slots[par1] = null; - } + if (this.slots[par1].stackSize == 0) { + this.slots[par1] = null; + } - return itemstack; - } - } else { - return null; - } - } + return itemstack; + } + } else { + return null; + } + } - public ItemStack getStackInSlotOnClosing(int par1) { - if (this.slots[par1] != null) { - ItemStack itemstack = this.slots[par1]; - this.slots[par1] = null; - return itemstack; - } else { - return null; - } - } + public ItemStack getStackInSlotOnClosing(int par1) { + if (this.slots[par1] != null) { + ItemStack itemstack = this.slots[par1]; + this.slots[par1] = null; + return itemstack; + } else { + return null; + } + } - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - this.slots[par1] = par2ItemStack; + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { + this.slots[par1] = par2ItemStack; - if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { - par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - } + if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { + par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + } - public String getInvName() { - return "Ethereal Processor"; - } + public String getInvName() { + return "Ethereal Processor"; + } - public boolean isInvNameLocalized() { - return false; - } + public boolean isInvNameLocalized() { + return false; + } - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - NBTTagList nbttaglist = tagCompound.getTagList("Items", 10); - this.slots = new ItemStack[this.getSizeInventory()]; + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + NBTTagList nbttaglist = tagCompound.getTagList("Items", 10); + this.slots = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); - if (b0 >= 0 && b0 < this.slots.length) { - this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - this.cookTime = tagCompound.getShort("CookTime"); - } + if (b0 >= 0 && b0 < this.slots.length) { + this.slots[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + this.cookTime = tagCompound.getShort("CookTime"); + } - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tagCompound.setShort("CookTime", (short) this.cookTime); - NBTTagList nbttaglist = new NBTTagList(); + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + tagCompound.setShort("CookTime", (short) this.cookTime); + NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < this.slots.length; ++i) { - if (this.slots[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.slots[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - tagCompound.setTag("Items", nbttaglist); - } + for (int i = 0; i < this.slots.length; ++i) { + if (this.slots[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.slots[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + tagCompound.setTag("Items", nbttaglist); + } - public int getInventoryStackLimit() { - return 64; - } + public int getInventoryStackLimit() { + return 64; + } - public void updateEntity() { - if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) { - ++this.cookTime; - this.isOn = true; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + public void updateEntity() { + if (this.canSmelt() && isOverLimit(1) == false && isOverLimit(2) == false && isOP() == false) { + ++this.cookTime; + this.isOn = true; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - if (this.cookTime == this.maceratingSpeed) { - this.cookTime = 0; - this.smeltItem(); - } - } else { - this.cookTime = 0; - this.isOn = false; - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } + if (this.cookTime == this.maceratingSpeed) { + this.cookTime = 0; + this.smeltItem(); + } + } else { + this.cookTime = 0; + this.isOn = false; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } - private boolean canSmelt() { - if (this.slots[0] == null) { - return false; - } else { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]); - if (itemstack == null) - return false; - if (this.slots[2] == null) - return true; - if (!this.slots[2].isItemEqual(itemstack)) - return false; - int result = slots[2].stackSize + (itemstack.stackSize * 2); - return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); - } - } + private boolean canSmelt() { + if (this.slots[0] == null) { + return false; + } else { + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]); + if (itemstack == null) + return false; + if (this.slots[2] == null) + return true; + if (!this.slots[2].isItemEqual(itemstack)) + return false; + int result = slots[2].stackSize + (itemstack.stackSize * 2); + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + } - public void smeltItem() { - if (this.canSmelt()) { - ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]); + public void smeltItem() { + if (this.canSmelt()) { + ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.slots[0]); - if (this.slots[2] == null) { - this.slots[2] = itemstack.copy(); - this.slots[2].stackSize *= 2; - } else if (this.slots[2].isItemEqual(itemstack)) { - slots[2].stackSize += (itemstack.stackSize * 2); - } + if (this.slots[2] == null) { + this.slots[2] = itemstack.copy(); + this.slots[2].stackSize *= 2; + } else if (this.slots[2].isItemEqual(itemstack)) { + slots[2].stackSize += (itemstack.stackSize * 2); + } - --this.slots[0].stackSize; + --this.slots[0].stackSize; - if (this.slots[0].stackSize <= 0) { - this.slots[0] = null; - } - this.addBonus(); - } - } + if (this.slots[0].stackSize <= 0) { + this.slots[0] = null; + } + this.addBonus(); + } + } - public void addBonus() { - if (this.canSmelt()) { - if (this.worldObj.rand.nextInt(ConfigHandler.etherealProcessorBonus) == 0) { - if (this.slots[1] == null) { - this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6)); - } else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) { - slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2); - } - } - } - } + public void addBonus() { + if (this.canSmelt()) { + if (this.worldObj.rand.nextInt(ConfigHandler.etherealProcessorBonus) == 0) { + if (this.slots[1] == null) { + this.setInventorySlotContents(1, new ItemStack(ConfigItems.itemNugget, 1, 6)); + } else if (this.slots[1].isItemEqual(new ItemStack(ConfigItems.itemNugget, 1, 6)) && this.isOverLimit(1) == false && this.isOverLimit(2) == false) { + slots[1] = new ItemStack(getStackInSlot(1).getItem(), slots[1].stackSize + 1, 2); + } + } + } + } - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D; - } + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D) <= 64.0D; + } - public void openChest() { - } + public void openChest() { + } - public void closeChest() { - } + public void closeChest() { + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - if (slot != 0) - return false; - if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null) - return true; - return false; - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + if (slot != 0) + return false; + if (FurnaceRecipes.smelting().getSmeltingResult(stack) != null) + return true; + return false; + } - public int[] getAccessibleSlotsFromSide(int par1) { - return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides); - } + public int[] getAccessibleSlotsFromSide(int par1) { + return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides); + } - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } + public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { + return this.isItemValidForSlot(par1, par2ItemStack); + } - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } + public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { + return true; + } - public boolean isOverLimit(int i) { - if (slots[i] != null) { - if (slots[i].stackSize >= 63) - return true; - else if (slots[i].stackSize < 63) - return false; - else - return false; - } else { - return false; - } - } + public boolean isOverLimit(int i) { + if (slots[i] != null) { + if (slots[i].stackSize >= 63) + return true; + else if (slots[i].stackSize < 63) + return false; + else + return false; + } else { + return false; + } + } - public boolean isOP() { - final int cobblestoneId = OreDictionary.getOreID("blockCobble"); + public boolean isOP() { + final int cobblestoneId = OreDictionary.getOreID("blockCobble"); - if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish || this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem() || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) { - return true; - } else { - return false; - } - } + if (OreDictionary.getOreID(this.slots[0]) == cobblestoneId || this.slots[0].getItem() == Item.getItemFromBlock(Blocks.sand) || this.slots[0].getItem() == Items.potato || this.slots[0].getItem() == Items.porkchop || this.slots[0].getItem() == Items.beef || this.slots[0].getItem() == Items.chicken || this.slots[0].getItem() == Items.fish || this.slots[0].getItem() == IC2Items.getItem("coalDust").getItem() || (OreDictionary.getOreName(OreDictionary.getOreID(this.slots[0])).toLowerCase().contains("dust") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armour") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("armor") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("helm") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("legging") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("boot") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("chestp") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("shovel") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("axe") || this.slots[0].getItem().getUnlocalizedName(this.slots[0]).toLowerCase().contains("pick"))) { + return true; + } else { + return false; + } + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } - @Override - public short getFacing() { - return 0; - } + @Override + public short getFacing() { + return 0; + } - @Override - public void setFacing(short facing) { + @Override + public void setFacing(short facing) { - } + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } - @Override - public float getWrenchDropRate() { - return 1; - } + @Override + public float getWrenchDropRate() { + return 1; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtMachines, 1, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtMachines, 1, 1); + } - @Override - public String getInventoryName() { - return "Ethereal Macerator"; - } + @Override + public String getInventoryName() { + return "Ethereal Macerator"; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public void openInventory() { + @Override + public void openInventory() { - } + } - @Override - public void closeInventory() { + @Override + public void closeInventory() { - } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityIndustrialWandRecharge.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityIndustrialWandRecharge.java index 2c03854..4d0b0e9 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityIndustrialWandRecharge.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/TileEntityIndustrialWandRecharge.java @@ -24,165 +24,165 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityIndustrialWandRecharge extends TileEntityEMT implements IInventory { - private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4); + private BasicSink ic2EnergySink = new BasicSink(this, 100000, 4); - ItemStack ItemStacks[]; + ItemStack ItemStacks[]; - public TileEntityIndustrialWandRecharge() { - ItemStacks = new ItemStack[1]; - } + public TileEntityIndustrialWandRecharge() { + ItemStacks = new ItemStack[1]; + } - @Override - public int getSizeInventory() { - return 1; - } + @Override + public int getSizeInventory() { + return 1; + } - @Override - public ItemStack getStackInSlot(int i) { - return ItemStacks[i]; - } + @Override + public ItemStack getStackInSlot(int i) { + return ItemStacks[i]; + } - @Override - public ItemStack decrStackSize(int i, int j) { - if (ItemStacks[i] != null) { + @Override + public ItemStack decrStackSize(int i, int j) { + if (ItemStacks[i] != null) { - if (ItemStacks[i].stackSize <= j) { - ItemStack itemstack = ItemStacks[i]; - ItemStacks[i] = null; - return itemstack; - } else { - ItemStack itemstack1 = ItemStacks[i].splitStack(j); + if (ItemStacks[i].stackSize <= j) { + ItemStack itemstack = ItemStacks[i]; + ItemStacks[i] = null; + return itemstack; + } else { + ItemStack itemstack1 = ItemStacks[i].splitStack(j); - if (ItemStacks[i].stackSize == 0) { - ItemStacks[i] = null; - } + if (ItemStacks[i].stackSize == 0) { + ItemStacks[i] = null; + } - return itemstack1; - } - } else { - return null; - } - } + return itemstack1; + } + } else { + return null; + } + } - @Override - public ItemStack getStackInSlotOnClosing(int i) { - if (ItemStacks[i] != null) { - ItemStack itemstack = ItemStacks[i]; - ItemStacks[i] = null; - return itemstack; - } else { - return null; - } - } + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if (ItemStacks[i] != null) { + ItemStack itemstack = ItemStacks[i]; + ItemStacks[i] = null; + return itemstack; + } else { + return null; + } + } - @Override - public void updateEntity() { - ic2EnergySink.updateEntity(); - if (!this.worldObj.isRemote) { - if (getStackInSlot(0) != null) { + @Override + public void updateEntity() { + ic2EnergySink.updateEntity(); + if (!this.worldObj.isRemote) { + if (getStackInSlot(0) != null) { - ItemStack wand = getStackInSlot(0); - if (wand != null && wand.getItem() instanceof ItemWandCasting) { - ItemWandCasting wandItem = (ItemWandCasting) wand.getItem(); - if (ic2EnergySink.useEnergy(ConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) { - wandItem.addVis(wand, Aspect.ORDER, 1, true); - wandItem.addVis(wand, Aspect.FIRE, 1, true); - wandItem.addVis(wand, Aspect.ENTROPY, 1, true); - wandItem.addVis(wand, Aspect.WATER, 1, true); - wandItem.addVis(wand, Aspect.EARTH, 1, true); - wandItem.addVis(wand, Aspect.AIR, 1, true); - } - } - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - } + ItemStack wand = getStackInSlot(0); + if (wand != null && wand.getItem() instanceof ItemWandCasting) { + ItemWandCasting wandItem = (ItemWandCasting) wand.getItem(); + if (ic2EnergySink.useEnergy(ConfigHandler.wandChargerConsumption) && wandItem.getAspectsWithRoom(wand) != null) { + wandItem.addVis(wand, Aspect.ORDER, 1, true); + wandItem.addVis(wand, Aspect.FIRE, 1, true); + wandItem.addVis(wand, Aspect.ENTROPY, 1, true); + wandItem.addVis(wand, Aspect.WATER, 1, true); + wandItem.addVis(wand, Aspect.EARTH, 1, true); + wandItem.addVis(wand, Aspect.AIR, 1, true); + } + } + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } - @Override - public void setInventorySlotContents(int i, ItemStack itemstack) { - ItemStacks[i] = itemstack; + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + ItemStacks[i] = itemstack; - if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { - itemstack.stackSize = getInventoryStackLimit(); - } - } + if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { + itemstack.stackSize = getInventoryStackLimit(); + } + } - public void readFromNBT(NBTTagCompound p_145839_1_) { - super.readFromNBT(p_145839_1_); - NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10); - this.ItemStacks = new ItemStack[this.getSizeInventory()]; + public void readFromNBT(NBTTagCompound p_145839_1_) { + super.readFromNBT(p_145839_1_); + NBTTagList nbttaglist = p_145839_1_.getTagList("Items", 10); + this.ItemStacks = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); + for (int i = 0; i < nbttaglist.tagCount(); ++i) { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + byte b0 = nbttagcompound1.getByte("Slot"); - if (b0 >= 0 && b0 < this.ItemStacks.length) { - this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - } + if (b0 >= 0 && b0 < this.ItemStacks.length) { + this.ItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); + } + } + } - public void writeToNBT(NBTTagCompound p_145841_1_) { - super.writeToNBT(p_145841_1_); - NBTTagList nbttaglist = new NBTTagList(); + public void writeToNBT(NBTTagCompound p_145841_1_) { + super.writeToNBT(p_145841_1_); + NBTTagList nbttaglist = new NBTTagList(); - for (int i = 0; i < this.ItemStacks.length; ++i) { - if (this.ItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.ItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } + for (int i = 0; i < this.ItemStacks.length; ++i) { + if (this.ItemStacks[i] != null) { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte) i); + this.ItemStacks[i].writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } - p_145841_1_.setTag("Items", nbttaglist); - } + p_145841_1_.setTag("Items", nbttaglist); + } - @Override - public int getInventoryStackLimit() { - return 64; - } + @Override + public int getInventoryStackLimit() { + return 64; + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { - return false; - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { + return false; + } - return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D; - } + return player.getDistanceSq((double) xCoord + 0.5D, (double) yCoord + 0.5D, (double) zCoord + 0.5D) <= 64D; + } - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return true; - } + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + return true; + } - @Override - public void invalidate() { - ic2EnergySink.invalidate(); - super.invalidate(); - } + @Override + public void invalidate() { + ic2EnergySink.invalidate(); + super.invalidate(); + } - @Override - public void onChunkUnload() { - ic2EnergySink.onChunkUnload(); - } + @Override + public void onChunkUnload() { + ic2EnergySink.onChunkUnload(); + } - @Override - public String getInventoryName() { - return "Industrial Wand Charging Station"; - } + @Override + public String getInventoryName() { + return "Industrial Wand Charging Station"; + } - @Override - public boolean hasCustomInventoryName() { - return false; - } + @Override + public boolean hasCustomInventoryName() { + return false; + } - @Override - public void openInventory() { - } + @Override + public void openInventory() { + } - @Override - public void closeInventory() { - } + @Override + public void closeInventory() { + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityArborGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityArborGenerator.java index f60ca98..cf7956b 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityArborGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityArborGenerator.java @@ -17,8 +17,8 @@ import tombenpotter.emt.common.util.EssentiasOutputs; public class TileEntityArborGenerator extends TileEntityBaseGenerator { - public TileEntityArborGenerator() { - aspect = Aspect.TREE; + public TileEntityArborGenerator() { + aspect = Aspect.TREE; EssentiasOutputs.outputs.get(aspect.getTag()); - } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityBaseGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityBaseGenerator.java index 6bcbca6..eed32f6 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityBaseGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityBaseGenerator.java @@ -10,56 +10,56 @@ import tombenpotter.emt.common.util.ConfigHandler; public abstract class TileEntityBaseGenerator extends TileEntityEMT { - public static int waitTime; - public BasicSource energySource = new BasicSource(this, 1000000000, 3); - public Aspect aspect; - public double output; + public static int waitTime; + public BasicSource energySource = new BasicSource(this, 1000000000, 3); + public Aspect aspect; + public double output; - public TileEntityBaseGenerator() { - waitTime = 30; - output = 0; - } + public TileEntityBaseGenerator() { + waitTime = 30; + output = 0; + } - @Override - public void updateEntity() { - energySource.updateEntity(); + @Override + public void updateEntity() { + energySource.updateEntity(); - if (waitTime > 0) { - waitTime--; - } + if (waitTime > 0) { + waitTime--; + } - if (waitTime <= 0) { - createEnergy(); - waitTime = ConfigHandler.essentiaGeneratorsDelay; - } - } + if (waitTime <= 0) { + createEnergy(); + waitTime = ConfigHandler.essentiaGeneratorsDelay; + } + } - public void createEnergy() { - if (!this.worldObj.isRemote && EssentiaHandler.drainEssentia(this, aspect, ForgeDirection.UNKNOWN, 8)) { - energySource.addEnergy(output); - } - } + public void createEnergy() { + if (!this.worldObj.isRemote && EssentiaHandler.drainEssentia(this, aspect, ForgeDirection.UNKNOWN, 8)) { + energySource.addEnergy(output); + } + } - @Override - public void onChunkUnload() { - energySource.onChunkUnload(); - } + @Override + public void onChunkUnload() { + energySource.onChunkUnload(); + } - @Override - public void invalidate() { - energySource.invalidate(); - super.invalidate(); - } + @Override + public void invalidate() { + energySource.invalidate(); + super.invalidate(); + } - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - energySource.readFromNBT(tag); - } + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + energySource.readFromNBT(tag); + } - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); - energySource.writeToNBT(tag); - } + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + energySource.writeToNBT(tag); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityEssentiaGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityEssentiaGenerator.java index 87f3d59..efe7916 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityEssentiaGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityEssentiaGenerator.java @@ -11,63 +11,63 @@ import tombenpotter.emt.common.util.EssentiasOutputs; public class TileEntityEssentiaGenerator extends TileEntityEMT { - public String[] aspects = new String[4]; - public boolean[] isFree = new boolean[4]; - public static int waitTime; - public BasicSource energySource = new BasicSource(this, 1000000000, 3); + public String[] aspects = new String[4]; + public boolean[] isFree = new boolean[4]; + public static int waitTime; + public BasicSource energySource = new BasicSource(this, 1000000000, 3); - public TileEntityEssentiaGenerator() { - waitTime = 30; - for (int i = 0; i < aspects.length; i++) { - aspects[i] = String.valueOf(i); - isFree[i] = true; - } - } + public TileEntityEssentiaGenerator() { + waitTime = 30; + for (int i = 0; i < aspects.length; i++) { + aspects[i] = String.valueOf(i); + isFree[i] = true; + } + } - public void updateEntity() { - energySource.updateEntity(); - if (waitTime > 0) { - waitTime--; - } + public void updateEntity() { + energySource.updateEntity(); + if (waitTime > 0) { + waitTime--; + } - if (waitTime <= 0 && !worldObj.isRemote) { - for (int i = 0; i < aspects.length; i++) { - if (EssentiaHandler.drainEssentia(this, Aspect.getAspect(aspects[i]), ForgeDirection.UNKNOWN, 8)) { - energySource.addEnergy(EssentiasOutputs.outputs.get(aspects[i])); - } - } - waitTime = ConfigHandler.essentiaGeneratorsDelay; - } - } + if (waitTime <= 0 && !worldObj.isRemote) { + for (int i = 0; i < aspects.length; i++) { + if (EssentiaHandler.drainEssentia(this, Aspect.getAspect(aspects[i]), ForgeDirection.UNKNOWN, 8)) { + energySource.addEnergy(EssentiasOutputs.outputs.get(aspects[i])); + } + } + waitTime = ConfigHandler.essentiaGeneratorsDelay; + } + } - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - energySource.readFromNBT(tag); - for (int i = 0; i < aspects.length; i++) { - this.aspects[i] = tag.getString("aspect" + String.valueOf(i)); - this.isFree[i] = tag.getBoolean("isFree" + String.valueOf(i)); - } - } + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + energySource.readFromNBT(tag); + for (int i = 0; i < aspects.length; i++) { + this.aspects[i] = tag.getString("aspect" + String.valueOf(i)); + this.isFree[i] = tag.getBoolean("isFree" + String.valueOf(i)); + } + } - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); - energySource.writeToNBT(tag); - for (int i = 0; i < aspects.length; i++) { - tag.setString("aspect" + String.valueOf(i), this.aspects[i]); - tag.setBoolean("isFree" + String.valueOf(i), this.isFree[i]); - } - } + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + energySource.writeToNBT(tag); + for (int i = 0; i < aspects.length; i++) { + tag.setString("aspect" + String.valueOf(i), this.aspects[i]); + tag.setBoolean("isFree" + String.valueOf(i), this.isFree[i]); + } + } - @Override - public void onChunkUnload() { - energySource.onChunkUnload(); - } + @Override + public void onChunkUnload() { + energySource.onChunkUnload(); + } - @Override - public void invalidate() { - energySource.invalidate(); - super.invalidate(); - } + @Override + public void invalidate() { + energySource.invalidate(); + super.invalidate(); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityIgnisGenerator.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityIgnisGenerator.java index 4f54261..9f1c9e4 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityIgnisGenerator.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/generators/TileEntityIgnisGenerator.java @@ -17,8 +17,8 @@ import tombenpotter.emt.common.util.EssentiasOutputs; public class TileEntityIgnisGenerator extends TileEntityBaseGenerator { - public TileEntityIgnisGenerator() { - aspect = Aspect.FIRE; + public TileEntityIgnisGenerator() { + aspect = Aspect.FIRE; EssentiasOutputs.outputs.get(aspect.getTag()); - } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/TileEntitySolarBase.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/TileEntitySolarBase.java index c340982..c87c8a0 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/TileEntitySolarBase.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/TileEntitySolarBase.java @@ -10,96 +10,96 @@ import java.util.Random; public abstract class TileEntitySolarBase extends TileEntityEMT implements IWrenchable { - public BasicSource energySource = new BasicSource(this, 10000, 1); - public static Random random = new Random(); - public boolean initialized; - public boolean theSunIsVisible; - public boolean canRain; - public boolean noSunlight; - public int tick; - public double output = 0; + public BasicSource energySource = new BasicSource(this, 10000, 1); + public static Random random = new Random(); + public boolean initialized; + public boolean theSunIsVisible; + public boolean canRain; + public boolean noSunlight; + public int tick; + public double output = 0; - public TileEntitySolarBase() { - this.tick = random.nextInt(64); - } + public TileEntitySolarBase() { + this.tick = random.nextInt(64); + } - @Override - public void updateEntity() { - energySource.updateEntity(); - checkConditions(); - } + @Override + public void updateEntity() { + energySource.updateEntity(); + checkConditions(); + } - public void checkConditions() { - if (!initialized && worldObj != null) { - canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0; - noSunlight = worldObj.provider.hasNoSky; - initialized = true; - } - if (noSunlight) { - return; - } - if (tick-- == 0) { - updateSunState(); - tick = 64; - } - createEnergy(); - } + public void checkConditions() { + if (!initialized && worldObj != null) { + canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0; + noSunlight = worldObj.provider.hasNoSky; + initialized = true; + } + if (noSunlight) { + return; + } + if (tick-- == 0) { + updateSunState(); + tick = 64; + } + createEnergy(); + } - public void createEnergy() { - if (theSunIsVisible) { - energySource.addEnergy(output); - } - } + public void createEnergy() { + if (theSunIsVisible) { + energySource.addEnergy(output); + } + } - public void updateSunState() { - boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering()); - theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord); - } + public void updateSunState() { + boolean isRaining = canRain && (worldObj.isRaining() || worldObj.isThundering()); + theSunIsVisible = worldObj.isDaytime() && !isRaining && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord); + } - @Override - public void onChunkUnload() { - energySource.onChunkUnload(); - } + @Override + public void onChunkUnload() { + energySource.onChunkUnload(); + } - @Override - public void invalidate() { - energySource.invalidate(); - super.invalidate(); - } + @Override + public void invalidate() { + energySource.invalidate(); + super.invalidate(); + } - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - energySource.writeToNBT(nbttagcompound); - } + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + energySource.writeToNBT(nbttagcompound); + } - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - energySource.readFromNBT(nbttagcompound); - } + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + energySource.readFromNBT(nbttagcompound); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { + return false; + } - @Override - public short getFacing() { - return 0; - } + @Override + public short getFacing() { + return 0; + } - @Override - public void setFacing(short facing) { - } + @Override + public void setFacing(short facing) { + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - return true; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + return true; + } - @Override - public float getWrenchDropRate() { - return 1; - } + @Override + public float getWrenchDropRate() { + return 1; + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityAirSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityAirSolar.java index 40cc6b1..0f028d5 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityAirSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityAirSolar.java @@ -20,21 +20,21 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityAirSolar extends TileEntitySolarBase { - public TileEntityAirSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityAirSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void createEnergy() { - if (theSunIsVisible && this.yCoord >= 160) { - energySource.addEnergy(output * 2.5); - } else if (theSunIsVisible) { - energySource.addEnergy(output); - } - } + @Override + public void createEnergy() { + if (theSunIsVisible && this.yCoord >= 160) { + energySource.addEnergy(output * 2.5); + } else if (theSunIsVisible) { + energySource.addEnergy(output); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 15); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 15); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityDoubleAirSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityDoubleAirSolar.java index 25e1319..8d579e2 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityDoubleAirSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityDoubleAirSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleAirSolar extends TileEntityAirSolar { - public TileEntityDoubleAirSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleAirSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 0); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 0); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityTripleAirSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityTripleAirSolar.java index 2270922..d346403 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityTripleAirSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/air/TileEntityTripleAirSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleAirSolar extends TileEntityAirSolar { - public TileEntityTripleAirSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleAirSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 1); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityCompressedSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityCompressedSolar.java index 3db240b..745b869 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityCompressedSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityCompressedSolar.java @@ -20,12 +20,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityCompressedSolar extends TileEntitySolarBase { - public TileEntityCompressedSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityCompressedSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 0); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 0); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityDoubleCompressedSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityDoubleCompressedSolar.java index 7756683..374ed2f 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityDoubleCompressedSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityDoubleCompressedSolar.java @@ -20,12 +20,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleCompressedSolar extends TileEntitySolarBase { - public TileEntityDoubleCompressedSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleCompressedSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 1); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityTripleCompressedSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityTripleCompressedSolar.java index d31e698..b68230d 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityTripleCompressedSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/compressed/TileEntityTripleCompressedSolar.java @@ -20,12 +20,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleCompressedSolar extends TileEntitySolarBase { - public TileEntityTripleCompressedSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleCompressedSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 2); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 2); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDarkSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDarkSolar.java index a699022..6136ca6 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDarkSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDarkSolar.java @@ -20,19 +20,19 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDarkSolar extends TileEntitySolarBase { - public TileEntityDarkSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityDarkSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void createEnergy() { - if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !worldObj.isDaytime() && !worldObj.isRaining() && !worldObj.isThundering()) { - energySource.addEnergy(output); - } - } + @Override + public void createEnergy() { + if (worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) && !worldObj.isDaytime() && !worldObj.isRaining() && !worldObj.isThundering()) { + energySource.addEnergy(output); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 6); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 6); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDoubleDarkSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDoubleDarkSolar.java index 0ee08df..e3cb7f8 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDoubleDarkSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityDoubleDarkSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleDarkSolar extends TileEntityDarkSolar { - public TileEntityDoubleDarkSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleDarkSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 7); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 7); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityTripleDarkSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityTripleDarkSolar.java index 4f01840..b126c8a 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityTripleDarkSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/dark/TileEntityTripleDarkSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleDarkSolar extends TileEntityDarkSolar { - public TileEntityTripleDarkSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleDarkSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 8); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 8); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityDoubleEarthSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityDoubleEarthSolar.java index bd44fc0..6820874 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityDoubleEarthSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityDoubleEarthSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleEarthSolar extends TileEntityEarthSolar { - public TileEntityDoubleEarthSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleEarthSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 3); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 3); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityEarthSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityEarthSolar.java index 76cd401..74cd9a3 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityEarthSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityEarthSolar.java @@ -20,21 +20,21 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityEarthSolar extends TileEntitySolarBase { - public TileEntityEarthSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityEarthSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void createEnergy() { - if (theSunIsVisible && this.yCoord <= 10) { - energySource.addEnergy(output * 2.5); - } else if (theSunIsVisible) { - energySource.addEnergy(output); - } - } + @Override + public void createEnergy() { + if (theSunIsVisible && this.yCoord <= 10) { + energySource.addEnergy(output * 2.5); + } else if (theSunIsVisible) { + energySource.addEnergy(output); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 2); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 2); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityTripleEarthSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityTripleEarthSolar.java index 902e24d..86e2f13 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityTripleEarthSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/earth/TileEntityTripleEarthSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleEarthSolar extends TileEntityEarthSolar { - public TileEntityTripleEarthSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleEarthSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 4); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars2, 1, 4); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityDoubleFireSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityDoubleFireSolar.java index 8fcb6c9..eddf02c 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityDoubleFireSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityDoubleFireSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleFireSolar extends TileEntityFireSolar { - public TileEntityDoubleFireSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleFireSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 13); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 13); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityFireSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityFireSolar.java index c7e97ef..48b0606 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityFireSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityFireSolar.java @@ -20,29 +20,29 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityFireSolar extends TileEntitySolarBase { - public TileEntityFireSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityFireSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void checkConditions() { - if (!initialized && worldObj != null) { - canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0; - initialized = true; - } + @Override + public void checkConditions() { + if (!initialized && worldObj != null) { + canRain = worldObj.getWorldChunkManager().getBiomeGenAt(xCoord, zCoord).getIntRainfall() > 0; + initialized = true; + } - if (worldObj.provider.dimensionId == -1) { - energySource.addEnergy(output * 2); - } else { - if (tick-- == 0) { - updateSunState(); - tick = 64; - } - } - } + if (worldObj.provider.dimensionId == -1) { + energySource.addEnergy(output * 2); + } else { + if (tick-- == 0) { + updateSunState(); + tick = 64; + } + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 12); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 12); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityTripleFireSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityTripleFireSolar.java index 0a1de70..40abe77 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityTripleFireSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/fire/TileEntityTripleFireSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleFireSolar extends TileEntityFireSolar { - public TileEntityTripleFireSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleFireSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 14); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 14); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityDoubleOrderSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityDoubleOrderSolar.java index 2b7defa..3056605 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityDoubleOrderSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityDoubleOrderSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleOrderSolar extends TileEntityOrderSolar { - public TileEntityDoubleOrderSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleOrderSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 10); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 10); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityOrderSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityOrderSolar.java index 9ee3439..999a16a 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityOrderSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityOrderSolar.java @@ -20,19 +20,19 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityOrderSolar extends TileEntitySolarBase { - public TileEntityOrderSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityOrderSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void createEnergy() { - if (theSunIsVisible) { - energySource.addEnergy(output * 3); - } - } + @Override + public void createEnergy() { + if (theSunIsVisible) { + energySource.addEnergy(output * 3); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 9); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 9); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityTripleOrderSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityTripleOrderSolar.java index 9120785..b0a3886 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityTripleOrderSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/order/TileEntityTripleOrderSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleOrderSolar extends TileEntityOrderSolar { - public TileEntityTripleOrderSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleOrderSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 11); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 11); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityDoubleWaterSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityDoubleWaterSolar.java index f0733a2..3069b19 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityDoubleWaterSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityDoubleWaterSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityDoubleWaterSolar extends TileEntityWaterSolar { - public TileEntityDoubleWaterSolar() { - output = ConfigHandler.doubleCompressedSolarOutput; - } + public TileEntityDoubleWaterSolar() { + output = ConfigHandler.doubleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 4); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 4); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityTripleWaterSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityTripleWaterSolar.java index db61236..f1f2d14 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityTripleWaterSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityTripleWaterSolar.java @@ -19,12 +19,12 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityTripleWaterSolar extends TileEntityWaterSolar { - public TileEntityTripleWaterSolar() { - output = ConfigHandler.tripleCompressedSolarOutput; - } + public TileEntityTripleWaterSolar() { + output = ConfigHandler.tripleCompressedSolarOutput; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 5); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 5); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityWaterSolar.java b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityWaterSolar.java index bdeef4e..af70b24 100644 --- a/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityWaterSolar.java +++ b/src/main/java/tombenpotter/emt/common/module/ic2/tile/solars/water/TileEntityWaterSolar.java @@ -20,19 +20,19 @@ import tombenpotter.emt.common.util.ConfigHandler; public class TileEntityWaterSolar extends TileEntitySolarBase { - public TileEntityWaterSolar() { - output = ConfigHandler.compressedSolarOutput; - } + public TileEntityWaterSolar() { + output = ConfigHandler.compressedSolarOutput; + } - @Override - public void createEnergy() { - if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) { - energySource.addEnergy(output); - } - } + @Override + public void createEnergy() { + if (worldObj.isRaining() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord) || worldObj.isThundering() && worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord)) { + energySource.addEnergy(output); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 3); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(IC2ModuleBlockRegistry.emtSolars, 1, 3); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaBlocksRegistry.java b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaBlocksRegistry.java index 794dfb9..4e33657 100644 --- a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaBlocksRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaBlocksRegistry.java @@ -2,7 +2,7 @@ package tombenpotter.emt.common.module.vanilla; public class VanillaBlocksRegistry { - public static void registerBlocks() { + public static void registerBlocks() { - } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaItemsRegistry.java b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaItemsRegistry.java index 5e735dc..5a37526 100644 --- a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaItemsRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaItemsRegistry.java @@ -1,8 +1,47 @@ package tombenpotter.emt.common.module.vanilla; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import tombenpotter.emt.ModInformation; +import tombenpotter.emt.common.module.vanilla.items.tools.ItemVanillaChainsaw; +import tombenpotter.emt.common.module.vanilla.items.tools.ItemVanillaDrill; + public class VanillaItemsRegistry { - public static void registerItems() { + public static Item woodenDrill; + public static Item stoneDrill; + public static Item ironDrill; + public static Item goldenDrill; + public static Item diamondDrill; + public static Item woodenChainsaw; + public static Item stoneChainsaw; + public static Item ironChainsaw; + public static Item goldenChainsaw; + public static Item diamondChainsaw; - } -} + public static void registerItems() { + woodenDrill = new ItemVanillaDrill(Item.ToolMaterial.WOOD, 75, "woodendrill", Item.getItemFromBlock(Blocks.planks)).setUnlocalizedName(ModInformation.modid + "woodenDrill"); + GameRegistry.registerItem(woodenDrill, "woodenDrill"); + stoneDrill = new ItemVanillaDrill(Item.ToolMaterial.STONE, 165, "stonedrill", Item.getItemFromBlock(Blocks.cobblestone)).setUnlocalizedName(ModInformation.modid + "stoneDrill"); + GameRegistry.registerItem(stoneDrill, "stoneDrill"); + ironDrill = new ItemVanillaDrill(Item.ToolMaterial.IRON, 315, "irondrill", Items.iron_ingot).setUnlocalizedName(ModInformation.modid + "ironDrill"); + GameRegistry.registerItem(ironDrill, "ironDrill"); + goldenDrill = new ItemVanillaDrill(Item.ToolMaterial.GOLD, 55, "goldendrill", Items.gold_ingot).setUnlocalizedName(ModInformation.modid + "goldenDrill"); + GameRegistry.registerItem(goldenDrill, "goldenDrill"); + diamondDrill = new ItemVanillaDrill(Item.ToolMaterial.EMERALD, 2015, "diamondDrill", Items.diamond).setUnlocalizedName(ModInformation.modid + "diamondDrill"); + GameRegistry.registerItem(diamondDrill, "diamondDrill"); + + woodenChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.WOOD, 75, "woodenchainsaw", Item.getItemFromBlock(Blocks.planks)).setUnlocalizedName(ModInformation.modid + "woodenChainsaw"); + GameRegistry.registerItem(woodenChainsaw, "woodenChainsaw"); + stoneChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.STONE, 165, "stonechainsaw", Item.getItemFromBlock(Blocks.cobblestone)).setUnlocalizedName(ModInformation.modid + "stoneChainsaw"); + GameRegistry.registerItem(stoneChainsaw, "stoneChainsaw"); + ironChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.IRON, 315, "ironchainsaw", Items.iron_ingot, 3F).setUnlocalizedName(ModInformation.modid + "ironChainsaw"); + GameRegistry.registerItem(ironChainsaw, "ironChainsaw"); + goldenChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.GOLD, 55, "goldenchainsaw", Items.gold_ingot).setUnlocalizedName(ModInformation.modid + "goldenChainsaw"); + GameRegistry.registerItem(goldenChainsaw, "goldenChainsaw"); + diamondChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.EMERALD, 2015, "diamondchainsaw", Items.diamond, 5F).setUnlocalizedName(ModInformation.modid + "diamondChainsaw"); + GameRegistry.registerItem(diamondChainsaw, "diamondChainsaw"); + } +} \ No newline at end of file diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaRecipesRegistry.java b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaRecipesRegistry.java index 3a5e428..cac3c9a 100644 --- a/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaRecipesRegistry.java +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/VanillaRecipesRegistry.java @@ -2,7 +2,7 @@ package tombenpotter.emt.common.module.vanilla; public class VanillaRecipesRegistry { - public static void registerRecipes() { + public static void registerRecipes() { - } + } } diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/items/ItemCrafting.java b/src/main/java/tombenpotter/emt/common/module/vanilla/items/ItemCrafting.java index 24f238b..a8a0f3c 100644 --- a/src/main/java/tombenpotter/emt/common/module/vanilla/items/ItemCrafting.java +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/items/ItemCrafting.java @@ -6,11 +6,11 @@ import tombenpotter.emt.ElectroMagicTools; public class ItemCrafting extends Item { - public IIcon[] icon = new IIcon[500]; + public IIcon[] icon = new IIcon[500]; - public ItemCrafting() { - this.setMaxDamage(0); - this.setHasSubtypes(true); - this.setCreativeTab(ElectroMagicTools.tabEMT); - } + public ItemCrafting() { + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.setCreativeTab(ElectroMagicTools.tabEMT); + } } diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaChainsaw.java b/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaChainsaw.java new file mode 100644 index 0000000..a46734d --- /dev/null +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaChainsaw.java @@ -0,0 +1,65 @@ +package tombenpotter.emt.common.module.vanilla.items.tools; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import tombenpotter.emt.common.module.base.items.tools.ItemBaseChainsaw; + +public class ItemVanillaChainsaw extends ItemBaseChainsaw { + + public Item repairMaterial; + public int repairMeta; + public float damageAdded; + + public ItemVanillaChainsaw(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = 0; + damageAdded = 2; + } + + public ItemVanillaChainsaw(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, float damageAdded) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = 0; + this.damageAdded = damageAdded; + } + + public ItemVanillaChainsaw(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, int repairMeta) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = repairMeta; + damageAdded = 2; + } + + public ItemVanillaChainsaw(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, int repairMeta, float damageAdded) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = repairMeta; + this.damageAdded = damageAdded; + } + + @Override + public boolean canHarvestBlock(Block block, ItemStack stack) { + return (block.getHarvestLevel(new ItemStack(Item.getItemFromBlock(block)).getItemDamage()) <= this.toolMaterial.getHarvestLevel()); + } + + @Override + public boolean getIsRepairable(ItemStack stack1, ItemStack stack2) { + return (stack2.getItem() == repairMaterial && stack2.getItemDamage() == repairMeta) ? true : super.getIsRepairable(stack1, stack2); + } + + @Override + public boolean isRepairable() { + return true; + } + + @Override + public boolean hitEntity(ItemStack stack, EntityLivingBase entityliving, EntityLivingBase attacker) { + stack.damageItem(1, attacker); + entityliving.attackEntityFrom(DamageSource.generic, damageAdded); + return true; + } +} diff --git a/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaDrill.java b/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaDrill.java new file mode 100644 index 0000000..334bddd --- /dev/null +++ b/src/main/java/tombenpotter/emt/common/module/vanilla/items/tools/ItemVanillaDrill.java @@ -0,0 +1,40 @@ +package tombenpotter.emt.common.module.vanilla.items.tools; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import tombenpotter.emt.common.module.base.items.tools.ItemBaseDrill; +import tombenpotter.emt.common.util.IRefillable; + +public class ItemVanillaDrill extends ItemBaseDrill implements IRefillable { + + public Item repairMaterial; + public int repairMeta; + + public ItemVanillaDrill(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = 0; + } + + public ItemVanillaDrill(ToolMaterial material, int maxDamage, String textureName, Item repairMaterial, int repairMeta) { + super(material, maxDamage, textureName); + this.repairMaterial = repairMaterial; + this.repairMeta = repairMeta; + } + + @Override + public boolean canHarvestBlock(Block block, ItemStack stack) { + return (block.getHarvestLevel(new ItemStack(Item.getItemFromBlock(block)).getItemDamage()) <= this.toolMaterial.getHarvestLevel()); + } + + @Override + public boolean getIsRepairable(ItemStack stack1, ItemStack stack2) { + return (stack2.getItem() == repairMaterial && stack2.getItemDamage() == repairMeta) ? true : super.getIsRepairable(stack1, stack2); + } + + @Override + public boolean isRepairable() { + return true; + } +} diff --git a/src/main/java/tombenpotter/emt/common/util/ConfigHandler.java b/src/main/java/tombenpotter/emt/common/util/ConfigHandler.java index edd7705..e30acf9 100644 --- a/src/main/java/tombenpotter/emt/common/util/ConfigHandler.java +++ b/src/main/java/tombenpotter/emt/common/util/ConfigHandler.java @@ -6,198 +6,199 @@ import java.io.File; public class ConfigHandler { - public static Configuration config; + public static Configuration config; - // sections - public static String CATEGORY_RESEARCH = "Research"; - public static String CATEGORY_VALUES = "Numeric Values"; - public static String CATEGORY_OUTPUTS = "Essentia Generator Outputs"; + // sections + public static String CATEGORY_RANDOM = "Random Configs"; + public static String CATEGORY_RESEARCH = "Research"; + public static String CATEGORY_VALUES = "Numeric Values"; + public static String CATEGORY_OUTPUTS = "Essentia Generator Outputs"; - public static int essentiaGeneratorsDelay; - public static int etherealProcessorBaseSpeed; - public static int etherealProcessorBonus; - public static int chargeFocusProduction; - public static int armorBaubleProduction; - public static int inventoryBaubleProdution; - public static int wandChargeFocusCost; + public static int essentiaGeneratorsDelay; + public static int etherealProcessorBaseSpeed; + public static int etherealProcessorBonus; + public static int chargeFocusProduction; + public static int armorBaubleProduction; + public static int inventoryBaubleProdution; + public static int wandChargeFocusCost; - // values - public static double wandChargerConsumption; - public static double compressedSolarOutput; - public static double doubleCompressedSolarOutput; - public static double nanoBootsSpeed; - public static double quantumBootsSpeed; - public static double nanoBootsJump; - public static double quantumBootsJump; - public static double tripleCompressedSolarOutput; + // values + public static double wandChargerConsumption; + public static double compressedSolarOutput; + public static double doubleCompressedSolarOutput; + public static double nanoBootsSpeed; + public static double quantumBootsSpeed; + public static double nanoBootsJump; + public static double quantumBootsJump; + public static double tripleCompressedSolarOutput; - // essentias - public static double fireOutput; - public static double waterOutput; - public static double airOutput; - public static double earthOutput; - public static double orderOutput; - public static double entropyOutput; - public static double outputCap; + // essentias + public static double fireOutput; + public static double waterOutput; + public static double airOutput; + public static double earthOutput; + public static double orderOutput; + public static double entropyOutput; + public static double outputCap; - // random stuff - public static boolean capesOn; - public static boolean toolsInBore; - public static boolean nightVisionOff; - public static boolean enchanting; - public static boolean smoke; - public static boolean oneRingSpawn; - public static boolean removeAmberAndCinnabarMacerating; + // random stuff + public static boolean capesOn; + public static boolean toolsInBore; + public static boolean nightVisionOff; + public static boolean enchanting; + public static boolean smoke; + public static boolean oneRingSpawn; + public static boolean removeAmberAndCinnabarMacerating; - // loot chance - public static int chanceOneRing; - public static int chanceTaintedMjolnir; + // loot chance + public static int chanceOneRing; + public static int chanceTaintedMjolnir; - // research - public static boolean thaumiumDrillResearch; - public static boolean thaumiumChainsawResearch; - public static boolean thaumiumOmnitoolResearch; - public static boolean rockbreakerDrillResearch; - public static boolean streamChainsawResearch; - public static boolean electricGooglesResearch; - public static boolean nanoGooglesResearch; - public static boolean quantumGooglesResearch; - public static boolean ironOmnitoolResearch; - public static boolean diamondOmnitoolResearch; - public static boolean explosionFocusResearch; - public static boolean christmasFocusResearch; - public static boolean shieldFocusResearch; - public static boolean shieldBlockResearch; - public static boolean potentiaGeneratorResearch; - public static boolean ignisGeneratorResearch; - public static boolean auramGeneratorResearch; - public static boolean arborGeneratorResearch; - public static boolean wandChargingSationResearch; - public static boolean tinyUraniumResearch; - public static boolean thorHammerResearch; - public static boolean superchargedThorHammerResearch; - public static boolean compressedSolarsResearch; - public static boolean solarHelmetResearch; - public static boolean electricBootsResearch; - public static boolean nanoBootsResearch; - public static boolean quantumBootsResearch; - public static boolean electricScribingToolsResearch; - public static boolean etherealProcessorResearch; - public static boolean waterSolarsResearch; - public static boolean darkSolarsResearch; - public static boolean orderSolarsResearch; - public static boolean fireSolarsResearch; - public static boolean airSolarsResearch; - public static boolean earthSolarsResearch; - public static boolean saxumGenResearch; - public static boolean uuMInfusionResearch; - public static boolean portableNodeResarch; - public static boolean electricHoeGrowthResearch; - public static boolean chargeFocusResearch; - public static boolean wandChargeFocusResearch; - public static boolean inventoryChargingRing; - public static boolean armorChargingRing; - public static boolean thaumiumWingResearch; - public static boolean nanoWingResearch; - public static boolean quantumWingsResearch; - public static boolean aerGeneratorResearch; + // research + public static boolean thaumiumDrillResearch; + public static boolean thaumiumChainsawResearch; + public static boolean thaumiumOmnitoolResearch; + public static boolean rockbreakerDrillResearch; + public static boolean streamChainsawResearch; + public static boolean electricGooglesResearch; + public static boolean nanoGooglesResearch; + public static boolean quantumGooglesResearch; + public static boolean ironOmnitoolResearch; + public static boolean diamondOmnitoolResearch; + public static boolean explosionFocusResearch; + public static boolean christmasFocusResearch; + public static boolean shieldFocusResearch; + public static boolean shieldBlockResearch; + public static boolean potentiaGeneratorResearch; + public static boolean ignisGeneratorResearch; + public static boolean auramGeneratorResearch; + public static boolean arborGeneratorResearch; + public static boolean wandChargingSationResearch; + public static boolean tinyUraniumResearch; + public static boolean thorHammerResearch; + public static boolean superchargedThorHammerResearch; + public static boolean compressedSolarsResearch; + public static boolean solarHelmetResearch; + public static boolean electricBootsResearch; + public static boolean nanoBootsResearch; + public static boolean quantumBootsResearch; + public static boolean electricScribingToolsResearch; + public static boolean etherealProcessorResearch; + public static boolean waterSolarsResearch; + public static boolean darkSolarsResearch; + public static boolean orderSolarsResearch; + public static boolean fireSolarsResearch; + public static boolean airSolarsResearch; + public static boolean earthSolarsResearch; + public static boolean saxumGenResearch; + public static boolean uuMInfusionResearch; + public static boolean portableNodeResarch; + public static boolean electricHoeGrowthResearch; + public static boolean chargeFocusResearch; + public static boolean wandChargeFocusResearch; + public static boolean inventoryChargingRing; + public static boolean armorChargingRing; + public static boolean thaumiumWingResearch; + public static boolean nanoWingResearch; + public static boolean quantumWingsResearch; + public static boolean aerGeneratorResearch; - public static void init(File file) { - config = new Configuration(file); - syncConfig(); - } + public static void init(File file) { + config = new Configuration(file); + syncConfig(); + } - public static void syncConfig() { + public static void syncConfig() { - config.addCustomCategoryComment(CATEGORY_VALUES, "The only way to change some numbers that my machines uses."); - config.addCustomCategoryComment(CATEGORY_RESEARCH, "The only way to disable some researches. " + "Be careful, if you disable some researches, " + "all researches linked to it will be removed too. " + "Really, don't touch that unless you know exactly what you are doing."); - config.addCustomCategoryComment(CATEGORY_OUTPUTS, "Change outputs linked to different Essentias here"); + config.addCustomCategoryComment(CATEGORY_VALUES, "The only way to change some numbers that my machines uses."); + config.addCustomCategoryComment(CATEGORY_RESEARCH, "The only way to disable some researches. " + "Be careful, if you disable some researches, " + "all researches linked to it will be removed too. " + "Really, don't touch that unless you know exactly what you are doing."); + config.addCustomCategoryComment(CATEGORY_OUTPUTS, "Change outputs linked to different Essentias here"); - capesOn = config.get(Configuration.CATEGORY_GENERAL, "Enable capes", true, "This config option is to enable or disable capes for people who have them. " + "Seriously, you shouldn't touch that unless you have another cape and " + "it conflicts with it.").getBoolean(capesOn); - toolsInBore = config.get(Configuration.CATEGORY_GENERAL, "Tools for Arcane Bore", false, "This will augment the durablilty of the tools, and will also decrease the EU cost to 1. " + "The tools should have the same number of uses than before.").getBoolean(toolsInBore); - nightVisionOff = config.get(Configuration.CATEGORY_GENERAL, "Disable nightvision helmets", false, "This was added because of mods making you totally blind if using nightvision. For example, enable that when in the Deep Dark.").getBoolean(nightVisionOff); - enchanting = config.get(Configuration.CATEGORY_GENERAL, "Enable enchanting tools", false, "Warning: the enchantability is low.").getBoolean(enchanting); - smoke = config.get(Configuration.CATEGORY_GENERAL, "Disable smoke effect for boots", false, "This effect only appears when the player isn't on the ground").getBoolean(smoke); - oneRingSpawn = config.get(Configuration.CATEGORY_GENERAL, "Disable One Ring in dungeon chests", false, "There is no other way to get this item.").getBoolean(oneRingSpawn); - chanceTaintedMjolnir = config.get(Configuration.CATEGORY_GENERAL, "Tainted Mjolnir spawning change", 25, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt(); - chanceOneRing = config.get(Configuration.CATEGORY_GENERAL, "One Ring spawning chance", 15, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt(); - removeAmberAndCinnabarMacerating = config.get(Configuration.CATEGORY_GENERAL, "Clear Amber/Cinnabar Macerating", true, "This is here because of conflicts between mods that add the same input and different outputs").getBoolean(removeAmberAndCinnabarMacerating); + capesOn = config.get(CATEGORY_RANDOM, "Enable capes", true, "This config option is to enable or disable capes for people who have them. " + "Seriously, you shouldn't touch that unless you have another cape and " + "it conflicts with it.").getBoolean(capesOn); + toolsInBore = config.get(CATEGORY_RANDOM, "Tools for Arcane Bore", false, "This will augment the durablilty of the tools, and will also decrease the EU cost to 1. " + "The tools should have the same number of uses than before.").getBoolean(toolsInBore); + nightVisionOff = config.get(CATEGORY_RANDOM, "Disable nightvision helmets", false, "This was added because of mods making you totally blind if using nightvision. For example, enable that when in the Deep Dark.").getBoolean(nightVisionOff); + enchanting = config.get(CATEGORY_RANDOM, "Enable enchanting tools", false, "Warning: the enchantability is low.").getBoolean(enchanting); + smoke = config.get(CATEGORY_RANDOM, "Disable smoke effect for boots", false, "This effect only appears when the player isn't on the ground").getBoolean(smoke); + oneRingSpawn = config.get(CATEGORY_RANDOM, "Disable One Ring in dungeon chests", false, "There is no other way to get this item.").getBoolean(oneRingSpawn); + chanceTaintedMjolnir = config.get(CATEGORY_RANDOM, "Tainted Mjolnir spawning change", 25, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt(); + chanceOneRing = config.get(CATEGORY_RANDOM, "One Ring spawning chance", 15, "If you have a lot of mods adding dungeon loot, you should definetely increase this").getInt(); + removeAmberAndCinnabarMacerating = config.get(CATEGORY_RANDOM, "Clear Amber/Cinnabar Macerating", true, "This is here because of conflicts between mods that add the same input and different outputs").getBoolean(removeAmberAndCinnabarMacerating); - // DEFAULTS - Aer - 15,000 Aqua - 5,000 Ignis - 20,000 Ordo - 16,000 Perditio - 10,000 Terra - 2,000 - airOutput = config.get(CATEGORY_OUTPUTS, "Aer Output", 15000).getDouble(airOutput); - waterOutput = config.get(CATEGORY_OUTPUTS, "Aqua Output", 5000).getDouble(waterOutput); - fireOutput = config.get(CATEGORY_OUTPUTS, "Ignis Output", 20000).getDouble(fireOutput); - orderOutput = config.get(CATEGORY_OUTPUTS, "Ordo Output", 16000).getDouble(orderOutput); - entropyOutput = config.get(CATEGORY_OUTPUTS, "Perditio Output", 10000).getDouble(entropyOutput); - earthOutput = config.get(CATEGORY_OUTPUTS, "Terra Output", 2000).getDouble(earthOutput); - outputCap = config.get(CATEGORY_OUTPUTS, "Output Cap", -1).getDouble(outputCap); + // DEFAULTS - Aer - 15,000 Aqua - 5,000 Ignis - 20,000 Ordo - 16,000 Perditio - 10,000 Terra - 2,000 + airOutput = config.get(CATEGORY_OUTPUTS, "Aer Output", 15000).getDouble(airOutput); + waterOutput = config.get(CATEGORY_OUTPUTS, "Aqua Output", 5000).getDouble(waterOutput); + fireOutput = config.get(CATEGORY_OUTPUTS, "Ignis Output", 20000).getDouble(fireOutput); + orderOutput = config.get(CATEGORY_OUTPUTS, "Ordo Output", 16000).getDouble(orderOutput); + entropyOutput = config.get(CATEGORY_OUTPUTS, "Perditio Output", 10000).getDouble(entropyOutput); + earthOutput = config.get(CATEGORY_OUTPUTS, "Terra Output", 2000).getDouble(earthOutput); + outputCap = config.get(CATEGORY_OUTPUTS, "Output Cap", -1).getDouble(outputCap); - wandChargerConsumption = config.get(CATEGORY_VALUES, "Wand Charging Station Consumption", 50000, "This is the number you have to modify if you want to make the Industrial Wand Charging " + "Station use more or less EU to charge 1 unit of Vis on your wand.").getDouble(wandChargerConsumption); - compressedSolarOutput = config.get(CATEGORY_VALUES, "Compressed Solar Panel Output", 10, "This is the number you have to modify if you want to make the Compressed Solar Panel yield " + "more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(compressedSolarOutput); - doubleCompressedSolarOutput = config.get(CATEGORY_VALUES, "Double Compressed Solar Panel Output", 100, "This is the number you have to modify if you want to make the Double Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(doubleCompressedSolarOutput); - tripleCompressedSolarOutput = config.get(CATEGORY_VALUES, "Triple Compressed Solar Panel Output", 1000, "This is the number you have to modify if you want to make the Triple Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(tripleCompressedSolarOutput); - essentiaGeneratorsDelay = config.get(CATEGORY_VALUES, "Essentia Generators draw rate", 120, "The number of ticks the Essentia Generators wait before using 2 Essentia. " + "If you want them to be slower, increase the number.").getInt(essentiaGeneratorsDelay); - nanoBootsSpeed = config.get(CATEGORY_VALUES, "Nano Boots of the Traveller Speed", 0.25, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsSpeed); - quantumBootsSpeed = config.get(CATEGORY_VALUES, "Quantum Boots of the Traveller Speed", 0.5, "Watch out, that goes up REALLY quickly.").getDouble(quantumBootsSpeed); - nanoBootsJump = config.get(CATEGORY_VALUES, "Nano Boots of the Traveller jump", 0.6, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump); - quantumBootsJump = config.get(CATEGORY_VALUES, "Quantum Boots of the Traveller jump", 0.9, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump); - etherealProcessorBaseSpeed = config.get(CATEGORY_VALUES, "Etheral Processor speed", 400, "Default is 400, the double of a regular furnace").getInt(); - etherealProcessorBonus = config.get(CATEGORY_VALUES, "Ethereal Processor Bonus", 10, "This number is the chance of getting a Thaumium Ingot as a bonus when " + "processing an item in the machine. It is 1 out of the number you will enter. " + "The default is 1/10 chance.").getInt(); - chargeFocusProduction = config.get(CATEGORY_VALUES, "Wand Focus: Charge production", 64, "Default is 64").getInt(); - armorBaubleProduction = config.get(CATEGORY_VALUES, "Armor Charging Ring production", 32, "Default is 32").getInt(); - inventoryBaubleProdution = config.get(CATEGORY_VALUES, "Inventory Charging Ring production", 32, "Default is 32").getInt(); - wandChargeFocusCost = config.get(CATEGORY_VALUES, "Wand Focus: Wand Charging Cost", 40000, "Default is 40000").getInt(); + wandChargerConsumption = config.get(CATEGORY_VALUES, "Wand Charging Station Consumption", 50000, "This is the number you have to modify if you want to make the Industrial Wand Charging " + "Station use more or less EU to charge 1 unit of Vis on your wand.").getDouble(wandChargerConsumption); + compressedSolarOutput = config.get(CATEGORY_VALUES, "Compressed Solar Panel Output", 10, "This is the number you have to modify if you want to make the Compressed Solar Panel yield " + "more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(compressedSolarOutput); + doubleCompressedSolarOutput = config.get(CATEGORY_VALUES, "Double Compressed Solar Panel Output", 100, "This is the number you have to modify if you want to make the Double Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(doubleCompressedSolarOutput); + tripleCompressedSolarOutput = config.get(CATEGORY_VALUES, "Triple Compressed Solar Panel Output", 1000, "This is the number you have to modify if you want to make the Triple Compressed Solar Panel " + "yield more or less EU per tick. Really, you shouldn't touch that, " + "since it's pretty balanced as it is.").getDouble(tripleCompressedSolarOutput); + essentiaGeneratorsDelay = config.get(CATEGORY_VALUES, "Essentia Generators draw rate", 120, "The number of ticks the Essentia Generators wait before using 2 Essentia. " + "If you want them to be slower, increase the number.").getInt(essentiaGeneratorsDelay); + nanoBootsSpeed = config.get(CATEGORY_VALUES, "Nano Boots of the Traveller Speed", 0.25, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsSpeed); + quantumBootsSpeed = config.get(CATEGORY_VALUES, "Quantum Boots of the Traveller Speed", 0.5, "Watch out, that goes up REALLY quickly.").getDouble(quantumBootsSpeed); + nanoBootsJump = config.get(CATEGORY_VALUES, "Nano Boots of the Traveller jump", 0.6, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump); + quantumBootsJump = config.get(CATEGORY_VALUES, "Quantum Boots of the Traveller jump", 0.9, "Watch out, that goes up REALLY quickly.").getDouble(nanoBootsJump); + etherealProcessorBaseSpeed = config.get(CATEGORY_VALUES, "Etheral Processor speed", 400, "Default is 400, the double of a regular furnace").getInt(); + etherealProcessorBonus = config.get(CATEGORY_VALUES, "Ethereal Processor Bonus", 10, "This number is the chance of getting a Thaumium Ingot as a bonus when " + "processing an item in the machine. It is 1 out of the number you will enter. " + "The default is 1/10 chance.").getInt(); + chargeFocusProduction = config.get(CATEGORY_VALUES, "Wand Focus: Charge production", 64, "Default is 64").getInt(); + armorBaubleProduction = config.get(CATEGORY_VALUES, "Armor Charging Ring production", 32, "Default is 32").getInt(); + inventoryBaubleProdution = config.get(CATEGORY_VALUES, "Inventory Charging Ring production", 32, "Default is 32").getInt(); + wandChargeFocusCost = config.get(CATEGORY_VALUES, "Wand Focus: Wand Charging Cost", 40000, "Default is 40000").getInt(); - thaumiumDrillResearch = config.get(CATEGORY_RESEARCH, "Thaumium Drill", false).getBoolean(thaumiumDrillResearch); - thaumiumChainsawResearch = config.get(CATEGORY_RESEARCH, "Thaumium Chainsaw", false).getBoolean(thaumiumChainsawResearch); - thaumiumDrillResearch = config.get(CATEGORY_RESEARCH, "Thaumium Omnitool", false).getBoolean(thaumiumOmnitoolResearch); - rockbreakerDrillResearch = config.get(CATEGORY_RESEARCH, "Drill of the Rockbreaker", false).getBoolean(rockbreakerDrillResearch); - streamChainsawResearch = config.get(CATEGORY_RESEARCH, "Chainsaw of the Stream", false).getBoolean(streamChainsawResearch); - electricGooglesResearch = config.get(CATEGORY_RESEARCH, "Electric Googles of Revealing", false).getBoolean(electricGooglesResearch); - nanoGooglesResearch = config.get(CATEGORY_RESEARCH, "Nanosuit Googles of Revealing", false).getBoolean(nanoGooglesResearch); - quantumGooglesResearch = config.get(CATEGORY_RESEARCH, "Quantum Googles of Revealing", false).getBoolean(quantumGooglesResearch); - ironOmnitoolResearch = config.get(CATEGORY_RESEARCH, "Omnitool", false).getBoolean(ironOmnitoolResearch); - diamondOmnitoolResearch = config.get(CATEGORY_RESEARCH, "Diamond Omnitool", false).getBoolean(diamondOmnitoolResearch); - explosionFocusResearch = config.get(CATEGORY_RESEARCH, "Explosion Focus", false).getBoolean(explosionFocusResearch); - christmasFocusResearch = config.get(CATEGORY_RESEARCH, "Kris-tmas Focus", false).getBoolean(christmasFocusResearch); - shieldFocusResearch = config.get(CATEGORY_RESEARCH, "Shield Focus", false).getBoolean(shieldFocusResearch); - shieldBlockResearch = config.get(CATEGORY_RESEARCH, "Shield Block", false).getBoolean(shieldBlockResearch); - potentiaGeneratorResearch = config.get(CATEGORY_RESEARCH, "Potentia Generator", false).getBoolean(potentiaGeneratorResearch); - ignisGeneratorResearch = config.get(CATEGORY_RESEARCH, "Ignis Generator", false).getBoolean(ignisGeneratorResearch); - auramGeneratorResearch = config.get(CATEGORY_RESEARCH, "Auram Generator", false).getBoolean(auramGeneratorResearch); - arborGeneratorResearch = config.get(CATEGORY_RESEARCH, "Arbor Generator", false).getBoolean(arborGeneratorResearch); - wandChargingSationResearch = config.get(CATEGORY_RESEARCH, "Industrial Wand Charging Station", false).getBoolean(wandChargingSationResearch); - tinyUraniumResearch = config.get(CATEGORY_RESEARCH, "Tiny Piles of Uranium", false).getBoolean(tinyUraniumResearch); - thorHammerResearch = config.get(CATEGORY_RESEARCH, "Mjolnir", false).getBoolean(thorHammerResearch); - superchargedThorHammerResearch = config.get(CATEGORY_RESEARCH, "Supercharged Mjolnir", false).getBoolean(superchargedThorHammerResearch); - compressedSolarsResearch = config.get(CATEGORY_RESEARCH, "Compressed Solars", false).getBoolean(compressedSolarsResearch); - solarHelmetResearch = config.get(CATEGORY_RESEARCH, "Solar Helmet of Revealing", false).getBoolean(solarHelmetResearch); - electricBootsResearch = config.get(CATEGORY_RESEARCH, "Electric Boots of the Traveller", false).getBoolean(electricBootsResearch); - nanoBootsResearch = config.get(CATEGORY_RESEARCH, "Nano Boots of the Traveller", false).getBoolean(nanoBootsResearch); - quantumBootsResearch = config.get(CATEGORY_RESEARCH, "Quantum Boots of the Traveller", false).getBoolean(quantumBootsResearch); - electricScribingToolsResearch = config.get(CATEGORY_RESEARCH, "Electric Scribing Tools", false).getBoolean(electricScribingToolsResearch); - etherealProcessorResearch = config.get(CATEGORY_RESEARCH, "Ethereal Processor", false).getBoolean(etherealProcessorResearch); - waterSolarsResearch = config.get(CATEGORY_RESEARCH, "Water Solar Panels", false).getBoolean(waterSolarsResearch); - darkSolarsResearch = config.get(CATEGORY_RESEARCH, "Entropy Solar Panels", false).getBoolean(darkSolarsResearch); - orderSolarsResearch = config.get(CATEGORY_RESEARCH, "Order Solar Panels", false).getBoolean(orderSolarsResearch); - fireSolarsResearch = config.get(CATEGORY_RESEARCH, "Fire Solar Panels", false).getBoolean(fireSolarsResearch); - airSolarsResearch = config.get(CATEGORY_RESEARCH, "Air Solar Panels", false).getBoolean(airSolarsResearch); - earthSolarsResearch = config.get(CATEGORY_RESEARCH, "Earth Solar Panels", false).getBoolean(earthSolarsResearch); - saxumGenResearch = config.get(CATEGORY_RESEARCH, "Saxum Generator", false).getBoolean(saxumGenResearch); - uuMInfusionResearch = config.get(CATEGORY_RESEARCH, "UU-Mater Infusion", false).getBoolean(uuMInfusionResearch); - portableNodeResarch = config.get(CATEGORY_RESEARCH, "Portable Node", false).getBoolean(portableNodeResarch); - electricHoeGrowthResearch = config.get(CATEGORY_RESEARCH, "Electric Hoe of Growth", false).getBoolean(electricHoeGrowthResearch); - chargeFocusResearch = config.get(CATEGORY_RESEARCH, "Wand Focus: Charging", false).getBoolean(chargeFocusResearch); - wandChargeFocusResearch = config.get(CATEGORY_RESEARCH, "Wand Focus: Wand Charging", false).getBoolean(wandChargeFocusResearch); - inventoryChargingRing = config.get(CATEGORY_RESEARCH, "Inventory Charging Ring", false).getBoolean(inventoryChargingRing); - armorChargingRing = config.get(CATEGORY_RESEARCH, "Armor Charging Ring", false).getBoolean(armorChargingRing); - thaumiumWingResearch = config.get(CATEGORY_RESEARCH, "Thaumium Reinforced Wings", false).getBoolean(thaumiumWingResearch); - nanoWingResearch = config.get(CATEGORY_RESEARCH, "Nanosuit Wings", false).getBoolean(nanoWingResearch); - quantumWingsResearch = config.get(CATEGORY_RESEARCH, "Quantum Wings", false).getBoolean(quantumWingsResearch); - aerGeneratorResearch = config.get(CATEGORY_RESEARCH, "Aer Generator", false).getBoolean(aerGeneratorResearch); + thaumiumDrillResearch = config.get(CATEGORY_RESEARCH, "Thaumium Drill", false).getBoolean(thaumiumDrillResearch); + thaumiumChainsawResearch = config.get(CATEGORY_RESEARCH, "Thaumium Chainsaw", false).getBoolean(thaumiumChainsawResearch); + thaumiumDrillResearch = config.get(CATEGORY_RESEARCH, "Thaumium Omnitool", false).getBoolean(thaumiumOmnitoolResearch); + rockbreakerDrillResearch = config.get(CATEGORY_RESEARCH, "Drill of the Rockbreaker", false).getBoolean(rockbreakerDrillResearch); + streamChainsawResearch = config.get(CATEGORY_RESEARCH, "Chainsaw of the Stream", false).getBoolean(streamChainsawResearch); + electricGooglesResearch = config.get(CATEGORY_RESEARCH, "Electric Googles of Revealing", false).getBoolean(electricGooglesResearch); + nanoGooglesResearch = config.get(CATEGORY_RESEARCH, "Nanosuit Googles of Revealing", false).getBoolean(nanoGooglesResearch); + quantumGooglesResearch = config.get(CATEGORY_RESEARCH, "Quantum Googles of Revealing", false).getBoolean(quantumGooglesResearch); + ironOmnitoolResearch = config.get(CATEGORY_RESEARCH, "Omnitool", false).getBoolean(ironOmnitoolResearch); + diamondOmnitoolResearch = config.get(CATEGORY_RESEARCH, "Diamond Omnitool", false).getBoolean(diamondOmnitoolResearch); + explosionFocusResearch = config.get(CATEGORY_RESEARCH, "Explosion Focus", false).getBoolean(explosionFocusResearch); + christmasFocusResearch = config.get(CATEGORY_RESEARCH, "Kris-tmas Focus", false).getBoolean(christmasFocusResearch); + shieldFocusResearch = config.get(CATEGORY_RESEARCH, "Shield Focus", false).getBoolean(shieldFocusResearch); + shieldBlockResearch = config.get(CATEGORY_RESEARCH, "Shield Block", false).getBoolean(shieldBlockResearch); + potentiaGeneratorResearch = config.get(CATEGORY_RESEARCH, "Potentia Generator", false).getBoolean(potentiaGeneratorResearch); + ignisGeneratorResearch = config.get(CATEGORY_RESEARCH, "Ignis Generator", false).getBoolean(ignisGeneratorResearch); + auramGeneratorResearch = config.get(CATEGORY_RESEARCH, "Auram Generator", false).getBoolean(auramGeneratorResearch); + arborGeneratorResearch = config.get(CATEGORY_RESEARCH, "Arbor Generator", false).getBoolean(arborGeneratorResearch); + wandChargingSationResearch = config.get(CATEGORY_RESEARCH, "Industrial Wand Charging Station", false).getBoolean(wandChargingSationResearch); + tinyUraniumResearch = config.get(CATEGORY_RESEARCH, "Tiny Piles of Uranium", false).getBoolean(tinyUraniumResearch); + thorHammerResearch = config.get(CATEGORY_RESEARCH, "Mjolnir", false).getBoolean(thorHammerResearch); + superchargedThorHammerResearch = config.get(CATEGORY_RESEARCH, "Supercharged Mjolnir", false).getBoolean(superchargedThorHammerResearch); + compressedSolarsResearch = config.get(CATEGORY_RESEARCH, "Compressed Solars", false).getBoolean(compressedSolarsResearch); + solarHelmetResearch = config.get(CATEGORY_RESEARCH, "Solar Helmet of Revealing", false).getBoolean(solarHelmetResearch); + electricBootsResearch = config.get(CATEGORY_RESEARCH, "Electric Boots of the Traveller", false).getBoolean(electricBootsResearch); + nanoBootsResearch = config.get(CATEGORY_RESEARCH, "Nano Boots of the Traveller", false).getBoolean(nanoBootsResearch); + quantumBootsResearch = config.get(CATEGORY_RESEARCH, "Quantum Boots of the Traveller", false).getBoolean(quantumBootsResearch); + electricScribingToolsResearch = config.get(CATEGORY_RESEARCH, "Electric Scribing Tools", false).getBoolean(electricScribingToolsResearch); + etherealProcessorResearch = config.get(CATEGORY_RESEARCH, "Ethereal Processor", false).getBoolean(etherealProcessorResearch); + waterSolarsResearch = config.get(CATEGORY_RESEARCH, "Water Solar Panels", false).getBoolean(waterSolarsResearch); + darkSolarsResearch = config.get(CATEGORY_RESEARCH, "Entropy Solar Panels", false).getBoolean(darkSolarsResearch); + orderSolarsResearch = config.get(CATEGORY_RESEARCH, "Order Solar Panels", false).getBoolean(orderSolarsResearch); + fireSolarsResearch = config.get(CATEGORY_RESEARCH, "Fire Solar Panels", false).getBoolean(fireSolarsResearch); + airSolarsResearch = config.get(CATEGORY_RESEARCH, "Air Solar Panels", false).getBoolean(airSolarsResearch); + earthSolarsResearch = config.get(CATEGORY_RESEARCH, "Earth Solar Panels", false).getBoolean(earthSolarsResearch); + saxumGenResearch = config.get(CATEGORY_RESEARCH, "Saxum Generator", false).getBoolean(saxumGenResearch); + uuMInfusionResearch = config.get(CATEGORY_RESEARCH, "UU-Mater Infusion", false).getBoolean(uuMInfusionResearch); + portableNodeResarch = config.get(CATEGORY_RESEARCH, "Portable Node", false).getBoolean(portableNodeResarch); + electricHoeGrowthResearch = config.get(CATEGORY_RESEARCH, "Electric Hoe of Growth", false).getBoolean(electricHoeGrowthResearch); + chargeFocusResearch = config.get(CATEGORY_RESEARCH, "Wand Focus: Charging", false).getBoolean(chargeFocusResearch); + wandChargeFocusResearch = config.get(CATEGORY_RESEARCH, "Wand Focus: Wand Charging", false).getBoolean(wandChargeFocusResearch); + inventoryChargingRing = config.get(CATEGORY_RESEARCH, "Inventory Charging Ring", false).getBoolean(inventoryChargingRing); + armorChargingRing = config.get(CATEGORY_RESEARCH, "Armor Charging Ring", false).getBoolean(armorChargingRing); + thaumiumWingResearch = config.get(CATEGORY_RESEARCH, "Thaumium Reinforced Wings", false).getBoolean(thaumiumWingResearch); + nanoWingResearch = config.get(CATEGORY_RESEARCH, "Nanosuit Wings", false).getBoolean(nanoWingResearch); + quantumWingsResearch = config.get(CATEGORY_RESEARCH, "Quantum Wings", false).getBoolean(quantumWingsResearch); + aerGeneratorResearch = config.get(CATEGORY_RESEARCH, "Aer Generator", false).getBoolean(aerGeneratorResearch); - if (config.hasChanged()) { - config.save(); - } - } + if (config.hasChanged()) { + config.save(); + } + } } diff --git a/src/main/java/tombenpotter/emt/common/util/CraftingAspects.java b/src/main/java/tombenpotter/emt/common/util/CraftingAspects.java index cf4ab4e..a4c14b0 100644 --- a/src/main/java/tombenpotter/emt/common/util/CraftingAspects.java +++ b/src/main/java/tombenpotter/emt/common/util/CraftingAspects.java @@ -17,52 +17,52 @@ import thaumcraft.api.aspects.AspectList; public class CraftingAspects { - public static AspectList thaumiumDrillCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.MINE, 16).add(Aspect.ENERGY, 16); - public static AspectList thaumiumChainsawCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.WEAPON, 16).add(Aspect.ENERGY, 16); - public static AspectList thaumicQuantumHelmetCrafting = new AspectList().add(Aspect.ARMOR, 25).add(Aspect.SENSES, 25).add(Aspect.ENERGY, 25); - public static AspectList diamondOmnitoolCrafting = new AspectList().add(Aspect.ORDER, 15).add(Aspect.AIR, 15); - public static AspectList thaumiumOmnitoolCrafting = new AspectList().add(Aspect.TOOL, 25).add(Aspect.MINE, 25).add(Aspect.ENERGY, 25).add(Aspect.WEAPON, 25); - public static AspectList thaumicNanoHelmetCrafting = new AspectList().add(Aspect.ARMOR, 16).add(Aspect.SENSES, 16).add(Aspect.ENERGY, 16); - public static AspectList laserFocusCrafting = new AspectList().add(Aspect.FIRE, 30).add(Aspect.MOTION, 16).add(Aspect.WEAPON, 30).add(Aspect.DEATH, 16); - public static AspectList christmasFocusCrafting = new AspectList().add(Aspect.ORDER, 20).add(Aspect.AIR, 20); - public static AspectList shieldFocusCrafting = new AspectList().add(Aspect.AIR, 16).add(Aspect.ARMOR, 20).add(Aspect.CRYSTAL, 16).add(Aspect.TRAP, 20).add(Aspect.LIFE, 16); - public static AspectList electricGogglesCrafting = new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 20).add(Aspect.WATER, 20); - public static AspectList potentiaGeneratorCrafting = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.MAGIC, 32).add(Aspect.METAL, 32).add(Aspect.EXCHANGE, 32); - public static AspectList ignisGeneratorCrafting = new AspectList().add(Aspect.FIRE, 16).add(Aspect.EXCHANGE, 8); - public static AspectList auramGeneratorCrafting = new AspectList().add(Aspect.AURA, 16).add(Aspect.EXCHANGE, 8); - public static AspectList arborGeneratorCrafting = new AspectList().add(Aspect.TREE, 16).add(Aspect.EXCHANGE, 8); - public static AspectList streamChaisnawCrafting = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.TREE, 48).add(Aspect.TOOL, 32).add(Aspect.WATER, 32); - public static AspectList rockbreakerDrillCrafting = new AspectList().add(Aspect.TOOL, 32).add(Aspect.ENERGY, 48).add(Aspect.MINE, 32); - public static AspectList shieldBlockCrafting = new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1); - public static AspectList tinyUraniumCrafting = new AspectList().add(Aspect.FIRE, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1).add(Aspect.EARTH, 1).add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1); - public static AspectList thorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.WEATHER, 48).add(Aspect.ELDRITCH, 32); - public static AspectList superchargedThorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.ENERGY, 64).add(Aspect.BEAST, 32); - public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.CRAFT, 48).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64); - public static AspectList compressedSolars = new AspectList().add(Aspect.FIRE, 8).add(Aspect.WATER, 8).add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8); - public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.AIR, 32).add(Aspect.LIGHT, 25); - public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 16).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 32); - public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 25).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 48); - public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 64); - public static AspectList electricScribingTools = new AspectList().add(Aspect.AIR, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16); - public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 16).add(Aspect.MAGIC, 16).add(Aspect.CRAFT, 16); - public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList airSolars = new AspectList().add(Aspect.AIR, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); - public static AspectList uuMatterInfusions = new AspectList().add(Aspect.FIRE, 32).add(Aspect.WATER, 32).add(Aspect.AIR, 32).add(Aspect.EARTH, 32).add(Aspect.ORDER, 32).add(Aspect.ENTROPY, 32); - public static AspectList lesserUUMInfusions = new AspectList().add(Aspect.FIRE, 16).add(Aspect.WATER, 16).add(Aspect.AIR, 16).add(Aspect.EARTH, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16); - public static AspectList cheapUUMInfusions = new AspectList().add(Aspect.FIRE, 8).add(Aspect.WATER, 8).add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8); - public static AspectList cheapestUUMInfusions = new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 4).add(Aspect.AIR, 4).add(Aspect.EARTH, 4).add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4); - public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 32).add(Aspect.AURA, 32).add(Aspect.GREED, 32); - public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.PLANT, 25).add(Aspect.CROP, 32).add(Aspect.MAGIC, 48); - public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 25).add(Aspect.ENERGY, 32).add(Aspect.MECHANISM, 32); - public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.AURA, 32).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64); - public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.CRYSTAL, 32).add(Aspect.MAGIC, 48); - public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.ARMOR, 32).add(Aspect.MAGIC, 48); - public static AspectList thaumiumWing = new AspectList().add(Aspect.FIRE, 48).add(Aspect.WATER, 48).add(Aspect.AIR, 48).add(Aspect.EARTH, 48).add(Aspect.ORDER, 48).add(Aspect.ENTROPY, 48); - public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 48).add(Aspect.AIR, 32).add(Aspect.MECHANISM, 48).add(Aspect.ENERGY, 32); - public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 48).add(Aspect.AIR, 32).add(Aspect.MECHANISM, 48).add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 48); - public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 16).add(Aspect.AIR, 8); + public static AspectList thaumiumDrillCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.MINE, 16).add(Aspect.ENERGY, 16); + public static AspectList thaumiumChainsawCrafting = new AspectList().add(Aspect.TOOL, 16).add(Aspect.WEAPON, 16).add(Aspect.ENERGY, 16); + public static AspectList thaumicQuantumHelmetCrafting = new AspectList().add(Aspect.ARMOR, 25).add(Aspect.SENSES, 25).add(Aspect.ENERGY, 25); + public static AspectList diamondOmnitoolCrafting = new AspectList().add(Aspect.ORDER, 15).add(Aspect.AIR, 15); + public static AspectList thaumiumOmnitoolCrafting = new AspectList().add(Aspect.TOOL, 25).add(Aspect.MINE, 25).add(Aspect.ENERGY, 25).add(Aspect.WEAPON, 25); + public static AspectList thaumicNanoHelmetCrafting = new AspectList().add(Aspect.ARMOR, 16).add(Aspect.SENSES, 16).add(Aspect.ENERGY, 16); + public static AspectList laserFocusCrafting = new AspectList().add(Aspect.FIRE, 30).add(Aspect.MOTION, 16).add(Aspect.WEAPON, 30).add(Aspect.DEATH, 16); + public static AspectList christmasFocusCrafting = new AspectList().add(Aspect.ORDER, 20).add(Aspect.AIR, 20); + public static AspectList shieldFocusCrafting = new AspectList().add(Aspect.AIR, 16).add(Aspect.ARMOR, 20).add(Aspect.CRYSTAL, 16).add(Aspect.TRAP, 20).add(Aspect.LIFE, 16); + public static AspectList electricGogglesCrafting = new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 20).add(Aspect.WATER, 20); + public static AspectList potentiaGeneratorCrafting = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.MAGIC, 32).add(Aspect.METAL, 32).add(Aspect.EXCHANGE, 32); + public static AspectList ignisGeneratorCrafting = new AspectList().add(Aspect.FIRE, 16).add(Aspect.EXCHANGE, 8); + public static AspectList auramGeneratorCrafting = new AspectList().add(Aspect.AURA, 16).add(Aspect.EXCHANGE, 8); + public static AspectList arborGeneratorCrafting = new AspectList().add(Aspect.TREE, 16).add(Aspect.EXCHANGE, 8); + public static AspectList streamChaisnawCrafting = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.TREE, 48).add(Aspect.TOOL, 32).add(Aspect.WATER, 32); + public static AspectList rockbreakerDrillCrafting = new AspectList().add(Aspect.TOOL, 32).add(Aspect.ENERGY, 48).add(Aspect.MINE, 32); + public static AspectList shieldBlockCrafting = new AspectList().add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1); + public static AspectList tinyUraniumCrafting = new AspectList().add(Aspect.FIRE, 1).add(Aspect.WATER, 1).add(Aspect.AIR, 1).add(Aspect.EARTH, 1).add(Aspect.ORDER, 1).add(Aspect.ENTROPY, 1); + public static AspectList thorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.WEATHER, 48).add(Aspect.ELDRITCH, 32); + public static AspectList superchargedThorHammerCrafting = new AspectList().add(Aspect.WEAPON, 48).add(Aspect.ENERGY, 64).add(Aspect.BEAST, 32); + public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.CRAFT, 48).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64); + public static AspectList compressedSolars = new AspectList().add(Aspect.FIRE, 8).add(Aspect.WATER, 8).add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8); + public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.AIR, 32).add(Aspect.LIGHT, 25); + public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 16).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 32); + public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 25).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 48); + public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 32).add(Aspect.MOTION, 64); + public static AspectList electricScribingTools = new AspectList().add(Aspect.AIR, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16); + public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 16).add(Aspect.MAGIC, 16).add(Aspect.CRAFT, 16); + public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList airSolars = new AspectList().add(Aspect.AIR, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 16).add(Aspect.MAGIC, 16).add(Aspect.EXCHANGE, 16); + public static AspectList uuMatterInfusions = new AspectList().add(Aspect.FIRE, 32).add(Aspect.WATER, 32).add(Aspect.AIR, 32).add(Aspect.EARTH, 32).add(Aspect.ORDER, 32).add(Aspect.ENTROPY, 32); + public static AspectList lesserUUMInfusions = new AspectList().add(Aspect.FIRE, 16).add(Aspect.WATER, 16).add(Aspect.AIR, 16).add(Aspect.EARTH, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16); + public static AspectList cheapUUMInfusions = new AspectList().add(Aspect.FIRE, 8).add(Aspect.WATER, 8).add(Aspect.AIR, 8).add(Aspect.EARTH, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8); + public static AspectList cheapestUUMInfusions = new AspectList().add(Aspect.FIRE, 4).add(Aspect.WATER, 4).add(Aspect.AIR, 4).add(Aspect.EARTH, 4).add(Aspect.ORDER, 4).add(Aspect.ENTROPY, 4); + public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 32).add(Aspect.AURA, 32).add(Aspect.GREED, 32); + public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 32).add(Aspect.PLANT, 25).add(Aspect.CROP, 32).add(Aspect.MAGIC, 48); + public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 25).add(Aspect.ENERGY, 32).add(Aspect.MECHANISM, 32); + public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 48).add(Aspect.AURA, 32).add(Aspect.EXCHANGE, 48).add(Aspect.GREED, 64); + public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.CRYSTAL, 32).add(Aspect.MAGIC, 48); + public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 64).add(Aspect.ARMOR, 32).add(Aspect.MAGIC, 48); + public static AspectList thaumiumWing = new AspectList().add(Aspect.FIRE, 48).add(Aspect.WATER, 48).add(Aspect.AIR, 48).add(Aspect.EARTH, 48).add(Aspect.ORDER, 48).add(Aspect.ENTROPY, 48); + public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 48).add(Aspect.AIR, 32).add(Aspect.MECHANISM, 48).add(Aspect.ENERGY, 32); + public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 48).add(Aspect.AIR, 32).add(Aspect.MECHANISM, 48).add(Aspect.ENERGY, 32).add(Aspect.ARMOR, 48); + public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 16).add(Aspect.AIR, 8); } diff --git a/src/main/java/tombenpotter/emt/common/util/CreativeTabEMT.java b/src/main/java/tombenpotter/emt/common/util/CreativeTabEMT.java index dc338e6..a1cd03d 100644 --- a/src/main/java/tombenpotter/emt/common/util/CreativeTabEMT.java +++ b/src/main/java/tombenpotter/emt/common/util/CreativeTabEMT.java @@ -39,8 +39,7 @@ public class CreativeTabEMT extends CreativeTabs { } @Override - public int getSearchbarWidth() - { + public int getSearchbarWidth() { return 63; } } diff --git a/src/main/java/tombenpotter/emt/common/util/DungeonChestGenerator.java b/src/main/java/tombenpotter/emt/common/util/DungeonChestGenerator.java index 5f14b81..fe30f7d 100644 --- a/src/main/java/tombenpotter/emt/common/util/DungeonChestGenerator.java +++ b/src/main/java/tombenpotter/emt/common/util/DungeonChestGenerator.java @@ -7,12 +7,12 @@ import tombenpotter.emt.common.module.ic2.IC2ModuleItemRegistry; public class DungeonChestGenerator { - public static void generateLoot() { - if (!ConfigHandler.thorHammerResearch) { - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(IC2ModuleItemRegistry.taintedThorHammer), 0, 1, ConfigHandler.chanceTaintedMjolnir)); - } - if (!ConfigHandler.oneRingSpawn) { - ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(IC2ModuleItemRegistry.emtBauble, 1, 2), 0, 1, ConfigHandler.chanceOneRing)); - } - } + public static void generateLoot() { + if (!ConfigHandler.thorHammerResearch) { + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(IC2ModuleItemRegistry.taintedThorHammer), 0, 1, ConfigHandler.chanceTaintedMjolnir)); + } + if (!ConfigHandler.oneRingSpawn) { + ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(IC2ModuleItemRegistry.emtBauble, 1, 2), 0, 1, ConfigHandler.chanceOneRing)); + } + } } diff --git a/src/main/java/tombenpotter/emt/common/util/EMTResearchItem.java b/src/main/java/tombenpotter/emt/common/util/EMTResearchItem.java index 1d2bc05..ea6990d 100644 --- a/src/main/java/tombenpotter/emt/common/util/EMTResearchItem.java +++ b/src/main/java/tombenpotter/emt/common/util/EMTResearchItem.java @@ -32,49 +32,49 @@ import thaumcraft.api.research.ResearchPage.PageType; public class EMTResearchItem extends ResearchItem { - public EMTResearchItem(String par1, String par2) { - super(par1, par2); - } + public EMTResearchItem(String par1, String par2) { + super(par1, par2); + } - public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon) { - super(par1, par2, tags, par3, par4, par5, icon); - } + public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ItemStack icon) { + super(par1, par2, tags, par3, par4, par5, icon); + } - public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon) { - super(par1, par2, tags, par3, par4, par5, icon); - } + public EMTResearchItem(String par1, String par2, AspectList tags, int par3, int par4, int par5, ResourceLocation icon) { + super(par1, par2, tags, par3, par4, par5, icon); + } - @Override - @SideOnly(Side.CLIENT) - public String getName() { - return TextHelper.localize(key); - } + @Override + @SideOnly(Side.CLIENT) + public String getName() { + return TextHelper.localize(key); + } - @Override - @SideOnly(Side.CLIENT) - public String getText() { - return "[EMT] " + TextHelper.localize("emt.tag." + key); - } + @Override + @SideOnly(Side.CLIENT) + public String getText() { + return "[EMT] " + TextHelper.localize("emt.tag." + key); + } - @Override - public ResearchItem setPages(ResearchPage... par) { - for (ResearchPage page : par) { - if (page.type == PageType.TEXT) - page.text = "emt.text." + key; + @Override + public ResearchItem setPages(ResearchPage... par) { + for (ResearchPage page : par) { + if (page.type == PageType.TEXT) + page.text = "emt.text." + key; - if (page.type == PageType.INFUSION_CRAFTING) { - if (parentsHidden == null || parentsHidden.length == 0) - parentsHidden = new String[]{"INFUSION"}; - else { - String[] newParents = new String[parentsHidden.length + 1]; - newParents[0] = "INFUSION"; - for (int i = 0; i < parentsHidden.length; i++) - newParents[i + 1] = parentsHidden[i]; - parentsHidden = newParents; - } - } - } + if (page.type == PageType.INFUSION_CRAFTING) { + if (parentsHidden == null || parentsHidden.length == 0) + parentsHidden = new String[]{"INFUSION"}; + else { + String[] newParents = new String[parentsHidden.length + 1]; + newParents[0] = "INFUSION"; + for (int i = 0; i < parentsHidden.length; i++) + newParents[i + 1] = parentsHidden[i]; + parentsHidden = newParents; + } + } + } - return super.setPages(par); - } + return super.setPages(par); + } } diff --git a/src/main/java/tombenpotter/emt/common/util/EntityEventHandler.java b/src/main/java/tombenpotter/emt/common/util/EntityEventHandler.java index 7346064..67d2bd3 100644 --- a/src/main/java/tombenpotter/emt/common/util/EntityEventHandler.java +++ b/src/main/java/tombenpotter/emt/common/util/EntityEventHandler.java @@ -10,19 +10,19 @@ import tombenpotter.emt.common.module.ic2.IC2ModuleItemRegistry; public class EntityEventHandler { - @SubscribeEvent - public void onEntityLivingDrops(LivingDropsEvent event) { + @SubscribeEvent + public void onEntityLivingDrops(LivingDropsEvent event) { - if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) { - if (event.entityLiving instanceof EntityCreeper) { - EntityCreeper creeper = (EntityCreeper) event.entityLiving; - if (creeper.getPowered()) { - event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 6), 1); - } - } - if (event.entityLiving instanceof EntityTaintChicken) { - event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 14), 1); - } - } - } + if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) { + if (event.entityLiving instanceof EntityCreeper) { + EntityCreeper creeper = (EntityCreeper) event.entityLiving; + if (creeper.getPowered()) { + event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 6), 1); + } + } + if (event.entityLiving instanceof EntityTaintChicken) { + event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 14), 1); + } + } + } } diff --git a/src/main/java/tombenpotter/emt/common/util/EssentiasOutputs.java b/src/main/java/tombenpotter/emt/common/util/EssentiasOutputs.java index 2a743b0..40224a3 100644 --- a/src/main/java/tombenpotter/emt/common/util/EssentiasOutputs.java +++ b/src/main/java/tombenpotter/emt/common/util/EssentiasOutputs.java @@ -7,35 +7,35 @@ import java.util.HashMap; public class EssentiasOutputs { - public static HashMap outputs = new HashMap(); + public static HashMap outputs = new HashMap(); - public static void addOutput(Aspect aspect) { - if (!aspect.isPrimal()) { - Aspect[] parents = aspect.getComponents(); - if (ConfigHandler.outputCap == (-1)) { - outputs.put(aspect.getTag(), (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag()))); - } else { - double originalOutput = (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag())); - if (originalOutput > ConfigHandler.outputCap) - outputs.put(aspect.getTag(), ConfigHandler.outputCap); - } - } - } + public static void addOutput(Aspect aspect) { + if (!aspect.isPrimal()) { + Aspect[] parents = aspect.getComponents(); + if (ConfigHandler.outputCap == (-1)) { + outputs.put(aspect.getTag(), (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag()))); + } else { + double originalOutput = (outputs.get(parents[0].getTag()) + outputs.get(parents[1].getTag())); + if (originalOutput > ConfigHandler.outputCap) + outputs.put(aspect.getTag(), ConfigHandler.outputCap); + } + } + } - public static void addOutputs() { - Collection aspectCollection = Aspect.aspects.values(); - for (Aspect aspect : aspectCollection) { - if (!aspect.isPrimal()) - addOutput(aspect); - } - } + public static void addOutputs() { + Collection aspectCollection = Aspect.aspects.values(); + for (Aspect aspect : aspectCollection) { + if (!aspect.isPrimal()) + addOutput(aspect); + } + } - public static void addPrimalOutputs() { - outputs.put(Aspect.FIRE.getTag(), ConfigHandler.fireOutput); - outputs.put(Aspect.WATER.getTag(), ConfigHandler.waterOutput); - outputs.put(Aspect.ORDER.getTag(), ConfigHandler.orderOutput); - outputs.put(Aspect.ENTROPY.getTag(), ConfigHandler.entropyOutput); - outputs.put(Aspect.EARTH.getTag(), ConfigHandler.earthOutput); - outputs.put(Aspect.AIR.getTag(), ConfigHandler.airOutput); - } + public static void addPrimalOutputs() { + outputs.put(Aspect.FIRE.getTag(), ConfigHandler.fireOutput); + outputs.put(Aspect.WATER.getTag(), ConfigHandler.waterOutput); + outputs.put(Aspect.ORDER.getTag(), ConfigHandler.orderOutput); + outputs.put(Aspect.ENTROPY.getTag(), ConfigHandler.entropyOutput); + outputs.put(Aspect.EARTH.getTag(), ConfigHandler.earthOutput); + outputs.put(Aspect.AIR.getTag(), ConfigHandler.airOutput); + } } diff --git a/src/main/java/tombenpotter/emt/common/util/EventHandlerEMT.java b/src/main/java/tombenpotter/emt/common/util/EventHandlerEMT.java index 98a51cb..9d50d98 100644 --- a/src/main/java/tombenpotter/emt/common/util/EventHandlerEMT.java +++ b/src/main/java/tombenpotter/emt/common/util/EventHandlerEMT.java @@ -26,33 +26,33 @@ import tombenpotter.emt.common.module.ic2.IC2ModuleItemRegistry; public class EventHandlerEMT { - @SubscribeEvent - public void onEntityLivingDrops(LivingDropsEvent event) { - if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) { - if (event.entityLiving instanceof EntityCreeper) { - EntityCreeper creeper = (EntityCreeper) event.entityLiving; - if (creeper.getPowered()) { - event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 6))); - } - } - if (event.entityLiving instanceof EntityTaintChicken) { - event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 14))); - } - } + @SubscribeEvent + public void onEntityLivingDrops(LivingDropsEvent event) { + if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) { + if (event.entityLiving instanceof EntityCreeper) { + EntityCreeper creeper = (EntityCreeper) event.entityLiving; + if (creeper.getPowered()) { + event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 6))); + } + } + if (event.entityLiving instanceof EntityTaintChicken) { + event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 1, 14))); + } + } - if (event.entityLiving instanceof EntityCreeper) { - event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 6), 1); - } - if (event.entityLiving instanceof EntityTaintChicken) { - event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 14), 1); - } - } + if (event.entityLiving instanceof EntityCreeper) { + event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 6), 1); + } + if (event.entityLiving instanceof EntityTaintChicken) { + event.entityLiving.entityDropItem(new ItemStack(IC2ModuleItemRegistry.itemEMTItems, 14), 1); + } + } - @SubscribeEvent - public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) { - if (eventArgs.modID.equals(ModInformation.modid)) { - ConfigHandler.syncConfig(); - ElectroMagicTools.logger.info(TextHelper.localize("console.EMT.config.refresh")); - } - } + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) { + if (eventArgs.modID.equals(ModInformation.modid)) { + ConfigHandler.syncConfig(); + ElectroMagicTools.logger.info(TextHelper.localize("console.EMT.config.refresh")); + } + } } diff --git a/src/main/java/tombenpotter/emt/common/util/RegistryHandler.java b/src/main/java/tombenpotter/emt/common/util/RegistryHandler.java index 734ae63..776e60b 100644 --- a/src/main/java/tombenpotter/emt/common/util/RegistryHandler.java +++ b/src/main/java/tombenpotter/emt/common/util/RegistryHandler.java @@ -10,24 +10,24 @@ import tombenpotter.emt.common.module.vanilla.VanillaRecipesRegistry; public class RegistryHandler { - public static void registerVanillaRegistrys() { - VanillaBlocksRegistry.registerBlocks(); - VanillaItemsRegistry.registerItems(); - VanillaRecipesRegistry.registerRecipes(); - } + public static void registerVanillaRegistrys() { + VanillaBlocksRegistry.registerBlocks(); + VanillaItemsRegistry.registerItems(); + VanillaRecipesRegistry.registerRecipes(); + } - public static void registerIc2Registrys() { - IC2ModuleItemRegistry.registerItems(); - IC2ModuleBlockRegistry.registerBlocks(); - IC2ModuleTERegistry.registerTEs(); - } + public static void registerIc2Registrys() { + IC2ModuleItemRegistry.registerItems(); + IC2ModuleBlockRegistry.registerBlocks(); + IC2ModuleTERegistry.registerTEs(); + } - public static void registerIc2PostRegistrys() { - IC2ModuleResearch.addResearchTab(); - IC2ModuleResearch.addResearch(); - } + public static void registerIc2PostRegistrys() { + IC2ModuleResearch.addResearchTab(); + IC2ModuleResearch.addResearch(); + } - public static void registerTeRegistrys() { + public static void registerTeRegistrys() { - } + } } diff --git a/src/main/java/tombenpotter/emt/common/util/ResearchAspects.java b/src/main/java/tombenpotter/emt/common/util/ResearchAspects.java index ce4adf3..16ffe30 100644 --- a/src/main/java/tombenpotter/emt/common/util/ResearchAspects.java +++ b/src/main/java/tombenpotter/emt/common/util/ResearchAspects.java @@ -17,49 +17,49 @@ import thaumcraft.api.aspects.AspectList; public class ResearchAspects { - public static AspectList thaumiumDrillResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4); - public static AspectList thaumiumChainsawResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.WEAPON, 6).add(Aspect.TOOL, 4); - public static AspectList thaumicQuantumHelmet = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 4).add(Aspect.SENSES, 6); - public static AspectList diamondOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.TOOL, 3).add(Aspect.MINE, 2).add(Aspect.WEAPON, 2); - public static AspectList thaumiumOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4).add(Aspect.WEAPON, 6); - public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6); - public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3); - public static AspectList christmasFocusResearch = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6); - public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2); - public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6); - public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3); - public static AspectList ignisGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.FIRE, 3); - public static AspectList auramGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AURA, 3); - public static AspectList arborGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.TREE, 3); - public static AspectList streamChainsawResearch = new AspectList().add(Aspect.TOOL, 3).add(Aspect.TREE, 3).add(Aspect.WATER, 6).add(Aspect.ENERGY, 4); - public static AspectList rockbreakerDrillResearch = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.FIRE, 2).add(Aspect.MINE, 3); - public static AspectList shieldBlockResearch = new AspectList().add(Aspect.ARMOR, 3).add(Aspect.TRAP, 2); - public static AspectList tinyUraniumResearch = new AspectList().add(Aspect.POISON, 4).add(Aspect.DEATH, 3).add(Aspect.EXCHANGE, 3); - public static AspectList thorHammerResearch = new AspectList().add(Aspect.WEAPON, 3).add(Aspect.WEATHER, 4).add(Aspect.ELDRITCH, 3); - public static AspectList superchargedThorHammerResearch = new AspectList().add(Aspect.WEAPON, 4).add(Aspect.ENERGY, 6).add(Aspect.BEAST, 4); - public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRAFT, 2).add(Aspect.EXCHANGE, 3).add(Aspect.GREED, 5); - public static AspectList compressedSolars = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.LIGHT, 3).add(Aspect.METAL, 2); - public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AIR, 2).add(Aspect.LIGHT, 4); - public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 2); - public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 3); - public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 4); - public static AspectList electricScribingTools = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.DARKNESS, 3).add(Aspect.CRAFT, 1); - public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 3).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5); - public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList airSolars = new AspectList().add(Aspect.AIR, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); - public static AspectList uuMInfusion = new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5); - public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.GREED, 5); - public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.PLANT, 4).add(Aspect.CROP, 5).add(Aspect.MAGIC, 4); - public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 4); - public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AURA, 4).add(Aspect.EXCHANGE, 4).add(Aspect.GREED, 5); - public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRYSTAL, 4).add(Aspect.MAGIC, 4); - public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 4); - public static AspectList thaumiumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8); - public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4); - public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4); - public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AIR, 3); + public static AspectList thaumiumDrillResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4); + public static AspectList thaumiumChainsawResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.WEAPON, 6).add(Aspect.TOOL, 4); + public static AspectList thaumicQuantumHelmet = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 4).add(Aspect.SENSES, 6); + public static AspectList diamondOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.TOOL, 3).add(Aspect.MINE, 2).add(Aspect.WEAPON, 2); + public static AspectList thaumiumOmnitoolResearch = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.TOOL, 6).add(Aspect.MINE, 4).add(Aspect.WEAPON, 6); + public static AspectList thaumicNanoHelmet = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.SENSES, 8).add(Aspect.ARMOR, 6); + public static AspectList laserFocusResearch = new AspectList().add(Aspect.FIRE, 3).add(Aspect.DEATH, 2).add(Aspect.WEAPON, 3); + public static AspectList christmasFocusResearch = new AspectList().add(Aspect.COLD, 2).add(Aspect.BEAST, 5).add(Aspect.LIFE, 6); + public static AspectList shieldFocusResearch = new AspectList().add(Aspect.ARMOR, 5).add(Aspect.AIR, 2).add(Aspect.CRYSTAL, 3).add(Aspect.TRAP, 2); + public static AspectList electricGogglesResearch = new AspectList().add(Aspect.ARMOR, 8).add(Aspect.ENERGY, 5).add(Aspect.SENSES, 6); + public static AspectList potentiaGeneratorResearch = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.EXCHANGE, 4).add(Aspect.METAL, 3); + public static AspectList ignisGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.FIRE, 3); + public static AspectList auramGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AURA, 3); + public static AspectList arborGeneratorResearch = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.TREE, 3); + public static AspectList streamChainsawResearch = new AspectList().add(Aspect.TOOL, 3).add(Aspect.TREE, 3).add(Aspect.WATER, 6).add(Aspect.ENERGY, 4); + public static AspectList rockbreakerDrillResearch = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.FIRE, 2).add(Aspect.MINE, 3); + public static AspectList shieldBlockResearch = new AspectList().add(Aspect.ARMOR, 3).add(Aspect.TRAP, 2); + public static AspectList tinyUraniumResearch = new AspectList().add(Aspect.POISON, 4).add(Aspect.DEATH, 3).add(Aspect.EXCHANGE, 3); + public static AspectList thorHammerResearch = new AspectList().add(Aspect.WEAPON, 3).add(Aspect.WEATHER, 4).add(Aspect.ELDRITCH, 3); + public static AspectList superchargedThorHammerResearch = new AspectList().add(Aspect.WEAPON, 4).add(Aspect.ENERGY, 6).add(Aspect.BEAST, 4); + public static AspectList wandCharger = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRAFT, 2).add(Aspect.EXCHANGE, 3).add(Aspect.GREED, 5); + public static AspectList compressedSolars = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.LIGHT, 3).add(Aspect.METAL, 2); + public static AspectList solarHelmetRevealing = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AIR, 2).add(Aspect.LIGHT, 4); + public static AspectList electricBootsTravel = new AspectList().add(Aspect.ENERGY, 2).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 2); + public static AspectList nanoBootsTravel = new AspectList().add(Aspect.ENERGY, 3).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 3); + public static AspectList quantumBootsTravel = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 5).add(Aspect.MOTION, 4); + public static AspectList electricScribingTools = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.DARKNESS, 3).add(Aspect.CRAFT, 1); + public static AspectList etherealProcessor = new AspectList().add(Aspect.MECHANISM, 3).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5); + public static AspectList waterSolars = new AspectList().add(Aspect.WATER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList darkSolars = new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList orderSolars = new AspectList().add(Aspect.ORDER, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList fireSolars = new AspectList().add(Aspect.FIRE, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList airSolars = new AspectList().add(Aspect.AIR, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList earthSolars = new AspectList().add(Aspect.EARTH, 4).add(Aspect.MAGIC, 3).add(Aspect.ENERGY, 4); + public static AspectList uuMInfusion = new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 5); + public static AspectList portableNode = new AspectList().add(Aspect.MAGIC, 5).add(Aspect.AURA, 5).add(Aspect.GREED, 5); + public static AspectList electricHoeGrowth = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.PLANT, 4).add(Aspect.CROP, 5).add(Aspect.MAGIC, 4); + public static AspectList chargeFocus = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.ENERGY, 5).add(Aspect.MECHANISM, 4); + public static AspectList wandChargeFocus = new AspectList().add(Aspect.ENERGY, 5).add(Aspect.AURA, 4).add(Aspect.EXCHANGE, 4).add(Aspect.GREED, 5); + public static AspectList inventoryChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.CRYSTAL, 4).add(Aspect.MAGIC, 4); + public static AspectList armorChargingRing = new AspectList().add(Aspect.ENERGY, 4).add(Aspect.ARMOR, 4).add(Aspect.MAGIC, 4); + public static AspectList thaumiumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8); + public static AspectList nanoWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4); + public static AspectList quantumWing = new AspectList().add(Aspect.FLIGHT, 5).add(Aspect.AIR, 5).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 4); + public static AspectList aerGenerator = new AspectList().add(Aspect.EXCHANGE, 4).add(Aspect.AIR, 3); } diff --git a/src/main/java/tombenpotter/emt/common/util/TextHelper.java b/src/main/java/tombenpotter/emt/common/util/TextHelper.java index c0a3c7e..0aa3106 100644 --- a/src/main/java/tombenpotter/emt/common/util/TextHelper.java +++ b/src/main/java/tombenpotter/emt/common/util/TextHelper.java @@ -4,40 +4,40 @@ import net.minecraft.util.StatCollector; public class TextHelper { - /** - * Color Coding * - */ - public static final String BLACK = (char) 167 + "0"; - public static final String BLUE = (char) 167 + "1"; - public static final String GREEN = (char) 167 + "2"; - public static final String TEAL = (char) 167 + "3"; - public static final String RED = (char) 167 + "4"; - public static final String PURPLE = (char) 167 + "5"; - public static final String ORANGE = (char) 167 + "6"; - public static final String LIGHT_GRAY = (char) 167 + "7"; - public static final String GRAY = (char) 167 + "8"; - public static final String LIGHT_BLUE = (char) 167 + "9"; - public static final String BRIGHT_GREEN = (char) 167 + "a"; - public static final String BRIGHT_BLUE = (char) 167 + "b"; - public static final String LIGHT_RED = (char) 167 + "c"; - public static final String PINK = (char) 167 + "d"; - public static final String YELLOW = (char) 167 + "e"; - public static final String WHITE = (char) 167 + "f"; + /** + * Color Coding * + */ + public static final String BLACK = (char) 167 + "0"; + public static final String BLUE = (char) 167 + "1"; + public static final String GREEN = (char) 167 + "2"; + public static final String TEAL = (char) 167 + "3"; + public static final String RED = (char) 167 + "4"; + public static final String PURPLE = (char) 167 + "5"; + public static final String ORANGE = (char) 167 + "6"; + public static final String LIGHT_GRAY = (char) 167 + "7"; + public static final String GRAY = (char) 167 + "8"; + public static final String LIGHT_BLUE = (char) 167 + "9"; + public static final String BRIGHT_GREEN = (char) 167 + "a"; + public static final String BRIGHT_BLUE = (char) 167 + "b"; + public static final String LIGHT_RED = (char) 167 + "c"; + public static final String PINK = (char) 167 + "d"; + public static final String YELLOW = (char) 167 + "e"; + public static final String WHITE = (char) 167 + "f"; - /** - * Text formatting * - */ - public static final String OBFUSCATED = (char) 167 + "k"; - public static final String BOLD = (char) 167 + "l"; - public static final String STRIKETHROUGH = (char) 167 + "m"; - public static final String UNDERLINE = (char) 167 + "n"; - public static final String ITALIC = (char) 167 + "o"; - public static final String END = (char) 167 + "r"; + /** + * Text formatting * + */ + public static final String OBFUSCATED = (char) 167 + "k"; + public static final String BOLD = (char) 167 + "l"; + public static final String STRIKETHROUGH = (char) 167 + "m"; + public static final String UNDERLINE = (char) 167 + "n"; + public static final String ITALIC = (char) 167 + "o"; + public static final String END = (char) 167 + "r"; - /** - * Enable Localizationizing * - */ - public static String localize(String key) { - return StatCollector.translateToLocal(key); - } + /** + * Enable Localizationizing * + */ + public static String localize(String key) { + return StatCollector.translateToLocal(key); + } } diff --git a/src/main/java/tombenpotter/emt/proxies/ClientProxy.java b/src/main/java/tombenpotter/emt/proxies/ClientProxy.java index 7af4a44..7a5c879 100644 --- a/src/main/java/tombenpotter/emt/proxies/ClientProxy.java +++ b/src/main/java/tombenpotter/emt/proxies/ClientProxy.java @@ -20,13 +20,13 @@ import tombenpotter.emt.common.module.base.entities.EntityLaser; public class ClientProxy extends CommonProxy { - @Override - public void load() { - registerRenders(); - } + @Override + public void load() { + registerRenders(); + } - public void registerRenders() { - RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser()); - RenderingRegistry.registerEntityRenderingHandler(EntityArcher.class, new RenderArcher()); - } + public void registerRenders() { + RenderingRegistry.registerEntityRenderingHandler(EntityLaser.class, new RenderLaser()); + RenderingRegistry.registerEntityRenderingHandler(EntityArcher.class, new RenderArcher()); + } } diff --git a/src/main/java/tombenpotter/emt/proxies/CommonProxy.java b/src/main/java/tombenpotter/emt/proxies/CommonProxy.java index b143062..6532869 100644 --- a/src/main/java/tombenpotter/emt/proxies/CommonProxy.java +++ b/src/main/java/tombenpotter/emt/proxies/CommonProxy.java @@ -25,47 +25,47 @@ import tombenpotter.emt.common.module.ic2.tile.TileEntityIndustrialWandRecharge; public class CommonProxy implements IGuiHandler { - public void load() { - registerRenders(); - } + public void load() { + registerRenders(); + } - public void registerRenders() { - /* Empty in base proxy */ - } + public void registerRenders() { + /* Empty in base proxy */ + } - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity entity = world.getTileEntity(x, y, z); + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + TileEntity entity = world.getTileEntity(x, y, z); - switch (ID) { - case 0: - if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) { - return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity); - } - case 1: - if (entity != null && entity instanceof TileEntityEtherealMacerator) { - return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity); - } - default: - return null; - } - } + switch (ID) { + case 0: + if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) { + return new ContainerIndustrialWandRecharge(player.inventory, (TileEntityIndustrialWandRecharge) entity); + } + case 1: + if (entity != null && entity instanceof TileEntityEtherealMacerator) { + return new ContainerEtheralMacerator(player.inventory, (TileEntityEtherealMacerator) entity); + } + default: + return null; + } + } - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity entity = world.getTileEntity(x, y, z); + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + TileEntity entity = world.getTileEntity(x, y, z); - switch (ID) { - case 0: - if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) { - return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity); - } - case 1: - if (entity != null && entity instanceof TileEntityEtherealMacerator) { - return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity); - } - default: - return null; - } - } + switch (ID) { + case 0: + if (entity != null && entity instanceof TileEntityIndustrialWandRecharge) { + return new GuiIndustrialWandRecharger(player.inventory, (TileEntityIndustrialWandRecharge) entity); + } + case 1: + if (entity != null && entity instanceof TileEntityEtherealMacerator) { + return new GuiEtherealMacerator(player.inventory, (TileEntityEtherealMacerator) entity); + } + default: + return null; + } + } }