aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0549-Add-PufferFishStateChangeEvent.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-06-14 14:07:44 -0700
committerJake Potrebic <[email protected]>2024-06-14 14:07:44 -0700
commitffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8 (patch)
tree7748595488691c8494b5bdb2d01711a5242f6b34 /patches/server/0549-Add-PufferFishStateChangeEvent.patch
parent188cff20c75367d8c90ae548a0dd528805d4a5a3 (diff)
downloadPaper-ffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8.tar.gz
Paper-ffe310a8e1dd4ed1027e903b4683f0ab42ee9ff8.zip
remove api that was scheduled for removal
Diffstat (limited to 'patches/server/0549-Add-PufferFishStateChangeEvent.patch')
-rw-r--r--patches/server/0549-Add-PufferFishStateChangeEvent.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/patches/server/0549-Add-PufferFishStateChangeEvent.patch b/patches/server/0549-Add-PufferFishStateChangeEvent.patch
new file mode 100644
index 0000000000..87e61bb2a3
--- /dev/null
+++ b/patches/server/0549-Add-PufferFishStateChangeEvent.patch
@@ -0,0 +1,50 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: HexedHero <[email protected]>
+Date: Mon, 10 May 2021 16:59:05 +0100
+Subject: [PATCH] Add PufferFishStateChangeEvent
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java
+index 9498bac12196637c187961424ef23ecb77eddff8..3f0fad476fe573c3ba946a9436d1b3f7c5260ee2 100644
+--- a/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java
++++ b/src/main/java/net/minecraft/world/entity/animal/Pufferfish.java
+@@ -101,25 +101,39 @@ public class Pufferfish extends AbstractFish {
+ public void tick() {
+ if (!this.level().isClientSide && this.isAlive() && this.isEffectiveAi()) {
+ if (this.inflateCounter > 0) {
++ boolean increase = true; // Paper - Add PufferFishStateChangeEvent
+ if (this.getPuffState() == 0) {
++ if (new io.papermc.paper.event.entity.PufferFishStateChangeEvent((org.bukkit.entity.PufferFish) getBukkitEntity(), 1).callEvent()) { // Paper - Add PufferFishStateChangeEvent
+ this.makeSound(SoundEvents.PUFFER_FISH_BLOW_UP);
+ this.setPuffState(1);
++ } else { increase = false; } // Paper - Add PufferFishStateChangeEvent
+ } else if (this.inflateCounter > 40 && this.getPuffState() == 1) {
++ if (new io.papermc.paper.event.entity.PufferFishStateChangeEvent((org.bukkit.entity.PufferFish) getBukkitEntity(), 2).callEvent()) { // Paper - Add PufferFishStateChangeEvent
+ this.makeSound(SoundEvents.PUFFER_FISH_BLOW_UP);
+ this.setPuffState(2);
++ } else { increase = false; } // Paper - Add PufferFishStateChangeEvent
+ }
+
++ if (increase) { // Paper - Add PufferFishStateChangeEvent
+ ++this.inflateCounter;
++ } // Paper - Add PufferFishStateChangeEvent
+ } else if (this.getPuffState() != 0) {
++ boolean increase = true; // Paper - Add PufferFishStateChangeEvent
+ if (this.deflateTimer > 60 && this.getPuffState() == 2) {
++ if (new io.papermc.paper.event.entity.PufferFishStateChangeEvent((org.bukkit.entity.PufferFish) getBukkitEntity(), 1).callEvent()) { // Paper - Add PufferFishStateChangeEvent
+ this.makeSound(SoundEvents.PUFFER_FISH_BLOW_OUT);
+ this.setPuffState(1);
++ } else { increase = false; } // Paper - Add PufferFishStateChangeEvent
+ } else if (this.deflateTimer > 100 && this.getPuffState() == 1) {
++ if (new io.papermc.paper.event.entity.PufferFishStateChangeEvent((org.bukkit.entity.PufferFish) getBukkitEntity(), 0).callEvent()) { // Paper - Add PufferFishStateChangeEvent
+ this.makeSound(SoundEvents.PUFFER_FISH_BLOW_OUT);
+ this.setPuffState(0);
++ } else { increase = false; } // Paper - Add PufferFishStateChangeEvent
+ }
+
++ if (increase) { // Paper - Add PufferFishStateChangeEvent
+ ++this.deflateTimer;
++ } // Paper - Add PufferFishStateChangeEvent
+ }
+ }
+