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