From df702736bf44165b32d3e86e4f57856130489ebe Mon Sep 17 00:00:00 2001 From: KennyTV Date: Sat, 4 Apr 2020 00:37:06 +0200 Subject: [PATCH] Readd block entity wrapping --- .../protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java | 3 ++- .../protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java | 3 ++- .../protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java | 3 ++- .../protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java index 1563d6c6d..7de8e508a 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java @@ -13,6 +13,7 @@ import us.myles.ViaVersion.api.type.types.minecraft.BaseChunkType; import us.myles.ViaVersion.api.type.types.version.Types1_13; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.logging.Level; @@ -55,7 +56,7 @@ public class Chunk1_13Type extends PartialType { } } - List nbtData = Arrays.asList(Type.NBT_ARRAY.read(input)); + List nbtData = new ArrayList<>(Arrays.asList(Type.NBT_ARRAY.read(input))); // Read all the remaining bytes (workaround for #681) if (input.readableBytes() > 0) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java index c4c2b0181..43f2d7b74 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java @@ -12,6 +12,7 @@ import us.myles.ViaVersion.api.type.types.minecraft.BaseChunkType; import us.myles.ViaVersion.api.type.types.version.Types1_13; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -50,7 +51,7 @@ public class Chunk1_14Type extends PartialType { } } - List nbtData = Arrays.asList(Type.NBT_ARRAY.read(input)); + List nbtData = new ArrayList<>(Arrays.asList(Type.NBT_ARRAY.read(input))); // Read all the remaining bytes (workaround for #681) if (input.readableBytes() > 0) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java index 298e41339..a947a585b 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java @@ -12,6 +12,7 @@ import us.myles.ViaVersion.api.type.types.minecraft.BaseChunkType; import us.myles.ViaVersion.api.type.types.version.Types1_13; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -51,7 +52,7 @@ public class Chunk1_15Type extends PartialType { sections[i] = section; } - List nbtData = Arrays.asList(Type.NBT_ARRAY.read(input)); + List nbtData = new ArrayList<>(Arrays.asList(Type.NBT_ARRAY.read(input))); // Read all the remaining bytes (workaround for #681) if (input.readableBytes() > 0) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java index ca1740fcb..3669c213e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/types/Chunk1_9_3_4Type.java @@ -13,6 +13,7 @@ import us.myles.ViaVersion.api.type.types.minecraft.BaseChunkType; import us.myles.ViaVersion.api.type.types.version.Types1_9; import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -51,7 +52,7 @@ public class Chunk1_9_3_4Type extends PartialType { } } - List nbtData = Arrays.asList(Type.NBT_ARRAY.read(input)); + List nbtData = new ArrayList<>(Arrays.asList(Type.NBT_ARRAY.read(input))); // Read all the remaining bytes (workaround for #681) if (input.readableBytes() > 0) {