Fix bunches of bugs. Quad tree ticks! Gen call is fired! Chunk gen works! Next to fix: File updates

This commit is contained in:
TomTheFurry
2022-07-26 17:06:51 +08:00
parent fd4f628618
commit ae02066093
3 changed files with 13 additions and 1 deletions
@@ -61,4 +61,9 @@ public class WrapperFactory implements IWrapperFactory
public IBlockStateWrapper deserializeBlockStateWrapper(String str) {
return BlockStateWrapper.deserialize(str);
}
@Override
public IBlockStateWrapper getAirBlockStateWrapper() {
return BlockStateWrapper.AIR;
}
}
@@ -8,6 +8,7 @@ import net.minecraft.world.level.block.state.BlockState;
import java.util.Objects;
public class BlockStateWrapper implements IBlockStateWrapper {
public static final BlockStateWrapper AIR = new BlockStateWrapper(null);
public final BlockState blockState;
public BlockStateWrapper(BlockState blockState) {
this.blockState = blockState;
@@ -15,10 +16,16 @@ public class BlockStateWrapper implements IBlockStateWrapper {
@Override
public String serialize() {
if (blockState == null) {
return "AIR";
}
return BlockState.CODEC.encodeStart(JsonOps.COMPRESSED, blockState).get().orThrow().toString();
}
public static BlockStateWrapper deserialize(String str) {
if (str.equals("AIR")) {
return AIR;
}
return new BlockStateWrapper(
BlockState.CODEC.decode(JsonOps.COMPRESSED, JsonParser.parseString(str)).get().orThrow().getFirst()
);
+1 -1
Submodule core updated: 50c5d044f1...a4546c63e3