diff --git a/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java b/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java index 0bb12ee15..251df6e81 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java +++ b/api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java @@ -63,7 +63,7 @@ public interface ViaAPI { * @return API version incremented with meaningful API changes */ default int apiVersion() { - return 21; + return 22; } /** diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_10Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_10.java similarity index 99% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_10Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_10.java index 448d00211..8841d5b1c 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_10Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_10.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Optional; // 1.10 Entity / Object ids -public class Entity1_10Types { +public class EntityTypes1_10 { public static EntityType getTypeFromId(int typeID, boolean isObject) { Optional type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_11Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_11.java similarity index 99% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_11Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_11.java index a14475952..c128377b3 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_11Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_11.java @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Optional; // 1.11 Entity / Object ids -public class Entity1_11Types { +public class EntityTypes1_11 { public static EntityType getTypeFromId(int typeID, boolean isObject) { Optional type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_12Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_12.java similarity index 99% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_12Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_12.java index 7ec94306a..162884277 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_12Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_12.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Optional; // 1.12 Entity / Object taken from https://github.com/Matsv/ViaBackwards/blob/master/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java -public class Entity1_12Types { +public class EntityTypes1_12 { public static EntityType getTypeFromId(int typeID, boolean isObject) { Optional type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_13Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_13.java similarity index 99% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_13Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_13.java index bff92e112..345719609 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_13Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_13.java @@ -27,7 +27,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -public class Entity1_13Types { +public class EntityTypes1_13 { public static EntityType getTypeFromId(int typeID, boolean isObject) { Optional type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_14Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_14Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java index d3acf1450..1bdfa8dde 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_14Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_14.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities; import com.viaversion.viaversion.util.EntityTypeUtil; -public enum Entity1_14Types implements EntityType { +public enum EntityTypes1_14 implements EntityType { ENTITY(-1), @@ -204,12 +204,12 @@ public enum Entity1_14Types implements EntityType { private final int id; private final EntityType parent; - Entity1_14Types(int id) { + EntityTypes1_14(int id) { this.id = id; this.parent = null; } - Entity1_14Types(int id, EntityType parent) { + EntityTypes1_14(int id, EntityType parent) { this.id = id; this.parent = parent; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_15Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_15Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java index eacf32ef9..c99b4359e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_15Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_15.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities; import com.viaversion.viaversion.util.EntityTypeUtil; -public enum Entity1_15Types implements EntityType { +public enum EntityTypes1_15 implements EntityType { ENTITY(-1), @@ -206,12 +206,12 @@ public enum Entity1_15Types implements EntityType { private final int id; private final EntityType parent; - Entity1_15Types(int id) { + EntityTypes1_15(int id) { this.id = id; this.parent = null; } - Entity1_15Types(int id, EntityType parent) { + EntityTypes1_15(int id, EntityType parent) { this.id = id; this.parent = parent; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java index ca9fd7b5b..1ddbeaa39 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities; import com.viaversion.viaversion.util.EntityTypeUtil; -public enum Entity1_16Types implements EntityType { +public enum EntityTypes1_16 implements EntityType { ENTITY(-1), @@ -211,12 +211,12 @@ public enum Entity1_16Types implements EntityType { private final int id; private final EntityType parent; - Entity1_16Types(int id) { + EntityTypes1_16(int id) { this.id = id; this.parent = null; } - Entity1_16Types(int id, EntityType parent) { + EntityTypes1_16(int id, EntityType parent) { this.id = id; this.parent = parent; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16_2Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16_2Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java index 3268c8cd1..123447be3 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_16_2Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_16_2.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities; import com.viaversion.viaversion.util.EntityTypeUtil; -public enum Entity1_16_2Types implements EntityType { +public enum EntityTypes1_16_2 implements EntityType { ENTITY(-1), @@ -215,12 +215,12 @@ public enum Entity1_16_2Types implements EntityType { private final int id; private final EntityType parent; - Entity1_16_2Types(int id) { + EntityTypes1_16_2(int id) { this.id = id; this.parent = null; } - Entity1_16_2Types(int id, EntityType parent) { + EntityTypes1_16_2(int id, EntityType parent) { this.id = id; this.parent = parent; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_17Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_17Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java index 6d880ef90..441dc88f6 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_17Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_17.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.entities; import com.viaversion.viaversion.util.EntityTypeUtil; -public enum Entity1_17Types implements EntityType { +public enum EntityTypes1_17 implements EntityType { ENTITY(-1), @@ -220,12 +220,12 @@ public enum Entity1_17Types implements EntityType { private final int id; private final EntityType parent; - Entity1_17Types(int id) { + EntityTypes1_17(int id) { this.id = id; this.parent = null; } - Entity1_17Types(int id, EntityType parent) { + EntityTypes1_17(int id, EntityType parent) { this.id = id; this.parent = parent; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java index dbb0b04a1..f67a547d6 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19.java @@ -28,7 +28,7 @@ import com.viaversion.viaversion.util.EntityTypeUtil; import java.util.Locale; import org.checkerframework.checker.nullness.qual.Nullable; -public enum Entity1_19Types implements EntityType { +public enum EntityTypes1_19 implements EntityType { ENTITY(null, null), @@ -229,12 +229,12 @@ public enum Entity1_19Types implements EntityType { private final String identifier; private int id = -1; - Entity1_19Types(final EntityType parent) { + EntityTypes1_19(final EntityType parent) { this.parent = parent; this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT); } - Entity1_19Types(final EntityType parent, @Nullable final String identifier) { + EntityTypes1_19(final EntityType parent, @Nullable final String identifier) { this.parent = parent; this.identifier = identifier; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_3Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_3Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java index dbdd5f503..7398e6a0c 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_3Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_3.java @@ -28,7 +28,7 @@ import com.viaversion.viaversion.util.EntityTypeUtil; import java.util.Locale; import org.checkerframework.checker.nullness.qual.Nullable; -public enum Entity1_19_3Types implements EntityType { +public enum EntityTypes1_19_3 implements EntityType { ENTITY(null, null), @@ -230,12 +230,12 @@ public enum Entity1_19_3Types implements EntityType { private final String identifier; private int id = -1; - Entity1_19_3Types(final EntityType parent) { + EntityTypes1_19_3(final EntityType parent) { this.parent = parent; this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT); } - Entity1_19_3Types(final EntityType parent, @Nullable final String identifier) { + EntityTypes1_19_3(final EntityType parent, @Nullable final String identifier) { this.parent = parent; this.identifier = identifier; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_4Types.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_4Types.java rename to api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java index bae4afbc6..936311818 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/Entity1_19_4Types.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/entities/EntityTypes1_19_4.java @@ -28,7 +28,7 @@ import com.viaversion.viaversion.util.EntityTypeUtil; import java.util.Locale; import org.checkerframework.checker.nullness.qual.Nullable; -public enum Entity1_19_4Types implements EntityType { +public enum EntityTypes1_19_4 implements EntityType { ENTITY(null, null), @@ -237,12 +237,12 @@ public enum Entity1_19_4Types implements EntityType { private final String identifier; private int id = -1; - Entity1_19_4Types(final EntityType parent) { + EntityTypes1_19_4(final EntityType parent) { this.parent = parent; this.identifier = "minecraft:" + name().toLowerCase(Locale.ROOT); } - Entity1_19_4Types(final EntityType parent, @Nullable final String identifier) { + EntityTypes1_19_4(final EntityType parent, @Nullable final String identifier) { this.parent = parent; this.identifier = identifier; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_12.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_12.java index 00be61c5e..4377b20dd 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_12.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_12.java @@ -31,7 +31,7 @@ public enum MetaType1_12 implements MetaType { Float(2, Type.FLOAT), String(3, Type.STRING), Chat(4, Type.COMPONENT), - Slot(5, Type.ITEM), + Slot(5, Type.ITEM1_8), Boolean(6, Type.BOOLEAN), Vector3F(7, Type.ROTATION), Position(8, Type.POSITION), diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13.java deleted file mode 100644 index 579825bef..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_13; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_13 implements MetaType { - Byte(0, Type.BYTE), - VarInt(1, Type.VAR_INT), - Float(2, Type.FLOAT), - String(3, Type.STRING), - Chat(4, Type.COMPONENT), - OptChat(5, Type.OPTIONAL_COMPONENT), - Slot(6, Type.FLAT_ITEM), - Boolean(7, Type.BOOLEAN), - Vector3F(8, Type.ROTATION), - Position(9, Type.POSITION), - OptPosition(10, Type.OPTIONAL_POSITION), - Direction(11, Type.VAR_INT), - OptUUID(12, Type.OPTIONAL_UUID), - BlockID(13, Type.VAR_INT), - NBTTag(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_13.PARTICLE); - - private final int typeID; - private final Type type; - - MetaType1_13(int typeID, Type type) { - this.typeID = typeID; - this.type = type; - } - - public static MetaType1_13 byId(int id) { - return values()[id]; - } - - @Override - public int typeId() { - return typeID; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13_2.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13_2.java deleted file mode 100644 index 3436053d9..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_13_2.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_13_2; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_13_2 implements MetaType { - Byte(0, Type.BYTE), - VarInt(1, Type.VAR_INT), - Float(2, Type.FLOAT), - String(3, Type.STRING), - Chat(4, Type.COMPONENT), - OptChat(5, Type.OPTIONAL_COMPONENT), - Slot(6, Type.FLAT_VAR_INT_ITEM), - Boolean(7, Type.BOOLEAN), - Vector3F(8, Type.ROTATION), - Position(9, Type.POSITION), - OptPosition(10, Type.OPTIONAL_POSITION), - Direction(11, Type.VAR_INT), - OptUUID(12, Type.OPTIONAL_UUID), - BlockID(13, Type.VAR_INT), - NBTTag(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_13_2.PARTICLE); - - private final int typeID; - private final Type type; - - MetaType1_13_2(int typeID, Type type) { - this.typeID = typeID; - this.type = type; - } - - public static MetaType1_13_2 byId(int id) { - return values()[id]; - } - - @Override - public int typeId() { - return typeID; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_14.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_14.java deleted file mode 100644 index 301956948..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_14.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_14; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_14 implements MetaType { - Byte(0, Type.BYTE), - VarInt(1, Type.VAR_INT), - Float(2, Type.FLOAT), - String(3, Type.STRING), - Chat(4, Type.COMPONENT), - OptChat(5, Type.OPTIONAL_COMPONENT), - Slot(6, Type.FLAT_VAR_INT_ITEM), - Boolean(7, Type.BOOLEAN), - Vector3F(8, Type.ROTATION), - Position(9, Type.POSITION1_14), - OptPosition(10, Type.OPTIONAL_POSITION_1_14), - Direction(11, Type.VAR_INT), - OptUUID(12, Type.OPTIONAL_UUID), - BlockID(13, Type.VAR_INT), - NBTTag(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_14.PARTICLE), - VillagerData(16, Type.VILLAGER_DATA), - OptVarInt(17, Type.OPTIONAL_VAR_INT), - Pose(18, Type.VAR_INT); - - private final int typeID; - private final Type type; - - MetaType1_14(int typeID, Type type) { - this.typeID = typeID; - this.type = type; - } - - public static MetaType1_14 byId(int id) { - return values()[id]; - } - - @Override - public int typeId() { - return typeID; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_16.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_16.java deleted file mode 100644 index 538e2318d..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_16.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_16; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_16 implements MetaType { - BYTE(0, Type.BYTE), - VAR_INT(1, Type.VAR_INT), - FLOAT(2, Type.FLOAT), - STRING(3, Type.STRING), - COMPONENT(4, Type.COMPONENT), - OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT), - ITEM(6, Type.FLAT_VAR_INT_ITEM), - BOOLEAN(7, Type.BOOLEAN), - ROTATION(8, Type.ROTATION), - POSITION(9, Type.POSITION1_14), - OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14), - DIRECTION(11, Type.VAR_INT), - OPT_UUID(12, Type.OPTIONAL_UUID), - BLOCK_STATE(13, Type.VAR_INT), - NBT(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_16.PARTICLE), - VILLAGER_DATA(16, Type.VILLAGER_DATA), - OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT), - POSE(18, Type.VAR_INT); - - private static final MetaType1_16[] VALUES = values(); - private final int typeId; - private final Type type; - - MetaType1_16(int typeId, Type type) { - this.typeId = typeId; - this.type = type; - } - - public static MetaType1_16 byId(int id) { - return VALUES[id]; - } - - @Override - public int typeId() { - return typeId; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_17.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_17.java deleted file mode 100644 index 33c9fb0c1..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_17.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_17; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_17 implements MetaType { - BYTE(0, Type.BYTE), - VAR_INT(1, Type.VAR_INT), - FLOAT(2, Type.FLOAT), - STRING(3, Type.STRING), - COMPONENT(4, Type.COMPONENT), - OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT), - ITEM(6, Type.FLAT_VAR_INT_ITEM), - BOOLEAN(7, Type.BOOLEAN), - ROTATION(8, Type.ROTATION), - POSITION(9, Type.POSITION1_14), - OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14), - DIRECTION(11, Type.VAR_INT), - OPT_UUID(12, Type.OPTIONAL_UUID), - BLOCK_STATE(13, Type.VAR_INT), - NBT(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_17.PARTICLE), - VILLAGER_DATA(16, Type.VILLAGER_DATA), - OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT), - POSE(18, Type.VAR_INT); - - private static final MetaType1_17[] VALUES = values(); - private final int typeId; - private final Type type; - - MetaType1_17(int typeId, Type type) { - this.typeId = typeId; - this.type = type; - } - - public static MetaType1_17 byId(int id) { - return VALUES[id]; - } - - @Override - public int typeId() { - return typeId; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_18.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_18.java deleted file mode 100644 index 37204eca8..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_18.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.minecraft.metadata.types; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.version.Types1_18; - -@Deprecated/*(forRemoval = true)*/ -public enum MetaType1_18 implements MetaType { - BYTE(0, Type.BYTE), - VAR_INT(1, Type.VAR_INT), - FLOAT(2, Type.FLOAT), - STRING(3, Type.STRING), - COMPONENT(4, Type.COMPONENT), - OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT), - ITEM(6, Type.FLAT_VAR_INT_ITEM), - BOOLEAN(7, Type.BOOLEAN), - ROTATION(8, Type.ROTATION), - POSITION(9, Type.POSITION1_14), - OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14), - DIRECTION(11, Type.VAR_INT), - OPT_UUID(12, Type.OPTIONAL_UUID), - BLOCK_STATE(13, Type.VAR_INT), - NBT(14, Type.NAMED_COMPOUND_TAG), - PARTICLE(15, Types1_18.PARTICLE), - VILLAGER_DATA(16, Type.VILLAGER_DATA), - OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT), - POSE(18, Type.VAR_INT); - - private static final MetaType1_18[] VALUES = values(); - private final int typeId; - private final Type type; - - MetaType1_18(int typeId, Type type) { - this.typeId = typeId; - this.type = type; - } - - public static MetaType1_18 byId(int id) { - return VALUES[id]; - } - - @Override - public int typeId() { - return typeId; - } - - @Override - public Type type() { - return type; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_8.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_8.java index 4fcab72f6..bc80165b0 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_8.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_8.java @@ -24,6 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; +import com.viaversion.viaversion.api.type.types.VoidType; public enum MetaType1_8 implements MetaType { Byte(0, Type.BYTE), @@ -31,11 +32,11 @@ public enum MetaType1_8 implements MetaType { Int(2, Type.INT), Float(3, Type.FLOAT), String(4, Type.STRING), - Slot(5, Type.ITEM), + Slot(5, Type.ITEM1_8), Position(6, Type.VECTOR), Rotation(7, Type.ROTATION), @Deprecated - NonExistent(-1, Type.NOTHING); + NonExistent(-1, new VoidType()); private final int typeID; private final Type type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_9.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_9.java index e95560600..0a2b8123e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_9.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaType1_9.java @@ -31,7 +31,7 @@ public enum MetaType1_9 implements MetaType { Float(2, Type.FLOAT), String(3, Type.STRING), Chat(4, Type.COMPONENT), - Slot(5, Type.ITEM), + Slot(5, Type.ITEM1_8), Boolean(6, Type.BOOLEAN), Vector3F(7, Type.ROTATION), Position(8, Type.POSITION), diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13.java index 33e52ae83..86f012cc1 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_13 extends AbstractMetaTypes { @@ -34,7 +34,7 @@ public final class MetaTypes1_13 extends AbstractMetaTypes { public final MetaType stringType = add(3, Type.STRING); public final MetaType componentType = add(4, Type.COMPONENT); public final MetaType optionalComponentType = add(5, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(6, Type.FLAT_ITEM); + public final MetaType itemType = add(6, Type.ITEM1_13); public final MetaType booleanType = add(7, Type.BOOLEAN); public final MetaType rotationType = add(8, Type.ROTATION); public final MetaType positionType = add(9, Type.POSITION); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13_2.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13_2.java index 0b9cc6735..f5e1c5801 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_13_2.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_13_2 extends AbstractMetaTypes { @@ -34,7 +34,7 @@ public final class MetaTypes1_13_2 extends AbstractMetaTypes { public final MetaType stringType = add(3, Type.STRING); public final MetaType componentType = add(4, Type.COMPONENT); public final MetaType optionalComponentType = add(5, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(6, Type.FLAT_VAR_INT_ITEM); + public final MetaType itemType = add(6, Type.ITEM1_13_2); public final MetaType booleanType = add(7, Type.BOOLEAN); public final MetaType rotationType = add(8, Type.ROTATION); public final MetaType positionType = add(9, Type.POSITION); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_14.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_14.java index 0422d072f..6b84c2ae1 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_14.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_14.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_14 extends AbstractMetaTypes { @@ -34,7 +34,7 @@ public final class MetaTypes1_14 extends AbstractMetaTypes { public final MetaType stringType = add(3, Type.STRING); public final MetaType componentType = add(4, Type.COMPONENT); public final MetaType optionalComponentType = add(5, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(6, Type.FLAT_VAR_INT_ITEM); + public final MetaType itemType = add(6, Type.ITEM1_13_2); public final MetaType booleanType = add(7, Type.BOOLEAN); public final MetaType rotationType = add(8, Type.ROTATION); public final MetaType positionType = add(9, Type.POSITION1_14); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19.java index c98c99f15..f3e2e2586 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_19 extends AbstractMetaTypes { @@ -34,7 +34,7 @@ public final class MetaTypes1_19 extends AbstractMetaTypes { public final MetaType stringType = add(3, Type.STRING); public final MetaType componentType = add(4, Type.COMPONENT); public final MetaType optionalComponentType = add(5, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(6, Type.FLAT_VAR_INT_ITEM); + public final MetaType itemType = add(6, Type.ITEM1_13_2); public final MetaType booleanType = add(7, Type.BOOLEAN); public final MetaType rotationType = add(8, Type.ROTATION); public final MetaType positionType = add(9, Type.POSITION1_14); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_3.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_3.java index 1359372f5..f070ca7ea 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_3.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_19_3 extends AbstractMetaTypes { @@ -35,7 +35,7 @@ public final class MetaTypes1_19_3 extends AbstractMetaTypes { public final MetaType stringType = add(4, Type.STRING); public final MetaType componentType = add(5, Type.COMPONENT); public final MetaType optionalComponentType = add(6, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(7, Type.FLAT_VAR_INT_ITEM); + public final MetaType itemType = add(7, Type.ITEM1_13_2); public final MetaType booleanType = add(8, Type.BOOLEAN); public final MetaType rotationType = add(9, Type.ROTATION); public final MetaType positionType = add(10, Type.POSITION1_14); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_4.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_4.java index 1728aefb2..9ebc31215 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_4.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_19_4.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_19_4 extends AbstractMetaTypes { @@ -35,7 +35,7 @@ public final class MetaTypes1_19_4 extends AbstractMetaTypes { public final MetaType stringType = add(4, Type.STRING); public final MetaType componentType = add(5, Type.COMPONENT); public final MetaType optionalComponentType = add(6, Type.OPTIONAL_COMPONENT); - public final MetaType itemType = add(7, Type.FLAT_VAR_INT_ITEM); + public final MetaType itemType = add(7, Type.ITEM1_13_2); public final MetaType booleanType = add(8, Type.BOOLEAN); public final MetaType rotationType = add(9, Type.ROTATION); public final MetaType positionType = add(10, Type.POSITION1_14); diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_2.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_2.java index ce050b320..2d15200ed 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_2.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_20_2 extends AbstractMetaTypes { diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_3.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_3.java index be5276e47..7e5076708 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/metadata/types/MetaTypes1_20_3.java @@ -24,7 +24,7 @@ package com.viaversion.viaversion.api.minecraft.metadata.types; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; public final class MetaTypes1_20_3 extends AbstractMetaTypes { diff --git a/api/src/main/java/com/viaversion/viaversion/api/rewriter/RewriterBase.java b/api/src/main/java/com/viaversion/viaversion/api/rewriter/RewriterBase.java index 1c8794037..f4fd0b2d8 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/rewriter/RewriterBase.java +++ b/api/src/main/java/com/viaversion/viaversion/api/rewriter/RewriterBase.java @@ -27,7 +27,7 @@ import com.viaversion.viaversion.api.protocol.Protocol; public abstract class RewriterBase implements Rewriter { protected final T protocol; - protected RewriterBase(T protocol) { + protected RewriterBase(final T protocol) { this.protocol = protocol; } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/Type.java index 09383642a..40efc04f2 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/Type.java @@ -52,38 +52,36 @@ import com.viaversion.viaversion.api.type.types.RemainingBytesType; import com.viaversion.viaversion.api.type.types.ShortByteArrayType; import com.viaversion.viaversion.api.type.types.ShortType; import com.viaversion.viaversion.api.type.types.StringType; -import com.viaversion.viaversion.api.type.types.UUIDIntArrayType; import com.viaversion.viaversion.api.type.types.UUIDType; import com.viaversion.viaversion.api.type.types.UnsignedByteType; import com.viaversion.viaversion.api.type.types.UnsignedShortType; import com.viaversion.viaversion.api.type.types.VarIntArrayType; import com.viaversion.viaversion.api.type.types.VarIntType; import com.viaversion.viaversion.api.type.types.VarLongType; -import com.viaversion.viaversion.api.type.types.VoidType; -import com.viaversion.viaversion.api.type.types.minecraft.BlockChangeRecordType; -import com.viaversion.viaversion.api.type.types.minecraft.ChunkPositionType; -import com.viaversion.viaversion.api.type.types.minecraft.CompoundTagType; -import com.viaversion.viaversion.api.type.types.minecraft.EulerAngleType; -import com.viaversion.viaversion.api.type.types.minecraft.FlatItemArrayType; -import com.viaversion.viaversion.api.type.types.minecraft.FlatItemType; -import com.viaversion.viaversion.api.type.types.minecraft.FlatVarIntItemArrayType; -import com.viaversion.viaversion.api.type.types.minecraft.FlatVarIntItemType; -import com.viaversion.viaversion.api.type.types.minecraft.GlobalPositionType; -import com.viaversion.viaversion.api.type.types.minecraft.Item1_20_2Type; -import com.viaversion.viaversion.api.type.types.minecraft.ItemArrayType; -import com.viaversion.viaversion.api.type.types.minecraft.ItemType; -import com.viaversion.viaversion.api.type.types.minecraft.NamedCompoundTagType; -import com.viaversion.viaversion.api.type.types.minecraft.OptionalVarIntType; -import com.viaversion.viaversion.api.type.types.minecraft.PlayerMessageSignatureType; -import com.viaversion.viaversion.api.type.types.minecraft.Position1_14Type; -import com.viaversion.viaversion.api.type.types.minecraft.PositionType; -import com.viaversion.viaversion.api.type.types.minecraft.ProfileKeyType; -import com.viaversion.viaversion.api.type.types.minecraft.QuaternionType; -import com.viaversion.viaversion.api.type.types.minecraft.TagType; -import com.viaversion.viaversion.api.type.types.minecraft.VarLongBlockChangeRecordType; -import com.viaversion.viaversion.api.type.types.minecraft.Vector3fType; -import com.viaversion.viaversion.api.type.types.minecraft.VectorType; -import com.viaversion.viaversion.api.type.types.minecraft.VillagerDataType; +import com.viaversion.viaversion.api.type.types.chunk.BlockChangeRecordType; +import com.viaversion.viaversion.api.type.types.math.ChunkPositionType; +import com.viaversion.viaversion.api.type.types.misc.CompoundTagType; +import com.viaversion.viaversion.api.type.types.math.EulerAngleType; +import com.viaversion.viaversion.api.type.types.item.ItemShortArrayType1_13; +import com.viaversion.viaversion.api.type.types.item.ItemType1_13; +import com.viaversion.viaversion.api.type.types.item.ItemShortArrayType1_13_2; +import com.viaversion.viaversion.api.type.types.item.ItemType1_13_2; +import com.viaversion.viaversion.api.type.types.math.GlobalPositionType; +import com.viaversion.viaversion.api.type.types.item.ItemType1_20_2; +import com.viaversion.viaversion.api.type.types.item.ItemShortArrayType1_8; +import com.viaversion.viaversion.api.type.types.item.ItemType1_8; +import com.viaversion.viaversion.api.type.types.misc.NamedCompoundTagType; +import com.viaversion.viaversion.api.type.types.OptionalVarIntType; +import com.viaversion.viaversion.api.type.types.misc.PlayerMessageSignatureType; +import com.viaversion.viaversion.api.type.types.math.PositionType1_14; +import com.viaversion.viaversion.api.type.types.math.PositionType1_8; +import com.viaversion.viaversion.api.type.types.misc.ProfileKeyType; +import com.viaversion.viaversion.api.type.types.math.QuaternionType; +import com.viaversion.viaversion.api.type.types.misc.TagType; +import com.viaversion.viaversion.api.type.types.chunk.VarLongBlockChangeRecordType; +import com.viaversion.viaversion.api.type.types.math.Vector3fType; +import com.viaversion.viaversion.api.type.types.math.VectorType; +import com.viaversion.viaversion.api.type.types.misc.VillagerDataType; import java.util.UUID; /** @@ -124,46 +122,17 @@ public abstract class Type implements ByteBufReader, ByteBufWriter { public static final Type UUID = new UUIDType(); public static final Type OPTIONAL_UUID = new UUIDType.OptionalUUIDType(); public static final Type UUID_ARRAY = new ArrayType<>(Type.UUID); - @Deprecated/*(forRemoval = true)*/ - public static final Type UUID_INT_ARRAY = new UUIDIntArrayType(); public static final VarIntType VAR_INT = new VarIntType(); public static final OptionalVarIntType OPTIONAL_VAR_INT = new OptionalVarIntType(); public static final Type VAR_INT_ARRAY_PRIMITIVE = new VarIntArrayType(); public static final VarLongType VAR_LONG = new VarLongType(); - /* Boxed number array types */ - @Deprecated - public static final Type BYTE_ARRAY = new ArrayType<>(Type.BYTE); - @Deprecated - public static final Type UNSIGNED_BYTE_ARRAY = new ArrayType<>(Type.UNSIGNED_BYTE); - @Deprecated - public static final Type BOOLEAN_ARRAY = new ArrayType<>(Type.BOOLEAN); - @Deprecated - public static final Type INT_ARRAY = new ArrayType<>(Type.INT); - @Deprecated - public static final Type SHORT_ARRAY = new ArrayType<>(Type.SHORT); - @Deprecated - public static final Type UNSIGNED_SHORT_ARRAY = new ArrayType<>(Type.UNSIGNED_SHORT); - @Deprecated - public static final Type DOUBLE_ARRAY = new ArrayType<>(Type.DOUBLE); - @Deprecated - public static final Type LONG_ARRAY = new ArrayType<>(Type.LONG); - @Deprecated - public static final Type FLOAT_ARRAY = new ArrayType<>(Type.FLOAT); - @Deprecated - public static final Type VAR_INT_ARRAY = new ArrayType<>(Type.VAR_INT); - @Deprecated - public static final Type VAR_LONG_ARRAY = new ArrayType<>(Type.VAR_LONG); - - /* Special Types */ - public static final VoidType NOTHING = new VoidType(); // This is purely used for remapping. - /* MC Types */ - public static final Type POSITION = new PositionType(); - public static final Type OPTIONAL_POSITION = new PositionType.OptionalPositionType(); - public static final Type POSITION1_14 = new Position1_14Type(); - public static final Type OPTIONAL_POSITION_1_14 = new Position1_14Type.OptionalPosition1_14Type(); + public static final Type POSITION = new PositionType1_8(); + public static final Type OPTIONAL_POSITION = new PositionType1_8.OptionalPositionType(); + public static final Type POSITION1_14 = new PositionType1_14(); + public static final Type OPTIONAL_POSITION_1_14 = new PositionType1_14.OptionalPosition1_14Type(); public static final Type ROTATION = new EulerAngleType(); public static final Type VECTOR = new VectorType(); public static final Type VECTOR3F = new Vector3fType(); @@ -192,9 +161,6 @@ public abstract class Type implements ByteBufReader, ByteBufWriter { public static final Type VILLAGER_DATA = new VillagerDataType(); - public static final Type ITEM = new ItemType(); - public static final Type ITEM_ARRAY = new ItemArrayType(); - public static final Type PROFILE_KEY = new ProfileKeyType(); public static final Type OPTIONAL_PROFILE_KEY = new ProfileKeyType.OptionalProfileKeyType(); @@ -206,16 +172,30 @@ public abstract class Type implements ByteBufReader, ByteBufWriter { public static final ByteArrayType SIGNATURE_BYTES = new ByteArrayType(256); public static final ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES = new ByteArrayType.OptionalByteArrayType(256); - /* 1.13 Flat Item (no data) */ - public static final Type FLAT_ITEM = new FlatItemType(); - public static final Type FLAT_VAR_INT_ITEM = new FlatVarIntItemType(); - public static final Type FLAT_ITEM_ARRAY = new FlatItemArrayType(); - public static final Type FLAT_VAR_INT_ITEM_ARRAY = new FlatVarIntItemArrayType(); - public static final Type FLAT_ITEM_ARRAY_VAR_INT = new ArrayType<>(FLAT_ITEM); - public static final Type FLAT_VAR_INT_ITEM_ARRAY_VAR_INT = new ArrayType<>(FLAT_VAR_INT_ITEM); - - public static final Type ITEM1_20_2 = new Item1_20_2Type(); - public static final Type ITEM1_20_2_VAR_INT_ARRAY = new ArrayType<>(ITEM1_20_2); + public static final Type ITEM1_8 = new ItemType1_8(); + public static final Type ITEM1_13 = new ItemType1_13(); + public static final Type ITEM1_13_2 = new ItemType1_13_2(); + public static final Type ITEM1_20_2 = new ItemType1_20_2(); + public static final Type ITEM1_13_SHORT_ARRAY = new ItemShortArrayType1_13(); + public static final Type ITEM1_13_2_SHORT_ARRAY = new ItemShortArrayType1_13_2(); + public static final Type ITEM1_8_ARRAY = new ItemShortArrayType1_8(); + public static final Type ITEM1_13_ARRAY = new ArrayType<>(ITEM1_13); + public static final Type ITEM1_13_2_ARRAY = new ArrayType<>(ITEM1_13_2); + public static final Type ITEM1_20_2_ARRAY = new ArrayType<>(ITEM1_20_2); + @Deprecated/*(forRemoval=true)*/ + public static final Type ITEM = ITEM1_8; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_ITEM = ITEM1_13; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_VAR_INT_ITEM = ITEM1_13_2; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_ITEM_ARRAY = ITEM1_13_SHORT_ARRAY; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_VAR_INT_ITEM_ARRAY = ITEM1_13_2_SHORT_ARRAY; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_ITEM_ARRAY_VAR_INT = ITEM1_13_ARRAY; + @Deprecated/*(forRemoval=true)*/ + public static final Type FLAT_VAR_INT_ITEM_ARRAY_VAR_INT = ITEM1_13_2_ARRAY; /* Actual Class */ private final Class outputClass; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalVarIntType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/OptionalVarIntType.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalVarIntType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/OptionalVarIntType.java index a65d8362b..a143aa318 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OptionalVarIntType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/OptionalVarIntType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/VoidType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/VoidType.java index 991bc4be3..f126ad94e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/VoidType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/VoidType.java @@ -26,6 +26,7 @@ import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.TypeConverter; import io.netty.buffer.ByteBuf; +@Deprecated public class VoidType extends Type implements TypeConverter { public VoidType() { super(Void.class); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkBulkType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkBulkType.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkBulkType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkBulkType.java index d3d90b4f8..0e32bd3a5 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkBulkType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkBulkType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkType.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkType.java index f5c3f6710..27377743e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BaseChunkType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BlockChangeRecordType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockChangeRecordType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BlockChangeRecordType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockChangeRecordType.java index e299a6d79..5cc9e633c 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BlockChangeRecordType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockChangeRecordType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.BlockChangeRecord; import com.viaversion.viaversion.api.minecraft.BlockChangeRecord1_8; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_18.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_18.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_18.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_18.java index 53a90841d..c73c09b81 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_18.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_18.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_20_2.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_20_2.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_20_2.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_20_2.java index 30f30f802..5f946e198 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/BlockEntityType1_20_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/BlockEntityType1_20_2.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_13.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_13.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_13.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_13.java index 688bbd469..99933ab60 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_13.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_13.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_16.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_16.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_16.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_16.java index c78a6d5ed..1ea4be9fe 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_16.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_16.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_18.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_18.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_18.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_18.java index 6c54df642..80a99a9bf 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_18.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_18.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_8.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_8.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_8.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_8.java index f7076254d..1f6765f97 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_8.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_8.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_9.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_9.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_9.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_9.java index 3799bdfcb..6e9231c89 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/ChunkSectionType1_9.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/ChunkSectionType1_9.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/PaletteType1_18.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/PaletteType1_18.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/PaletteType1_18.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/PaletteType1_18.java index b206e5c33..47ca60eff 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/PaletteType1_18.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/PaletteType1_18.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.chunks.DataPalette; import com.viaversion.viaversion.api.minecraft.chunks.DataPaletteImpl; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VarLongBlockChangeRecordType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/VarLongBlockChangeRecordType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VarLongBlockChangeRecordType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/VarLongBlockChangeRecordType.java index 4ebc22cb5..ab76f36b5 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VarLongBlockChangeRecordType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/chunk/VarLongBlockChangeRecordType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.chunk; import com.viaversion.viaversion.api.minecraft.BlockChangeRecord; import com.viaversion.viaversion.api.minecraft.BlockChangeRecord1_16_2; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemArrayType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemArrayType.java similarity index 92% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemArrayType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemArrayType.java index a44bd823e..faeddddc1 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemArrayType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemArrayType.java @@ -20,12 +20,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.type.Type; -public abstract class BaseItemArrayType extends Type { +abstract class BaseItemArrayType extends Type { protected BaseItemArrayType() { super(Item[].class); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemType.java similarity index 93% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemType.java index efbc7037e..ac98d151e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseItemType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/BaseItemType.java @@ -20,12 +20,12 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.type.Type; -public abstract class BaseItemType extends Type { +abstract class BaseItemType extends Type { protected BaseItemType() { super(Item.class); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemArrayType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13.java similarity index 87% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemArrayType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13.java index da3cd6cc9..b0107ca40 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemArrayType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13.java @@ -20,15 +20,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; -public class FlatItemArrayType extends BaseItemArrayType { +public class ItemShortArrayType1_13 extends BaseItemArrayType { - public FlatItemArrayType() { + public ItemShortArrayType1_13() { super("Flat Item Array"); } @@ -37,7 +37,7 @@ public class FlatItemArrayType extends BaseItemArrayType { int amount = Type.SHORT.readPrimitive(buffer); Item[] array = new Item[amount]; for (int i = 0; i < amount; i++) { - array[i] = Type.FLAT_ITEM.read(buffer); + array[i] = Type.ITEM1_13.read(buffer); } return array; } @@ -46,7 +46,7 @@ public class FlatItemArrayType extends BaseItemArrayType { public void write(ByteBuf buffer, Item[] object) throws Exception { Type.SHORT.writePrimitive(buffer, (short) object.length); for (Item o : object) { - Type.FLAT_ITEM.write(buffer, o); + Type.ITEM1_13.write(buffer, o); } } } \ No newline at end of file diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemArrayType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13_2.java similarity index 86% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemArrayType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13_2.java index 6b67fd9d1..1508a63fe 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemArrayType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_13_2.java @@ -20,14 +20,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.Item; import io.netty.buffer.ByteBuf; -public class FlatVarIntItemArrayType extends BaseItemArrayType { +public class ItemShortArrayType1_13_2 extends BaseItemArrayType { - public FlatVarIntItemArrayType() { + public ItemShortArrayType1_13_2() { super("Flat Item Array"); } @@ -36,7 +36,7 @@ public class FlatVarIntItemArrayType extends BaseItemArrayType { int amount = SHORT.readPrimitive(buffer); Item[] array = new Item[amount]; for (int i = 0; i < amount; i++) { - array[i] = FLAT_VAR_INT_ITEM.read(buffer); + array[i] = ITEM1_13_2.read(buffer); } return array; } @@ -45,7 +45,7 @@ public class FlatVarIntItemArrayType extends BaseItemArrayType { public void write(ByteBuf buffer, Item[] object) throws Exception { SHORT.writePrimitive(buffer, (short) object.length); for (Item o : object) { - FLAT_VAR_INT_ITEM.write(buffer, o); + ITEM1_13_2.write(buffer, o); } } } \ No newline at end of file diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemArrayType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_8.java similarity index 88% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemArrayType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_8.java index 094bea0a8..be35a5f27 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemArrayType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemShortArrayType1_8.java @@ -20,14 +20,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.Item; import io.netty.buffer.ByteBuf; -public class ItemArrayType extends BaseItemArrayType { +public class ItemShortArrayType1_8 extends BaseItemArrayType { - public ItemArrayType() { + public ItemShortArrayType1_8() { super("Item Array"); } @@ -36,7 +36,7 @@ public class ItemArrayType extends BaseItemArrayType { int amount = SHORT.readPrimitive(buffer); Item[] array = new Item[amount]; for (int i = 0; i < amount; i++) { - array[i] = ITEM.read(buffer); + array[i] = ITEM1_8.read(buffer); } return array; } @@ -45,7 +45,7 @@ public class ItemArrayType extends BaseItemArrayType { public void write(ByteBuf buffer, Item[] object) throws Exception { SHORT.writePrimitive(buffer, (short) object.length); for (Item o : object) { - ITEM.write(buffer, o); + ITEM1_8.write(buffer, o); } } } \ No newline at end of file diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13.java similarity index 94% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13.java index 471e7a6c5..725014ebf 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatItemType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; @@ -28,8 +28,8 @@ import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; import org.checkerframework.checker.nullness.qual.Nullable; -public class FlatItemType extends BaseItemType { - public FlatItemType() { +public class ItemType1_13 extends BaseItemType { + public ItemType1_13() { super("FlatItem"); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13_2.java similarity index 93% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13_2.java index d66bf7815..87542e662 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/FlatVarIntItemType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_13_2.java @@ -20,15 +20,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import io.netty.buffer.ByteBuf; import org.checkerframework.checker.nullness.qual.Nullable; -public class FlatVarIntItemType extends BaseItemType { - public FlatVarIntItemType() { +public class ItemType1_13_2 extends BaseItemType { + public ItemType1_13_2() { super("FlatVarIntItem"); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Item1_20_2Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_20_2.java similarity index 92% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Item1_20_2Type.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_20_2.java index 5b990926f..9af635745 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Item1_20_2Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_20_2.java @@ -20,17 +20,17 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import io.netty.buffer.ByteBuf; import org.checkerframework.checker.nullness.qual.Nullable; -public class Item1_20_2Type extends BaseItemType { +public class ItemType1_20_2 extends BaseItemType { - public Item1_20_2Type() { - super("Item1_20_2Type"); + public ItemType1_20_2() { + super("ItemType1_20_2"); } @Override diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_8.java similarity index 94% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_8.java index d9dbd1607..066ca32d4 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ItemType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/item/ItemType1_8.java @@ -20,16 +20,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.item; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import io.netty.buffer.ByteBuf; import org.checkerframework.checker.nullness.qual.Nullable; -public class ItemType extends BaseItemType { +public class ItemType1_8 extends BaseItemType { - public ItemType() { + public ItemType1_8() { super("Item"); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ChunkPositionType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/ChunkPositionType.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ChunkPositionType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/ChunkPositionType.java index bf5434fea..a30710a1f 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ChunkPositionType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/ChunkPositionType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.metadata.ChunkPosition; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/EulerAngleType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/EulerAngleType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/EulerAngleType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/EulerAngleType.java index 052aaf302..45c1c0c24 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/EulerAngleType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/EulerAngleType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.EulerAngle; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/GlobalPositionType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/GlobalPositionType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/GlobalPositionType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/GlobalPositionType.java index f0dbf8a7a..4434aeadd 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/GlobalPositionType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/GlobalPositionType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.GlobalPosition; import com.viaversion.viaversion.api.type.OptionalType; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Position1_14Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_14.java similarity index 92% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Position1_14Type.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_14.java index cfec06c82..5e890e3cf 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Position1_14Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_14.java @@ -20,15 +20,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.Position; import com.viaversion.viaversion.api.type.OptionalType; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; -public class Position1_14Type extends Type { - public Position1_14Type() { +public class PositionType1_14 extends Type { + public PositionType1_14() { super(Position.class); } @@ -52,7 +52,7 @@ public class Position1_14Type extends Type { @Override public Class getBaseClass() { - return PositionType.class; + return PositionType1_8.class; } public static final class OptionalPosition1_14Type extends OptionalType { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PositionType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_8.java similarity index 93% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PositionType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_8.java index ace052781..05307aef7 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PositionType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/PositionType1_8.java @@ -20,16 +20,16 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.Position; import com.viaversion.viaversion.api.type.OptionalType; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; -public class PositionType extends Type { +public class PositionType1_8 extends Type { - public PositionType() { + public PositionType1_8() { super(Position.class); } diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/QuaternionType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/QuaternionType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/QuaternionType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/QuaternionType.java index 1b9a1f80b..5fa191767 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/QuaternionType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/QuaternionType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.Quaternion; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Vector3fType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/Vector3fType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Vector3fType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/Vector3fType.java index 4563beed1..5e7c5c56f 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Vector3fType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/Vector3fType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.Vector3f; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VectorType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/VectorType.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VectorType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/math/VectorType.java index 9514d9549..c5a70d32a 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VectorType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/math/VectorType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.math; import com.viaversion.viaversion.api.minecraft.Vector; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListType.java index ca37fe849..3419bd74e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.metadata; import com.google.common.base.Preconditions; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListTypeTemplate.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListTypeTemplate.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListTypeTemplate.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListTypeTemplate.java index 8da8a8b82..f0ee4f03d 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaListTypeTemplate.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaListTypeTemplate.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaTypeTemplate.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaTypeTemplate.java similarity index 96% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaTypeTemplate.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaTypeTemplate.java index dcf19f8af..adf51ba82 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/MetaTypeTemplate.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetaTypeTemplate.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/MetadataType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType.java similarity index 92% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/MetadataType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType.java index 420f9e096..35adb66cb 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/MetadataType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType.java @@ -20,11 +20,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; +import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType; public final class MetadataType extends ModernMetaType { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_12Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_12.java similarity index 88% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_12Type.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_12.java index 844685788..94074ff87 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_12Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_12.java @@ -20,13 +20,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_12; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; +import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType; -public class Metadata1_12Type extends ModernMetaType { +public class MetadataType1_12 extends ModernMetaType { @Override protected MetaType getType(final int index) { return MetaType1_12.byId(index); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_8Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_8.java similarity index 89% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_8Type.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_8.java index a41bd3c44..07afdfcb0 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_8Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_8.java @@ -20,14 +20,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_8; -import com.viaversion.viaversion.api.type.types.minecraft.OldMetaType; +import com.viaversion.viaversion.api.type.types.metadata.OldMetaType; -public class Metadata1_8Type extends OldMetaType { +public class MetadataType1_8 extends OldMetaType { @Override protected MetaType getType(int index) { return MetaType1_8.byId(index); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_9Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_9.java similarity index 88% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_9Type.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_9.java index c244ce726..c3a7cbb48 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_9Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/MetadataType1_9.java @@ -20,13 +20,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.version; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_9; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; +import com.viaversion.viaversion.api.type.types.metadata.ModernMetaType; -public class Metadata1_9Type extends ModernMetaType { +public class MetadataType1_9 extends ModernMetaType { @Override protected MetaType getType(final int index) { return MetaType1_9.byId(index); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ModernMetaType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/ModernMetaType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ModernMetaType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/ModernMetaType.java index 61784167f..d94146342 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ModernMetaType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/ModernMetaType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OldMetaType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/OldMetaType.java similarity index 94% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OldMetaType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/OldMetaType.java index 04ff695ea..2cb914258 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/OldMetaType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/metadata/OldMetaType.java @@ -20,10 +20,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.metadata; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; +import com.viaversion.viaversion.api.type.types.metadata.MetaTypeTemplate; import io.netty.buffer.ByteBuf; public abstract class OldMetaType extends MetaTypeTemplate { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/AbstractParticleType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/AbstractParticleType.java deleted file mode 100644 index dc2842905..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/AbstractParticleType.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.minecraft.Position; -import com.viaversion.viaversion.api.minecraft.item.Item; -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; -import io.netty.buffer.ByteBuf; -import it.unimi.dsi.fastutil.ints.Int2ObjectMap; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; - -@Deprecated/*(forRemoval = true)*/ -public abstract class AbstractParticleType extends Type { - - protected final Int2ObjectMap readers = new Int2ObjectOpenHashMap<>(); - - protected AbstractParticleType() { - super("Particle", Particle.class); - } - - @Override - public void write(ByteBuf buffer, Particle object) throws Exception { - Type.VAR_INT.writePrimitive(buffer, object.getId()); - for (Particle.ParticleData data : object.getArguments()) { - data.getType().write(buffer, data.getValue()); - } - } - - @Override - public Particle read(ByteBuf buffer) throws Exception { - int type = Type.VAR_INT.readPrimitive(buffer); - Particle particle = new Particle(type); - - ParticleReader reader = readers.get(type); - if (reader != null) { - reader.read(buffer, particle); - } - return particle; - } - - protected ParticleReader blockHandler() { - return (buf, particle) -> { - particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, Type.VAR_INT.readPrimitive(buf))); // Flat Block - }; - } - - protected ParticleReader itemHandler(Type itemType) { - return (buf, particle) -> { - particle.getArguments().add(new Particle.ParticleData(itemType, itemType.read(buf))); // Flat item; - }; - } - - protected ParticleReader dustHandler() { - return (buf, particle) -> { - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Red 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Green 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Blue 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Scale 0.01 - 4 - }; - } - - protected ParticleReader dustTransitionHandler() { - return (buf, particle) -> { - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Red 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Green 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Blue 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Scale 0.01 - 4 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Red - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Green - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buf))); // Blue - }; - } - - protected ParticleReader vibrationHandler(Type positionType) { - return (buf, particle) -> { - particle.getArguments().add(new Particle.ParticleData(positionType, positionType.read(buf))); // From block pos - String resourceLocation = Type.STRING.read(buf); - if (resourceLocation.equals("block")) { - particle.getArguments().add(new Particle.ParticleData(positionType, positionType.read(buf))); // Target block pos - } else if (resourceLocation.equals("entity")) { - particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, Type.VAR_INT.readPrimitive(buf))); // Target entity - } else { - Via.getPlatform().getLogger().warning("Unknown vibration path position source type: " + resourceLocation); - } - particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, Type.VAR_INT.readPrimitive(buf))); // Arrival in ticks - }; - } - - @FunctionalInterface - public interface ParticleReader { - - void read(ByteBuf buf, Particle particle) throws Exception; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13Type.java deleted file mode 100644 index 121763a61..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13Type.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_13Type extends AbstractParticleType { - - public Particle1_13Type() { - readers.put(3, blockHandler()); - readers.put(20, blockHandler()); - readers.put(11, dustHandler()); - readers.put(27, itemHandler(Type.FLAT_ITEM)); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13_2Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13_2Type.java deleted file mode 100644 index 0ee5e30d9..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_13_2Type.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.Particle; -import io.netty.buffer.ByteBuf; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_13_2Type extends Type { - - public Particle1_13_2Type() { - super("Particle", Particle.class); - } - - @Override - public void write(ByteBuf buffer, Particle object) throws Exception { - Type.VAR_INT.writePrimitive(buffer, object.getId()); - for (Particle.ParticleData data : object.getArguments()) - data.getType().write(buffer, data.getValue()); - } - - @Override - public Particle read(ByteBuf buffer) throws Exception { - int type = Type.VAR_INT.readPrimitive(buffer); - Particle particle = new Particle(type); - - switch (type) { - // Block / Falling Dust / - case 3: - case 20: - particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, Type.VAR_INT.readPrimitive(buffer))); // Flat Block - break; - // Dust - case 11: - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buffer))); // Red 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buffer))); // Green 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buffer))); // Blue 0 - 1 - particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.readPrimitive(buffer)));// Scale 0.01 - 4 - break; - // Item - case 27: - particle.getArguments().add(new Particle.ParticleData(Type.FLAT_VAR_INT_ITEM, Type.FLAT_VAR_INT_ITEM.read(buffer))); // Flat item - break; - } - return particle; - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_14Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_14Type.java deleted file mode 100644 index e30323404..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_14Type.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_14Type extends AbstractParticleType { - - public Particle1_14Type() { - readers.put(3, blockHandler()); - readers.put(23, blockHandler()); - readers.put(14, dustHandler()); - readers.put(32, itemHandler(Type.FLAT_VAR_INT_ITEM)); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_16Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_16Type.java deleted file mode 100644 index d78c179a6..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_16Type.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_16Type extends AbstractParticleType { - - public Particle1_16Type() { - readers.put(3, blockHandler()); - readers.put(23, blockHandler()); - readers.put(14, dustHandler()); - readers.put(34, itemHandler(Type.FLAT_VAR_INT_ITEM)); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_17Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_17Type.java deleted file mode 100644 index 777cb7fd0..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_17Type.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_17Type extends AbstractParticleType { - - public Particle1_17Type() { - readers.put(4, blockHandler()); - readers.put(25, blockHandler()); - readers.put(15, dustHandler()); - readers.put(16, dustTransitionHandler()); - readers.put(36, itemHandler(Type.FLAT_VAR_INT_ITEM)); - readers.put(37, vibrationHandler(Type.POSITION1_14)); - } -} - diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_18Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_18Type.java deleted file mode 100644 index 07beea674..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/Particle1_18Type.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.minecraft; - -import com.viaversion.viaversion.api.type.Type; - -@Deprecated/*(forRemoval = true)*/ -public class Particle1_18Type extends AbstractParticleType { - - public Particle1_18Type() { - readers.put(2, blockHandler()); - readers.put(3, blockHandler()); - readers.put(24, blockHandler()); - readers.put(14, dustHandler()); - readers.put(15, dustTransitionHandler()); - readers.put(35, itemHandler(Type.FLAT_VAR_INT_ITEM)); - readers.put(36, vibrationHandler(Type.POSITION1_14)); - } -} - diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/CompoundTagType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/CompoundTagType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/CompoundTagType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/CompoundTagType.java index b46877b72..c20f7621e 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/CompoundTagType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/CompoundTagType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.api.type.OptionalType; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/NamedCompoundTagType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/NamedCompoundTagType.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/NamedCompoundTagType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/NamedCompoundTagType.java index 19b0c8ca5..15dd03c27 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/NamedCompoundTagType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/NamedCompoundTagType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.Tag; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ParticleType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ParticleType.java similarity index 98% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ParticleType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ParticleType.java index 26e6bce3b..3d1ac1227 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ParticleType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ParticleType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.data.ParticleMappings; @@ -83,8 +83,8 @@ public class ParticleType extends Type { public static final ParticleReader BLOCK = (buf, particle) -> { particle.add(Type.VAR_INT, Type.VAR_INT.readPrimitive(buf)); // Flat Block }; - public static final ParticleReader ITEM = itemHandler(Type.FLAT_ITEM); - public static final ParticleReader VAR_INT_ITEM = itemHandler(Type.FLAT_VAR_INT_ITEM); + public static final ParticleReader ITEM = itemHandler(Type.ITEM1_13); + public static final ParticleReader VAR_INT_ITEM = itemHandler(Type.ITEM1_13_2); public static final ParticleReader DUST = (buf, particle) -> { particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Red 0-1 particle.add(Type.FLOAT, Type.FLOAT.readPrimitive(buf)); // Green 0-1 diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PlayerMessageSignatureType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/PlayerMessageSignatureType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PlayerMessageSignatureType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/PlayerMessageSignatureType.java index f1ad45e7d..afdd7b265 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/PlayerMessageSignatureType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/PlayerMessageSignatureType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature; import com.viaversion.viaversion.api.type.OptionalType; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ProfileKeyType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ProfileKeyType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ProfileKeyType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ProfileKeyType.java index 2ab75e93c..4daf08002 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/ProfileKeyType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/ProfileKeyType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.viaversion.viaversion.api.minecraft.ProfileKey; import com.viaversion.viaversion.api.type.OptionalType; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/TagType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/TagType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/TagType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/TagType.java index 5470d8ac8..47d9d038d 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/TagType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/TagType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.github.steveice10.opennbt.tag.TagRegistry; import com.github.steveice10.opennbt.tag.builtin.Tag; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VillagerDataType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/VillagerDataType.java similarity index 97% rename from api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VillagerDataType.java rename to api/src/main/java/com/viaversion/viaversion/api/type/types/misc/VillagerDataType.java index 4e1b75017..7ba0632ee 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/VillagerDataType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/misc/VillagerDataType.java @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -package com.viaversion.viaversion.api.type.types.minecraft; +package com.viaversion.viaversion.api.type.types.misc; import com.viaversion.viaversion.api.minecraft.VillagerData; import com.viaversion.viaversion.api.type.Type; diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13Type.java deleted file mode 100644 index 13db5a0b1..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13Type.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_13Type extends ModernMetaType { - @Override - protected MetaType getType(final int index) { - return Types1_13.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13_2Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13_2Type.java deleted file mode 100644 index 221119c7b..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_13_2Type.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_13_2Type extends ModernMetaType { - @Override - protected MetaType getType(final int index) { - return Types1_13_2.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_14Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_14Type.java deleted file mode 100644 index 3f6bb0288..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_14Type.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_14Type extends ModernMetaType { - @Override - protected MetaType getType(final int index) { - return Types1_14.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_16Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_16Type.java deleted file mode 100644 index 9b2856933..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_16Type.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_16Type extends ModernMetaType { - - @Override - protected MetaType getType(final int index) { - return Types1_16.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_17Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_17Type.java deleted file mode 100644 index 58e152a2f..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_17Type.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_17Type extends ModernMetaType { - - @Override - protected MetaType getType(final int index) { - return Types1_17.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_18Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_18Type.java deleted file mode 100644 index 296357ef4..000000000 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Metadata1_18Type.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion - * Copyright (C) 2016-2023 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.type.types.version; - -import com.viaversion.viaversion.api.minecraft.metadata.MetaType; -import com.viaversion.viaversion.api.type.types.minecraft.ModernMetaType; - -@Deprecated/*(forRemoval = true)*/ -public class Metadata1_18Type extends ModernMetaType { - - @Override - protected MetaType getType(final int index) { - return Types1_18.META_TYPES.byId(index); - } -} diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_12.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_12.java index 52b92d78f..6f7c63172 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_12.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_12.java @@ -24,15 +24,16 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_12; import java.util.List; -public class Types1_12 { +public final class Types1_12 { /** * Metadata type for 1.12 */ - public static final Type METADATA = new Metadata1_12Type(); + public static final Type METADATA = new MetadataType1_12(); /** * Metadata list type for 1.12 */ diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13.java index 923f7a567..bdb9e43a6 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13.java @@ -26,8 +26,10 @@ import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_13; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_13; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_13 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13_2.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13_2.java index 3afd75f8a..d9e4a27d1 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_13_2.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_13_2; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_13_2 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_14.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_14.java index 8ba427db0..312005832 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_14.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_14.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_14 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_16.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_16.java index 5ee171f59..12bfbf359 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_16.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_16.java @@ -26,8 +26,10 @@ import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_16; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_16 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_17.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_17.java index 05bc1da03..62435bcf8 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_17.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_17.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_17 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_18.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_18.java index c71c3f579..32bef5325 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_18.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_18.java @@ -26,8 +26,10 @@ import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_14; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.chunk.BlockEntityType1_18; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_18 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19.java index 334d56194..798fd6f42 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_19; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_19 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_3.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_3.java index eb1881f91..c9ccdf859 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_3.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_19_3; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_19_3 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_4.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_4.java index 31803e79e..1c09ec7f2 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_4.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_19_4.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_19_4; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_19_4 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20.java index d6c758735..fab3b3ffe 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_19_4; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_20 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_2.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_2.java index f572c7e48..167e89787 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_2.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_2.java @@ -26,8 +26,10 @@ import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_20_2; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.chunk.BlockEntityType1_20_2; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_20_2 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_3.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_3.java index 6d2e097b5..4c8e49bb8 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_3.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_20_3.java @@ -25,8 +25,9 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.minecraft.metadata.types.MetaTypes1_20_3; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import java.util.List; public final class Types1_20_3 { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_8.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_8.java index 3dea70de4..975e03cd6 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_8.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_8.java @@ -25,15 +25,17 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_8; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_8; import java.util.List; -public class Types1_8 { +public final class Types1_8 { /** * Metadata type for 1.8 */ - public static final Type METADATA = new Metadata1_8Type(); + public static final Type METADATA = new MetadataType1_8(); /** * Metadata list type for 1.8 */ diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_9.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_9.java index 9f161eebd..947b36243 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_9.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/version/Types1_9.java @@ -25,14 +25,16 @@ package com.viaversion.viaversion.api.type.types.version; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.MetaListType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_9; +import com.viaversion.viaversion.api.type.types.metadata.MetaListType; +import com.viaversion.viaversion.api.type.types.metadata.MetadataType1_9; import java.util.List; -public class Types1_9 { +public final class Types1_9 { /** * Metadata type for 1.9 */ - public static final Type METADATA = new Metadata1_9Type(); + public static final Type METADATA = new MetadataType1_9(); /** * Metadata list type for 1.9 */ diff --git a/common/src/main/java/com/viaversion/viaversion/protocol/packet/PacketWrapperImpl.java b/common/src/main/java/com/viaversion/viaversion/protocol/packet/PacketWrapperImpl.java index e6d22fa59..662a8ce1e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocol/packet/PacketWrapperImpl.java +++ b/common/src/main/java/com/viaversion/viaversion/protocol/packet/PacketWrapperImpl.java @@ -135,10 +135,6 @@ public class PacketWrapperImpl implements PacketWrapper { @Override public T read(Type type) throws Exception { - if (type == Type.NOTHING) { - return null; - } - if (readableObjects.isEmpty()) { Preconditions.checkNotNull(inputBuffer, "This packet does not have an input buffer."); // We could in the future log input read values, but honestly for things like bulk maps, mem waste D: @@ -156,8 +152,6 @@ public class PacketWrapperImpl implements PacketWrapper { && type.getOutputClass() == readType.getOutputClass())) { //noinspection unchecked return (T) readValue.value(); - } else if (readType == Type.NOTHING) { - return read(type); // retry } else { throw createInformativeException(new IOException("Unable to read type " + type.getTypeName() + ", found " + readValue.type().getTypeName()), type, readableObjects.size()); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_10to1_9_3/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_10to1_9_3/packets/InventoryPackets.java index f4bf131e3..07cd86ad5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_10to1_9_3/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_10to1_9_3/packets/InventoryPackets.java @@ -27,12 +27,12 @@ import com.viaversion.viaversion.rewriter.ItemRewriter; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_10To1_9_3_4 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM); + registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM1_8); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11_1to1_11/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11_1to1_11/packets/InventoryPackets.java index 598ce03d7..31168fdd5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11_1to1_11/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11_1to1_11/packets/InventoryPackets.java @@ -27,12 +27,12 @@ import com.viaversion.viaversion.rewriter.ItemRewriter; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_11_1To1_11 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM); + registerCreativeInvAction(ServerboundPackets1_9_3.CREATIVE_INVENTORY_ACTION, Type.ITEM1_8); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java index 183dd4969..dddd56c19 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/Protocol1_11To1_10.java @@ -22,7 +22,7 @@ import com.github.steveice10.opennbt.tag.builtin.StringTag; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_11Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_11; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; @@ -94,7 +94,7 @@ public class Protocol1_11To1_10 extends AbstractProtocol metadata) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/packets/InventoryPackets.java index 343248148..7cddb6600 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_11to1_10/packets/InventoryPackets.java @@ -29,14 +29,14 @@ import com.viaversion.viaversion.rewriter.ItemRewriter; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_11To1_10 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - registerSetSlot(ClientboundPackets1_9_3.SET_SLOT, Type.ITEM); - registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS, Type.ITEM_ARRAY); - registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM); + registerSetSlot(ClientboundPackets1_9_3.SET_SLOT, Type.ITEM1_8); + registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS, Type.ITEM1_8_ARRAY); + registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM1_8); // Plugin message Packet -> Trading protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { @@ -50,12 +50,12 @@ public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_12To1_11_1 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - registerSetSlot(ClientboundPackets1_9_3.SET_SLOT, Type.ITEM); - registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS, Type.ITEM_ARRAY); - registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM); + registerSetSlot(ClientboundPackets1_9_3.SET_SLOT, Type.ITEM1_8); + registerWindowItems(ClientboundPackets1_9_3.WINDOW_ITEMS, Type.ITEM1_8_ARRAY); + registerEntityEquipment(ClientboundPackets1_9_3.ENTITY_EQUIPMENT, Type.ITEM1_8); // Plugin message Packet -> Trading protocol.registerClientbound(ClientboundPackets1_9_3.PLUGIN_MESSAGE, new PacketHandlers() { @@ -52,12 +52,12 @@ public class InventoryPackets extends ItemRewriter { - Item item = wrapper.get(Type.ITEM, 0); + Item item = wrapper.get(Type.ITEM1_8, 0); if (!Via.getConfig().is1_12QuickMoveActionFix()) { handleItemToServer(item); return; @@ -108,7 +108,7 @@ public class InventoryPackets extends ItemRewriter { - Item item = wrapper.get(Type.FLAT_ITEM, 0); + Item item = wrapper.get(Type.ITEM1_13, 0); itemRewriter.handleItemToServer(item); }); handler(wrapper -> { @@ -135,7 +135,7 @@ public class Protocol1_13_1To1_13 extends AbstractProtocol= 7) { + } else if (type.isOrHasParent(EntityTypes1_13.EntityType.ABSTRACT_ARROW) && metadata.id() >= 7) { metadata.setId(metadata.id() + 1); // New shooter UUID } } @Override public EntityType typeFromId(int type) { - return Entity1_13Types.getTypeFromId(type, false); + return EntityTypes1_13.getTypeFromId(type, false); } @Override public EntityType objectTypeFromId(int type) { - return Entity1_13Types.getTypeFromId(type, true); + return EntityTypes1_13.getTypeFromId(type, true); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/EntityPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/EntityPackets.java index 12546673f..fdc36ad4c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/EntityPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/EntityPackets.java @@ -17,7 +17,7 @@ */ package com.viaversion.viaversion.protocols.protocol1_13_1to1_13.packets; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_13Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.version.Types1_13; @@ -47,10 +47,10 @@ public class EntityPackets { handler(wrapper -> { int entityId = wrapper.get(Type.VAR_INT, 0); byte type = wrapper.get(Type.BYTE, 0); - Entity1_13Types.EntityType entType = Entity1_13Types.getTypeFromId(type, true); + EntityTypes1_13.EntityType entType = EntityTypes1_13.getTypeFromId(type, true); if (entType != null) { - if (entType.is(Entity1_13Types.EntityType.FALLING_BLOCK)) { + if (entType.is(EntityTypes1_13.EntityType.FALLING_BLOCK)) { int data = wrapper.get(Type.INT, 0); wrapper.set(Type.INT, 0, protocol.getMappingData().getNewBlockStateId(data)); } @@ -94,7 +94,7 @@ public class EntityPackets { map(Type.BYTE); // 6 - Pitch map(Types1_13.METADATA_LIST); // 7 - Metadata - handler(metadataRewriter.trackerAndRewriterHandler(Types1_13.METADATA_LIST, Entity1_13Types.EntityType.PLAYER)); + handler(metadataRewriter.trackerAndRewriterHandler(Types1_13.METADATA_LIST, EntityTypes1_13.EntityType.PLAYER)); } }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/InventoryPackets.java index 8f0991b5d..7cb527c8c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_1to1_13/packets/InventoryPackets.java @@ -28,14 +28,14 @@ import com.viaversion.viaversion.rewriter.RecipeRewriter; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_13_1To1_13 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - registerSetSlot(ClientboundPackets1_13.SET_SLOT, Type.FLAT_ITEM); - registerWindowItems(ClientboundPackets1_13.WINDOW_ITEMS, Type.FLAT_ITEM_ARRAY); - registerAdvancements(ClientboundPackets1_13.ADVANCEMENTS, Type.FLAT_ITEM); + registerSetSlot(ClientboundPackets1_13.SET_SLOT, Type.ITEM1_13); + registerWindowItems(ClientboundPackets1_13.WINDOW_ITEMS, Type.ITEM1_13_SHORT_ARRAY); + registerAdvancements(ClientboundPackets1_13.ADVANCEMENTS, Type.ITEM1_13); registerSetCooldown(ClientboundPackets1_13.COOLDOWN); protocol.registerClientbound(ClientboundPackets1_13.PLUGIN_MESSAGE, new PacketHandlers() { @@ -50,14 +50,14 @@ public class InventoryPackets extends ItemRewriter recipeRewriter = new RecipeRewriter<>(protocol); protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, wrapper -> { @@ -82,9 +82,9 @@ public class InventoryPackets extends ItemRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION); + BlockRewriter blockRewriter = BlockRewriter.legacy(protocol); protocol.registerClientbound(ClientboundPackets1_13.CHUNK_DATA, wrapper -> { ClientWorld clientWorld = wrapper.user().get(ClientWorld.class); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_2to1_13_1/Protocol1_13_2To1_13_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_2to1_13_1/Protocol1_13_2To1_13_1.java index b14e5f2da..29d38c840 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_2to1_13_1/Protocol1_13_2To1_13_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13_2to1_13_1/Protocol1_13_2To1_13_1.java @@ -42,7 +42,7 @@ public class Protocol1_13_2To1_13_1 extends AbstractProtocol { int id = wrapper.get(Type.INT, 0); if (id == 27) { - wrapper.write(Type.FLAT_VAR_INT_ITEM, wrapper.read(Type.FLAT_ITEM)); + wrapper.write(Type.ITEM1_13_2, wrapper.read(Type.ITEM1_13)); } }); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java index 9f1ee936b..53d7bd992 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java @@ -24,7 +24,7 @@ import com.google.gson.JsonParseException; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.Position; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_13Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_13; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.platform.providers.ViaProviders; @@ -35,7 +35,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandler; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.protocol.remapper.ValueTransformer; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.version.Types1_13; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.protocol1_12_1to1_12.ClientboundPackets1_12_1; @@ -417,9 +417,9 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol Plugin Message registerServerbound(ServerboundPackets1_13.EDIT_BOOK, ServerboundPackets1_12_1.PLUGIN_MESSAGE, wrapper -> { - Item item = wrapper.read(Type.FLAT_ITEM); + Item item = wrapper.read(Type.ITEM1_13); boolean isSigning = wrapper.read(Type.BOOLEAN); itemRewriter.handleItemToServer(item); wrapper.write(Type.STRING, isSigning ? "MC|BSign" : "MC|BEdit"); // Channel - wrapper.write(Type.ITEM, item); + wrapper.write(Type.ITEM1_8, item); }); // New 0x0C - Query Entity NBT @@ -862,7 +862,7 @@ public class Protocol1_13To1_12_2 extends AbstractProtocol> 12 & 15; @@ -78,18 +78,18 @@ public class MetadataRewriter1_13To1_12_2 extends EntityRewriter 14) metadata.setId(metadata.id() + 1); } // Handle Minecart inner block - if (type.isOrHasParent(Entity1_13Types.EntityType.MINECART_ABSTRACT) && metadata.id() == 9) { + if (type.isOrHasParent(EntityTypes1_13.EntityType.MINECART_ABSTRACT) && metadata.id() == 9) { // New block format int oldId = (int) metadata.getValue(); int combined = (((oldId & 4095) << 4) | (oldId >> 12 & 15)); @@ -98,7 +98,7 @@ public class MetadataRewriter1_13To1_12_2 extends EntityRewriter { int entityId = wrapper.get(Type.VAR_INT, 0); byte type = wrapper.get(Type.BYTE, 0); - Entity1_13Types.EntityType entType = Entity1_13Types.getTypeFromId(type, true); + EntityTypes1_13.EntityType entType = EntityTypes1_13.getTypeFromId(type, true); if (entType == null) return; // Register Type ID wrapper.user().getEntityTracker(Protocol1_13To1_12_2.class).addEntity(entityId, entType); - if (entType.is(Entity1_13Types.EntityType.FALLING_BLOCK)) { + if (entType.is(EntityTypes1_13.EntityType.FALLING_BLOCK)) { int oldId = wrapper.get(Type.INT, 0); int combined = (((oldId & 4095) << 4) | (oldId >> 12 & 15)); wrapper.set(Type.INT, 0, WorldPackets.toNewId(combined)); } // Fix ItemFrame hitbox - if (entType.is(Entity1_13Types.EntityType.ITEM_FRAME)) { + if (entType.is(EntityTypes1_13.EntityType.ITEM_FRAME)) { int data = wrapper.get(Type.INT, 0); switch (data) { @@ -121,7 +121,7 @@ public class EntityPackets { map(Type.BYTE); // 6 - Pitch map(Types1_12.METADATA_LIST, Types1_13.METADATA_LIST); // 7 - Metadata - handler(metadataRewriter.trackerAndRewriterHandler(Types1_13.METADATA_LIST, Entity1_13Types.EntityType.PLAYER)); + handler(metadataRewriter.trackerAndRewriterHandler(Types1_13.METADATA_LIST, EntityTypes1_13.EntityType.PLAYER)); } }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java index 25cacd2cc..fa70ebed4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java @@ -51,7 +51,7 @@ public class InventoryPackets extends ItemRewriter metadatas, UserConnection connection) { if (type == null) return; - if (type == Entity1_14Types.VILLAGER || type == Entity1_14Types.WANDERING_TRADER) { + if (type == EntityTypes1_14.VILLAGER || type == EntityTypes1_14.WANDERING_TRADER) { if (metadata.id() >= 15) { metadata.setId(metadata.id() + 1); } @@ -45,6 +45,6 @@ public class MetadataRewriter1_14_1To1_14 extends EntityRewriter 5) { metadata.setId(metadata.id() + 1); } - if (metadata.id() == 8 && type.isOrHasParent(Entity1_14Types.LIVINGENTITY)) { + if (metadata.id() == 8 && type.isOrHasParent(EntityTypes1_14.LIVINGENTITY)) { final float v = ((Number) metadata.getValue()).floatValue(); if (Float.isNaN(v) && Via.getConfig().is1_14HealthNaNFix()) { metadata.setValue(1F); @@ -75,11 +75,11 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter 11 && type.isOrHasParent(Entity1_14Types.LIVINGENTITY)) { + if (metadata.id() > 11 && type.isOrHasParent(EntityTypes1_14.LIVINGENTITY)) { metadata.setId(metadata.id() + 1); } - if (type.isOrHasParent(Entity1_14Types.ABSTRACT_INSENTIENT)) { + if (type.isOrHasParent(EntityTypes1_14.ABSTRACT_INSENTIENT)) { if (metadata.id() == 13) { tracker.setInsentientData(entityId, (byte) ((((Number) metadata.getValue()).byteValue() & ~0x4) | (tracker.getInsentientData(entityId) & 0x4))); // New attacking metadata @@ -87,7 +87,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter= 9) { // New piercing metadata.setId(metadata.id() + 1); } - } else if (type.is(Entity1_14Types.FIREWORK_ROCKET)) { + } else if (type.is(EntityTypes1_14.FIREWORK_ROCKET)) { if (metadata.id() == 8) { metadata.setMetaType(Types1_14.META_TYPES.optionalVarIntType); if (metadata.getValue().equals(0)) { metadata.setValue(null); // https://bugs.mojang.com/browse/MC-111480 } } - } else if (type.isOrHasParent(Entity1_14Types.ABSTRACT_SKELETON)) { + } else if (type.isOrHasParent(EntityTypes1_14.ABSTRACT_SKELETON)) { if (metadata.id() == 14) { tracker.setInsentientData(entityId, (byte) ((tracker.getInsentientData(entityId) & ~0x4) | ((boolean) metadata.getValue() ? 0x4 : 0))); // New attacking @@ -167,7 +167,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter= 14) { // 19w13 added a new boolean (raid participant - is celebrating) with id 14 metadata.setId(metadata.id() + 1); } @@ -185,7 +185,7 @@ public class MetadataRewriter1_14To1_13_2 extends EntityRewriter 0) - || type1_14.isOrHasParent(Entity1_14Types.ABSTRACT_ARROW)) { - if (type1_14.isOrHasParent(Entity1_14Types.ABSTRACT_ARROW)) { + } else if ((type1_14.is(EntityTypes1_14.ITEM) && data > 0) + || type1_14.isOrHasParent(EntityTypes1_14.ABSTRACT_ARROW)) { + if (type1_14.isOrHasParent(EntityTypes1_14.ABSTRACT_ARROW)) { wrapper.set(Type.INT, 0, data - 1); } // send velocity in separate packet, 1.14 is now ignoring the velocity @@ -159,7 +159,7 @@ public class EntityPackets { map(Type.BYTE); // 6 - Pitch map(Types1_13_2.METADATA_LIST, Types1_14.METADATA_LIST); // 7 - Metadata - handler(metadataRewriter.trackerAndRewriterHandler(Types1_14.METADATA_LIST, Entity1_14Types.PLAYER)); + handler(metadataRewriter.trackerAndRewriterHandler(Types1_14.METADATA_LIST, EntityTypes1_14.PLAYER)); } }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java index 64fc81b98..70fdbdd9c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java @@ -59,13 +59,13 @@ public class InventoryPackets extends ItemRewriter { Short windowId = wrapper.read(Type.UNSIGNED_BYTE); @@ -135,8 +135,8 @@ public class InventoryPackets extends ItemRewriter recipeRewriter = new RecipeRewriter<>(protocol); protocol.registerClientbound(ClientboundPackets1_13.DECLARE_RECIPES, wrapper -> { @@ -210,7 +210,7 @@ public class InventoryPackets extends ItemRewriter { // Selecting trade now moves the items, we need to resync the inventory @@ -223,13 +223,13 @@ public class InventoryPackets extends ItemRewriter { - Item item = wrapper.passthrough(Type.FLAT_VAR_INT_ITEM); + Item item = wrapper.passthrough(Type.ITEM1_13_2); protocol.getItemRewriter().handleItemToServer(item); if (item == null) return; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/WorldPackets.java index c2c5e4774..63c5412c4 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/packets/WorldPackets.java @@ -53,7 +53,7 @@ public class WorldPackets { } public static void register(Protocol1_14To1_13_2 protocol) { - BlockRewriter blockRewriter = new BlockRewriter<>(protocol, null); + BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); protocol.registerClientbound(ClientboundPackets1_13.BLOCK_BREAK_ANIMATION, new PacketHandlers() { @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/storage/EntityTracker1_14.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/storage/EntityTracker1_14.java index 950fc83de..594ddef0a 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/storage/EntityTracker1_14.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/storage/EntityTracker1_14.java @@ -18,7 +18,7 @@ package com.viaversion.viaversion.protocols.protocol1_14to1_13_2.storage; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_14; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import space.vectrix.flare.fastutil.Int2ObjectSyncMap; @@ -34,7 +34,7 @@ public class EntityTracker1_14 extends EntityTrackerBase { private int chunkCenterZ; public EntityTracker1_14(UserConnection user) { - super(user, Entity1_14Types.PLAYER); + super(user, EntityTypes1_14.PLAYER); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java index eca9fd735..b01670a16 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_13; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java index a32fb144e..f00feb359 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java @@ -21,7 +21,7 @@ import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; import com.viaversion.viaversion.api.minecraft.RegistryType; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_15Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_15; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.data.entity.EntityTrackerBase; @@ -60,7 +60,7 @@ public class Protocol1_15To1_14_4 extends AbstractProtocol(this).register(ClientboundPackets1_14_4.STATISTICS); - registerServerbound(ServerboundPackets1_14.EDIT_BOOK, wrapper -> itemRewriter.handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM))); + registerServerbound(ServerboundPackets1_14.EDIT_BOOK, wrapper -> itemRewriter.handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2))); tagRewriter = new TagRewriter<>(this); tagRewriter.register(ClientboundPackets1_14_4.TAGS, RegistryType.ENTITY); @@ -78,7 +78,7 @@ public class Protocol1_15To1_14_4 extends AbstractProtocol 11 && type.isOrHasParent(Entity1_15Types.LIVINGENTITY)) { + if (metadata.id() > 11 && type.isOrHasParent(EntityTypes1_15.LIVINGENTITY)) { metadata.setId(metadata.id() + 1); } @@ -66,7 +66,7 @@ public class MetadataRewriter1_15To1_14_4 extends EntityRewriter 18) { @@ -82,6 +82,6 @@ public class MetadataRewriter1_15To1_14_4 extends EntityRewriter { int entityId = wrapper.get(Type.VAR_INT, 0); - wrapper.user().getEntityTracker(Protocol1_15To1_14_4.class).addEntity(entityId, Entity1_15Types.PLAYER); + wrapper.user().getEntityTracker(Protocol1_15To1_14_4.class).addEntity(entityId, EntityTypes1_15.PLAYER); sendMetadataPacket(wrapper, entityId, metadataRewriter); }); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/InventoryPackets.java index 50f5c50eb..67badd80a 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/InventoryPackets.java @@ -27,21 +27,21 @@ import com.viaversion.viaversion.rewriter.RecipeRewriter; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_15To1_14_4 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { registerSetCooldown(ClientboundPackets1_14_4.COOLDOWN); - registerWindowItems(ClientboundPackets1_14_4.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY); + registerWindowItems(ClientboundPackets1_14_4.WINDOW_ITEMS, Type.ITEM1_13_2_SHORT_ARRAY); registerTradeList(ClientboundPackets1_14_4.TRADE_LIST); - registerSetSlot(ClientboundPackets1_14_4.SET_SLOT, Type.FLAT_VAR_INT_ITEM); - registerEntityEquipment(ClientboundPackets1_14_4.ENTITY_EQUIPMENT, Type.FLAT_VAR_INT_ITEM); - registerAdvancements(ClientboundPackets1_14_4.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM); + registerSetSlot(ClientboundPackets1_14_4.SET_SLOT, Type.ITEM1_13_2); + registerEntityEquipment(ClientboundPackets1_14_4.ENTITY_EQUIPMENT, Type.ITEM1_13_2); + registerAdvancements(ClientboundPackets1_14_4.ADVANCEMENTS, Type.ITEM1_13_2); new RecipeRewriter<>(protocol).register(ClientboundPackets1_14_4.DECLARE_RECIPES); - registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM); - registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); + registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.ITEM1_13_2); + registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java index 55d938a08..4468855a3 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java @@ -32,7 +32,7 @@ import com.viaversion.viaversion.rewriter.BlockRewriter; public final class WorldPackets { public static void register(Protocol1_15To1_14_4 protocol) { - BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_14_4.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_14_4.BLOCK_CHANGE); @@ -99,7 +99,7 @@ public final class WorldPackets { int data = wrapper.passthrough(Type.VAR_INT); wrapper.set(Type.VAR_INT, 0, protocol.getMappingData().getNewBlockStateId(data)); } else if (id == 32) { - protocol.getItemRewriter().handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); + protocol.getItemRewriter().handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2)); } }); } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java index 293ba3cfe..ab93960a5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_13; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/Protocol1_16_2To1_16_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/Protocol1_16_2To1_16_1.java index 9b496f139..46d5bb771 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/Protocol1_16_2To1_16_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/Protocol1_16_2To1_16_1.java @@ -19,7 +19,7 @@ package com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.RegistryType; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_16_2Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16_2; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.data.entity.EntityTrackerBase; @@ -103,7 +103,7 @@ public class Protocol1_16_2To1_16_1 extends AbstractProtocol { public InventoryPackets(Protocol1_16_2To1_16_1 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { registerSetCooldown(ClientboundPackets1_16.COOLDOWN); - registerWindowItems(ClientboundPackets1_16.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY); + registerWindowItems(ClientboundPackets1_16.WINDOW_ITEMS, Type.ITEM1_13_2_SHORT_ARRAY); registerTradeList(ClientboundPackets1_16.TRADE_LIST); - registerSetSlot(ClientboundPackets1_16.SET_SLOT, Type.FLAT_VAR_INT_ITEM); + registerSetSlot(ClientboundPackets1_16.SET_SLOT, Type.ITEM1_13_2); registerEntityEquipmentArray(ClientboundPackets1_16.ENTITY_EQUIPMENT); - registerAdvancements(ClientboundPackets1_16.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM); + registerAdvancements(ClientboundPackets1_16.ADVANCEMENTS, Type.ITEM1_13_2); protocol.registerClientbound(ClientboundPackets1_16.UNLOCK_RECIPES, wrapper -> { wrapper.passthrough(Type.VAR_INT); @@ -54,10 +54,10 @@ public class InventoryPackets extends ItemRewriter(protocol).register(ClientboundPackets1_16.DECLARE_RECIPES); - registerClickWindow(ServerboundPackets1_16_2.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM); - registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); - protocol.registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM))); + registerClickWindow(ServerboundPackets1_16_2.CLICK_WINDOW, Type.ITEM1_13_2); + registerCreativeInvAction(ServerboundPackets1_16_2.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2); + protocol.registerServerbound(ServerboundPackets1_16_2.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2))); - registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE); + registerSpawnParticle(ClientboundPackets1_16.SPAWN_PARTICLE, Type.ITEM1_13_2, Type.DOUBLE); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/packets/WorldPackets.java index 8b19387fe..c1b80d7a8 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/packets/WorldPackets.java @@ -39,7 +39,7 @@ public class WorldPackets { private static final BlockChangeRecord[] EMPTY_RECORDS = new BlockChangeRecord[0]; public static void register(Protocol1_16_2To1_16_1 protocol) { - BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_16.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_16.BLOCK_CHANGE); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/types/Chunk1_16_2Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/types/Chunk1_16_2Type.java index 99ec63cc9..49fe4515d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/types/Chunk1_16_2Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_2to1_16_1/types/Chunk1_16_2Type.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_16; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_4to1_16_3/Protocol1_16_4To1_16_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_4to1_16_3/Protocol1_16_4To1_16_3.java index 2d2debead..d83b3f200 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_4to1_16_3/Protocol1_16_4To1_16_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16_4to1_16_3/Protocol1_16_4To1_16_3.java @@ -34,7 +34,7 @@ public class Protocol1_16_4To1_16_3 extends AbstractProtocol { int slot = wrapper.read(Type.VAR_INT); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java index f62c588d1..6a9f5fcf2 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/Protocol1_16To1_15_2.java @@ -24,13 +24,13 @@ import com.google.gson.JsonObject; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.RegistryType; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16; import com.viaversion.viaversion.api.platform.providers.ViaProviders; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.version.Types1_16; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ServerboundPackets1_14; @@ -267,7 +267,7 @@ public class Protocol1_16To1_15_2 extends AbstractProtocol 8) { @@ -67,7 +67,7 @@ public class MetadataRewriter1_16To1_15_2 extends EntityRewriter { - wrapper.user().getEntityTracker(Protocol1_16To1_15_2.class).addEntity(wrapper.get(Type.INT, 0), Entity1_16Types.PLAYER); + wrapper.user().getEntityTracker(Protocol1_16To1_15_2.class).addEntity(wrapper.get(Type.INT, 0), EntityTypes1_16.PLAYER); final String type = wrapper.read(Type.STRING);// level type wrapper.passthrough(Type.VAR_INT); // View distance diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/InventoryPackets.java index e89664d13..2cf41c79b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/InventoryPackets.java @@ -43,7 +43,7 @@ import java.util.UUID; public class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_16To1_15_2 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override @@ -53,7 +53,7 @@ public class InventoryPackets extends ItemRewriter { int slot = wrapper.read(Type.VAR_INT); wrapper.write(Type.BYTE, (byte) slot); - handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)); + handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2)); }); } }); new RecipeRewriter<>(protocol).register(ClientboundPackets1_15.DECLARE_RECIPES); - registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM); - registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); + registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW, Type.ITEM1_13_2); + registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2); protocol.registerServerbound(ServerboundPackets1_16.CLOSE_WINDOW, wrapper -> { InventoryTracker1_16 inventoryTracker = wrapper.user().get(InventoryTracker1_16.class); inventoryTracker.setInventoryOpen(false); }); - protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM))); + protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2))); - registerSpawnParticle(ClientboundPackets1_15.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE); + registerSpawnParticle(ClientboundPackets1_15.SPAWN_PARTICLE, Type.ITEM1_13_2, Type.DOUBLE); } @Override diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java index ae5ae4892..cc959f02e 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/packets/WorldPackets.java @@ -42,7 +42,7 @@ import java.util.UUID; public class WorldPackets { public static void register(Protocol1_16To1_15_2 protocol) { - BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_15.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_15.BLOCK_CHANGE); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/types/Chunk1_16Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/types/Chunk1_16Type.java index fc6515515..5a835ca02 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/types/Chunk1_16Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_16to1_15_2/types/Chunk1_16Type.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_16; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17_1to1_17/Protocol1_17_1To1_17.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17_1to1_17/Protocol1_17_1To1_17.java index 274776f0c..aaa4d27c0 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17_1to1_17/Protocol1_17_1To1_17.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17_1to1_17/Protocol1_17_1To1_17.java @@ -61,10 +61,10 @@ public final class Protocol1_17_1To1_17 extends AbstractProtocol { // Length encoded as var int now - wrapper.write(Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT, wrapper.read(Type.FLAT_VAR_INT_ITEM_ARRAY)); + wrapper.write(Type.ITEM1_13_2_ARRAY, wrapper.read(Type.ITEM1_13_2_SHORT_ARRAY)); // Carried item - should work like this - wrapper.write(Type.FLAT_VAR_INT_ITEM, null); + wrapper.write(Type.ITEM1_13_2, null); }); } }); @@ -82,7 +82,7 @@ public final class Protocol1_17_1To1_17 extends AbstractProtocol { @@ -165,21 +165,21 @@ public final class EntityPackets extends EntityRewriter { + filter().filterFamily(EntityTypes1_17.MINECART_ABSTRACT).index(11).handler((event, meta) -> { // Convert to new block id int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); // Attachment position removed - filter().type(Entity1_17Types.SHULKER).removeIndex(17); + filter().type(EntityTypes1_17.SHULKER).removeIndex(17); } @Override public EntityType typeFromId(int type) { - return Entity1_17Types.getTypeFromId(type); + return EntityTypes1_17.getTypeFromId(type); } private static void addNewDimensionData(CompoundTag tag) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java index 70d225290..df989b9c9 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java @@ -36,24 +36,24 @@ import com.viaversion.viaversion.rewriter.RecipeRewriter; public final class InventoryPackets extends ItemRewriter { public InventoryPackets(Protocol1_17To1_16_4 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { registerSetCooldown(ClientboundPackets1_16_2.COOLDOWN); - registerWindowItems(ClientboundPackets1_16_2.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY); + registerWindowItems(ClientboundPackets1_16_2.WINDOW_ITEMS, Type.ITEM1_13_2_SHORT_ARRAY); registerTradeList(ClientboundPackets1_16_2.TRADE_LIST); - registerSetSlot(ClientboundPackets1_16_2.SET_SLOT, Type.FLAT_VAR_INT_ITEM); - registerAdvancements(ClientboundPackets1_16_2.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM); + registerSetSlot(ClientboundPackets1_16_2.SET_SLOT, Type.ITEM1_13_2); + registerAdvancements(ClientboundPackets1_16_2.ADVANCEMENTS, Type.ITEM1_13_2); registerEntityEquipmentArray(ClientboundPackets1_16_2.ENTITY_EQUIPMENT); - registerSpawnParticle(ClientboundPackets1_16_2.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE); + registerSpawnParticle(ClientboundPackets1_16_2.SPAWN_PARTICLE, Type.ITEM1_13_2, Type.DOUBLE); new RecipeRewriter<>(protocol).register(ClientboundPackets1_16_2.DECLARE_RECIPES); - registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); + registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2); - protocol.registerServerbound(ServerboundPackets1_17.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM))); + protocol.registerServerbound(ServerboundPackets1_17.EDIT_BOOK, wrapper -> handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2))); protocol.registerServerbound(ServerboundPackets1_17.CLICK_WINDOW, new PacketHandlers() { @Override @@ -69,11 +69,11 @@ public final class InventoryPackets extends ItemRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_16_2.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_16_2.BLOCK_CHANGE); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/types/Chunk1_17Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/types/Chunk1_17Type.java index 0f3a4db53..0299664a5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/types/Chunk1_17Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/types/Chunk1_17Type.java @@ -24,7 +24,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_16; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java index b07902e4d..d0a33e945 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/Protocol1_18To1_17_1.java @@ -19,11 +19,11 @@ package com.viaversion.viaversion.protocols.protocol1_18to1_17_1; 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.api.minecraft.entities.EntityTypes1_17; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.version.Types1_18; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.protocol1_17_1to1_17.ClientboundPackets1_17_1; @@ -101,7 +101,7 @@ public final class Protocol1_18To1_17_1 extends AbstractProtocol { public InventoryPackets(Protocol1_18To1_17_1 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override @@ -38,7 +38,7 @@ public final class InventoryPackets extends ItemRewriter(protocol).register(ClientboundPackets1_17_1.DECLARE_RECIPES); registerClickWindow1_17_1(ServerboundPackets1_17.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); + registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2); } } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/types/Chunk1_18Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/types/Chunk1_18Type.java index a8becb0a2..f3c1ae250 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/types/Chunk1_18Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_18to1_17_1/types/Chunk1_18Type.java @@ -24,8 +24,8 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk1_18; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; -import com.viaversion.viaversion.api.type.types.version.ChunkSectionType1_18; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_18; import com.viaversion.viaversion.api.type.types.version.Types1_18; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_3to1_19_1/Protocol1_19_3To1_19_1.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_3to1_19_1/Protocol1_19_3To1_19_1.java index 5e73f39ae..cf9166a27 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_3to1_19_1/Protocol1_19_3To1_19_1.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_3to1_19_1/Protocol1_19_3To1_19_1.java @@ -23,14 +23,14 @@ import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; import com.viaversion.viaversion.api.minecraft.PlayerMessageSignature; import com.viaversion.viaversion.api.minecraft.RegistryType; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_3Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_3; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.BitSetType; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.version.Types1_19_3; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.libs.kyori.adventure.text.Component; @@ -289,13 +289,13 @@ public final class Protocol1_19_3To1_19_1 extends AbstractProtocol { + filter().filterFamily(EntityTypes1_19_3.MINECART_ABSTRACT).index(11).handler((event, meta) -> { // Convert to new block id final int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); @@ -175,6 +175,6 @@ public final class EntityPackets extends EntityRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_19_1.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_19_1.BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_1.MULTI_BLOCK_CHANGE); @@ -50,11 +50,11 @@ public final class InventoryPackets extends ItemRewriter { + filter().filterFamily(EntityTypes1_19_4.MINECART_ABSTRACT).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); - filter().filterFamily(Entity1_19_4Types.BOAT).index(11).handler((event, meta) -> { + filter().filterFamily(EntityTypes1_19_4.BOAT).index(11).handler((event, meta) -> { final int boatType = meta.value(); if (boatType > 4) { // Cherry added meta.setValue(boatType + 1); } }); - filter().filterFamily(Entity1_19_4Types.ABSTRACT_HORSE).removeIndex(18); // Owner UUID + filter().filterFamily(EntityTypes1_19_4.ABSTRACT_HORSE).removeIndex(18); // Owner UUID } @Override @@ -257,6 +257,6 @@ public final class EntityPackets extends EntityRewriter { public InventoryPackets(final Protocol1_19_4To1_19_3 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - final BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_19_3.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_19_3.BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_3.MULTI_BLOCK_CHANGE); @@ -86,12 +86,12 @@ public final class InventoryPackets extends ItemRewriter(protocol) { 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 0f068fc6d..83179c428 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 @@ -20,14 +20,14 @@ package com.viaversion.viaversion.protocols.protocol1_19to1_18_2; import com.google.gson.JsonElement; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19; import com.viaversion.viaversion.api.platform.providers.ViaProviders; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.remapper.PacketHandler; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.ParticleType; +import com.viaversion.viaversion.api.type.types.misc.ParticleType; import com.viaversion.viaversion.api.type.types.version.Types1_19; import com.viaversion.viaversion.data.entity.EntityTrackerBase; import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets; @@ -302,7 +302,7 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol { final int entityId = wrapper.get(Type.VAR_INT, 0); final EntityType entityType = tracker(wrapper.user()).entityType(entityId); - if (entityType == Entity1_19Types.FALLING_BLOCK) { + if (entityType == EntityTypes1_19.FALLING_BLOCK) { wrapper.set(Type.VAR_INT, 2, protocol.getMappingData().getNewBlockStateId(wrapper.get(Type.VAR_INT, 2))); } }); @@ -127,7 +127,7 @@ public final class EntityPackets extends EntityRewriter { - wrapper.write(Type.VAR_INT, Entity1_19Types.PAINTING.getId()); + wrapper.write(Type.VAR_INT, EntityTypes1_19.PAINTING.getId()); final int motive = wrapper.read(Type.VAR_INT); final Position blockPosition = wrapper.read(Type.POSITION1_14); @@ -376,13 +376,13 @@ public final class EntityPackets extends EntityRewriter { + filter().filterFamily(EntityTypes1_19.MINECART_ABSTRACT).index(11).handler((event, meta) -> { // Convert to new block id final int data = (int) meta.getValue(); meta.setValue(protocol.getMappingData().getNewBlockStateId(data)); }); - filter().type(Entity1_19Types.CAT).index(19).handler((event, meta) -> meta.setMetaType(Types1_19.META_TYPES.catVariantType)); + filter().type(EntityTypes1_19.CAT).index(19).handler((event, meta) -> meta.setMetaType(Types1_19.META_TYPES.catVariantType)); } @Override @@ -392,6 +392,6 @@ public final class EntityPackets extends EntityRewriter { public InventoryPackets(Protocol1_19To1_18_2 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override @@ -41,7 +41,7 @@ public final class InventoryPackets extends ItemRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_18.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_18.BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_18.MULTI_BLOCK_CHANGE); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java index 139a4bdd0..236bfc91b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java @@ -24,7 +24,7 @@ import com.viaversion.viaversion.api.connection.ProtocolInfo; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.Direction; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; @@ -331,7 +331,7 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol { public BlockItemPacketRewriter1_20_2(final Protocol1_20_2To1_20 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - final BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_19_4.MULTI_BLOCK_CHANGE); @@ -120,12 +120,12 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter { - final Item[] items = wrapper.read(Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT); + final Item[] items = wrapper.read(Type.ITEM1_13_2_ARRAY); for (final Item item : items) { handleItemToClient(item); } - wrapper.write(Type.ITEM1_20_2_VAR_INT_ARRAY, items); - wrapper.write(Type.ITEM1_20_2, handleItemToClient(wrapper.read(Type.FLAT_VAR_INT_ITEM))); // Carried item + wrapper.write(Type.ITEM1_20_2_ARRAY, items); + wrapper.write(Type.ITEM1_20_2, handleItemToClient(wrapper.read(Type.ITEM1_13_2))); // Carried item }); } }); @@ -135,7 +135,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter wrapper.write(Type.ITEM1_20_2, handleItemToClient(wrapper.read(Type.FLAT_VAR_INT_ITEM)))); + handler(wrapper -> wrapper.write(Type.ITEM1_20_2, handleItemToClient(wrapper.read(Type.ITEM1_13_2)))); } }); protocol.registerClientbound(ClientboundPackets1_19_4.ADVANCEMENTS, wrapper -> { @@ -152,7 +152,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter wrapper.write(Type.FLAT_VAR_INT_ITEM, handleItemToServer(wrapper.read(Type.ITEM1_20_2)))); // 1 - Clicked Item + handler(wrapper -> wrapper.write(Type.ITEM1_13_2, handleItemToServer(wrapper.read(Type.ITEM1_20_2)))); // 1 - Clicked Item } }); protocol.registerClientbound(ClientboundPackets1_19_4.SPAWN_PARTICLE, new PacketHandlers() { @@ -253,7 +253,7 @@ public final class BlockItemPacketRewriter1_20_2 extends ItemRewriter meta.setMetaType(Types1_20_2.META_TYPES.byId(meta.metaType().typeId()))); registerMetaTypeHandler(Types1_20_2.META_TYPES.itemType, Types1_20_2.META_TYPES.blockStateType, Types1_20_2.META_TYPES.optionalBlockStateType, Types1_20_2.META_TYPES.particleType); - filter().filterFamily(Entity1_19_4Types.DISPLAY).addIndex(10); + filter().filterFamily(EntityTypes1_19_4.DISPLAY).addIndex(10); - filter().filterFamily(Entity1_19_4Types.MINECART_ABSTRACT).index(11).handler((event, meta) -> { + filter().filterFamily(EntityTypes1_19_4.MINECART_ABSTRACT).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); @@ -185,6 +185,6 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter extends Recip @Override protected Type itemArrayType() { - return Type.ITEM1_20_2_VAR_INT_ARRAY; + return Type.ITEM1_20_2_ARRAY; } } \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/type/ChunkType1_20_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/type/ChunkType1_20_2.java index 2afbc1d12..1a6d058a5 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/type/ChunkType1_20_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/type/ChunkType1_20_2.java @@ -24,8 +24,8 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk1_18; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; -import com.viaversion.viaversion.api.type.types.version.ChunkSectionType1_18; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.ChunkSectionType1_18; import com.viaversion.viaversion.api.type.types.version.Types1_20_2; import io.netty.buffer.ByteBuf; import java.util.ArrayList; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java index 869bb425e..54fed317f 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java @@ -39,7 +39,7 @@ import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; @@ -482,7 +482,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol { + filter().filterFamily(EntityTypes1_19_4.ITEM_DISPLAY).handler((event, meta) -> { if (event.trackedEntity().hasSentMetadata() || event.hasExtraMeta()) { return; } @@ -141,12 +141,12 @@ public final class EntityPackets extends EntityRewriter { + filter().filterFamily(EntityTypes1_19_4.ITEM_DISPLAY).index(12).handler((event, meta) -> { final Quaternion quaternion = meta.value(); meta.setValue(rotateY180(quaternion)); }); - filter().filterFamily(Entity1_19_4Types.MINECART_ABSTRACT).index(11).handler((event, meta) -> { + filter().filterFamily(EntityTypes1_19_4.MINECART_ABSTRACT).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); @@ -154,7 +154,7 @@ public final class EntityPackets extends EntityRewriter { public InventoryPackets(final Protocol1_20To1_19_4 protocol) { - super(protocol); + super(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } @Override public void registerPackets() { - final BlockRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_14(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_CHANGE); blockRewriter.registerEffect(ClientboundPackets1_19_4.EFFECT, 1010, 2001); @@ -57,7 +57,7 @@ public final class InventoryPackets extends ItemRewriter, MetaIndex> metadataRewrites = new HashMap<>(); + private static final HashMap, MetaIndex> metadataRewrites = new HashMap<>(); static { for (MetaIndex index : MetaIndex.values()) metadataRewrites.put(new Pair<>(index.clazz, index.index), index); } - private final Entity1_10Types.EntityType clazz; + private final EntityTypes1_10.EntityType clazz; private final int newIndex; private final MetaType1_9 newType; private final MetaType1_8 oldType; private final int index; - MetaIndex(Entity1_10Types.EntityType type, int index, MetaType1_8 oldType, @Nullable MetaType1_9 newType) { + MetaIndex(EntityTypes1_10.EntityType type, int index, MetaType1_8 oldType, @Nullable MetaType1_9 newType) { this.clazz = type; this.index = index; this.newIndex = index; @@ -179,7 +179,7 @@ public enum MetaIndex { this.newType = newType; } - MetaIndex(Entity1_10Types.EntityType type, int index, MetaType1_8 oldType, int newIndex, @Nullable MetaType1_9 newType) { + MetaIndex(EntityTypes1_10.EntityType type, int index, MetaType1_8 oldType, int newIndex, @Nullable MetaType1_9 newType) { this.clazz = type; this.index = index; this.oldType = oldType; @@ -187,7 +187,7 @@ public enum MetaIndex { this.newType = newType; } - public Entity1_10Types.EntityType getClazz() { + public EntityTypes1_10.EntityType getClazz() { return clazz; } diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/metadata/MetadataRewriter1_9To1_8.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/metadata/MetadataRewriter1_9To1_8.java index 431355905..e39644caa 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/metadata/MetadataRewriter1_9To1_8.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/metadata/MetadataRewriter1_9To1_8.java @@ -20,7 +20,7 @@ package com.viaversion.viaversion.protocols.protocol1_9to1_8.metadata; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.EulerAngle; import com.viaversion.viaversion.api.minecraft.Vector; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_10Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_10; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.metadata.MetaType; @@ -65,7 +65,7 @@ public class MetadataRewriter1_9To1_8 extends EntityRewriter(Type.NOTHING) { - @Override - public Void transform(PacketWrapper wrapper, Short inputValue) throws Exception { - EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - if (inputValue == 0) { - int passenger = wrapper.get(Type.INT, 0); - int vehicle = wrapper.get(Type.INT, 1); + handler(wrapper -> { + final short leashState = wrapper.read(Type.UNSIGNED_BYTE); + EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); + if (leashState == 0) { + int passenger = wrapper.get(Type.INT, 0); + int vehicle = wrapper.get(Type.INT, 1); - wrapper.cancel(); // Don't send current packet + wrapper.cancel(); // Don't send current packet - PacketWrapper passengerPacket = wrapper.create(ClientboundPackets1_9.SET_PASSENGERS); - if (vehicle == -1) { - if (!tracker.getVehicleMap().containsKey(passenger)) - return null; // Cancel - passengerPacket.write(Type.VAR_INT, tracker.getVehicleMap().remove(passenger)); - passengerPacket.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{}); - } else { - passengerPacket.write(Type.VAR_INT, vehicle); - passengerPacket.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{passenger}); - tracker.getVehicleMap().put(passenger, vehicle); + PacketWrapper passengerPacket = wrapper.create(ClientboundPackets1_9.SET_PASSENGERS); + if (vehicle == -1) { + if (!tracker.getVehicleMap().containsKey(passenger)) { + return; // Cancel } - passengerPacket.send(Protocol1_9To1_8.class); // Send the packet + + passengerPacket.write(Type.VAR_INT, tracker.getVehicleMap().remove(passenger)); + passengerPacket.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{}); + } else { + passengerPacket.write(Type.VAR_INT, vehicle); + passengerPacket.write(Type.VAR_INT_ARRAY_PRIMITIVE, new int[]{passenger}); + tracker.getVehicleMap().put(passenger, vehicle); } - return null; + passengerPacket.send(Protocol1_9To1_8.class); // Send the packet } }); } @@ -164,17 +162,17 @@ public class EntityPackets { return slot > 0 ? slot.intValue() + 1 : slot.intValue(); } }); - map(Type.ITEM); // 2 - Item + map(Type.ITEM1_8); // 2 - Item // Item Rewriter handler(wrapper -> { - Item stack = wrapper.get(Type.ITEM, 0); + Item stack = wrapper.get(Type.ITEM1_8, 0); ItemRewriter.toClient(stack); }); // Blocking handler(wrapper -> { EntityTracker1_9 entityTracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); int entityID = wrapper.get(Type.VAR_INT, 0); - Item stack = wrapper.get(Type.ITEM, 0); + Item stack = wrapper.get(Type.ITEM1_8, 0); if (stack != null && Protocol1_9To1_8.isSword(stack.identifier())) { entityTracker.getValidBlocking().add(entityID); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/InventoryPackets.java index 22e951359..0bcec6ea3 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/InventoryPackets.java @@ -19,8 +19,6 @@ package com.viaversion.viaversion.protocols.protocol1_9to1_8.packets; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.minecraft.item.Item; -import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; -import com.viaversion.viaversion.api.protocol.remapper.PacketHandler; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.protocols.protocol1_8.ClientboundPackets1_8; @@ -94,9 +92,9 @@ public class InventoryPackets { public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID map(Type.SHORT); // 1 - Slot ID - map(Type.ITEM); // 2 - Slot Value + map(Type.ITEM1_8); // 2 - Slot Value handler(wrapper -> { - Item stack = wrapper.get(Type.ITEM, 0); + Item stack = wrapper.get(Type.ITEM1_8, 0); boolean showShieldWhenSwordInHand = Via.getConfig().isShowShieldWhenSwordInHand() && Via.getConfig().isShieldBlocking(); @@ -136,10 +134,10 @@ public class InventoryPackets { @Override public void register() { map(Type.UNSIGNED_BYTE); // 0 - Window ID - map(Type.ITEM_ARRAY); // 1 - Window Values + map(Type.ITEM1_8_ARRAY); // 1 - Window Values handler(wrapper -> { - Item[] stacks = wrapper.get(Type.ITEM_ARRAY, 0); + Item[] stacks = wrapper.get(Type.ITEM1_8_ARRAY, 0); Short windowId = wrapper.get(Type.UNSIGNED_BYTE, 0); InventoryTracker inventoryTracker = wrapper.user().get(InventoryTracker.class); @@ -168,7 +166,7 @@ public class InventoryPackets { handler(wrapper -> { InventoryTracker inventoryTracker = wrapper.user().get(InventoryTracker.class); if (inventoryTracker.getInventory() != null && inventoryTracker.getInventory().equals("minecraft:brewing_stand")) { - Item[] oldStack = wrapper.get(Type.ITEM_ARRAY, 0); + Item[] oldStack = wrapper.get(Type.ITEM1_8_ARRAY, 0); Item[] newStack = new Item[oldStack.length + 1]; for (int i = 0; i < newStack.length; i++) { if (i > 4) { @@ -179,7 +177,7 @@ public class InventoryPackets { } } } - wrapper.set(Type.ITEM_ARRAY, 0, newStack); + wrapper.set(Type.ITEM1_8_ARRAY, 0, newStack); } }); } @@ -218,9 +216,9 @@ public class InventoryPackets { @Override public void register() { map(Type.SHORT); // 0 - Slot ID - map(Type.ITEM); // 1 - Item + map(Type.ITEM1_8); // 1 - Item handler(wrapper -> { - Item stack = wrapper.get(Type.ITEM, 0); + Item stack = wrapper.get(Type.ITEM1_8, 0); boolean showShieldWhenSwordInHand = Via.getConfig().isShowShieldWhenSwordInHand() && Via.getConfig().isShieldBlocking(); @@ -248,7 +246,7 @@ public class InventoryPackets { wrapper.create(ClientboundPackets1_9.SET_SLOT, w -> { w.write(Type.UNSIGNED_BYTE, (short) 0); w.write(Type.SHORT, slot); - w.write(Type.ITEM, null); + w.write(Type.ITEM1_8, null); }).send(Protocol1_9To1_8.class); // Finally reset to simulate throwing item wrapper.set(Type.SHORT, 0, (short) -999); // Set slot to -999 @@ -266,9 +264,9 @@ public class InventoryPackets { map(Type.BYTE); // 2 - Button map(Type.SHORT); // 3 - Action map(Type.VAR_INT, Type.BYTE); // 4 - Mode - map(Type.ITEM); // 5 - Clicked Item + map(Type.ITEM1_8); // 5 - Clicked Item handler(wrapper -> { - Item stack = wrapper.get(Type.ITEM, 0); + Item stack = wrapper.get(Type.ITEM1_8, 0); if (Via.getConfig().isShowShieldWhenSwordInHand()) { Short windowId = wrapper.get(Type.UNSIGNED_BYTE, 0); @@ -303,7 +301,7 @@ public class InventoryPackets { wrapper.create(ClientboundPackets1_9.SET_SLOT, w -> { w.write(Type.UNSIGNED_BYTE, windowID); w.write(Type.SHORT, slot); - w.write(Type.ITEM, null); + w.write(Type.ITEM1_8, null); }).scheduleSend(Protocol1_9To1_8.class); // Finally reset to simulate throwing item wrapper.set(Type.BYTE, 0, (byte) 0); // Set button to 0 diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/PlayerPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/PlayerPackets.java index a9c1f84c7..5e9a24c8c 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/PlayerPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/PlayerPackets.java @@ -19,7 +19,7 @@ package com.viaversion.viaversion.protocols.protocol1_9to1_8.packets; import com.google.gson.JsonObject; import com.viaversion.viaversion.api.Via; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_10Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_10; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; @@ -173,7 +173,7 @@ public class PlayerPackets { handler(wrapper -> { int entityId = wrapper.get(Type.INT, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityId, Entity1_10Types.EntityType.PLAYER); + tracker.addEntity(entityId, EntityTypes1_10.EntityType.PLAYER); tracker.setClientEntityId(entityId); }); map(Type.UNSIGNED_BYTE); // 1 - Player Gamemode @@ -276,16 +276,16 @@ public class PlayerPackets { Short size = wrapper.passthrough(Type.UNSIGNED_BYTE); for (int i = 0; i < size; ++i) { - Item item1 = wrapper.passthrough(Type.ITEM); + Item item1 = wrapper.passthrough(Type.ITEM1_8); ItemRewriter.toClient(item1); - Item item2 = wrapper.passthrough(Type.ITEM); + Item item2 = wrapper.passthrough(Type.ITEM1_8); ItemRewriter.toClient(item2); boolean present = wrapper.passthrough(Type.BOOLEAN); if (present) { - Item item3 = wrapper.passthrough(Type.ITEM); + Item item3 = wrapper.passthrough(Type.ITEM1_8); ItemRewriter.toClient(item3); } @@ -365,7 +365,7 @@ public class PlayerPackets { @Override public void register() { map(Type.STRING); // 0 - Requested Command - map(Type.BOOLEAN, Type.NOTHING); // 1 - Is Command Block + read(Type.BOOLEAN); // 1 - Is Command Block } }); @@ -395,7 +395,7 @@ public class PlayerPackets { protocol.registerServerbound(ServerboundPackets1_9.ANIMATION, new PacketHandlers() { @Override public void register() { - map(Type.VAR_INT, Type.NOTHING); // 0 - Hand + read(Type.VAR_INT); // 0 - Hand } }); @@ -410,7 +410,7 @@ public class PlayerPackets { handler(wrapper -> { String name = wrapper.get(Type.STRING, 0); if (name.equalsIgnoreCase("MC|BSign")) { - Item item = wrapper.passthrough(Type.ITEM); + Item item = wrapper.passthrough(Type.ITEM1_8); if (item != null) { item.setIdentifier(387); // Written Book ItemRewriter.rewriteBookToServer(item); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/SpawnPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/SpawnPackets.java index 64318e88d..87cd59817 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/SpawnPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/SpawnPackets.java @@ -19,7 +19,7 @@ package com.viaversion.viaversion.protocols.protocol1_9to1_8.packets; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.data.entity.EntityTracker; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_10Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_10; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; @@ -65,7 +65,7 @@ public class SpawnPackets { int entityID = wrapper.get(Type.VAR_INT, 0); int typeID = wrapper.get(Type.BYTE, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.getTypeFromId(typeID, true)); + tracker.addEntity(entityID, EntityTypes1_10.getTypeFromId(typeID, true)); tracker.sendMetadataBuffer(entityID); }); @@ -102,7 +102,7 @@ public class SpawnPackets { final int data = wrapper.get(Type.INT, 0); // Data int typeID = wrapper.get(Type.BYTE, 0); - if (Entity1_10Types.getTypeFromId(typeID, true) == Entity1_10Types.EntityType.SPLASH_POTION) { + if (EntityTypes1_10.getTypeFromId(typeID, true) == EntityTypes1_10.EntityType.SPLASH_POTION) { // Convert this to meta data, woo! PacketWrapper metaPacket = wrapper.create(ClientboundPackets1_9.ENTITY_METADATA, wrapper1 -> { wrapper1.write(Type.VAR_INT, entityID); @@ -132,7 +132,7 @@ public class SpawnPackets { handler(wrapper -> { int entityID = wrapper.get(Type.VAR_INT, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.EntityType.EXPERIENCE_ORB); + tracker.addEntity(entityID, EntityTypes1_10.EntityType.EXPERIENCE_ORB); tracker.sendMetadataBuffer(entityID); }); @@ -154,7 +154,7 @@ public class SpawnPackets { // Currently only lightning uses this int entityID = wrapper.get(Type.VAR_INT, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.EntityType.LIGHTNING); + tracker.addEntity(entityID, EntityTypes1_10.EntityType.LIGHTNING); tracker.sendMetadataBuffer(entityID); }); @@ -181,7 +181,7 @@ public class SpawnPackets { int entityID = wrapper.get(Type.VAR_INT, 0); int typeID = wrapper.get(Type.UNSIGNED_BYTE, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.getTypeFromId(typeID, false)); + tracker.addEntity(entityID, EntityTypes1_10.getTypeFromId(typeID, false)); tracker.sendMetadataBuffer(entityID); }); @@ -228,7 +228,7 @@ public class SpawnPackets { handler(wrapper -> { int entityID = wrapper.get(Type.VAR_INT, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.EntityType.PAINTING); + tracker.addEntity(entityID, EntityTypes1_10.EntityType.PAINTING); tracker.sendMetadataBuffer(entityID); }); handler(wrapper -> { @@ -253,7 +253,7 @@ public class SpawnPackets { handler(wrapper -> { int entityID = wrapper.get(Type.VAR_INT, 0); EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); - tracker.addEntity(entityID, Entity1_10Types.EntityType.PLAYER); + tracker.addEntity(entityID, EntityTypes1_10.EntityType.PLAYER); tracker.sendMetadataBuffer(entityID); }); @@ -271,7 +271,7 @@ public class SpawnPackets { PacketWrapper packet = PacketWrapper.create(ClientboundPackets1_9.ENTITY_EQUIPMENT, null, wrapper.user()); packet.write(Type.VAR_INT, wrapper.get(Type.VAR_INT, 0)); packet.write(Type.VAR_INT, 0); - packet.write(Type.ITEM, new DataItem(item, (byte) 1, (short) 0, null)); + packet.write(Type.ITEM1_8, new DataItem(item, (byte) 1, (short) 0, null)); try { packet.send(Protocol1_9To1_8.class); } catch (Exception e) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java index 5f6ff1da1..d623a3e87 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java @@ -325,7 +325,7 @@ public class WorldPackets { tracker.setBlocking(false); } } - wrapper.write(Type.ITEM, item); + wrapper.write(Type.ITEM1_8, item); wrapper.write(Type.UNSIGNED_BYTE, (short) 0); wrapper.write(Type.UNSIGNED_BYTE, (short) 0); @@ -343,7 +343,7 @@ public class WorldPackets { }); handler(wrapper -> { Item item = Protocol1_9To1_8.getHandItem(wrapper.user()); - wrapper.write(Type.ITEM, item); // 3 - Item + wrapper.write(Type.ITEM1_8, item); // 3 - Item }); map(Type.UNSIGNED_BYTE); // 4 - X map(Type.UNSIGNED_BYTE); // 5 - Y diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java index 68f345d8c..f31d71607 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/storage/EntityTracker1_9.java @@ -24,7 +24,7 @@ import com.viaversion.viaversion.api.legacy.bossbar.BossBar; import com.viaversion.viaversion.api.legacy.bossbar.BossColor; import com.viaversion.viaversion.api.legacy.bossbar.BossStyle; import com.viaversion.viaversion.api.minecraft.Position; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_10Types.EntityType; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_10.EntityType; import com.viaversion.viaversion.api.minecraft.item.DataItem; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; @@ -95,7 +95,7 @@ public class EntityTracker1_9 extends EntityTrackerBase { PacketWrapper wrapper = PacketWrapper.create(ClientboundPackets1_9.ENTITY_EQUIPMENT, null, user()); wrapper.write(Type.VAR_INT, entityID); wrapper.write(Type.VAR_INT, 1); // slot - wrapper.write(Type.ITEM, this.itemInSecondHand = item); + wrapper.write(Type.ITEM1_8, this.itemInSecondHand = item); try { wrapper.scheduleSend(Protocol1_9To1_8.class); } catch (Exception e) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/Chunk1_8Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/Chunk1_8Type.java index 1acee31f9..57052b71d 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/Chunk1_8Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/Chunk1_8Type.java @@ -23,7 +23,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.PartialType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkType; import com.viaversion.viaversion.api.type.types.version.Types1_8; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import io.netty.buffer.ByteBuf; diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/ChunkBulk1_8Type.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/ChunkBulk1_8Type.java index afbd7e32b..a01888635 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/ChunkBulk1_8Type.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/types/ChunkBulk1_8Type.java @@ -21,7 +21,7 @@ import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.type.PartialType; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.minecraft.BaseChunkBulkType; +import com.viaversion.viaversion.api.type.types.chunk.BaseChunkBulkType; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; import io.netty.buffer.ByteBuf; diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/BlockRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/BlockRewriter.java index d6abac704..0b35f9651 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/BlockRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/BlockRewriter.java @@ -42,16 +42,29 @@ import org.checkerframework.checker.nullness.qual.Nullable; public class BlockRewriter { private final Protocol protocol; private final Type positionType; - private final Type nbtType; + private final Type compoundTagType; + @Deprecated/*(forRemoval = true)*/ public BlockRewriter(Protocol protocol, Type positionType) { this(protocol, positionType, Type.NAMED_COMPOUND_TAG); } - public BlockRewriter(Protocol protocol, Type positionType, Type nbtType) { + public BlockRewriter(Protocol protocol, Type positionType, Type compoundTagType) { this.protocol = protocol; this.positionType = positionType; - this.nbtType = nbtType; + this.compoundTagType = compoundTagType; + } + + public static BlockRewriter legacy(final Protocol protocol) { + return new BlockRewriter<>(protocol, Type.POSITION, Type.NAMED_COMPOUND_TAG); + } + + public static BlockRewriter for1_14(final Protocol protocol) { + return new BlockRewriter<>(protocol, Type.POSITION1_14, Type.NAMED_COMPOUND_TAG); + } + + public static BlockRewriter for1_20_2(final Protocol protocol) { + return new BlockRewriter<>(protocol, Type.POSITION1_14, Type.COMPOUND_TAG); } public void registerBlockAction(C packetType) { @@ -220,7 +233,7 @@ public class BlockRewriter { } final CompoundTag tag; - if (blockEntityHandler != null && (tag = wrapper.passthrough(nbtType)) != null) { + if (blockEntityHandler != null && (tag = wrapper.passthrough(compoundTagType)) != null) { final BlockEntity blockEntity = new BlockEntityImpl(BlockEntity.pack(position.x(), position.z()), (short) position.y(), blockEntityId, tag); blockEntityHandler.accept(blockEntity); } diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java index 47b7815bf..63ad46598 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java @@ -29,13 +29,14 @@ import com.viaversion.viaversion.api.rewriter.RewriterBase; import com.viaversion.viaversion.api.type.Type; import org.checkerframework.checker.nullness.qual.Nullable; -public abstract class ItemRewriter> extends RewriterBase implements com.viaversion.viaversion.api.rewriter.ItemRewriter { private final Type itemType; private final Type itemArrayType; + @Deprecated/*(forRemoval = true)*/ protected ItemRewriter(T protocol) { - this(protocol, Type.FLAT_VAR_INT_ITEM, Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT); + this(protocol, Type.ITEM1_13_2, Type.ITEM1_13_2_ARRAY); } public ItemRewriter(T protocol, Type itemType, Type itemArrayType) { diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/RecipeRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/RecipeRewriter.java index 6fb01eb70..aab0045b2 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/RecipeRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/RecipeRewriter.java @@ -155,10 +155,10 @@ public class RecipeRewriter { } protected Type itemType() { - return Type.FLAT_VAR_INT_ITEM; + return Type.ITEM1_13_2; } protected Type itemArrayType() { - return Type.FLAT_VAR_INT_ITEM_ARRAY_VAR_INT; + return Type.ITEM1_13_2_ARRAY; } } diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaFilter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaFilter.java index 133554e8b..99bbf3453 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaFilter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaFilter.java @@ -124,13 +124,13 @@ public class MetaFilter { } public static final class Builder { - private final EntityRewriter rewriter; + private final EntityRewriter rewriter; private EntityType type; private int index = -1; private boolean filterFamily; private MetaHandler handler; - public Builder(EntityRewriter rewriter) { + public Builder(EntityRewriter rewriter) { this.rewriter = rewriter; } diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaHandlerEventImpl.java b/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaHandlerEventImpl.java index 98523a57e..9e6cff359 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaHandlerEventImpl.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/meta/MetaHandlerEventImpl.java @@ -21,11 +21,10 @@ package com.viaversion.viaversion.rewriter.meta; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.entity.TrackedEntity; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; -import org.checkerframework.checker.nullness.qual.Nullable; - import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.checkerframework.checker.nullness.qual.Nullable; public class MetaHandlerEventImpl implements MetaHandlerEvent { private final UserConnection connection; @@ -96,6 +95,10 @@ public class MetaHandlerEventImpl implements MetaHandlerEvent { @Override public void createExtraMeta(Metadata metadata) { - (extraData != null ? extraData : (extraData = new ArrayList<>())).add(metadata); + if (extraData == null) { + extraData = new ArrayList<>(); + } + + extraData.add(metadata); } } diff --git a/common/src/test/java/com/viaversion/viaversion/common/entities/EntityTypesTest.java b/common/src/test/java/com/viaversion/viaversion/common/entities/EntityTypesTest.java index a78b588cb..329932bfd 100644 --- a/common/src/test/java/com/viaversion/viaversion/common/entities/EntityTypesTest.java +++ b/common/src/test/java/com/viaversion/viaversion/common/entities/EntityTypesTest.java @@ -17,11 +17,11 @@ */ package com.viaversion.viaversion.common.entities; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_15Types; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_16_2Types; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_17Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_14; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_15; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16_2; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_17; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import java.util.function.Function; import org.junit.jupiter.api.Assertions; @@ -34,11 +34,11 @@ public class EntityTypesTest { @Test void testArrayOrder() { - testArrayOrder(Entity1_14Types.values(), Entity1_14Types::getTypeFromId); - testArrayOrder(Entity1_15Types.values(), Entity1_15Types::getTypeFromId); - testArrayOrder(Entity1_16Types.values(), Entity1_16Types::getTypeFromId); - testArrayOrder(Entity1_16_2Types.values(), Entity1_16_2Types::getTypeFromId); - testArrayOrder(Entity1_17Types.values(), Entity1_17Types::getTypeFromId); + testArrayOrder(EntityTypes1_14.values(), EntityTypes1_14::getTypeFromId); + testArrayOrder(EntityTypes1_15.values(), EntityTypes1_15::getTypeFromId); + testArrayOrder(EntityTypes1_16.values(), EntityTypes1_16::getTypeFromId); + testArrayOrder(EntityTypes1_16_2.values(), EntityTypes1_16_2::getTypeFromId); + testArrayOrder(EntityTypes1_17.values(), EntityTypes1_17::getTypeFromId); // Newer type enums are automatically filled using mappings } diff --git a/common/src/test/java/com/viaversion/viaversion/common/type/ItemTypeTest.java b/common/src/test/java/com/viaversion/viaversion/common/type/ItemTypeTest.java index 3a9a5af41..198b4ac1a 100644 --- a/common/src/test/java/com/viaversion/viaversion/common/type/ItemTypeTest.java +++ b/common/src/test/java/com/viaversion/viaversion/common/type/ItemTypeTest.java @@ -28,9 +28,9 @@ public class ItemTypeTest { @Test public void testEmptyItemRead() throws Exception { // Test empty item read - Assertions.assertNull(Type.ITEM.read(Unpooled.wrappedBuffer(new byte[]{-1, -1}))); - Assertions.assertNull(Type.FLAT_ITEM.read(Unpooled.wrappedBuffer(new byte[]{-1, -1}))); - Assertions.assertNull(Type.FLAT_VAR_INT_ITEM.read(Unpooled.wrappedBuffer(new byte[]{0}))); + Assertions.assertNull(Type.ITEM1_8.read(Unpooled.wrappedBuffer(new byte[]{-1, -1}))); + Assertions.assertNull(Type.ITEM1_13.read(Unpooled.wrappedBuffer(new byte[]{-1, -1}))); + Assertions.assertNull(Type.ITEM1_13_2.read(Unpooled.wrappedBuffer(new byte[]{0}))); } @Test @@ -39,7 +39,7 @@ public class ItemTypeTest { // Test item read Assertions.assertEquals( new DataItem((int) Short.MAX_VALUE, (byte) -128, (short) 257, null), - Type.ITEM.read(Unpooled.wrappedBuffer(new byte[]{ + Type.ITEM1_8.read(Unpooled.wrappedBuffer(new byte[]{ 127, -1, -128, 1, 1, @@ -48,7 +48,7 @@ public class ItemTypeTest { ); Assertions.assertEquals( new DataItem(420, (byte) 53, (short) 0, null), - Type.FLAT_ITEM.read(Unpooled.wrappedBuffer(new byte[]{ + Type.ITEM1_13.read(Unpooled.wrappedBuffer(new byte[]{ 1, (byte) 164, 53, 0 @@ -56,7 +56,7 @@ public class ItemTypeTest { ); Assertions.assertEquals( new DataItem(268435456, (byte) 127, (short) 0, null), - Type.FLAT_VAR_INT_ITEM.read(Unpooled.wrappedBuffer(new byte[]{ + Type.ITEM1_13_2.read(Unpooled.wrappedBuffer(new byte[]{ 1, -128, -128, -128, -128, 1, 127, @@ -70,11 +70,11 @@ public class ItemTypeTest { ByteBuf buf = Unpooled.buffer(); // Test item empty write - Type.ITEM.write(buf, null); + Type.ITEM1_8.write(buf, null); Assertions.assertArrayEquals(toBytes(buf), new byte[]{-1, -1}); - Type.FLAT_ITEM.write(buf, null); + Type.ITEM1_13.write(buf, null); Assertions.assertArrayEquals(toBytes(buf), new byte[]{-1, -1}); - Type.FLAT_VAR_INT_ITEM.write(buf, null); + Type.ITEM1_13_2.write(buf, null); Assertions.assertArrayEquals(toBytes(buf), new byte[]{0}); } @@ -83,20 +83,20 @@ public class ItemTypeTest { ByteBuf buf = Unpooled.buffer(); // Test item write - Type.ITEM.write(buf, new DataItem((int) Short.MAX_VALUE, (byte) -128, (short) 257, null)); + Type.ITEM1_8.write(buf, new DataItem((int) Short.MAX_VALUE, (byte) -128, (short) 257, null)); Assertions.assertArrayEquals(toBytes(buf), new byte[]{ 127, -1, -128, 1, 1, 0 }); - Type.FLAT_ITEM.write(buf, new DataItem(420, (byte) 53, (short) 0, null)); + Type.ITEM1_13.write(buf, new DataItem(420, (byte) 53, (short) 0, null)); Assertions.assertArrayEquals(toBytes(buf), new byte[]{ 1, (byte) 164, 53, 0 }); - Type.FLAT_VAR_INT_ITEM.write(buf, new DataItem(268435456, (byte) 127, (short) 0, null)); + Type.ITEM1_13_2.write(buf, new DataItem(268435456, (byte) 127, (short) 0, null)); Assertions.assertArrayEquals(toBytes(buf), new byte[]{ 1, -128, -128, -128, -128, 1, diff --git a/template/src/main/java/com/viaversion/viaversion/template/protocols/Protocol1_99To_98.java b/template/src/main/java/com/viaversion/viaversion/template/protocols/Protocol1_99To_98.java index e7298d5c1..432760459 100644 --- a/template/src/main/java/com/viaversion/viaversion/template/protocols/Protocol1_99To_98.java +++ b/template/src/main/java/com/viaversion/viaversion/template/protocols/Protocol1_99To_98.java @@ -20,7 +20,7 @@ package com.viaversion.viaversion.template.protocols; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingDataBase; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; import com.viaversion.viaversion.api.protocol.packet.ServerboundPacketType; @@ -107,7 +107,7 @@ public final class Protocol1_99To_98 extends AbstractProtocol { public BlockItemPacketRewriter1_99(final Protocol1_99To_98 protocol) { - super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_VAR_INT_ARRAY); + super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_ARRAY); } @Override @@ -40,7 +40,7 @@ public final class BlockItemPacketRewriter1_99 extends ItemRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); + final BlockRewriter blockRewriter = BlockRewriter.for1_20_2(protocol); blockRewriter.registerBlockAction(ClientboundPackets1_20_2.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_CHANGE); blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.MULTI_BLOCK_CHANGE); diff --git a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java index 100e1241b..1ab9efd06 100644 --- a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java +++ b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/EntityPacketRewriter1_99.java @@ -17,7 +17,7 @@ */ package com.viaversion.viaversion.template.protocols.rewriter; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; +import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4; import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; @@ -40,7 +40,7 @@ public final class EntityPacketRewriter1_99 extends EntityRewriter { + filter().filterFamily(EntityTypes1_19_4.MINECART_ABSTRACT).index(11).handler((event, meta) -> { final int blockState = meta.value(); meta.setValue(protocol.getMappingData().getNewBlockStateId(blockState)); }); @@ -115,6 +115,6 @@ public final class EntityPacketRewriter1_99 extends EntityRewriter