Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
Fix the long-range build tool's ability to build mid-air.
Dieser Commit ist enthalten in:
Ursprung
0656ef1920
Commit
f46c70093c
@ -208,6 +208,9 @@ public class Location {
|
||||
* @return the direction vector
|
||||
*/
|
||||
public Vector3 getDirection() {
|
||||
if (Float.isNaN(getYaw()) && Float.isNaN(getPitch())) {
|
||||
return Vector3.ZERO;
|
||||
}
|
||||
double yaw = Math.toRadians(this.getYaw());
|
||||
double pitch = Math.toRadians(this.getPitch());
|
||||
double xz = Math.cos(pitch);
|
||||
|
@ -189,11 +189,16 @@ public class TargetBlock {
|
||||
|
||||
public Location getAnyTargetBlockFace() {
|
||||
getAnyTargetBlock();
|
||||
return getCurrentBlock().setDirection(getCurrentBlock().toVector().subtract(getPreviousBlock().toVector()));
|
||||
Location current = getCurrentBlock();
|
||||
if (current != null)
|
||||
return current.setDirection(current.toVector().subtract(getPreviousBlock().toVector()));
|
||||
else
|
||||
return new Location(world, targetPos.toVector3(), Float.NaN, Float.NaN);
|
||||
}
|
||||
|
||||
public Location getTargetBlockFace() {
|
||||
getAnyTargetBlock();
|
||||
getTargetBlock();
|
||||
if (getCurrentBlock() == null) return null;
|
||||
return getCurrentBlock().setDirection(getCurrentBlock().toVector().subtract(getPreviousBlock().toVector()));
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren