Fix bunches of bugs. Quad tree ticks! Gen call is fired! Chunk gen works! Next to fix: File updates
This commit is contained in:
@@ -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
Reference in New Issue
Block a user