mortar now parses for metadata for direction

master
Soper Aylamo 2021-05-25 23:30:10 -04:00
parent 0f6e3c7273
commit 89ef2eac0d
Signed by: Soper
GPG Key ID: A27AC885ACC3BEAE
1 changed files with 10 additions and 6 deletions

View File

@ -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.
*/