From 43f770fd6698b073e1de821c233745a470638dd0 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 4 Aug 2013 10:20:45 -0400 Subject: [PATCH] Added electrostatic linker --- .../languages/en_US.properties | 1 + .../textures/items/linker.png | Bin 0 -> 1018 bytes src/resonantinduction/ResonantInduction.java | 6 ++- .../{Pathfinding.java => Pathfinder.java} | 4 +- .../entangler/ItemCoordLink.java | 24 ++++++++++++ .../entangler/ItemLinker.java | 35 ++++++++++++++++++ .../entangler/ItemQuantumEntangler.java | 19 ---------- 7 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 resources/assets/resonantinduction/textures/items/linker.png rename src/resonantinduction/contractor/{Pathfinding.java => Pathfinder.java} (97%) create mode 100644 src/resonantinduction/entangler/ItemLinker.java 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 0000000000000000000000000000000000000000..2302f1855662402866771cfd251399747f4c88ec GIT binary patch literal 1018 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv000ANNkl} z{+vNb?2CkuxUg?#F}s6|*;j*EY(b18vb*?}_~PQC%+1Xy=)%H+UacJv0vH18>+3H=V19mHfnD%lpBm(A z?%w(Nd|p-9+S+yy#ZQ6)heTQ0;(9RA793JgVOM zj^hoSIWRdnsRXE+&n^M$KdH#&auv${IIpPReE}Qv?7)MV@fL7H~JZ=8Ac?7D+J7>25jJNL{WkFMcn)0 zQ44sWrKLsM+uK!sciK@g_o$Zpkl|`7Bt_KZKRrG5C(zW?Bm)BjQM3R8oK#>;3~EG- zB;GKuSVUJ=R-zHTxw%=N02SD46csu;I&=;IK=or|W10v^*o=UTRSsxvM9Kfb!GXRX zP$IDf{K3s9-%mRBG^4S+W z=t$;9ls1?Ov;z_-zzPBPB9Ii(wzf9u@9&S=;A1#16UILDV9a_E4f${ApG_EY-uETs oodWGw;QxI-B!UR|Y#92?A6yE~rqL??i~s-t07*qoM6N<$f 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) {