mirror of
https://github.com/Phoenix616/RandomTeleport.git
synced 2024-11-25 20:15:55 +01:00
Fix version usage in hook selection
This commit is contained in:
parent
1c15f42a09
commit
a41bf653fb
@ -56,7 +56,7 @@ public class HookManager implements Listener, ProtectionHook, WorldborderHook {
|
|||||||
|
|
||||||
private void registerHook(Plugin plugin) {
|
private void registerHook(Plugin plugin) {
|
||||||
String path = getClass().getPackage().getName() + ".plugin." + plugin.getName();
|
String path = getClass().getPackage().getName() + ".plugin." + plugin.getName();
|
||||||
String version = plugin.getDescription().getVersion();
|
String version = plugin.getDescription().getVersion().replace('.', '_').replace('-', '_');
|
||||||
Class<?> hookClass = null;
|
Class<?> hookClass = null;
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
@ -65,8 +65,8 @@ public class HookManager implements Listener, ProtectionHook, WorldborderHook {
|
|||||||
hookClass = null;
|
hookClass = null;
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException ignored) {}
|
} catch (ClassNotFoundException ignored) {}
|
||||||
if (version.contains(".")) {
|
if (version.contains("_")) {
|
||||||
version = version.substring(0, version.lastIndexOf('.'));
|
version = version.substring(0, version.lastIndexOf('_'));
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
hookClass = Class.forName(path + "Hook");
|
hookClass = Class.forName(path + "Hook");
|
||||||
|
Loading…
Reference in New Issue
Block a user