hopefully fix core pos and size variable names getting fucked

This commit is contained in:
blackilykat 2024-11-02 20:54:48 +01:00
parent 5416cbf6f9
commit 9e6b14de91
4 changed files with 45 additions and 2 deletions

View file

@ -3,6 +3,8 @@ package land.chipmunk.chipmunkmod;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import land.chipmunk.chipmunkmod.data.BlockArea;
import land.chipmunk.chipmunkmod.data.SimpleBlockArea;
import land.chipmunk.chipmunkmod.data.SimpleBlockPos;
import net.minecraft.util.math.BlockPos;
import java.util.HashMap;
@ -25,7 +27,7 @@ public class Configuration {
}
public static class CommandCore {
public BlockArea relativeArea = new BlockArea(new BlockPos(0, 0, 0), new BlockPos(15, 0, 15));
public SimpleBlockArea relativeArea = new SimpleBlockArea(new SimpleBlockPos(0, 0, 0), new SimpleBlockPos(15, 0, 15));
}
public static class Bots {

View file

@ -0,0 +1,18 @@
package land.chipmunk.chipmunkmod.data;
/**
* {@link BlockArea} but with {@link SimpleBlockPos} instead of {@link net.minecraft.util.math.BlockPos}
*/
public class SimpleBlockArea {
public SimpleBlockPos start;
public SimpleBlockPos end;
public SimpleBlockArea(SimpleBlockPos start, SimpleBlockPos end) {
this.start = start;
this.end = end;
}
public BlockArea toBlockArea() {
return new BlockArea(start.toBlockPos(), end.toBlockPos());
}
}

View file

@ -0,0 +1,23 @@
package land.chipmunk.chipmunkmod.data;
import net.minecraft.util.math.BlockPos;
/**
* Basically {@link net.minecraft.util.math.BlockPos} but the mappings are consistent so they don't get fucked up
* in configs
*/
public class SimpleBlockPos {
public int x;
public int y;
public int z;
public SimpleBlockPos(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public BlockPos toBlockPos() {
return new BlockPos(x, y, z);
}
}

View file

@ -94,7 +94,7 @@ public class CommandCore {
}
public void reloadRelativeArea () {
noPos = ChipmunkMod.CONFIG.core.relativeArea;
noPos = ChipmunkMod.CONFIG.core.relativeArea.toBlockArea();
}
public void check () {