|
|
@ -21,6 +21,7 @@ class TNTTracer_15 {
|
|
|
|
|
|
|
|
|
|
|
|
private static TracerCallback_15 tracerCallback;
|
|
|
|
private static TracerCallback_15 tracerCallback;
|
|
|
|
private static TracerCallbackUpdatePoints_15 tracerCallbackUpdatePoints;
|
|
|
|
private static TracerCallbackUpdatePoints_15 tracerCallbackUpdatePoints;
|
|
|
|
|
|
|
|
private static TracerCallbackTracing_15 tracerCallbackTracing;
|
|
|
|
private static TracerActionBarCallback_15 tracerActionBarCallback;
|
|
|
|
private static TracerActionBarCallback_15 tracerActionBarCallback;
|
|
|
|
private static TNTShowCallback_15 tntShowCallback;
|
|
|
|
private static TNTShowCallback_15 tntShowCallback;
|
|
|
|
private static CacheUpdateCallback_15 cacheUpdateCallback;
|
|
|
|
private static CacheUpdateCallback_15 cacheUpdateCallback;
|
|
|
@ -39,7 +40,7 @@ class TNTTracer_15 {
|
|
|
|
return d * d;
|
|
|
|
return d * d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void init(Plugin plugin, TracerCallback_15 tracerCallback, TracerCallbackUpdatePoints_15 tracerCallbackUpdatePoints, TracerActionBarCallback_15 tracerActionBarCallback, TNTShowCallback_15 tntShowCallback, CacheUpdateCallback_15 cacheUpdateCallback) {
|
|
|
|
static void init(Plugin plugin, TracerCallback_15 tracerCallback, TracerCallbackUpdatePoints_15 tracerCallbackUpdatePoints, TracerActionBarCallback_15 tracerActionBarCallback, TNTShowCallback_15 tntShowCallback, CacheUpdateCallback_15 cacheUpdateCallback, TracerCallbackTracing_15 tracerCallbackTracing) {
|
|
|
|
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
|
|
|
|
Bukkit.getScheduler().runTaskTimer(plugin, () -> {
|
|
|
|
synchronized (synchronizer) {
|
|
|
|
synchronized (synchronizer) {
|
|
|
|
synchronizer.notifyAll();
|
|
|
|
synchronizer.notifyAll();
|
|
|
@ -63,6 +64,7 @@ class TNTTracer_15 {
|
|
|
|
TNTTracer_15.tracerActionBarCallback = tracerActionBarCallback;
|
|
|
|
TNTTracer_15.tracerActionBarCallback = tracerActionBarCallback;
|
|
|
|
TNTTracer_15.tntShowCallback = tntShowCallback;
|
|
|
|
TNTTracer_15.tntShowCallback = tntShowCallback;
|
|
|
|
TNTTracer_15.cacheUpdateCallback = cacheUpdateCallback;
|
|
|
|
TNTTracer_15.cacheUpdateCallback = cacheUpdateCallback;
|
|
|
|
|
|
|
|
TNTTracer_15.tracerCallbackTracing = tracerCallbackTracing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void initWorld() {
|
|
|
|
static void initWorld() {
|
|
|
@ -100,6 +102,10 @@ class TNTTracer_15 {
|
|
|
|
private static float[] noValue = new float[0];
|
|
|
|
private static float[] noValue = new float[0];
|
|
|
|
|
|
|
|
|
|
|
|
private static void update(Player p, PlayerTraceCache_15 traceCache) {
|
|
|
|
private static void update(Player p, PlayerTraceCache_15 traceCache) {
|
|
|
|
|
|
|
|
if (tracerCallbackTracing.run()) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
float[] floats = tracerCallback.run(p);
|
|
|
|
float[] floats = tracerCallback.run(p);
|
|
|
|
if (floats.length == 0 || floats.length % 3 != 0) {
|
|
|
|
if (floats.length == 0 || floats.length % 3 != 0) {
|
|
|
|
traceCache.setPositions(noValue);
|
|
|
|
traceCache.setPositions(noValue);
|
|
|
|