diff --git a/src/xyz/soper/arty/item/Mortar.java b/src/xyz/soper/arty/item/Mortar.java index 7c39932..bc63276 100644 --- a/src/xyz/soper/arty/item/Mortar.java +++ b/src/xyz/soper/arty/item/Mortar.java @@ -5,7 +5,6 @@ import org.bukkit.Material; import org.bukkit.Nameable; import org.bukkit.block.Block; import org.bukkit.util.Vector; - import java.util.Random; /** @@ -54,8 +53,14 @@ public class Mortar { String mortarName = brewingStandMortar.getCustomName(); if(block.hasMetadata("direction_x")){ -// float x = block.getMetadata("direction_x").; -// float TODO: figure out metadata + float x = this.getBlock().getMetadata("direction_x").get(0).asFloat(); + float y = this.getBlock().getMetadata("direction_y").get(0).asFloat(); + float z = this.getBlock().getMetadata("direction_z").get(0).asFloat(); + + setDirection(x, y, z); + } + else{ + setDirection(1,1,1); } if(mortarName.equals(BASIC_MORTAR_NAME)){ @@ -120,8 +125,7 @@ public class Mortar { * @param z Vector in the z-axis */ public void setDirection(double x, double y, double z){ - Vector vector = new Vector(x, y, z).normalize(); - setDirection(vector); + setDirection(new Vector(x, y, z).normalize()); } /** @@ -173,7 +177,7 @@ public class Mortar { } /** - * + * Checks if this mortar and shell are compatible. * @param shell Shell to test. * @return True if the shell and mortar are compatible. */