diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index be7076170..55caa5189 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -9,6 +9,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; import net.minecraftforge.oredict.ShapedOreRecipe; +import resonantinduction.api.IBattery; import resonantinduction.battery.BlockBattery; import resonantinduction.battery.ItemCapacitor; import resonantinduction.battery.TileEntityBattery; @@ -192,26 +193,29 @@ public class ResonantInduction /** * Recipes */ + ItemStack emptyCapacitor = new ItemStack(itemCapacitor); + ((IBattery) itemCapacitor).setEnergyStored(emptyCapacitor, 0); + /** Capacitor **/ - GameRegistry.addRecipe(new ShapedOreRecipe(itemCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', Item.ingotIron)); + GameRegistry.addRecipe(new ShapedOreRecipe(emptyCapacitor, "RRR", "RIR", "RRR", 'R', Item.redstone, 'I', Item.ingotIron)); /** Linker **/ - GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', itemCapacitor, 'G', Item.ingotGold)); + GameRegistry.addRecipe(new ShapedOreRecipe(itemLinker, " E ", "GCG", " E ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'G', Item.ingotGold)); /** Quantum Entangler **/ GameRegistry.addRecipe(new ShapedOreRecipe(itemQuantumEntangler, "EEE", "ILI", "EEE", 'E', Item.eyeOfEnder, 'L', itemLinker, 'I', Item.ingotIron)); /** Tesla - by Jyzarc */ - GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "EEE", " C ", " I ", 'E', Item.eyeOfEnder, 'C', itemCapacitor, 'I', Block.blockIron)); + GameRegistry.addRecipe(new ShapedOreRecipe(blockTesla, "EEE", " C ", " I ", 'E', Item.eyeOfEnder, 'C', emptyCapacitor, 'I', Block.blockIron)); /** Multimeter */ - GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "RRR", "ICI", "III", 'R', Item.redstone, 'C', itemCapacitor, 'I', Item.ingotIron)); + GameRegistry.addRecipe(new ShapedOreRecipe(blockMultimeter, "RRR", "ICI", "III", 'R', Item.redstone, 'C', emptyCapacitor, 'I', Item.ingotIron)); /** Multimeter */ GameRegistry.addRecipe(new ShapedOreRecipe(blockBattery, "III", "IRI", "III", 'R', Block.blockRedstone, 'I', Item.ingotIron)); /** EM Contractor */ - GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', Block.wood, 'C', itemCapacitor, 'G', Item.ingotGold, 'I', Item.ingotIron)); + GameRegistry.addRecipe(new ShapedOreRecipe(blockEMContractor, " I ", "GCG", "WWW", 'W', Block.wood, 'C', emptyCapacitor, 'G', Item.ingotGold, 'I', Item.ingotIron)); } public static int loadLanguages(String languagePath, String[] languageSupported) diff --git a/src/resonantinduction/contractor/BlockEMContractor.java b/src/resonantinduction/contractor/BlockEMContractor.java index 8ffffc940..71ba68df6 100644 --- a/src/resonantinduction/contractor/BlockEMContractor.java +++ b/src/resonantinduction/contractor/BlockEMContractor.java @@ -58,7 +58,7 @@ public class BlockEMContractor extends BlockBase implements ITileEntityProvider { contractor.setLink((TileEntityEMContractor) linkVec.getTileEntity(world), true); - if (!world.isRemote) + if (world.isRemote) { entityPlayer.addChatMessage("Linked " + this.getLocalizedName() + " with " + " [" + (int) linkVec.x + ", " + (int) linkVec.y + ", " + (int) linkVec.z + "]"); } diff --git a/src/resonantinduction/contractor/TileEntityEMContractor.java b/src/resonantinduction/contractor/TileEntityEMContractor.java index 9bfa59678..d39b12cec 100644 --- a/src/resonantinduction/contractor/TileEntityEMContractor.java +++ b/src/resonantinduction/contractor/TileEntityEMContractor.java @@ -124,12 +124,12 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec } } - if (this.linked != null && !this.linked.isInvalid()) + if (!this.suck) { - ResonantInduction.proxy.renderElectricShock(this.worldObj, new Vector3(this).translate(0.5), new Vector3(this).translate(new Vector3(this.getDirection())).translate(0.5), TileEntityTesla.dyeColors[dyeID]); - - if (!this.suck) + if (this.linked != null && !this.linked.isInvalid()) { + ResonantInduction.proxy.renderElectricShock(this.worldObj, new Vector3(this).translate(0.5), new Vector3(this).translate(new Vector3(this.getDirection())).translate(0.5), TileEntityTesla.dyeColors[dyeID]); + if (this.pathfinder != null) { for (int i = 0; i < this.pathfinder.results.size(); i++) @@ -167,6 +167,11 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec } else { + if (this.linked != null && !this.linked.isInvalid()) + { + ResonantInduction.proxy.renderElectricShock(this.worldObj, new Vector3(this).translate(0.5), new Vector3(this).translate(new Vector3(this.getDirection())).translate(0.5), TileEntityTesla.dyeColors[dyeID]); + } + this.pathfinder = null; if (operationBounds != null) diff --git a/src/resonantinduction/entangler/ItemCoordLink.java b/src/resonantinduction/entangler/ItemCoordLink.java index b8babff00..0b0cb5b58 100644 --- a/src/resonantinduction/entangler/ItemCoordLink.java +++ b/src/resonantinduction/entangler/ItemCoordLink.java @@ -22,6 +22,7 @@ public abstract class ItemCoordLink extends ItemBase public ItemCoordLink(String name, int id) { super(name, id); + this.setMaxStackSize(1); } @Override diff --git a/src/resonantinduction/multimeter/TileEntityMultimeter.java b/src/resonantinduction/multimeter/TileEntityMultimeter.java index 7b3e361b4..b5df83745 100644 --- a/src/resonantinduction/multimeter/TileEntityMultimeter.java +++ b/src/resonantinduction/multimeter/TileEntityMultimeter.java @@ -114,6 +114,7 @@ public class TileEntityMultimeter extends TileEntityBase implements IPacketRecei this.toggleMode(); break; case 3: + System.out.println(this.energyLimit); this.energyLimit = input.readFloat(); break; }