Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit dc38e0e

Browse files
committed
Made plugin mutable
1 parent 705d96b commit dc38e0e

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/xyz/xenondevs/particle/task/TaskManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private TaskManager() {
6363
*/
6464
public int startTask(ParticleTask task) {
6565
//noinspection CodeBlock2Expr
66-
int taskId = Bukkit.getScheduler().runTaskTimerAsynchronously(ReflectionUtils.PLUGIN, () -> {
66+
int taskId = Bukkit.getScheduler().runTaskTimerAsynchronously(ReflectionUtils.plugin, () -> {
6767
ParticleUtils.sendBulk(task.getPackets(), task.getTargetPlayers());
6868
}, 0, task.getTickDelay()).getTaskId();
6969

src/main/java/xyz/xenondevs/particle/utils/PlayerConnectionCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public final class PlayerConnectionCache implements Listener {
5151
* as an event listener. The plugin is retrieved from the PluginClassLoader.
5252
*/
5353
public PlayerConnectionCache() {
54-
Bukkit.getServer().getPluginManager().registerEvents(this, ReflectionUtils.PLUGIN);
54+
Bukkit.getServer().getPluginManager().registerEvents(this, ReflectionUtils.plugin);
5555
}
5656

5757
/**

src/main/java/xyz/xenondevs/particle/utils/ReflectionUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public final class ReflectionUtils {
7373
/**
7474
* The current {@link Plugin} using ParticleLib.
7575
*/
76-
public static final Plugin PLUGIN;
76+
public static Plugin plugin;
7777

7878
static {
7979
String serverPath = Bukkit.getServer().getClass().getPackage().getName();
@@ -82,7 +82,7 @@ public final class ReflectionUtils {
8282
MINECRAFT_VERSION = Integer.parseInt(packageVersion.substring(0, packageVersion.lastIndexOf("_")).replace("_", ".").substring(2));
8383
NET_MINECRAFT_SERVER_PACKAGE_PATH = "net.minecraft" + (MINECRAFT_VERSION < 17 ? ".server." + version : "");
8484
CRAFT_BUKKIT_PACKAGE_PATH = "org.bukkit.craftbukkit." + version;
85-
PLUGIN = readDeclaredField(PLUGIN_CLASS_LOADER_PLUGIN_FIELD, ReflectionUtils.class.getClassLoader());
85+
plugin = readDeclaredField(PLUGIN_CLASS_LOADER_PLUGIN_FIELD, ReflectionUtils.class.getClassLoader());
8686
PLAYER_CONNECTION_CACHE = new PlayerConnectionCache();
8787
}
8888

0 commit comments

Comments
 (0)