SteamWar/BauSystem
Archiviert
13
0

Fix Trace show/hide Bug #86

Manuell gemergt
YoyoNow hat 2 Commits von TNTTracer nach master 2020-07-25 21:57:06 +02:00 zusammengeführt
2 geänderte Dateien mit 15 neuen und 3 gelöschten Zeilen
Nur Änderungen aus Commit e0b885ad32 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -25,6 +25,11 @@ public class PlayerTraceCache_15 {
private boolean hiding = false; private boolean hiding = false;
private PlayerTraceCache_15 instance;
{
instance = this;
}
public PlayerTraceCache_15() { public PlayerTraceCache_15() {
this.pLocation = new float[]{0.0F, 0.0F, 0.0F}; this.pLocation = new float[]{0.0F, 0.0F, 0.0F};
} }
@ -52,7 +57,14 @@ public class PlayerTraceCache_15 {
} }
public void show(Player player, TNTCallbackShow.ShowMode showMode) { public void show(Player player, TNTCallbackShow.ShowMode showMode) {
if (hiding) {
try {
instance.wait(1000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (hiding) return; if (hiding) return;
}
if (positions.length == 0 || positions.length % 3 != 0) return; if (positions.length == 0 || positions.length % 3 != 0) return;
for (int i = 0; i < positions.length; i += 3) { for (int i = 0; i < positions.length; i += 3) {
float x = positions[i + 0]; float x = positions[i + 0];
@ -86,7 +98,7 @@ public class PlayerTraceCache_15 {
} }
} }
public synchronized void hide(Player player) { public void hide(Player player) {
hiding = true; hiding = true;
if (positions.length == 0 || positions.length % 3 != 0) return; if (positions.length == 0 || positions.length % 3 != 0) return;
for (int i = 0; i < positions.length; i += 3) { for (int i = 0; i < positions.length; i += 3) {
@ -107,6 +119,7 @@ public class PlayerTraceCache_15 {
} }
updatePoints = new float[0]; updatePoints = new float[0];
hiding = false; hiding = false;
instance.notifyAll();
} }
private static void showCorner(Player player, float x, float y, float z, Particle particle) { private static void showCorner(Player player, float x, float y, float z, Particle particle) {

Datei anzeigen

@ -133,7 +133,6 @@ public class CommandTrace implements CommandExecutor {
case "particle": case "particle":
case "particles": case "particles":
TNTTracer15.hideBlockTraces(player); TNTTracer15.hideBlockTraces(player);
ShowManager.get(player).show();
ShowManager.get(player).setShowMode(ShowStatus.ShowMode.PARTICLE); ShowManager.get(player).setShowMode(ShowStatus.ShowMode.PARTICLE);
break; break;
default: default: