diff --git a/patches/api/Missing-Entity-API.patch b/patches/api/Missing-Entity-API.patch index 0dccb46b30..6367145bb6 100644 --- a/patches/api/Missing-Entity-API.patch +++ b/patches/api/Missing-Entity-API.patch @@ -8,6 +8,7 @@ Co-authored-by: Jake Potrebic Co-authored-by: William Blake Galbreath Co-authored-by: SoSeDiK Co-authored-by: booky10 +Co-authored-by: Amin diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -762,6 +763,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return is charging + */ + boolean isChargingCrossbow(); ++ ++ /** ++ * Sets whether the Piglin is dancing or not ++ * ++ * @param dancing is dancing ++ */ ++ void setDancing(boolean dancing); ++ ++ /** ++ * Causes the piglin to dance for a ++ * specified amount of time ++ * ++ * @param duration duration of the dance in ticks ++ */ ++ void setDancing(long duration); ++ ++ /** ++ * Gets if the piglin is currently dancing ++ * ++ * @return is dancing ++ */ ++ boolean isDancing(); + // Paper end + } diff --git a/patches/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch index 992eec953e..bc7aff4523 100644 --- a/patches/server/Missing-Entity-API.patch +++ b/patches/server/Missing-Entity-API.patch @@ -37,6 +37,7 @@ Co-authored-by: Jake Potrebic Co-authored-by: William Blake Galbreath Co-authored-by: SoSeDiK Co-authored-by: booky10 +Co-authored-by: Amin diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -941,6 +942,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public boolean isChargingCrossbow() { + return this.getHandle().isChargingCrossbow(); + } ++ ++ @Override ++ public void setDancing(boolean dancing) { ++ if (dancing) { ++ this.getHandle().getBrain().setMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.DANCING, true); ++ this.getHandle().getBrain().setMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.CELEBRATE_LOCATION, this.getHandle().getOnPos()); ++ } else { ++ this.getHandle().getBrain().eraseMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.DANCING); ++ this.getHandle().getBrain().eraseMemory(net.minecraft.world.entity.ai.memory.MemoryModuleType.CELEBRATE_LOCATION); ++ } ++ } ++ ++ @Override ++ public void setDancing(long duration) { ++ this.getHandle().getBrain().setMemoryWithExpiry(net.minecraft.world.entity.ai.memory.MemoryModuleType.DANCING, true, duration); ++ this.getHandle().getBrain().setMemoryWithExpiry(net.minecraft.world.entity.ai.memory.MemoryModuleType.CELEBRATE_LOCATION, this.getHandle().getOnPos(), duration); ++ } ++ ++ @Override ++ public boolean isDancing() { ++ return this.getHandle().isDancing(); ++ } + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPolarBear.java