13
0

Fix REntity.setBowDrawn

Fix PacketProcessor
Dieser Commit ist enthalten in:
yoyosource 2021-04-23 20:28:02 +02:00
Ursprung da35cb6f10
Commit 0add346878
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -308,9 +308,9 @@ class PacketProcessor {
private void bow() throws IOException { private void bow() throws IOException {
int entityId = source.rInt(); int entityId = source.rInt();
boolean drawn = source.rBoolean(); 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 { private void damage() throws IOException {

Datei anzeigen

@ -168,11 +168,11 @@ public abstract class REntity {
sendDataWatcher(dataWatcher); sendDataWatcher(dataWatcher);
} }
public void setBowDrawn(boolean drawn, int hand) { public void setBowDrawn(boolean drawn, boolean offHand) {
DataWatcher dataWatcher = new DataWatcher(null); DataWatcher dataWatcher = new DataWatcher(null);
DataWatcherObject<Byte> dataWatcherObject = new DataWatcherObject<>(7, DataWatcherRegistry.a); DataWatcherObject<Byte> 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); dataWatcher.markDirty(dataWatcherObject);
sendDataWatcher(dataWatcher); sendDataWatcher(dataWatcher);