From 87ad6bd2b1f4cb0a5392fae131d9c6756b29adb0 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 16 Sep 2021 17:05:19 +0200 Subject: [PATCH] More work on 21w37a --- .../Protocol1_17_1To1_18.java | 21 +++++++++++++++++++ .../packets/BlockItemPackets1_18.java | 5 ++++- .../packets/EntityPackets1_18.java | 13 ++++++++++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java index 93a2f566..900b3a6d 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java @@ -18,11 +18,17 @@ package com.viaversion.viabackwards.protocol.protocol1_17_1to1_18; import com.viaversion.viabackwards.api.BackwardsProtocol; +import com.viaversion.viabackwards.api.rewriters.SoundRewriter; import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.data.BackwardsMappings; import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.packets.BlockItemPackets1_18; import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.packets.EntityPackets1_18; +import com.viaversion.viaversion.api.connection.UserConnection; +import com.viaversion.viaversion.api.minecraft.RegistryType; +import com.viaversion.viaversion.api.minecraft.entities.Entity1_17Types; +import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.protocol1_17_1to1_17.ClientboundPackets1_17_1; import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.ServerboundPackets1_17; +import com.viaversion.viaversion.rewriter.TagRewriter; public final class Protocol1_17_1To1_18 extends BackwardsProtocol { @@ -38,6 +44,21 @@ public final class Protocol1_17_1To1_18 extends BackwardsProtocol { @@ -140,7 +141,9 @@ public final class BlockItemPackets1_18 extends ItemRewriter { public EntityPackets1_18(final Protocol1_17_1To1_18 protocol) { @@ -56,14 +59,20 @@ public final class EntityPackets1_18 extends EntityRewriter { final CompoundTag registry = wrapper.get(Type.NBT, 0); final CompoundTag biomeRegistry = registry.get("minecraft:worldgen/biome"); final ListTag biomes = biomeRegistry.get("value"); - for (final Tag biome : biomes) { + for (final Tag biome : new ArrayList<>(biomes.getValue())) { final CompoundTag biomeCompound = ((CompoundTag) biome).get("element"); + final StringTag category = biomeCompound.get("category"); + if (category.getValue().equals("mountain")) { + biomes.remove(biome); + continue; + } + // The client just needs something biomeCompound.put("depth", new FloatTag(0.125F)); biomeCompound.put("scale", new FloatTag(0.05F));