From e26c34daf5f57c5ac13ea05bd9a4d3127102f133 Mon Sep 17 00:00:00 2001 From: Matsv Date: Sat, 6 Aug 2016 12:43:46 +0200 Subject: [PATCH] Fix some warnings --- .../protocol/protocol1_9_4to1_10/chunks/Chunk1_10.java | 2 +- .../protocol/protocol1_9_4to1_10/chunks/Chunk1_10Type.java | 5 +++-- .../protocol/protocol1_9_4to1_10/packets/EntityPackets.java | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10.java b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10.java index f46b9df9..6cb05db3 100644 --- a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10.java +++ b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10.java @@ -34,7 +34,7 @@ public class Chunk1_10 implements Chunk { private int bitmask; private ChunkSection1_10[] sections; private byte[] biomeData; - List blockEntities; + private List blockEntities; @Override public boolean isBiomeData() { diff --git a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10Type.java b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10Type.java index e55db7f1..84db3f83 100644 --- a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10Type.java +++ b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/chunks/Chunk1_10Type.java @@ -20,6 +20,7 @@ package nl.matsv.viabackwards.protocol.protocol1_9_4to1_10.chunks; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import org.apache.commons.lang.IllegalClassException; import org.bukkit.World; import us.myles.ViaVersion.api.minecraft.chunks.Chunk; import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection; @@ -46,7 +47,7 @@ public class Chunk1_10Type extends PartialType { boolean groundUp = input.readBoolean(); int primaryBitmask = Type.VAR_INT.read(input); - int size = Type.VAR_INT.read(input); + Type.VAR_INT.read(input); BitSet usedSections = new BitSet(16); ChunkSection1_10[] sections = new ChunkSection1_10[16]; @@ -82,7 +83,7 @@ public class Chunk1_10Type extends PartialType { @Override public void write(ByteBuf output, ClientWorld world, Chunk input) throws Exception { if (!(input instanceof Chunk1_10)) - throw new Exception("Tried to send the wrong chunk type from 1.9.3-4 chunk: " + input.getClass()); + throw new IllegalClassException("Tried to send the wrong chunk type from 1.9.3-4 chunk: " + input.getClass()); Chunk1_10 chunk = (Chunk1_10) input; output.writeInt(chunk.getX()); diff --git a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/EntityPackets.java b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/EntityPackets.java index 8fa3924a..5968cfbf 100644 --- a/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/EntityPackets.java +++ b/src/main/java/nl/matsv/viabackwards/protocol/protocol1_9_4to1_10/packets/EntityPackets.java @@ -322,6 +322,7 @@ public class EntityPackets extends EntityRewriter { protected void registerRewrites() { rewriteEntityId(102, 91); // Replace polar bear with sheep + // Handle Polar bear registerMetaRewriter((isObject, entityType, data) -> { // Change the sheep color when the polar bear is stending up if (!isObject && entityType != 102) return data; @@ -337,6 +338,7 @@ public class EntityPackets extends EntityRewriter { return data; }); + // Handle Husk registerMetaRewriter((isObject, entityType, data) -> { // Change husk to normal zombie if (isObject || entityType != 54) return data; @@ -346,6 +348,7 @@ public class EntityPackets extends EntityRewriter { return data; }); + // Handle stray registerMetaRewriter((isObject, entityType, data) -> { // Change stray- to normal skeleton if (isObject || entityType != 51) return data; @@ -355,6 +358,7 @@ public class EntityPackets extends EntityRewriter { return data; }); + // Handle the missing NoGravity tag registerMetaRewriter((isObject, entityType, m) -> { if (m.getId() == 5) throw new RemovedValueException();