Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 14:30:17 +01:00
Wolf interactions
Dieser Commit ist enthalten in:
Ursprung
687d299ff5
Commit
bbaffb2ab3
@ -133,17 +133,30 @@ public class WolfEntity extends TameableEntity {
|
|||||||
if (itemInHand.asItem() == Items.BONE && !getFlag(EntityFlag.TAMED)) {
|
if (itemInHand.asItem() == Items.BONE && !getFlag(EntityFlag.TAMED)) {
|
||||||
// Bone and untamed - can tame
|
// Bone and untamed - can tame
|
||||||
return InteractiveTag.TAME;
|
return InteractiveTag.TAME;
|
||||||
} else {
|
|
||||||
if (itemInHand.asItem() instanceof DyeItem item) {
|
|
||||||
// If this fails, as of Java Edition 1.18.1, you cannot toggle sit/stand
|
|
||||||
if (item.dyeColor() != this.collarColor) {
|
|
||||||
return InteractiveTag.DYE;
|
|
||||||
}
|
}
|
||||||
} else if (getFlag(EntityFlag.TAMED) && ownerBedrockId == session.getPlayerEntity().getGeyserId()) {
|
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 (dyeItem.dyeColor() != this.collarColor) {
|
||||||
|
return InteractiveTag.DYE;
|
||||||
|
} else {
|
||||||
|
return super.testMobInteraction(hand, itemInHand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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
|
// Tamed and owned by player - can sit/stand
|
||||||
return getFlag(EntityFlag.SITTING) ? InteractiveTag.STAND : InteractiveTag.SIT;
|
return getFlag(EntityFlag.SITTING) ? InteractiveTag.STAND : InteractiveTag.SIT;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return super.testMobInteraction(hand, itemInHand);
|
return super.testMobInteraction(hand, itemInHand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,10 @@ public enum InteractiveTag {
|
|||||||
READ,
|
READ,
|
||||||
WAKE_VILLAGER("wakevillager"),
|
WAKE_VILLAGER("wakevillager"),
|
||||||
BARTER,
|
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.
|
* The full string that should be passed on to the client.
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren