From 4c7cf56655f25af0cb2e65cd992d195e7a1a95cd Mon Sep 17 00:00:00 2001 From: KennyTV Date: Tue, 16 Jun 2020 21:04:29 +0200 Subject: [PATCH] Fix future entity equip reading --- .../main/java/us/myles/ViaVersion/api/protocol/Protocol.java | 3 ++- .../java/us/myles/ViaVersion/api/rewriters/ItemRewriter.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java index ff57ebdb8..0c78d098c 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java @@ -455,7 +455,8 @@ public abstract class Protocol T get(Class objectClass) { + @Nullable + public T get(Class objectClass) { return (T) storedObjects.get(objectClass); } diff --git a/common/src/main/java/us/myles/ViaVersion/api/rewriters/ItemRewriter.java b/common/src/main/java/us/myles/ViaVersion/api/rewriters/ItemRewriter.java index b91efa56e..d83af1076 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/rewriters/ItemRewriter.java +++ b/common/src/main/java/us/myles/ViaVersion/api/rewriters/ItemRewriter.java @@ -69,7 +69,7 @@ public class ItemRewriter { handler(wrapper -> { byte slot; do { - slot = wrapper.read(Type.BYTE); + slot = wrapper.passthrough(Type.BYTE); // & 0x7F into an extra variable if slot is needed toClient.rewrite(wrapper.passthrough(type)); } while ((slot & 0xFFFFFF80) != 0);