Fix Trace show/hide Bug #86
@ -25,11 +25,6 @@ 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};
|
||||||
}
|
}
|
||||||
@ -57,14 +52,7 @@ public class PlayerTraceCache_15 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void show(Player player, TNTCallbackShow.ShowMode showMode) {
|
public void show(Player player, TNTCallbackShow.ShowMode showMode) {
|
||||||
if (hiding) {
|
if (hiding) return;
|
||||||
try {
|
|
||||||
instance.wait(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
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];
|
||||||
@ -98,7 +86,7 @@ public class PlayerTraceCache_15 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hide(Player player) {
|
public void hideBlockTraces(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) {
|
||||||
@ -119,7 +107,6 @@ 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) {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package de.steamwar.bausystem.tracer;
|
package de.steamwar.bausystem.tracer;
|
||||||
|
|
||||||
import de.steamwar.bausystem.tracer.debugcallback.DebugCallbackActionBar;
|
import de.steamwar.bausystem.tracer.debugcallback.DebugCallbackActionBar;
|
||||||
import de.steamwar.bausystem.tracer.showcallback.TNTCallbackCacheUpdate;
|
|
||||||
import de.steamwar.bausystem.tracer.showcallback.TNTCallbackShow;
|
import de.steamwar.bausystem.tracer.showcallback.TNTCallbackShow;
|
||||||
import de.steamwar.bausystem.tracer.updatecallback.*;
|
import de.steamwar.bausystem.tracer.updatecallback.*;
|
||||||
import net.md_5.bungee.api.ChatMessageType;
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
@ -158,10 +157,10 @@ class TNTTracer_15 {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hide(Player p) {
|
static void hideBlockTraces(Player p) {
|
||||||
PlayerTraceCache_15 tracerCache15 = playerMap.get(p);
|
PlayerTraceCache_15 tracerCache15 = playerMap.get(p);
|
||||||
if (tracerCache15 == null) return;
|
if (tracerCache15 == null) return;
|
||||||
tracerCache15.hide(p);
|
tracerCache15.hideBlockTraces(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class CommandTrace implements CommandExecutor {
|
|||||||
ShowManager.get(player).addSelection(tntID);
|
ShowManager.get(player).addSelection(tntID);
|
||||||
player.sendMessage(BauSystem.PREFIX + "§aTNT-Positionen des TNT mit ID " + tntID + " angezeigt");
|
player.sendMessage(BauSystem.PREFIX + "§aTNT-Positionen des TNT mit ID " + tntID + " angezeigt");
|
||||||
player.sendMessage(BauSystem.PREFIX + "§eBei zu vielen zu zeigenden Positionen wird der Block Tracer aktiviert");
|
player.sendMessage(BauSystem.PREFIX + "§eBei zu vielen zu zeigenden Positionen wird der Block Tracer aktiviert");
|
||||||
player.sendMessage(BauSystem.PREFIX + "§eBitte aktiviere animiertes Feuer in den Grafikeinstellungen");
|
// player.sendMessage(BauSystem.PREFIX + "§eBitte aktiviere animiertes Feuer in den Grafikeinstellungen");
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
help15(player);
|
help15(player);
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ public class CommandTrace implements CommandExecutor {
|
|||||||
ShowManager.get(player).show();
|
ShowManager.get(player).show();
|
||||||
player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
player.sendMessage(BauSystem.PREFIX + "§aAlle TNT-Positionen angezeigt");
|
||||||
player.sendMessage(BauSystem.PREFIX + "§eBei zu vielen zu zeigenden Positionen wird der Block Tracer aktiviert");
|
player.sendMessage(BauSystem.PREFIX + "§eBei zu vielen zu zeigenden Positionen wird der Block Tracer aktiviert");
|
||||||
player.sendMessage(BauSystem.PREFIX + "§eBitte aktiviere animiertes Feuer in den Grafikeinstellungen");
|
// player.sendMessage(BauSystem.PREFIX + "§eBitte aktiviere animiertes Feuer in den Grafikeinstellungen");
|
||||||
break;
|
break;
|
||||||
case "hide":
|
case "hide":
|
||||||
if (args.length == 2) {
|
if (args.length == 2) {
|
||||||
|
@ -302,7 +302,7 @@ public class TNTTracer15 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void hideBlockTraces(Player p) {
|
public static void hideBlockTraces(Player p) {
|
||||||
TNTTracer_15.hide(p);
|
TNTTracer_15.hideBlockTraces(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void start() {
|
public static void start() {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren