diff options
Diffstat (limited to 'spark-sponge')
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java | 6 | ||||
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java index aa42efd..01052cb 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java @@ -116,7 +116,7 @@ public class SparkSpongePlugin implements CommandCallable { @Override public void runAsync(Runnable r) { - asyncExecutor.execute(r); + SparkSpongePlugin.this.asyncExecutor.execute(r); } @Override @@ -139,7 +139,7 @@ public class SparkSpongePlugin implements CommandCallable { @Listener public void onServerStart(GameStartedServerEvent event) { - game.getCommandManager().register(this, this, "spark"); + this.game.getCommandManager().register(this, this, "spark"); } @Override @@ -149,7 +149,7 @@ public class SparkSpongePlugin implements CommandCallable { return CommandResult.empty(); } - sparkPlatform.executeCommand(source, arguments.split(" ")); + this.sparkPlatform.executeCommand(source, arguments.split(" ")); return CommandResult.empty(); } diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java index a3eba45..14b30b8 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java @@ -26,14 +26,13 @@ import org.spongepowered.api.scheduler.Task; import java.util.HashSet; import java.util.Set; -import java.util.concurrent.atomic.LongAdder; public class SpongeTickCounter implements TickCounter, Runnable { private final SparkSpongePlugin plugin; private Task task; private final Set<Runnable> tasks = new HashSet<>(); - private final LongAdder tick = new LongAdder(); + private int tick = 0; public SpongeTickCounter(SparkSpongePlugin plugin) { this.plugin = plugin; @@ -44,7 +43,7 @@ public class SpongeTickCounter implements TickCounter, Runnable { for (Runnable r : this.tasks){ r.run(); } - this.tick.increment(); + this.tick++; } @Override @@ -58,8 +57,8 @@ public class SpongeTickCounter implements TickCounter, Runnable { } @Override - public long getCurrentTick() { - return this.tick.longValue(); + public int getCurrentTick() { + return this.tick; } @Override |