Skip to content

Commit

Permalink
Delete temporary fix for shulker box window titles
Browse files Browse the repository at this point in the history
Properly fixed by ViaVersion/ViaBackwards#761
  • Loading branch information
FlorianMichael committed May 28, 2024
1 parent 740a6d9 commit ee69005
Showing 1 changed file with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonParser;
import com.viaversion.nbt.tag.*;
import com.viaversion.viaversion.protocols.v1_8to1_9.data.EntityIds1_8;
import com.viaversion.viaversion.protocols.v1_8to1_9.data.PotionIdMappings1_9;
Expand Down Expand Up @@ -77,17 +75,8 @@ protected void registerPackets() {
protocol.registerClientbound(ClientboundPackets1_9.OPEN_SCREEN, wrapper -> {
final short windowId = wrapper.passthrough(Types.UNSIGNED_BYTE);
final String windowType = wrapper.passthrough(Types.STRING);
final JsonElement windowTitle = wrapper.passthrough(Types.COMPONENT);

wrapper.user().get(WindowTracker.class).put(windowId, windowType);

// TODO This is wrong, VB is missing pre 1.13 mappings for translations
if (windowType.equalsIgnoreCase("minecraft:shulker_box")) {
wrapper.set(Types.STRING, 0, "minecraft:container");
}
if (windowTitle.toString().equalsIgnoreCase("{\"translate\":\"container.shulkerBox\"}")) {
wrapper.set(Types.COMPONENT, 0, JsonParser.parseString("{\"text\":\"Shulker Box\"}"));
}
});

protocol.registerClientbound(ClientboundPackets1_9.CONTAINER_SET_CONTENT, wrapper -> {
Expand Down

0 comments on commit ee69005

Please sign in to comment.