SteamWar/BauSystem2.0
Archiviert
12
0

Add RawEntityShowMode
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-10 13:52:27 +01:00
Ursprung 58537c42f3
Commit 4aa66e12c4
2 geänderte Dateien mit 18 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -27,6 +27,6 @@ import org.bukkit.entity.Player;
public class RawEntityShowMode extends FactoredEntityShowMode { public class RawEntityShowMode extends FactoredEntityShowMode {
public RawEntityShowMode(Player player, ShowModeParameter showModeParameter) { public RawEntityShowMode(Player player, ShowModeParameter showModeParameter) {
super(player, showModeParameter, 1000000); super(player, showModeParameter, -1);
} }
} }

Datei anzeigen

@ -25,11 +25,11 @@ import java.util.Objects;
public class RoundedPosition { public class RoundedPosition {
private static final int factor = 10; private static final long factor = 10;
private int x; private long x;
private int y; private long y;
private int z; private long z;
public RoundedPosition(Position position) { public RoundedPosition(Position position) {
this(position.getLocation().getX(), position.getLocation().getY(), position.getLocation().getZ()); this(position.getLocation().getX(), position.getLocation().getY(), position.getLocation().getZ());
@ -48,15 +48,21 @@ public class RoundedPosition {
} }
public RoundedPosition(double x, double y, double z) { public RoundedPosition(double x, double y, double z) {
this.x = (int) (x * factor); this.x = (long) (x * factor);
this.y = (int) (y * factor); this.y = (long) (y * factor);
this.z = (int) (z * factor); this.z = (long) (z * factor);
} }
public RoundedPosition(double x, double y, double z, int factor) { public RoundedPosition(double x, double y, double z, long factor) {
this.x = (int) (x * factor); if (factor == -1) {
this.y = (int) (y * factor); this.x = Double.doubleToLongBits(x);
this.z = (int) (z * factor); this.y = Double.doubleToLongBits(y);
this.z = Double.doubleToLongBits(z);
} else {
this.x = (long) (x * factor);
this.y = (long) (y * factor);
this.z = (long) (z * factor);
}
} }
@Override @Override