mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-11-29 01:04:00 +00:00
start up fix
This commit is contained in:
1 parent
36289b31af
commit
606510754e
8 files changed
+445
-40
No files matched your search
@@ -7,7 +7,7 @@
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTPAddons</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.8.10</version>
|
||||
<version>1.8.11</version>
|
||||
|
||||
<properties>
|
||||
<editor.website>https://www.minecentral.net</editor.website>
|
||||
@@ -169,7 +169,7 @@
|
||||
<dependency>
|
||||
<groupId>me.SuperRonanCraft</groupId>
|
||||
<artifactId>BetterRTP</artifactId>
|
||||
<version>3.6.13</version>
|
||||
<version>3.6.14</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- ProtocolLib -->
|
||||
|
||||
+11
-3
@@ -35,9 +35,17 @@ public class AddonsHandler {
|
||||
}
|
||||
|
||||
public void unload() {
|
||||
for (Addons addon : addons)
|
||||
addon.disable();
|
||||
addons.clear();
|
||||
try {
|
||||
for (Addons addon : addons)
|
||||
addon.disable();
|
||||
} finally {
|
||||
addons.clear();
|
||||
// Core retains these command objects after this plugin's classloader closes.
|
||||
BetterRTP core = BetterRTP.getInstance();
|
||||
if (core != null && core.getCmd() != null)
|
||||
core.getCmd().commands.removeIf(command ->
|
||||
command.getClass().getClassLoader() == getClass().getClassLoader());
|
||||
}
|
||||
}
|
||||
|
||||
public enum Addons {
|
||||
|
||||
@@ -41,8 +41,11 @@ public class Main extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (editorBridge != null) editorBridge.close();
|
||||
addonsHandler.unload();
|
||||
try {
|
||||
if (editorBridge != null) editorBridge.close();
|
||||
} finally {
|
||||
addonsHandler.unload();
|
||||
}
|
||||
}
|
||||
|
||||
public void load() {
|
||||
|
||||
Reference in new issue
Block a user