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