From d29252386a488897009689acb110fead099044fb Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sun, 4 Aug 2013 23:13:21 -0400 Subject: [PATCH] Fixed raytrace bug --- README.md | 2 +- src/resonantinduction/base/Vector3.java | 2 +- src/resonantinduction/tesla/BlockTesla.java | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 75a3acbd..b3bbb366 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,4 @@ In order to compile the source code into binary form, you must have a working Mi 5. Install it into Minecraft just like any other Forge mod. ### License -"Resonant Induction" is under the Calclavia Mod License (http://calclavia.com/license/cl). +"Resonant Induction" is under the Educational Public License (http://calclavia.com/license/rpl). diff --git a/src/resonantinduction/base/Vector3.java b/src/resonantinduction/base/Vector3.java index 8a3d6f82..2434386b 100644 --- a/src/resonantinduction/base/Vector3.java +++ b/src/resonantinduction/base/Vector3.java @@ -248,7 +248,7 @@ public class Vector3 { MovingObjectPosition pickedEntity = null; Vec3 startingPosition = this.toVec3(); - Vec3 look = target.normalize().toVec3(); + Vec3 look = target.clone().difference(this).normalize().toVec3(); double reachDistance = this.distance(target); Vec3 reachPoint = Vec3.createVectorHelper(startingPosition.xCoord + look.xCoord * reachDistance, startingPosition.yCoord + look.yCoord * reachDistance, startingPosition.zCoord + look.zCoord * reachDistance); diff --git a/src/resonantinduction/tesla/BlockTesla.java b/src/resonantinduction/tesla/BlockTesla.java index 6ea9848f..78301fe4 100644 --- a/src/resonantinduction/tesla/BlockTesla.java +++ b/src/resonantinduction/tesla/BlockTesla.java @@ -53,16 +53,22 @@ public class BlockTesla extends BlockBase implements ITileEntityProvider { entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); } + return true; } else if (entityPlayer.getCurrentEquippedItem().itemID == Item.redstone.itemID) { - tileEntity.toggleEntityAttack(); + boolean status = tileEntity.toggleEntityAttack(); if (!entityPlayer.capabilities.isCreativeMode) { entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, 1); } + + if (!world.isRemote) + { + entityPlayer.addChatMessage("Toggled entity attack to: " + status); + } return true; } else if (entityPlayer.getCurrentEquippedItem().getItem() instanceof ItemCoordLink)