testing new calculate direction candidates

master
Soper Aylamo 2021-06-19 02:35:41 -04:00
parent 8b431e1166
commit c23e74d43e
Signed by: Soper
GPG Key ID: A27AC885ACC3BEAE
2 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,7 @@ import org.bukkit.util.Vector;
import xyz.soper.arty.item.Mortar; import xyz.soper.arty.item.Mortar;
import xyz.soper.arty.item.MortarTuner; import xyz.soper.arty.item.MortarTuner;
import xyz.soper.arty.item.Shell; import xyz.soper.arty.item.Shell;
import xyz.soper.arty.util.ArtyMath;
import xyz.soper.arty.util.MortarHandler; import xyz.soper.arty.util.MortarHandler;
public class MortarInteract implements Listener { public class MortarInteract implements Listener {
@ -80,9 +81,11 @@ public class MortarInteract implements Listener {
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));
//Using new methods to test:
player.sendMessage("DEBUG: Angle with new basic trig method is " + ArtyMath.calculateDirectionBASICTRIG(playerDirection));
player.sendMessage("DEBUG: Angle with new dot product method is " + ArtyMath.calculateDirectionDOTPRODUCT(playerDirection));
} }
else if(event.getAction() == Action.RIGHT_CLICK_AIR){ else if(event.getAction() == Action.RIGHT_CLICK_AIR){
Vector verticalVector = new Vector(0, playerDirection.getY(), 0); Vector verticalVector = new Vector(0, playerDirection.getY(), 0);

View File

@ -204,7 +204,7 @@ public class Mortar {
* Adjusts a block's directional metadata. * Adjusts a block's directional metadata.
* @param block Block that represents a mortar. * @param block Block that represents a mortar.
* @param direction Directional vector. * @param direction Directional vector.
* @deprecated This function has been deprecated in favor of the angle-based setElevation and setDirection angles. * @deprecated This function has been deprecated in favor of the angle-based setElevation and setDirection methods.
*/ */
@Deprecated @Deprecated
public static void setMortarDirection(Block block, Vector direction){ public static void setMortarDirection(Block block, Vector direction){