Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
Camel EntityToggleSitEvent (#8970)
Dieser Commit ist enthalten in:
Ursprung
73cf1257ca
Commit
eb0232ef09
@ -68,3 +68,33 @@ index 0a18108fda778af5b600f77533770bd98584d60e..9c1e02c3a990cd0f8bba1c84c170b438
|
||||
this.setFlag(8, sitting);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 37882a393d7c17a9437145ab5fe1f74370681146..05c7680569346bb863b896bcc9515f3e7cfb8114 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -586,7 +586,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
}
|
||||
|
||||
public void sitDown() {
|
||||
- if (!this.isCamelSitting()) {
|
||||
+ if (!this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), true).callEvent()) { // Paper
|
||||
this.playSound(SoundEvents.CAMEL_SIT, 1.0F, 1.0F);
|
||||
this.setPose(Pose.SITTING);
|
||||
this.resetLastPoseChangeTick(-this.level.getGameTime());
|
||||
@@ -594,7 +594,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
}
|
||||
|
||||
public void standUp() {
|
||||
- if (this.isCamelSitting()) {
|
||||
+ if (this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), false).callEvent()) { // Paper
|
||||
this.playSound(SoundEvents.CAMEL_STAND, 1.0F, 1.0F);
|
||||
this.setPose(Pose.STANDING);
|
||||
this.resetLastPoseChangeTick(this.level.getGameTime());
|
||||
@@ -602,6 +602,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
||||
}
|
||||
|
||||
public void standUpPanic() {
|
||||
+ if (this.isCamelSitting() && !new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), false).callEvent()) return; // Paper
|
||||
this.setPose(Pose.STANDING);
|
||||
this.resetLastPoseChangeTickToFullStand(this.level.getGameTime());
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren