mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2025-01-21 21:01:53 +01:00
updated commandMap finder for Worldedit listener
This commit is contained in:
parent
0694859a87
commit
adb4c80a99
@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
public class WorldEditListener implements Listener {
|
||||
|
||||
private final List<String> worldEditCommands= new ArrayList<>();
|
||||
@ -28,7 +28,7 @@ public class WorldEditListener implements Listener {
|
||||
try {
|
||||
String packageName = Bukkit.getServer().getClass().getPackage().getName();
|
||||
String version = packageName.substring(packageName.lastIndexOf(".") + 1);
|
||||
Class<?> serverClass = Class.forName("org.bukkit.craftbukkit." + version + ".CraftServer");
|
||||
Class<?> serverClass = Bukkit.getServer().getClass();
|
||||
|
||||
Field f1 = serverClass.getDeclaredField("commandMap");
|
||||
f1.setAccessible(true);
|
||||
|
Loading…
Reference in New Issue
Block a user