From d166b09352eb1e08808e8ad2be4982af9a29496a Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 15 Mar 2023 10:37:41 -0400 Subject: [PATCH] Camel EntityToggleSitEvent (#8970) --- .../server/Added-EntityToggleSitEvent.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/patches/server/Added-EntityToggleSitEvent.patch b/patches/server/Added-EntityToggleSitEvent.patch index 8d93a6d9d3..0ff6ab1e42 100644 --- a/patches/server/Added-EntityToggleSitEvent.patch +++ b/patches/server/Added-EntityToggleSitEvent.patch @@ -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()); + }