mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Use correct field for unsaved in 1.18
This commit is contained in:
parent
308dba5601
commit
fbf07bbf1a
@ -46,7 +46,7 @@ import static com.plotsquared.core.util.ReflectionUtils.getRefClass;
|
|||||||
public class SingleWorldListener implements Listener {
|
public class SingleWorldListener implements Listener {
|
||||||
|
|
||||||
private final Method methodGetHandleChunk;
|
private final Method methodGetHandleChunk;
|
||||||
private Field shouldSave;
|
private Field shouldSave = null;
|
||||||
|
|
||||||
public SingleWorldListener() throws Exception {
|
public SingleWorldListener() throws Exception {
|
||||||
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
|
||||||
@ -59,9 +59,12 @@ public class SingleWorldListener implements Listener {
|
|||||||
} else {
|
} else {
|
||||||
this.shouldSave = classChunk.getField("s").getRealField();
|
this.shouldSave = classChunk.getField("s").getRealField();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (PlotSquared.platform().serverVersion()[1] == 17) {
|
||||||
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
|
||||||
this.shouldSave = classChunk.getField("r").getRealField();
|
this.shouldSave = classChunk.getField("r").getRealField();
|
||||||
|
} else if (PlotSquared.platform().serverVersion()[1] == 18) {
|
||||||
|
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.IChunkAccess");
|
||||||
|
this.shouldSave = classChunk.getField("b").getRealField();
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user