Skip to content

Commit

Permalink
Froge fixe
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudje committed Oct 19, 2023
1 parent b42e66a commit ca02ea8
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@ private static void writeScaledChunkData(ServerLevel level, ChunkAccess chunk, C
DataLayer dataLayer, DataLayer dataLayer2,
CompoundTag nbt,
LevelChunkSection section) {
ChunkSerializerHelper.INSTANCE.write(section, nbt);
if (chunk instanceof LevelChunk levelChunk) {
ChunkSerializerHelper.INSTANCE.write(levelChunk, j, nbt);
}
}

@Inject(
method = "read",
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/ai/village/poi/PoiManager;checkConsistencyWithBlocks(Lnet/minecraft/world/level/ChunkPos;Lnet/minecraft/world/level/chunk/LevelChunkSection;)V", shift = At.Shift.BEFORE),
locals = LocalCapture.CAPTURE_FAILHARD
at = @At(value = "RETURN", ordinal = 0)
)
private static void readScaledChunkData(ServerLevel level, PoiManager poiManager,
ChunkPos pos, CompoundTag tag, CallbackInfoReturnable<ProtoChunk> cir,
ChunkPos pos2,
UpgradeData upgradeData, boolean bl, ListTag listTag, int i,
LevelChunkSection[] levelChunkSections, boolean bl2,
ChunkSource chunkSource, LevelLightEngine levelLightEngine,
Registry registry, Codec codec, int j, CompoundTag sectionNbt, int k, int index,
PalettedContainer states, PalettedContainer biomes) {
ChunkSerializerHelper.INSTANCE.read(levelChunkSections, sectionNbt, index);
private static void readExtraChunkData(ServerLevel lvel,
PoiManager poiManager,
ChunkPos pos, CompoundTag tag,
CallbackInfoReturnable<ProtoChunk> cir) {
assert cir.getReturnValue() != null && cir.getReturnValue() instanceof ImposterProtoChunk;

ImposterProtoChunk chunk = (ImposterProtoChunk) cir.getReturnValue();
ListTag listTag = tag.getList("Sections", 10);

for (int index = 0; index < chunk.getSectionsCount(); index++) {
CompoundTag sectionNbt = listTag.getCompound(index);
ChunkSerializerHelper.INSTANCE.read(chunk.getWrapped(), sectionNbt, index);
}
}
}

0 comments on commit ca02ea8

Please sign in to comment.