deprecated direction vector method for mortar
This commit is contained in:
parent
05e0a1c934
commit
c93696c628
@ -79,6 +79,9 @@ public class MortarInteract implements Listener {
|
|||||||
Vector horizonVector = new Vector(playerDirection.getX(), 0, playerDirection.getZ());
|
Vector horizonVector = new Vector(playerDirection.getX(), 0, playerDirection.getZ());
|
||||||
Mortar.setMortarDirection(linkedMortar, horizonVector);
|
Mortar.setMortarDirection(linkedMortar, horizonVector);
|
||||||
player.sendMessage(ChatColor.GOLD + "Mortar is now pointing towards " + horizonVector.getX() + ", " + horizonVector.getZ());
|
player.sendMessage(ChatColor.GOLD + "Mortar is now pointing towards " + horizonVector.getX() + ", " + horizonVector.getZ());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
player.sendMessage("DEBUG: Angle is " + (180*horizonVector.angle(new Vector(1,0,0))/Math.PI));
|
player.sendMessage("DEBUG: Angle is " + (180*horizonVector.angle(new Vector(1,0,0))/Math.PI));
|
||||||
}
|
}
|
||||||
else if(event.getAction() == Action.RIGHT_CLICK_AIR){
|
else if(event.getAction() == Action.RIGHT_CLICK_AIR){
|
||||||
|
@ -200,6 +200,13 @@ public class Mortar {
|
|||||||
&& isStringMortar(((Nameable) block.getState()).getCustomName());
|
&& isStringMortar(((Nameable) block.getState()).getCustomName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adjusts a block's directional metadata.
|
||||||
|
* @param block Block that represents a mortar.
|
||||||
|
* @param direction Directional vector.
|
||||||
|
* @deprecated This function has been deprecated in favor of the angle-based setElevation and setDirection angles.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public static void setMortarDirection(Block block, Vector direction){
|
public static void setMortarDirection(Block block, Vector direction){
|
||||||
if(isMortar(block)){
|
if(isMortar(block)){
|
||||||
if(direction.getY() == 0){
|
if(direction.getY() == 0){
|
||||||
@ -211,6 +218,18 @@ public class Mortar {
|
|||||||
else throw new IllegalArgumentException("Cannot set non-mortar block's directional MetaData");
|
else throw new IllegalArgumentException("Cannot set non-mortar block's directional MetaData");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param angle
|
||||||
|
*/
|
||||||
|
public static void setElevationAngle(double angle){
|
||||||
|
//TODO: setElevationAngle method
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setDirectionAngle(double angle){
|
||||||
|
//TODO: setDirectionAngle method
|
||||||
|
}
|
||||||
|
|
||||||
private static boolean isStringMortar(String string){
|
private static boolean isStringMortar(String string){
|
||||||
if(string == null){
|
if(string == null){
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user