From b4650a95f28b62d0d9aeb7177963ef8e7b1e3e72 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 4 Aug 2013 21:47:28 -0400 Subject: [PATCH 1/2] Added modular battery box click zones --- .../battery/BlockBattery.java | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/src/resonantinduction/battery/BlockBattery.java b/src/resonantinduction/battery/BlockBattery.java index b2185002..023c3c93 100644 --- a/src/resonantinduction/battery/BlockBattery.java +++ b/src/resonantinduction/battery/BlockBattery.java @@ -4,7 +4,6 @@ package resonantinduction.battery; import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -12,6 +11,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; import resonantinduction.ResonantInduction; +import resonantinduction.api.IBattery; import resonantinduction.base.BlockBase; import resonantinduction.render.BlockRenderingHandler; import cpw.mods.fml.relauncher.Side; @@ -32,7 +32,7 @@ public class BlockBattery extends BlockBase implements ITileEntityProvider } @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7, float par8, float par9) + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float xClick, float yClick, float zClick) { if (entityPlayer.isSneaking()) { @@ -40,7 +40,61 @@ public class BlockBattery extends BlockBase implements ITileEntityProvider } else { + if (entityPlayer.getCurrentEquippedItem() != null) + { + if (entityPlayer.getCurrentEquippedItem().getItem() instanceof IBattery) + { + if (side != 0 && side != 1) + { + /** + * Place cells into block. 2 Dimensional Click Zone + */ + float xHit = 0; + float yHit = yClick; + if (side == 2 || side == 3) + { + xHit = xClick; + + if (side == 2) + { + xHit = 1 - xHit; + } + } + else if (side == 4 || side == 5) + { + xHit = zClick; + + if (side == 5) + { + xHit = 1 - xHit; + } + } + + // Convert to quadrant coords. + xHit -= 0.5f; + yHit -= 0.5f; + + // Quadrant 1 + if (xHit > 0 && yHit > 0) + { + + }// Quadrant 2 + if (xHit > 0 && yHit < 0) + { + + }// Quadrant 3 + if (xHit < 0 && yHit < 0) + { + + }// Quadrant 4 + if (xHit < 0 && yHit > 0) + { + + } + } + } + } } return true; From 2a2dcb16df6a57fc15b9fd53fee8ad2bdeb5c1b7 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 4 Aug 2013 22:06:57 -0400 Subject: [PATCH 2/2] Fixed multimeter GUI bar --- .../textures/gui/gui_multimeter.png | Bin 6115 -> 5664 bytes .../multimeter/GuiMultimeter.java | 17 +++++++---------- .../multimeter/TileEntityMultimeter.java | 10 ++++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/resources/assets/resonantinduction/textures/gui/gui_multimeter.png b/resources/assets/resonantinduction/textures/gui/gui_multimeter.png index d7719119c5f36ed093cb9a89f1dbb7cbd13ff9c7..e9a16fbebb0670b38c30b13bfffaf09f14653c82 100644 GIT binary patch delta 2730 zcmXw5dpuNm8~@E18n+C&Th~Yvo0zfXwvAjei!dq@xlAsxlw}$Ub5N#riCnfO(a@kW zn2la#Fk=f{h9(LPVi&KwC?vvr=KZ|yALozroX>gA^SwOZ-x)JwnsRtDG+9@oqy6y& z(cExLjDM#_$I@g8qh41DD;=x!oPcC~Rq<@jp-guiKsBPKE?=lJC^F$%vTR)3A5wzV zU5fWX*}kd7`GpU-FO`StGyhRwC^;3s{XPe3Ex@sJ)UpMHzz21kd zt=Hdfb9_zX6B6#Hr%T+UaZ}ESe*V5-yFGBDYDCbee<41e#hYM%T0c`?IBx#xi0Are z*Af@&Lx-5p&gd^LlKbzJmTrw)qeNCJr%6#KNbeNVyItQdEt!{4+7$V+9;LQrJ{M~2 zlGZ#w@wQua>@Gb&*gq%-bW-M~?hszOIbccMO;LMtZ=@s^C<0CtErWy~XP0Hz-^SWm`K(>yh3Q64TNcjt5`*>Q0%&g z_PQ~7<1QfVDrYfRPg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