3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Wolf interactions

Dieser Commit ist enthalten in:
AJ Ferguson 2024-04-23 19:12:20 -04:00 committet von Camotoy
Ursprung 687d299ff5
Commit bbaffb2ab3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 23 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -133,16 +133,29 @@ public class WolfEntity extends TameableEntity {
if (itemInHand.asItem() == Items.BONE && !getFlag(EntityFlag.TAMED)) {
// Bone and untamed - can tame
return InteractiveTag.TAME;
} else {
if (itemInHand.asItem() instanceof DyeItem item) {
}
if (getFlag(EntityFlag.TAMED) && ownerBedrockId == session.getPlayerEntity().getGeyserId()) {
if (itemInHand.asItem() instanceof DyeItem dyeItem) {
// If this fails, as of Java Edition 1.18.1, you cannot toggle sit/stand
if (item.dyeColor() != this.collarColor) {
if (dyeItem.dyeColor() != this.collarColor) {
return InteractiveTag.DYE;
} else {
return super.testMobInteraction(hand, itemInHand);
}
} else if (getFlag(EntityFlag.TAMED) && ownerBedrockId == session.getPlayerEntity().getGeyserId()) {
// Tamed and owned by player - can sit/stand
return getFlag(EntityFlag.SITTING) ? InteractiveTag.STAND : InteractiveTag.SIT;
}
if (itemInHand.asItem() == Items.WOLF_ARMOR && !this.chestplate.isValid() && !getFlag(EntityFlag.BABY)) {
return InteractiveTag.EQUIP_WOLF_ARMOR;
}
if (itemInHand.asItem() == Items.SHEARS && this.chestplate.isValid()) { // TODO: check curse of binding
return InteractiveTag.REMOVE_WOLF_ARMOR;
}
if (Items.WOLF_ARMOR.isValidRepairItem(itemInHand.asItem()) && getFlag(EntityFlag.SITTING) &&
this.chestplate.isValid() && this.chestplate.getTag() != null &&
this.chestplate.getTag().getInt("Damage") > 0) {
return InteractiveTag.REPAIR_WOLF_ARMOR;
}
// Tamed and owned by player - can sit/stand
return getFlag(EntityFlag.SITTING) ? InteractiveTag.STAND : InteractiveTag.SIT;
}
return super.testMobInteraction(hand, itemInHand);
}

Datei anzeigen

@ -70,7 +70,10 @@ public enum InteractiveTag {
READ,
WAKE_VILLAGER("wakevillager"),
BARTER,
GIVE_ITEM_TO_ALLAY("allay");
GIVE_ITEM_TO_ALLAY("allay"),
EQUIP_WOLF_ARMOR("equipwolfarmor"),
REMOVE_WOLF_ARMOR("removewolfarmor"),
REPAIR_WOLF_ARMOR("repairwolfarmor");
/**
* The full string that should be passed on to the client.