From f67e6f8209a79a8118c1128c19b862dca8e6947f Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 21 Jan 2017 16:53:09 +0000 Subject: [PATCH] Fixed the Key of the King's Law stacking portals together if the player is looking straight down. Closes #2122 --- .../vazkii/botania/common/item/relic/ItemKingKey.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java index e9116af58..114cedb74 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java @@ -64,8 +64,14 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { int spawned = getWeaponsSpawned(stack); if(count != getMaxItemUseDuration(stack) && spawned < 20 && !living.worldObj.isRemote && (!(living instanceof EntityPlayer) || ManaItemHandler.requestManaExact(stack, (EntityPlayer) living, 150, true))) { - Vector3 look = new Vector3(living.getLookVec()).multiply(1, 0, 1).normalize().multiply(-2);; - + Vector3 look = new Vector3(living.getLookVec()).multiply(1, 0, 1); + + double playerRot = Math.toRadians(living.rotationYaw + 90); + if(look.x == 0 && look.z == 0) + look = new Vector3(Math.cos(playerRot), 0, Math.sin(playerRot)); + + look = look.normalize().multiply(-2); + int div = spawned / 5; int mod = spawned % 5;