diff --git a/src/de/steamwar/spectatesystem/PacketProcessor.java b/src/de/steamwar/spectatesystem/PacketProcessor.java index 971afe7..9f733a7 100644 --- a/src/de/steamwar/spectatesystem/PacketProcessor.java +++ b/src/de/steamwar/spectatesystem/PacketProcessor.java @@ -308,9 +308,9 @@ class PacketProcessor { private void bow() throws IOException { int entityId = source.rInt(); boolean drawn = source.rBoolean(); - int hand = source.rInt(); + boolean offHand = source.rBoolean(); - execSync(() -> REntity.getEntity(entityId).setBowDrawn(drawn, hand)); + execSync(() -> REntity.getEntity(entityId).setBowDrawn(drawn, offHand)); } private void damage() throws IOException { diff --git a/src/de/steamwar/spectatesystem/elements/REntity.java b/src/de/steamwar/spectatesystem/elements/REntity.java index ccc5171..2faa831 100644 --- a/src/de/steamwar/spectatesystem/elements/REntity.java +++ b/src/de/steamwar/spectatesystem/elements/REntity.java @@ -168,11 +168,11 @@ public abstract class REntity { sendDataWatcher(dataWatcher); } - public void setBowDrawn(boolean drawn, int hand) { + public void setBowDrawn(boolean drawn, boolean offHand) { DataWatcher dataWatcher = new DataWatcher(null); DataWatcherObject dataWatcherObject = new DataWatcherObject<>(7, DataWatcherRegistry.a); - dataWatcher.register(dataWatcherObject, (byte) ((drawn?1:0) + (hand * 2))); + dataWatcher.register(dataWatcherObject, (byte) ((drawn ? 1 : 0) + (offHand ? 2 : 0))); dataWatcher.markDirty(dataWatcherObject); sendDataWatcher(dataWatcher);