Skip to content

Commit

Permalink
Mappings be obfuscated
Browse files Browse the repository at this point in the history
  • Loading branch information
dordsor21 committed Sep 11, 2021
1 parent cfae804 commit 04821f7
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class SingleWorldListener implements Listener {

private final Method methodGetHandleChunk;
private Field mustSave;
private Field shouldSave;

public SingleWorldListener() throws Exception {
ReflectionUtils.RefClass classCraftChunk = getRefClass("{cb}.CraftChunk");
Expand All @@ -55,13 +55,13 @@ public SingleWorldListener() throws Exception {
if (PlotSquared.platform().serverVersion()[1] < 17) {
ReflectionUtils.RefClass classChunk = getRefClass("{nms}.Chunk");
if (PlotSquared.platform().serverVersion()[1] == 13) {
this.mustSave = classChunk.getField("mustSave").getRealField();
this.shouldSave = classChunk.getField("mustSave").getRealField();
} else {
this.mustSave = classChunk.getField("unsaved").getRealField();
this.shouldSave = classChunk.getField("s").getRealField();
}
} else {
ReflectionUtils.RefClass classChunk = getRefClass("net.minecraft.world.level.chunk.Chunk");
this.mustSave = classChunk.getField("mustNotSave").getRealField();
this.shouldSave = classChunk.getField("r").getRealField();
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
Expand All @@ -71,8 +71,8 @@ public SingleWorldListener() throws Exception {
public void markChunkAsClean(Chunk chunk) {
try {
Object nmsChunk = methodGetHandleChunk.invoke(chunk);
if (mustSave != null) {
this.mustSave.set(nmsChunk, false);
if (shouldSave != null) {
this.shouldSave.set(nmsChunk, false);
}
} catch (Throwable e) {
e.printStackTrace();
Expand Down

0 comments on commit 04821f7

Please sign in to comment.