diff --git a/resources/assets/resonantinduction/languages/en_US.properties b/resources/assets/resonantinduction/languages/en_US.properties index cdeeb1a7..eab8e4cb 100755 --- a/resources/assets/resonantinduction/languages/en_US.properties +++ b/resources/assets/resonantinduction/languages/en_US.properties @@ -11,3 +11,4 @@ tile.resonantinduction\:battery.name=Modular Battery ## Items item.resonantinduction\:quantumEntangler.name=Quantum Entangler item.resonantinduction\:capacitor.name=Capacitor Cell +item.resonantinduction\:linker.name=Electrostatic Linker diff --git a/resources/assets/resonantinduction/textures/items/linker.png b/resources/assets/resonantinduction/textures/items/linker.png new file mode 100644 index 00000000..2302f185 Binary files /dev/null and b/resources/assets/resonantinduction/textures/items/linker.png differ diff --git a/src/resonantinduction/ResonantInduction.java b/src/resonantinduction/ResonantInduction.java index d0df10a8..0791949c 100644 --- a/src/resonantinduction/ResonantInduction.java +++ b/src/resonantinduction/ResonantInduction.java @@ -16,6 +16,7 @@ import resonantinduction.battery.TileEntityBattery; import resonantinduction.contractor.BlockEMContractor; import resonantinduction.contractor.ItemBlockContractor; import resonantinduction.contractor.TileEntityEMContractor; +import resonantinduction.entangler.ItemLinker; import resonantinduction.entangler.ItemQuantumEntangler; import resonantinduction.multimeter.BlockMultimeter; import resonantinduction.multimeter.ItemBlockMultimeter; @@ -114,6 +115,7 @@ public class ResonantInduction // Items public static Item itemQuantumEntangler; public static Item itemCapacitor; + public static Item itemLinker; // Blocks public static Block blockTesla; @@ -141,9 +143,11 @@ public class ResonantInduction // Items itemQuantumEntangler = new ItemQuantumEntangler(getNextItemID()); itemCapacitor = new ItemCapacitor(getNextItemID()); + itemLinker = new ItemLinker(getNextItemID()); GameRegistry.registerItem(itemQuantumEntangler, itemQuantumEntangler.getUnlocalizedName()); GameRegistry.registerItem(itemCapacitor, itemCapacitor.getUnlocalizedName()); + GameRegistry.registerItem(itemLinker, itemLinker.getUnlocalizedName()); // Blocks blockTesla = new BlockTesla(getNextBlockID()); @@ -163,7 +167,7 @@ public class ResonantInduction GameRegistry.registerTileEntity(TileEntityMultimeter.class, blockMultimeter.getUnlocalizedName()); GameRegistry.registerTileEntity(TileEntityEMContractor.class, blockEMContractor.getUnlocalizedName()); GameRegistry.registerTileEntity(TileEntityBattery.class, blockBattery.getUnlocalizedName()); - + TickRegistry.registerTickHandler(new BatteryManager(), Side.SERVER); ResonantInduction.proxy.registerRenderers(); diff --git a/src/resonantinduction/contractor/Pathfinding.java b/src/resonantinduction/contractor/Pathfinder.java similarity index 97% rename from src/resonantinduction/contractor/Pathfinding.java rename to src/resonantinduction/contractor/Pathfinder.java index 333dcd4c..7093ed58 100644 --- a/src/resonantinduction/contractor/Pathfinding.java +++ b/src/resonantinduction/contractor/Pathfinder.java @@ -16,7 +16,7 @@ import resonantinduction.base.Vector3; * @author Calclavia * */ -public class Pathfinding +public class Pathfinder { public Set openSet, closedSet; @@ -28,7 +28,7 @@ public class Pathfinding public Set results; - public Pathfinding(Vector3 target) + public Pathfinder(Vector3 target) { this.target = target; } diff --git a/src/resonantinduction/entangler/ItemCoordLink.java b/src/resonantinduction/entangler/ItemCoordLink.java index 239d94ad..d489a120 100644 --- a/src/resonantinduction/entangler/ItemCoordLink.java +++ b/src/resonantinduction/entangler/ItemCoordLink.java @@ -3,6 +3,11 @@ */ package resonantinduction.entangler; +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import resonantinduction.base.ItemBase; @@ -19,6 +24,25 @@ public abstract class ItemCoordLink extends ItemBase super(name, id); } + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) + { + super.addInformation(itemstack, entityplayer, list, flag); + + if (hasLink(itemstack)) + { + Vector3 vec = getLink(itemstack); + int dimID = getLinkDim(itemstack); + + list.add("Bound to [" + (int) vec.x + ", " + (int) vec.y + ", " + (int) vec.z + "], dimension '" + dimID + "'"); + } + else + { + list.add("No block bound"); + } + } + public boolean hasLink(ItemStack itemStack) { return getLink(itemStack) != null; diff --git a/src/resonantinduction/entangler/ItemLinker.java b/src/resonantinduction/entangler/ItemLinker.java new file mode 100644 index 00000000..e462063c --- /dev/null +++ b/src/resonantinduction/entangler/ItemLinker.java @@ -0,0 +1,35 @@ +/** + * + */ +package resonantinduction.entangler; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import resonantinduction.base.Vector3; + +/** + * @author Calclavia + * + */ +public class ItemLinker extends ItemCoordLink +{ + public ItemLinker(int id) + { + super("linker", id); + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10) + { + if (!world.isRemote) + { + System.out.println("TEST"); + int dimID = world.provider.dimensionId; + player.addChatMessage("Set link to block [" + x + ", " + y + ", " + z + "], dimension '" + dimID + "'"); + this.setLink(stack, new Vector3(x, y, z), dimID); + } + + return true; + } +} diff --git a/src/resonantinduction/entangler/ItemQuantumEntangler.java b/src/resonantinduction/entangler/ItemQuantumEntangler.java index 1a266136..85f30385 100644 --- a/src/resonantinduction/entangler/ItemQuantumEntangler.java +++ b/src/resonantinduction/entangler/ItemQuantumEntangler.java @@ -26,25 +26,6 @@ public class ItemQuantumEntangler extends ItemCoordLink // TODO Handheld model, render animation, energy usage (should be easy?) } - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) - { - super.addInformation(itemstack, entityplayer, list, flag); - - if (hasLink(itemstack)) - { - Vector3 vec = getLink(itemstack); - int dimID = getLinkDim(itemstack); - - list.add("Bound to [" + (int) vec.x + ", " + (int) vec.y + ", " + (int) vec.z + "], dimension '" + dimID + "'"); - } - else - { - list.add("No block bound"); - } - } - @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int x, int y, int z, int side, float posX, float posY, float posZ) {