mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Add missing Piglin Dancing API (#8894)
This commit is contained in:
@@ -37,6 +37,7 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||
Co-authored-by: booky10 <boooky10@gmail.com>
|
||||
Co-authored-by: Amin <amin.haddou@frg.wwschool.de>
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user