13
0
geforkt von Mirrors/Paper

Camel EntityToggleSitEvent (#8970)

Dieser Commit ist enthalten in:
Owen1212055 2023-03-15 10:37:41 -04:00
Ursprung 8640f5feff
Commit d166b09352

Datei anzeigen

@ -68,3 +68,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
@@ -0,0 +0,0 @@ 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());
@@ -0,0 +0,0 @@ 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());
@@ -0,0 +0,0 @@ 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());
}