From 7dc7b62cc982b1cd4bae3c75f15fc64ed475b855 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 12 May 2022 23:49:15 +0200 Subject: [PATCH] 22w19a (and a varying mix of removed and added dread) --- .../api/data/entity/DimensionData.java | 30 +++ .../api/data/entity/EntityTracker.java | 6 + .../api/minecraft/GlobalPosition.java | 21 +- .../viaversion/api/minecraft/Position.java | 10 +- .../api/protocol/version/ProtocolVersion.java | 2 +- .../minecraft/OptionalGlobalPositionType.java | 17 +- .../data/entity/DimensionDataImpl.java | 69 +++++++ .../data/entity/EntityTrackerBase.java | 15 ++ .../ClientboundPackets1_19.java | 182 +++++++++--------- .../Protocol1_19To1_18_2.java | 20 +- .../ServerboundPackets1_19.java | 89 ++++----- .../packets/EntityPackets.java | 130 +++++++++++-- .../packets/WorldPackets.java | 3 + .../storage/DimensionRegistryStorage.java | 37 ++++ .../util/PaintingOffsetUtil.java | 100 ---------- .../viaversion/rewriter/EntityRewriter.java | 23 +++ .../assets/viaversion/data/mapping-1.19.json | 170 ++++++++-------- .../data/mappingdiff-1.18to1.19.json | 87 ++++++++- gradle.properties | 2 +- 19 files changed, 636 insertions(+), 377 deletions(-) create mode 100644 api/src/main/java/com/viaversion/viaversion/api/data/entity/DimensionData.java create mode 100644 common/src/main/java/com/viaversion/viaversion/data/entity/DimensionDataImpl.java create mode 100644 common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/storage/DimensionRegistryStorage.java delete mode 100644 common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/util/PaintingOffsetUtil.java diff --git a/api/src/main/java/com/viaversion/viaversion/api/data/entity/DimensionData.java b/api/src/main/java/com/viaversion/viaversion/api/data/entity/DimensionData.java new file mode 100644 index 000000000..ce59e5938 --- /dev/null +++ b/api/src/main/java/com/viaversion/viaversion/api/data/entity/DimensionData.java @@ -0,0 +1,30 @@ +/* + * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion + * Copyright (C) 2016-2022 ViaVersion and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package com.viaversion.viaversion.api.data.entity; + +public interface DimensionData { + + int minY(); + + int height(); +} diff --git a/api/src/main/java/com/viaversion/viaversion/api/data/entity/EntityTracker.java b/api/src/main/java/com/viaversion/viaversion/api/data/entity/EntityTracker.java index fec6ce231..37aff5f69 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/data/entity/EntityTracker.java +++ b/api/src/main/java/com/viaversion/viaversion/api/data/entity/EntityTracker.java @@ -26,6 +26,8 @@ import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import org.checkerframework.checker.nullness.qual.Nullable; +import java.util.Map; + public interface EntityTracker { /** @@ -153,4 +155,8 @@ public interface EntityTracker { void setBiomesSent(int biomesSent); EntityType playerType(); + + @Nullable DimensionData dimensionData(String dimension); + + void setDimensions(Map dimensions); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/GlobalPosition.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/GlobalPosition.java index c7790ef64..0437c8dea 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/GlobalPosition.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/GlobalPosition.java @@ -22,29 +22,12 @@ */ package com.viaversion.viaversion.api.minecraft; -public final class GlobalPosition { +public final class GlobalPosition extends Position { private final String dimension; - private final int x; - private final int y; - private final int z; public GlobalPosition(final String dimension, final int x, final int y, final int z) { + super(x, y, z); this.dimension = dimension; - this.x = x; - this.y = y; - this.z = z; - } - - public int x() { - return x; - } - - public int y() { - return y; - } - - public int z() { - return z; } public String dimension() { diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/Position.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/Position.java index c5f1d86b2..c56db0859 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/Position.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/Position.java @@ -23,9 +23,9 @@ package com.viaversion.viaversion.api.minecraft; public class Position { - private final int x; - private final int y; - private final int z; + protected final int x; + protected final int y; + protected final int z; public Position(int x, int y, int z) { this.x = x; @@ -59,6 +59,10 @@ public class Position { return z; } + public GlobalPosition withDimension(String dimension) { + return new GlobalPosition(dimension, x, y, z); + } + @Deprecated/*(forRemoval=true)*/ public int getX() { return x; diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 616501984..82672abbb 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -80,7 +80,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_17_1 = register(756, "1.17.1"); public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1)); public static final ProtocolVersion v1_18_2 = register(758, "1.18.2"); - public static final ProtocolVersion v1_19 = register(759, 83, "1.19"); + public static final ProtocolVersion v1_19 = register(759, 84, "1.19"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalGlobalPositionType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalGlobalPositionType.java index 1bb3dc653..2c0f9c8f0 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalGlobalPositionType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalGlobalPositionType.java @@ -22,9 +22,6 @@ */ package com.viaversion.viaversion.api.type.types.minecraft; -import com.github.steveice10.opennbt.tag.builtin.CompoundTag; -import com.github.steveice10.opennbt.tag.builtin.IntArrayTag; -import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.viaversion.viaversion.api.minecraft.GlobalPosition; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; @@ -38,11 +35,8 @@ public class OptionalGlobalPositionType extends Type { @Override public GlobalPosition read(ByteBuf buffer) throws Exception { if (buffer.readBoolean()) { - // ♨︎_♨︎ - final CompoundTag compound = Type.NBT.read(buffer); - final String dimension = (String) compound.get("dimension").getValue(); - final IntArrayTag positionFields = compound.get("pos"); - return new GlobalPosition(dimension, positionFields.getValue(0), positionFields.getValue(1), positionFields.getValue(2)); + final String dimension = Type.STRING.read(buffer); + return Type.POSITION1_14.read(buffer).withDimension(dimension); } return null; } @@ -51,11 +45,8 @@ public class OptionalGlobalPositionType extends Type { public void write(ByteBuf buffer, GlobalPosition object) throws Exception { buffer.writeBoolean(object != null); if (object != null) { - final CompoundTag compound = new CompoundTag(); - compound.put("dimension", new StringTag(object.dimension())); - final int[] positionFields = {object.x(), object.y(), object.z()}; - compound.put("pos", new IntArrayTag(positionFields)); - Type.NBT.write(buffer, compound); + Type.STRING.write(buffer, object.dimension()); + Type.POSITION1_14.write(buffer, object); } } } diff --git a/common/src/main/java/com/viaversion/viaversion/data/entity/DimensionDataImpl.java b/common/src/main/java/com/viaversion/viaversion/data/entity/DimensionDataImpl.java new file mode 100644 index 000000000..605bfab90 --- /dev/null +++ b/common/src/main/java/com/viaversion/viaversion/data/entity/DimensionDataImpl.java @@ -0,0 +1,69 @@ +/* + * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion + * Copyright (C) 2016-2022 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.viaversion.viaversion.data.entity; + +import com.github.steveice10.opennbt.tag.builtin.CompoundTag; +import com.github.steveice10.opennbt.tag.builtin.IntTag; +import com.github.steveice10.opennbt.tag.builtin.NumberTag; +import com.github.steveice10.opennbt.tag.builtin.Tag; +import com.viaversion.viaversion.api.data.entity.DimensionData; + +public final class DimensionDataImpl implements DimensionData { + + private final int minY; + private final int height; + + public DimensionDataImpl(final int minY, final int height) { + this.minY = minY; + this.height = height; + } + + public DimensionDataImpl(final CompoundTag dimensionData) { + final Tag height = dimensionData.get("height"); + if (height instanceof IntTag) { + this.height = ((NumberTag) height).asInt(); + } else { + throw new IllegalArgumentException("height missing in dimension data: " + dimensionData); + } + + final Tag minY = dimensionData.get("min_y"); + if (minY instanceof IntTag) { + this.minY = ((NumberTag) minY).asInt(); + } else { + throw new IllegalArgumentException("min_y missing in dimension data: " + dimensionData); + } + } + + @Override + public int minY() { + return minY; + } + + @Override + public int height() { + return height; + } + + @Override + public String toString() { + return "DimensionData{" + + "minY=" + minY + + ", height=" + height + + '}'; + } +} diff --git a/common/src/main/java/com/viaversion/viaversion/data/entity/EntityTrackerBase.java b/common/src/main/java/com/viaversion/viaversion/data/entity/EntityTrackerBase.java index 25ad4b356..fe606fb9c 100644 --- a/common/src/main/java/com/viaversion/viaversion/data/entity/EntityTrackerBase.java +++ b/common/src/main/java/com/viaversion/viaversion/data/entity/EntityTrackerBase.java @@ -21,6 +21,7 @@ package com.viaversion.viaversion.data.entity; import com.google.common.base.Preconditions; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.entity.ClientEntityIdChangeListener; +import com.viaversion.viaversion.api.data.entity.DimensionData; import com.viaversion.viaversion.api.data.entity.EntityTracker; import com.viaversion.viaversion.api.data.entity.StoredEntityData; import com.viaversion.viaversion.api.minecraft.entities.EntityType; @@ -28,6 +29,9 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import org.checkerframework.checker.nullness.qual.Nullable; import space.vectrix.flare.fastutil.Int2ObjectSyncMap; +import java.util.Collections; +import java.util.Map; + public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeListener { private final Int2ObjectMap entityTypes = Int2ObjectSyncMap.hashmap(); private final Int2ObjectMap entityData; @@ -38,6 +42,7 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis private int currentMinY; private String currentWorld; private int biomesSent = -1; + private Map dimensions = Collections.emptyMap(); public EntityTrackerBase(UserConnection connection, @Nullable EntityType playerType) { this(connection, playerType, false); @@ -162,4 +167,14 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis public EntityType playerType() { return playerType; } + + @Override + public @Nullable DimensionData dimensionData(String dimension) { + return dimensions.get(dimension); + } + + @Override + public void setDimensions(Map dimensions) { + this.dimensions = dimensions; + } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/ClientboundPackets1_19.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/ClientboundPackets1_19.java index 08c92953f..24cacee9d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/ClientboundPackets1_19.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/ClientboundPackets1_19.java @@ -33,96 +33,98 @@ public enum ClientboundPackets1_19 implements ClientboundPacketType { BLOCK_CHANGE, // 0x09 BOSSBAR, // 0x0A SERVER_DIFFICULTY, // 0x0B - CLEAR_TITLES, // 0x0C - TAB_COMPLETE, // 0x0D - DECLARE_COMMANDS, // 0x0E - CLOSE_WINDOW, // 0x0F - WINDOW_ITEMS, // 0x10 - WINDOW_PROPERTY, // 0x11 - SET_SLOT, // 0x12 - COOLDOWN, // 0x13 - PLUGIN_MESSAGE, // 0x14 - NAMED_SOUND, // 0x15 - DISCONNECT, // 0x16 - ENTITY_STATUS, // 0x17 - EXPLOSION, // 0x18 - UNLOAD_CHUNK, // 0x19 - GAME_EVENT, // 0x1A - OPEN_HORSE_WINDOW, // 0x1B - WORLD_BORDER_INIT, // 0x1C - KEEP_ALIVE, // 0x1D - CHUNK_DATA, // 0x1E - EFFECT, // 0x1F - SPAWN_PARTICLE, // 0x20 - UPDATE_LIGHT, // 0x21 - JOIN_GAME, // 0x22 - MAP_DATA, // 0x23 - TRADE_LIST, // 0x24 - ENTITY_POSITION, // 0x25 - ENTITY_POSITION_AND_ROTATION, // 0x26 - ENTITY_ROTATION, // 0x27 - VEHICLE_MOVE, // 0x28 - OPEN_BOOK, // 0x29 - OPEN_WINDOW, // 0x2A - OPEN_SIGN_EDITOR, // 0x2B - PING, // 0x2C - CRAFT_RECIPE_RESPONSE, // 0x2D - PLAYER_ABILITIES, // 0x2E - PLAYER_CHAT, // 0x2F - COMBAT_END, // 0x30 - COMBAT_ENTER, // 0x31 - COMBAT_KILL, // 0x32 - PLAYER_INFO, // 0x33 - FACE_PLAYER, // 0x34 - PLAYER_POSITION, // 0x35 - UNLOCK_RECIPES, // 0x36 - REMOVE_ENTITIES, // 0x37 - REMOVE_ENTITY_EFFECT, // 0x38 - RESOURCE_PACK, // 0x39 - RESPAWN, // 0x3A - ENTITY_HEAD_LOOK, // 0x3B - MULTI_BLOCK_CHANGE, // 0x3C - SELECT_ADVANCEMENTS_TAB, // 0x3D - ACTIONBAR, // 0x3E - WORLD_BORDER_CENTER, // 0x3F - WORLD_BORDER_LERP_SIZE, // 0x40 - WORLD_BORDER_SIZE, // 0x41 - WORLD_BORDER_WARNING_DELAY, // 0x42 - WORLD_BORDER_WARNING_DISTANCE, // 0x43 - CAMERA, // 0x44 - HELD_ITEM_CHANGE, // 0x45 - UPDATE_VIEW_POSITION, // 0x46 - UPDATE_VIEW_DISTANCE, // 0x47 - SPAWN_POSITION, // 0x48 - DISPLAY_SCOREBOARD, // 0x49 - ENTITY_METADATA, // 0x4A - ATTACH_ENTITY, // 0x4B - ENTITY_VELOCITY, // 0x4C - ENTITY_EQUIPMENT, // 0x4D - SET_EXPERIENCE, // 0x4E - UPDATE_HEALTH, // 0x4F - SCOREBOARD_OBJECTIVE, // 0x50 - SET_PASSENGERS, // 0x51 - TEAMS, // 0x52 - UPDATE_SCORE, // 0x53 - SET_SIMULATION_DISTANCE, // 0x54 - TITLE_SUBTITLE, // 0x55 - TIME_UPDATE, // 0x56 - TITLE_TEXT, // 0x57 - TITLE_TIMES, // 0x58 - ENTITY_SOUND, // 0x59 - SOUND, // 0x5A - STOP_SOUND, // 0x5B - SYSTEM_CHAT, // 0x5C - TAB_LIST, // 0x5D - NBT_QUERY, // 0x5E - COLLECT_ITEM, // 0x5F - ENTITY_TELEPORT, // 0x60 - ADVANCEMENTS, // 0x61 - ENTITY_PROPERTIES, // 0x62 - ENTITY_EFFECT, // 0x63 - DECLARE_RECIPES, // 0x64 - TAGS; // 0x65 + CHAT_PREVIEW, // 0x0C + CLEAR_TITLES, // 0x0D + TAB_COMPLETE, // 0x0E + DECLARE_COMMANDS, // 0x0F + CLOSE_WINDOW, // 0x10 + WINDOW_ITEMS, // 0x11 + WINDOW_PROPERTY, // 0x12 + SET_SLOT, // 0x13 + COOLDOWN, // 0x14 + PLUGIN_MESSAGE, // 0x15 + NAMED_SOUND, // 0x16 + DISCONNECT, // 0x17 + ENTITY_STATUS, // 0x18 + EXPLOSION, // 0x19 + UNLOAD_CHUNK, // 0x1A + GAME_EVENT, // 0x1B + OPEN_HORSE_WINDOW, // 0x1C + WORLD_BORDER_INIT, // 0x1D + KEEP_ALIVE, // 0x1E + CHUNK_DATA, // 0x1F + EFFECT, // 0x20 + SPAWN_PARTICLE, // 0x21 + UPDATE_LIGHT, // 0x22 + JOIN_GAME, // 0x23 + MAP_DATA, // 0x24 + TRADE_LIST, // 0x25 + ENTITY_POSITION, // 0x26 + ENTITY_POSITION_AND_ROTATION, // 0x27 + ENTITY_ROTATION, // 0x28 + VEHICLE_MOVE, // 0x29 + OPEN_BOOK, // 0x2A + OPEN_WINDOW, // 0x2B + OPEN_SIGN_EDITOR, // 0x2C + PING, // 0x2D + CRAFT_RECIPE_RESPONSE, // 0x2E + PLAYER_ABILITIES, // 0x2F + PLAYER_CHAT, // 0x30 + COMBAT_END, // 0x31 + COMBAT_ENTER, // 0x32 + COMBAT_KILL, // 0x33 + PLAYER_INFO, // 0x34 + FACE_PLAYER, // 0x35 + PLAYER_POSITION, // 0x36 + UNLOCK_RECIPES, // 0x37 + REMOVE_ENTITIES, // 0x38 + REMOVE_ENTITY_EFFECT, // 0x39 + RESOURCE_PACK, // 0x3A + RESPAWN, // 0x3B + ENTITY_HEAD_LOOK, // 0x3C + MULTI_BLOCK_CHANGE, // 0x3D + SELECT_ADVANCEMENTS_TAB, // 0x3E + SERVER_DATA, // 0x3F + ACTIONBAR, // 0x40 + WORLD_BORDER_CENTER, // 0x41 + WORLD_BORDER_LERP_SIZE, // 0x42 + WORLD_BORDER_SIZE, // 0x43 + WORLD_BORDER_WARNING_DELAY, // 0x44 + WORLD_BORDER_WARNING_DISTANCE, // 0x45 + CAMERA, // 0x46 + HELD_ITEM_CHANGE, // 0x47 + UPDATE_VIEW_POSITION, // 0x48 + UPDATE_VIEW_DISTANCE, // 0x49 + SPAWN_POSITION, // 0x4A + DISPLAY_SCOREBOARD, // 0x4B + ENTITY_METADATA, // 0x4C + ATTACH_ENTITY, // 0x4D + ENTITY_VELOCITY, // 0x4E + ENTITY_EQUIPMENT, // 0x4F + SET_EXPERIENCE, // 0x50 + UPDATE_HEALTH, // 0x51 + SCOREBOARD_OBJECTIVE, // 0x52 + SET_PASSENGERS, // 0x53 + TEAMS, // 0x54 + UPDATE_SCORE, // 0x55 + SET_SIMULATION_DISTANCE, // 0x56 + TITLE_SUBTITLE, // 0x57 + TIME_UPDATE, // 0x58 + TITLE_TEXT, // 0x59 + TITLE_TIMES, // 0x5A + ENTITY_SOUND, // 0x5B + SOUND, // 0x5C + STOP_SOUND, // 0x5D + SYSTEM_CHAT, // 0x5E + TAB_LIST, // 0x5F + NBT_QUERY, // 0x60 + COLLECT_ITEM, // 0x61 + ENTITY_TELEPORT, // 0x62 + ADVANCEMENTS, // 0x63 + ENTITY_PROPERTIES, // 0x64 + ENTITY_EFFECT, // 0x65 + DECLARE_RECIPES, // 0x66 + TAGS; // 0x67 @Override public int getId() { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java index efe559f3c..4a3daeefd 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/Protocol1_19To1_18_2.java @@ -38,6 +38,7 @@ import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.ClientboundPacke import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.packets.EntityPackets; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.packets.InventoryPackets; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.packets.WorldPackets; +import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.DimensionRegistryStorage; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.NonceStorage; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage.SequenceStorage; import com.viaversion.viaversion.rewriter.CommandRewriter; @@ -179,6 +180,7 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { - // No properties - wrapper.write(Type.VAR_INT, 0); - }); + create(Type.VAR_INT, 0); // No properties } }); @@ -217,11 +217,9 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { - final byte[] pubKey = wrapper.get(Type.BYTE_ARRAY_PRIMITIVE, 0); - final byte[] nonce = wrapper.get(Type.BYTE_ARRAY_PRIMITIVE, 1); + final byte[] pubKey = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); + final byte[] nonce = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); final EncodedKeySpec keySpec = new X509EncodedKeySpec(pubKey); final PublicKey key = RSA_FACTORY.generatePublic(keySpec); final Cipher cipher = Cipher.getInstance(key.getAlgorithm()); @@ -236,9 +234,10 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { - // Read the public key if (wrapper.read(Type.BOOLEAN)) { - wrapper.read(Type.NBT); + wrapper.read(Type.LONG); // Timestamp + wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Key + wrapper.read(Type.BYTE_ARRAY_PRIMITIVE); // Signature } }); } @@ -285,6 +284,7 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { + private static final String CHAT_REGISTRY_SNBT = "{\n" + + " \"minecraft:chat_type\":{\n" + + " \"type\":\"minecraft:chat_type\",\n" + + " \"value\":[\n" + + " {\n" + + " \"name\":\"minecraft:chat\",\n" + + " \"id\":0,\n" + + " \"element\":{\n" + + " \"chat\":{\n" + + " \"decoration\":{\n" + + " \"translation_key\":\"chat.type.text\",\n" + + " \"style\":{\n" + + " \n" + + " },\n" + + " \"parameters\":[\n" + + " \"sender\",\n" + + " \"content\"\n" + + " ]\n" + + " }\n" + + " },\n" + + " \"narration\":{\n" + + " \"priority\":\"chat\",\n" + + " \"decoration\":{\n" + + " \"translation_key\":\"chat.type.text.narrate\",\n" + + " \"style\":{\n" + + " \n" + + " },\n" + + " \"parameters\":[\n" + + " \"sender\",\n" + + " \"content\"\n" + + " ]\n" + + " }\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"name\":\"minecraft:system\",\n" + + " \"id\":1,\n" + + " \"element\":{\n" + + " \"chat\":{\n" + + " \n" + + " },\n" + + " \"narration\":{\n" + + " \"priority\":\"system\"\n" + + " }\n" + + " }\n" + + " },\n" + + " {\n" + + " \"name\":\"minecraft:game_info\",\n" + + " \"id\":2,\n" + + " \"element\":{\n" + + " \"overlay\":{\n" + + " \n" + + " }\n" + + " }\n" + + " },\n" + + " ]\n" + + " },\n" + + "}"; + private static final CompoundTag CHAT_REGISTRY; + + static { + try { + CHAT_REGISTRY = BinaryTagIO.readString(CHAT_REGISTRY_SNBT).get("minecraft:chat_type"); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + public EntityPackets(final Protocol1_19To1_18_2 protocol) { super(protocol); mapTypes(Entity1_17Types.values(), Entity1_19Types.class); @@ -84,11 +161,9 @@ public final class EntityPackets extends EntityRewriter { final int motive = wrapper.read(Type.VAR_INT); final Position blockPosition = wrapper.read(Type.POSITION1_14); final byte direction = wrapper.read(Type.BYTE); - - final Position3d position = PaintingOffsetUtil.fixOffset(blockPosition, motive, direction); //TODO currently broken on servers; can probably remove the offsetting - wrapper.write(Type.DOUBLE, position.x()); - wrapper.write(Type.DOUBLE, position.y()); - wrapper.write(Type.DOUBLE, position.z()); + wrapper.write(Type.DOUBLE, blockPosition.x() + 0.5d); + wrapper.write(Type.DOUBLE, blockPosition.y() + 0.5d); + wrapper.write(Type.DOUBLE, blockPosition.z() + 0.5d); wrapper.write(Type.BYTE, (byte) 0); // Pitch wrapper.write(Type.BYTE, (byte) 0); // Yaw wrapper.write(Type.BYTE, (byte) 0); // Head yaw @@ -152,23 +227,45 @@ public final class EntityPackets extends EntityRewriter { map(Type.BYTE); // Previous Gamemode map(Type.STRING_ARRAY); // World List map(Type.NBT); // Registry - map(Type.NBT); // Current dimension data + handler(wrapper -> { + final CompoundTag tag = wrapper.get(Type.NBT, 0); + + // Add necessary chat types + tag.put("minecraft:chat_type", CHAT_REGISTRY.clone()); + + // Cache a whole lot of data + final ListTag dimensions = ((CompoundTag) tag.get("minecraft:dimension_type")).get("value"); + final Map dimensionDataMap = new HashMap<>(dimensions.size()); + final Map dimensionsMap = new HashMap<>(dimensions.size()); + for (final Tag dimension : dimensions) { + final CompoundTag dimensionCompound = (CompoundTag) dimension; + final CompoundTag element = dimensionCompound.get("element"); + final String name = (String) dimensionCompound.get("name").getValue(); + dimensionDataMap.put(name, new DimensionDataImpl(element)); + dimensionsMap.put(element, name); + } + tracker(wrapper.user()).setDimensions(dimensionDataMap); + + final DimensionRegistryStorage registryStorage = wrapper.user().get(DimensionRegistryStorage.class); + registryStorage.setDimensions(dimensionsMap); + writeDimensionKey(wrapper, registryStorage); + }); map(Type.STRING); // World map(Type.LONG); // Seed map(Type.VAR_INT); // Max players map(Type.VAR_INT); // Chunk radius map(Type.VAR_INT); // Simulation distance handler(playerTrackerHandler()); - handler(worldDataTrackerHandler(1)); + handler(worldDataTrackerHandlerByKey()); handler(biomeSizeTracker()); } }); protocol.registerClientbound(ClientboundPackets1_18.RESPAWN, new PacketRemapper() { @Override public void registerMap() { - map(Type.NBT); // Current dimension data + handler(wrapper -> writeDimensionKey(wrapper, wrapper.user().get(DimensionRegistryStorage.class))); map(Type.STRING); // World - handler(worldDataTrackerHandler(0)); + handler(worldDataTrackerHandlerByKey()); } }); @@ -213,6 +310,17 @@ public final class EntityPackets extends EntityRewriter { }); } + private static void writeDimensionKey(PacketWrapper wrapper, DimensionRegistryStorage registryStorage) throws Exception { + // Find dimension key by data + final CompoundTag currentDimension = wrapper.read(Type.NBT); + final String dimensionKey = registryStorage.dimensionKey(currentDimension); + if (dimensionKey == null) { + throw new IllegalArgumentException("Unknown dimension sent on join: " + currentDimension); + } + + wrapper.write(Type.STRING, dimensionKey); + } + private static int to3dId(final int id) { switch (id) { case -1: // Both up and down diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/WorldPackets.java index c9d658f27..1a47eb09b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/packets/WorldPackets.java @@ -17,6 +17,7 @@ */ package com.viaversion.viaversion.protocols.protocol1_19to1_18_2.packets; +import com.google.common.base.Preconditions; import com.viaversion.viaversion.api.data.entity.EntityTracker; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; @@ -58,6 +59,8 @@ public final class WorldPackets { public void registerMap() { handler(wrapper -> { final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user()); + Preconditions.checkArgument(tracker.biomesSent() != 0, "Biome count not set"); + Preconditions.checkArgument(tracker.currentWorldSectionHeight() != 0, "Section height not set"); final Chunk1_18Type chunkType = new Chunk1_18Type(tracker.currentWorldSectionHeight(), MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()), MathUtil.ceilLog2(tracker.biomesSent())); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/storage/DimensionRegistryStorage.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/storage/DimensionRegistryStorage.java new file mode 100644 index 000000000..cda1d95e9 --- /dev/null +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/storage/DimensionRegistryStorage.java @@ -0,0 +1,37 @@ +/* + * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion + * Copyright (C) 2016-2022 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.viaversion.viaversion.protocols.protocol1_19to1_18_2.storage; + +import com.github.steveice10.opennbt.tag.builtin.CompoundTag; +import com.viaversion.viaversion.api.connection.StorableObject; +import org.checkerframework.checker.nullness.qual.Nullable; + +import java.util.Map; + +public final class DimensionRegistryStorage implements StorableObject { + + private Map dimensions; + + public @Nullable String dimensionKey(CompoundTag dimensionData) { + return dimensions.get(dimensionData); // HMMMMMMMMMMM + } + + public void setDimensions(final Map dimensions) { + this.dimensions = dimensions; + } +} diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/util/PaintingOffsetUtil.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/util/PaintingOffsetUtil.java deleted file mode 100644 index f9f69ae87..000000000 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19to1_18_2/util/PaintingOffsetUtil.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2019-2022 GeyserMC. http://geysermc.org - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * @author GeyserMC - * @link https://github.com/GeyserMC/Geyser - */ -package com.viaversion.viaversion.protocols.protocol1_19to1_18_2.util; - -import com.viaversion.viaversion.api.minecraft.Position; -import com.viaversion.viaversion.api.minecraft.Position3d; - -public final class PaintingOffsetUtil { - - private static final double MAGIC_OFFSET = -0.46875; - private static final PaintingVariant[] VARIANTS = { - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(16, 16), - new PaintingVariant(32, 16), - new PaintingVariant(32, 16), - new PaintingVariant(32, 16), - new PaintingVariant(32, 16), - new PaintingVariant(32, 16), - new PaintingVariant(16, 32), - new PaintingVariant(16, 32), - new PaintingVariant(32, 32), - new PaintingVariant(32, 32), - new PaintingVariant(32, 32), - new PaintingVariant(32, 32), - new PaintingVariant(32, 32), - new PaintingVariant(32, 32), - new PaintingVariant(64, 32), - new PaintingVariant(64, 64), - new PaintingVariant(64, 64), - new PaintingVariant(64, 64), - new PaintingVariant(64, 48), - new PaintingVariant(64, 48) - }; - - public static Position3d fixOffset(final Position position, final int motive, final int direction) { - final PaintingVariant variant = VARIANTS[motive]; - final double offY = variant.height > 1 && variant.height != 3 ? 0.5 : 0; - final double offX; - final double offZ; - final double widthOffset = variant.width > 1 ? 0.5 : 0; - switch (direction) { - case 0: - offX = widthOffset; - offZ = MAGIC_OFFSET; - break; - case 1: - offX = -MAGIC_OFFSET; - offZ = widthOffset; - break; - case 2: - offX = -widthOffset; - offZ = -MAGIC_OFFSET; - break; - case 3: - offX = MAGIC_OFFSET; - offZ = -widthOffset; - break; - default: - throw new IllegalArgumentException("Invalid direction: " + direction); - } - return new Position3d(position.x() + offX + 0.5d, position.y() + offY + 0.5d, position.z() + offZ + 0.5d); - } - - private static final class PaintingVariant { - private final int width; - private final int height; - - private PaintingVariant(final int width, final int height) { - this.width = width / 16; - this.height = height / 16; - } - } -} diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java index 9ec29c5ff..1764a8296 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/EntityRewriter.java @@ -25,6 +25,7 @@ import com.google.common.base.Preconditions; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.ParticleMappings; +import com.viaversion.viaversion.api.data.entity.DimensionData; import com.viaversion.viaversion.api.data.entity.EntityTracker; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.item.Item; @@ -432,6 +433,28 @@ public abstract class EntityRewriter extends RewriterBase }; } + public PacketHandler worldDataTrackerHandlerByKey() { + return wrapper -> { + EntityTracker tracker = tracker(wrapper.user()); + String key = wrapper.get(Type.STRING, 0); + DimensionData dimensionData = tracker.dimensionData(key); + if (dimensionData == null) { + Via.getPlatform().getLogger().severe("Dimension data missing for dimension: " + key + ", falling back to overworld"); + dimensionData = tracker.dimensionData("minecraft:overworld"); + Preconditions.checkNotNull(dimensionData, "Overworld data missing"); + } + + tracker.setCurrentWorldSectionHeight(dimensionData.height() >> 4); + tracker.setCurrentMinY(dimensionData.minY()); + + String world = wrapper.get(Type.STRING, 0); + if (tracker.currentWorld() != null && !tracker.currentWorld().equals(world)) { + tracker.clearEntities(); + } + tracker.setCurrentWorld(world); + }; + } + public PacketHandler biomeSizeTracker() { return wrapper -> { final CompoundTag registry = wrapper.get(Type.NBT, 0); diff --git a/common/src/main/resources/assets/viaversion/data/mapping-1.19.json b/common/src/main/resources/assets/viaversion/data/mapping-1.19.json index 3cd519aa4..c0f995c90 100644 --- a/common/src/main/resources/assets/viaversion/data/mapping-1.19.json +++ b/common/src/main/resources/assets/viaversion/data/mapping-1.19.json @@ -1614,30 +1614,30 @@ "1611": "minecraft:piston[extended=false,facing=west]", "1612": "minecraft:piston[extended=false,facing=up]", "1613": "minecraft:piston[extended=false,facing=down]", - "1614": "minecraft:piston_head[facing=north,short=true,type=normal]", - "1615": "minecraft:piston_head[facing=north,short=true,type=sticky]", - "1616": "minecraft:piston_head[facing=north,short=false,type=normal]", - "1617": "minecraft:piston_head[facing=north,short=false,type=sticky]", - "1618": "minecraft:piston_head[facing=east,short=true,type=normal]", - "1619": "minecraft:piston_head[facing=east,short=true,type=sticky]", - "1620": "minecraft:piston_head[facing=east,short=false,type=normal]", - "1621": "minecraft:piston_head[facing=east,short=false,type=sticky]", - "1622": "minecraft:piston_head[facing=south,short=true,type=normal]", - "1623": "minecraft:piston_head[facing=south,short=true,type=sticky]", - "1624": "minecraft:piston_head[facing=south,short=false,type=normal]", - "1625": "minecraft:piston_head[facing=south,short=false,type=sticky]", - "1626": "minecraft:piston_head[facing=west,short=true,type=normal]", - "1627": "minecraft:piston_head[facing=west,short=true,type=sticky]", - "1628": "minecraft:piston_head[facing=west,short=false,type=normal]", - "1629": "minecraft:piston_head[facing=west,short=false,type=sticky]", - "1630": "minecraft:piston_head[facing=up,short=true,type=normal]", - "1631": "minecraft:piston_head[facing=up,short=true,type=sticky]", - "1632": "minecraft:piston_head[facing=up,short=false,type=normal]", - "1633": "minecraft:piston_head[facing=up,short=false,type=sticky]", - "1634": "minecraft:piston_head[facing=down,short=true,type=normal]", - "1635": "minecraft:piston_head[facing=down,short=true,type=sticky]", - "1636": "minecraft:piston_head[facing=down,short=false,type=normal]", - "1637": "minecraft:piston_head[facing=down,short=false,type=sticky]", + "1614": "minecraft:piston_head[type=normal,facing=north,short=true]", + "1615": "minecraft:piston_head[type=sticky,facing=north,short=true]", + "1616": "minecraft:piston_head[type=normal,facing=north,short=false]", + "1617": "minecraft:piston_head[type=sticky,facing=north,short=false]", + "1618": "minecraft:piston_head[type=normal,facing=east,short=true]", + "1619": "minecraft:piston_head[type=sticky,facing=east,short=true]", + "1620": "minecraft:piston_head[type=normal,facing=east,short=false]", + "1621": "minecraft:piston_head[type=sticky,facing=east,short=false]", + "1622": "minecraft:piston_head[type=normal,facing=south,short=true]", + "1623": "minecraft:piston_head[type=sticky,facing=south,short=true]", + "1624": "minecraft:piston_head[type=normal,facing=south,short=false]", + "1625": "minecraft:piston_head[type=sticky,facing=south,short=false]", + "1626": "minecraft:piston_head[type=normal,facing=west,short=true]", + "1627": "minecraft:piston_head[type=sticky,facing=west,short=true]", + "1628": "minecraft:piston_head[type=normal,facing=west,short=false]", + "1629": "minecraft:piston_head[type=sticky,facing=west,short=false]", + "1630": "minecraft:piston_head[type=normal,facing=up,short=true]", + "1631": "minecraft:piston_head[type=sticky,facing=up,short=true]", + "1632": "minecraft:piston_head[type=normal,facing=up,short=false]", + "1633": "minecraft:piston_head[type=sticky,facing=up,short=false]", + "1634": "minecraft:piston_head[type=normal,facing=down,short=true]", + "1635": "minecraft:piston_head[type=sticky,facing=down,short=true]", + "1636": "minecraft:piston_head[type=normal,facing=down,short=false]", + "1637": "minecraft:piston_head[type=sticky,facing=down,short=false]", "1638": "minecraft:white_wool", "1639": "minecraft:orange_wool", "1640": "minecraft:magenta_wool", @@ -1654,18 +1654,18 @@ "1651": "minecraft:green_wool", "1652": "minecraft:red_wool", "1653": "minecraft:black_wool", - "1654": "minecraft:moving_piston[facing=north,type=normal]", - "1655": "minecraft:moving_piston[facing=north,type=sticky]", - "1656": "minecraft:moving_piston[facing=east,type=normal]", - "1657": "minecraft:moving_piston[facing=east,type=sticky]", - "1658": "minecraft:moving_piston[facing=south,type=normal]", - "1659": "minecraft:moving_piston[facing=south,type=sticky]", - "1660": "minecraft:moving_piston[facing=west,type=normal]", - "1661": "minecraft:moving_piston[facing=west,type=sticky]", - "1662": "minecraft:moving_piston[facing=up,type=normal]", - "1663": "minecraft:moving_piston[facing=up,type=sticky]", - "1664": "minecraft:moving_piston[facing=down,type=normal]", - "1665": "minecraft:moving_piston[facing=down,type=sticky]", + "1654": "minecraft:moving_piston[type=normal,facing=north]", + "1655": "minecraft:moving_piston[type=sticky,facing=north]", + "1656": "minecraft:moving_piston[type=normal,facing=east]", + "1657": "minecraft:moving_piston[type=sticky,facing=east]", + "1658": "minecraft:moving_piston[type=normal,facing=south]", + "1659": "minecraft:moving_piston[type=sticky,facing=south]", + "1660": "minecraft:moving_piston[type=normal,facing=west]", + "1661": "minecraft:moving_piston[type=sticky,facing=west]", + "1662": "minecraft:moving_piston[type=normal,facing=up]", + "1663": "minecraft:moving_piston[type=sticky,facing=up]", + "1664": "minecraft:moving_piston[type=normal,facing=down]", + "1665": "minecraft:moving_piston[type=sticky,facing=down]", "1666": "minecraft:dandelion", "1667": "minecraft:poppy", "1668": "minecraft:blue_orchid", @@ -2288,30 +2288,30 @@ "2285": "minecraft:oak_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false]", "2286": "minecraft:oak_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true]", "2287": "minecraft:oak_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false]", - "2288": "minecraft:chest[facing=north,type=single,waterlogged=true]", - "2289": "minecraft:chest[facing=north,type=single,waterlogged=false]", - "2290": "minecraft:chest[facing=north,type=left,waterlogged=true]", - "2291": "minecraft:chest[facing=north,type=left,waterlogged=false]", - "2292": "minecraft:chest[facing=north,type=right,waterlogged=true]", - "2293": "minecraft:chest[facing=north,type=right,waterlogged=false]", - "2294": "minecraft:chest[facing=south,type=single,waterlogged=true]", - "2295": "minecraft:chest[facing=south,type=single,waterlogged=false]", - "2296": "minecraft:chest[facing=south,type=left,waterlogged=true]", - "2297": "minecraft:chest[facing=south,type=left,waterlogged=false]", - "2298": "minecraft:chest[facing=south,type=right,waterlogged=true]", - "2299": "minecraft:chest[facing=south,type=right,waterlogged=false]", - "2300": "minecraft:chest[facing=west,type=single,waterlogged=true]", - "2301": "minecraft:chest[facing=west,type=single,waterlogged=false]", - "2302": "minecraft:chest[facing=west,type=left,waterlogged=true]", - "2303": "minecraft:chest[facing=west,type=left,waterlogged=false]", - "2304": "minecraft:chest[facing=west,type=right,waterlogged=true]", - "2305": "minecraft:chest[facing=west,type=right,waterlogged=false]", - "2306": "minecraft:chest[facing=east,type=single,waterlogged=true]", - "2307": "minecraft:chest[facing=east,type=single,waterlogged=false]", - "2308": "minecraft:chest[facing=east,type=left,waterlogged=true]", - "2309": "minecraft:chest[facing=east,type=left,waterlogged=false]", - "2310": "minecraft:chest[facing=east,type=right,waterlogged=true]", - "2311": "minecraft:chest[facing=east,type=right,waterlogged=false]", + "2288": "minecraft:chest[type=single,facing=north,waterlogged=true]", + "2289": "minecraft:chest[type=single,facing=north,waterlogged=false]", + "2290": "minecraft:chest[type=left,facing=north,waterlogged=true]", + "2291": "minecraft:chest[type=left,facing=north,waterlogged=false]", + "2292": "minecraft:chest[type=right,facing=north,waterlogged=true]", + "2293": "minecraft:chest[type=right,facing=north,waterlogged=false]", + "2294": "minecraft:chest[type=single,facing=south,waterlogged=true]", + "2295": "minecraft:chest[type=single,facing=south,waterlogged=false]", + "2296": "minecraft:chest[type=left,facing=south,waterlogged=true]", + "2297": "minecraft:chest[type=left,facing=south,waterlogged=false]", + "2298": "minecraft:chest[type=right,facing=south,waterlogged=true]", + "2299": "minecraft:chest[type=right,facing=south,waterlogged=false]", + "2300": "minecraft:chest[type=single,facing=west,waterlogged=true]", + "2301": "minecraft:chest[type=single,facing=west,waterlogged=false]", + "2302": "minecraft:chest[type=left,facing=west,waterlogged=true]", + "2303": "minecraft:chest[type=left,facing=west,waterlogged=false]", + "2304": "minecraft:chest[type=right,facing=west,waterlogged=true]", + "2305": "minecraft:chest[type=right,facing=west,waterlogged=false]", + "2306": "minecraft:chest[type=single,facing=east,waterlogged=true]", + "2307": "minecraft:chest[type=single,facing=east,waterlogged=false]", + "2308": "minecraft:chest[type=left,facing=east,waterlogged=true]", + "2309": "minecraft:chest[type=left,facing=east,waterlogged=false]", + "2310": "minecraft:chest[type=right,facing=east,waterlogged=true]", + "2311": "minecraft:chest[type=right,facing=east,waterlogged=false]", "2312": "minecraft:redstone_wire[east=up,north=up,power=0,south=up,west=up]", "2313": "minecraft:redstone_wire[east=up,north=up,power=0,south=up,west=side]", "2314": "minecraft:redstone_wire[east=up,north=up,power=0,south=up,west=none]", @@ -7239,30 +7239,30 @@ "7236": "minecraft:damaged_anvil[facing=south]", "7237": "minecraft:damaged_anvil[facing=west]", "7238": "minecraft:damaged_anvil[facing=east]", - "7239": "minecraft:trapped_chest[facing=north,type=single,waterlogged=true]", - "7240": "minecraft:trapped_chest[facing=north,type=single,waterlogged=false]", - "7241": "minecraft:trapped_chest[facing=north,type=left,waterlogged=true]", - "7242": "minecraft:trapped_chest[facing=north,type=left,waterlogged=false]", - "7243": "minecraft:trapped_chest[facing=north,type=right,waterlogged=true]", - "7244": "minecraft:trapped_chest[facing=north,type=right,waterlogged=false]", - "7245": "minecraft:trapped_chest[facing=south,type=single,waterlogged=true]", - "7246": "minecraft:trapped_chest[facing=south,type=single,waterlogged=false]", - "7247": "minecraft:trapped_chest[facing=south,type=left,waterlogged=true]", - "7248": "minecraft:trapped_chest[facing=south,type=left,waterlogged=false]", - "7249": "minecraft:trapped_chest[facing=south,type=right,waterlogged=true]", - "7250": "minecraft:trapped_chest[facing=south,type=right,waterlogged=false]", - "7251": "minecraft:trapped_chest[facing=west,type=single,waterlogged=true]", - "7252": "minecraft:trapped_chest[facing=west,type=single,waterlogged=false]", - "7253": "minecraft:trapped_chest[facing=west,type=left,waterlogged=true]", - "7254": "minecraft:trapped_chest[facing=west,type=left,waterlogged=false]", - "7255": "minecraft:trapped_chest[facing=west,type=right,waterlogged=true]", - "7256": "minecraft:trapped_chest[facing=west,type=right,waterlogged=false]", - "7257": "minecraft:trapped_chest[facing=east,type=single,waterlogged=true]", - "7258": "minecraft:trapped_chest[facing=east,type=single,waterlogged=false]", - "7259": "minecraft:trapped_chest[facing=east,type=left,waterlogged=true]", - "7260": "minecraft:trapped_chest[facing=east,type=left,waterlogged=false]", - "7261": "minecraft:trapped_chest[facing=east,type=right,waterlogged=true]", - "7262": "minecraft:trapped_chest[facing=east,type=right,waterlogged=false]", + "7239": "minecraft:trapped_chest[type=single,facing=north,waterlogged=true]", + "7240": "minecraft:trapped_chest[type=single,facing=north,waterlogged=false]", + "7241": "minecraft:trapped_chest[type=left,facing=north,waterlogged=true]", + "7242": "minecraft:trapped_chest[type=left,facing=north,waterlogged=false]", + "7243": "minecraft:trapped_chest[type=right,facing=north,waterlogged=true]", + "7244": "minecraft:trapped_chest[type=right,facing=north,waterlogged=false]", + "7245": "minecraft:trapped_chest[type=single,facing=south,waterlogged=true]", + "7246": "minecraft:trapped_chest[type=single,facing=south,waterlogged=false]", + "7247": "minecraft:trapped_chest[type=left,facing=south,waterlogged=true]", + "7248": "minecraft:trapped_chest[type=left,facing=south,waterlogged=false]", + "7249": "minecraft:trapped_chest[type=right,facing=south,waterlogged=true]", + "7250": "minecraft:trapped_chest[type=right,facing=south,waterlogged=false]", + "7251": "minecraft:trapped_chest[type=single,facing=west,waterlogged=true]", + "7252": "minecraft:trapped_chest[type=single,facing=west,waterlogged=false]", + "7253": "minecraft:trapped_chest[type=left,facing=west,waterlogged=true]", + "7254": "minecraft:trapped_chest[type=left,facing=west,waterlogged=false]", + "7255": "minecraft:trapped_chest[type=right,facing=west,waterlogged=true]", + "7256": "minecraft:trapped_chest[type=right,facing=west,waterlogged=false]", + "7257": "minecraft:trapped_chest[type=single,facing=east,waterlogged=true]", + "7258": "minecraft:trapped_chest[type=single,facing=east,waterlogged=false]", + "7259": "minecraft:trapped_chest[type=left,facing=east,waterlogged=true]", + "7260": "minecraft:trapped_chest[type=left,facing=east,waterlogged=false]", + "7261": "minecraft:trapped_chest[type=right,facing=east,waterlogged=true]", + "7262": "minecraft:trapped_chest[type=right,facing=east,waterlogged=false]", "7263": "minecraft:light_weighted_pressure_plate[power=0]", "7264": "minecraft:light_weighted_pressure_plate[power=1]", "7265": "minecraft:light_weighted_pressure_plate[power=2]", @@ -25040,6 +25040,8 @@ "minecraft:time", "minecraft:resource_or_tag", "minecraft:resource", + "minecraft:template_mirror", + "minecraft:template_rotation", "minecraft:uuid" ], "enchantments": [ diff --git a/common/src/main/resources/assets/viaversion/data/mappingdiff-1.18to1.19.json b/common/src/main/resources/assets/viaversion/data/mappingdiff-1.18to1.19.json index 520503559..69b5c62f4 100644 --- a/common/src/main/resources/assets/viaversion/data/mappingdiff-1.18to1.19.json +++ b/common/src/main/resources/assets/viaversion/data/mappingdiff-1.18to1.19.json @@ -111,6 +111,91 @@ "256": "minecraft:flowering_azalea_leaves[distance=6,persistent=true,waterlogged=false]", "257": "minecraft:flowering_azalea_leaves[distance=6,persistent=false,waterlogged=false]", "258": "minecraft:flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false]", - "259": "minecraft:flowering_azalea_leaves[distance=7,persistent=false,waterlogged=false]" + "259": "minecraft:flowering_azalea_leaves[distance=7,persistent=false,waterlogged=false]", + + "1416": "minecraft:piston_head[type=normal,facing=north,short=true]", + "1417": "minecraft:piston_head[type=sticky,facing=north,short=true]", + "1418": "minecraft:piston_head[type=normal,facing=north,short=false]", + "1419": "minecraft:piston_head[type=sticky,facing=north,short=false]", + "1420": "minecraft:piston_head[type=normal,facing=east,short=true]", + "1421": "minecraft:piston_head[type=sticky,facing=east,short=true]", + "1422": "minecraft:piston_head[type=normal,facing=east,short=false]", + "1423": "minecraft:piston_head[type=sticky,facing=east,short=false]", + "1424": "minecraft:piston_head[type=normal,facing=south,short=true]", + "1425": "minecraft:piston_head[type=sticky,facing=south,short=true]", + "1426": "minecraft:piston_head[type=normal,facing=south,short=false]", + "1427": "minecraft:piston_head[type=sticky,facing=south,short=false]", + "1428": "minecraft:piston_head[type=normal,facing=west,short=true]", + "1429": "minecraft:piston_head[type=sticky,facing=west,short=true]", + "1430": "minecraft:piston_head[type=normal,facing=west,short=false]", + "1431": "minecraft:piston_head[type=sticky,facing=west,short=false]", + "1432": "minecraft:piston_head[type=normal,facing=up,short=true]", + "1433": "minecraft:piston_head[type=sticky,facing=up,short=true]", + "1434": "minecraft:piston_head[type=normal,facing=up,short=false]", + "1435": "minecraft:piston_head[type=sticky,facing=up,short=false]", + "1436": "minecraft:piston_head[type=normal,facing=down,short=true]", + "1437": "minecraft:piston_head[type=sticky,facing=down,short=true]", + "1438": "minecraft:piston_head[type=normal,facing=down,short=false]", + "1439": "minecraft:piston_head[type=sticky,facing=down,short=false]", + "1456": "minecraft:moving_piston[type=normal,facing=north]", + "1457": "minecraft:moving_piston[type=sticky,facing=north]", + "1458": "minecraft:moving_piston[type=normal,facing=east]", + "1459": "minecraft:moving_piston[type=sticky,facing=east]", + "1460": "minecraft:moving_piston[type=normal,facing=south]", + "1461": "minecraft:moving_piston[type=sticky,facing=south]", + "1462": "minecraft:moving_piston[type=normal,facing=west]", + "1463": "minecraft:moving_piston[type=sticky,facing=west]", + "1464": "minecraft:moving_piston[type=normal,facing=up]", + "1465": "minecraft:moving_piston[type=sticky,facing=up]", + "1466": "minecraft:moving_piston[type=normal,facing=down]", + "1467": "minecraft:moving_piston[type=sticky,facing=down]", + "2090": "minecraft:chest[type=single,facing=north,waterlogged=true]", + "2091": "minecraft:chest[type=single,facing=north,waterlogged=false]", + "2092": "minecraft:chest[type=left,facing=north,waterlogged=true]", + "2093": "minecraft:chest[type=left,facing=north,waterlogged=false]", + "2094": "minecraft:chest[type=right,facing=north,waterlogged=true]", + "2095": "minecraft:chest[type=right,facing=north,waterlogged=false]", + "2096": "minecraft:chest[type=single,facing=south,waterlogged=true]", + "2097": "minecraft:chest[type=single,facing=south,waterlogged=false]", + "2098": "minecraft:chest[type=left,facing=south,waterlogged=true]", + "2099": "minecraft:chest[type=left,facing=south,waterlogged=false]", + "2100": "minecraft:chest[type=right,facing=south,waterlogged=true]", + "2101": "minecraft:chest[type=right,facing=south,waterlogged=false]", + "2102": "minecraft:chest[type=single,facing=west,waterlogged=true]", + "2103": "minecraft:chest[type=single,facing=west,waterlogged=false]", + "2104": "minecraft:chest[type=left,facing=west,waterlogged=true]", + "2105": "minecraft:chest[type=left,facing=west,waterlogged=false]", + "2106": "minecraft:chest[type=right,facing=west,waterlogged=true]", + "2107": "minecraft:chest[type=right,facing=west,waterlogged=false]", + "2108": "minecraft:chest[type=single,facing=east,waterlogged=true]", + "2109": "minecraft:chest[type=single,facing=east,waterlogged=false]", + "2110": "minecraft:chest[type=left,facing=east,waterlogged=true]", + "2111": "minecraft:chest[type=left,facing=east,waterlogged=false]", + "2112": "minecraft:chest[type=right,facing=east,waterlogged=true]", + "2113": "minecraft:chest[type=right,facing=east,waterlogged=false]", + "6828": "minecraft:trapped_chest[type=single,facing=north,waterlogged=true]", + "6829": "minecraft:trapped_chest[type=single,facing=north,waterlogged=false]", + "6830": "minecraft:trapped_chest[type=left,facing=north,waterlogged=true]", + "6831": "minecraft:trapped_chest[type=left,facing=north,waterlogged=false]", + "6832": "minecraft:trapped_chest[type=right,facing=north,waterlogged=true]", + "6833": "minecraft:trapped_chest[type=right,facing=north,waterlogged=false]", + "6834": "minecraft:trapped_chest[type=single,facing=south,waterlogged=true]", + "6835": "minecraft:trapped_chest[type=single,facing=south,waterlogged=false]", + "6836": "minecraft:trapped_chest[type=left,facing=south,waterlogged=true]", + "6837": "minecraft:trapped_chest[type=left,facing=south,waterlogged=false]", + "6838": "minecraft:trapped_chest[type=right,facing=south,waterlogged=true]", + "6839": "minecraft:trapped_chest[type=right,facing=south,waterlogged=false]", + "6840": "minecraft:trapped_chest[type=single,facing=west,waterlogged=true]", + "6841": "minecraft:trapped_chest[type=single,facing=west,waterlogged=false]", + "6842": "minecraft:trapped_chest[type=left,facing=west,waterlogged=true]", + "6843": "minecraft:trapped_chest[type=left,facing=west,waterlogged=false]", + "6844": "minecraft:trapped_chest[type=right,facing=west,waterlogged=true]", + "6845": "minecraft:trapped_chest[type=right,facing=west,waterlogged=false]", + "6846": "minecraft:trapped_chest[type=single,facing=east,waterlogged=true]", + "6847": "minecraft:trapped_chest[type=single,facing=east,waterlogged=false]", + "6848": "minecraft:trapped_chest[type=left,facing=east,waterlogged=true]", + "6849": "minecraft:trapped_chest[type=left,facing=east,waterlogged=false]", + "6850": "minecraft:trapped_chest[type=right,facing=east,waterlogged=true]", + "6851": "minecraft:trapped_chest[type=right,facing=east,waterlogged=false]" } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index e7579a659..b3d3b47dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.3.0-22w18a-SNAPSHOT +projectVersion=4.3.0-22w19a-SNAPSHOT # Gradle properties org.gradle.daemon=true