mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-24 11:16:14 +01:00
Fixed improper d field reflection in WorldBorder SD-3861
This commit is contained in:
parent
56c1bf509d
commit
0b20a3669a
@ -44,11 +44,7 @@ public final class WorldBorder {
|
|||||||
|
|
||||||
Object worldBorder = worldBorderClass.getConstructor().newInstance();
|
Object worldBorder = worldBorderClass.getConstructor().newInstance();
|
||||||
|
|
||||||
if (NMSUtil.getVersionNumber() < 9) {
|
if (NMSUtil.getVersionNumber() >= 9) {
|
||||||
Field borderSize = worldBorder.getClass().getDeclaredField("d");
|
|
||||||
borderSize.setAccessible(true);
|
|
||||||
borderSize.set(worldBorder, size);
|
|
||||||
} else {
|
|
||||||
Object craftWorld = craftWorldClass.cast(centerLocation.getWorld());
|
Object craftWorld = craftWorldClass.cast(centerLocation.getWorld());
|
||||||
Method getHandleMethod = craftWorld.getClass().getMethod("getHandle");
|
Method getHandleMethod = craftWorld.getClass().getMethod("getHandle");
|
||||||
Object worldServer = getHandleMethod.invoke(craftWorld);
|
Object worldServer = getHandleMethod.invoke(craftWorld);
|
||||||
|
Loading…
Reference in New Issue
Block a user