Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-26 16:12:43 +01:00
Use a hanging bat for sitting parrot
Dieser Commit ist enthalten in:
Ursprung
4928dab3f0
Commit
a23204a86c
@ -16,4 +16,5 @@ import nl.matsv.viabackwards.api.entities.storage.EntityStorage;
|
|||||||
@Data
|
@Data
|
||||||
public class ParrotStorage extends EntityStorage {
|
public class ParrotStorage extends EntityStorage {
|
||||||
private boolean tamed = true;
|
private boolean tamed = true;
|
||||||
|
private boolean sitting = true;
|
||||||
}
|
}
|
||||||
|
@ -413,15 +413,29 @@ public class EntityPackets1_12 extends EntityRewriter<Protocol1_11_1To1_12> {
|
|||||||
// Parrot remove animal metadata
|
// Parrot remove animal metadata
|
||||||
registerMetaHandler().filter(EntityType.PARROT, 12).removed(); // Is baby
|
registerMetaHandler().filter(EntityType.PARROT, 12).removed(); // Is baby
|
||||||
registerMetaHandler().filter(EntityType.PARROT, 13).handle(e -> {
|
registerMetaHandler().filter(EntityType.PARROT, 13).handle(e -> {
|
||||||
|
Metadata data = e.getData();
|
||||||
ParrotStorage storage = e.getEntity().get(ParrotStorage.class);
|
ParrotStorage storage = e.getEntity().get(ParrotStorage.class);
|
||||||
boolean isTamed = (((byte) e.getData().getValue()) & 0x04) == 0x04;
|
boolean isSitting = (((byte) data.getValue()) & 0x01) == 0x01;
|
||||||
|
boolean isTamed = (((byte) data.getValue()) & 0x04) == 0x04;
|
||||||
|
|
||||||
if (!storage.isTamed() && isTamed) {
|
if (!storage.isTamed() && isTamed) {
|
||||||
// TODO do something to let the user know it's done
|
// TODO do something to let the user know it's done
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.setTamed(isTamed);
|
storage.setTamed(isTamed);
|
||||||
throw new RemovedValueException();
|
|
||||||
|
if (isSitting) {
|
||||||
|
data.setId(12);
|
||||||
|
data.setValue((byte) 0x01);
|
||||||
|
storage.setSitting(true);
|
||||||
|
} else if (storage.isSitting()) {
|
||||||
|
data.setId(12);
|
||||||
|
data.setValue((byte) 0x00);
|
||||||
|
storage.setSitting(false);
|
||||||
|
} else
|
||||||
|
throw new RemovedValueException();
|
||||||
|
|
||||||
|
return data;
|
||||||
}); // Flags (Is sitting etc, might be useful in the future
|
}); // Flags (Is sitting etc, might be useful in the future
|
||||||
registerMetaHandler().filter(EntityType.PARROT, 14).removed(); // Owner
|
registerMetaHandler().filter(EntityType.PARROT, 14).removed(); // Owner
|
||||||
registerMetaHandler().filter(EntityType.PARROT, 15).removed(); // Variant
|
registerMetaHandler().filter(EntityType.PARROT, 15).removed(); // Variant
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren