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