aboutsummaryrefslogtreecommitdiffhomepage
path: root/removed-patches-1-20-5
diff options
context:
space:
mode:
authorNoah van der Aa <[email protected]>2024-04-24 22:32:38 +0200
committerNoah van der Aa <[email protected]>2024-04-24 22:32:38 +0200
commit22227ccf2670e21152aa4746d0ac02e319e166f3 (patch)
treeb5d8baf8d9c28fe464a63b19e5f00a9cc97ad439 /removed-patches-1-20-5
parent71ae391eb3adc9a2e03514cd8bbff93d2241590c (diff)
downloadPaper-22227ccf2670e21152aa4746d0ac02e319e166f3.tar.gz
Paper-22227ccf2670e21152aa4746d0ac02e319e166f3.zip
more more work (757)
Diffstat (limited to 'removed-patches-1-20-5')
-rw-r--r--removed-patches-1-20-5/0757-properly-read-and-store-sus-effect-duration.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/removed-patches-1-20-5/0757-properly-read-and-store-sus-effect-duration.patch b/removed-patches-1-20-5/0757-properly-read-and-store-sus-effect-duration.patch
new file mode 100644
index 0000000000..94589408f4
--- /dev/null
+++ b/removed-patches-1-20-5/0757-properly-read-and-store-sus-effect-duration.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Mon, 18 Dec 2023 20:05:50 -0800
+Subject: [PATCH] properly read and store sus effect duration
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
+index e13146b71552ab3f9ae867110650fe3977563dfb..2c3b9f76067088efdc2250cdb5070df86e2dc0f5 100644
+--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
+@@ -49,7 +49,14 @@ public class CraftMetaSuspiciousStew extends CraftMetaItem implements Suspicious
+ if (type == null) {
+ continue;
+ }
+- int duration = effect.getInt(CraftMetaSuspiciousStew.DURATION.NBT);
++ // Paper start - default duration is 160
++ final int duration;
++ if (effect.contains(CraftMetaSuspiciousStew.DURATION.NBT)) {
++ duration = effect.getInt(CraftMetaSuspiciousStew.DURATION.NBT);
++ } else {
++ duration = net.minecraft.world.item.SuspiciousStewItem.DEFAULT_DURATION;
++ }
++ // Paper end start - default duration is 160
+ this.customEffects.add(new PotionEffect(type, duration, 0));
+ }
+ }
+@@ -80,7 +87,7 @@ public class CraftMetaSuspiciousStew extends CraftMetaItem implements Suspicious
+ for (PotionEffect effect : this.customEffects) {
+ CompoundTag effectData = new CompoundTag();
+ effectData.putString(CraftMetaSuspiciousStew.ID.NBT, effect.getType().getKey().toString());
+- effectData.putInt(CraftMetaSuspiciousStew.DURATION.NBT, effect.getDuration());
++ if (effect.getDuration() != net.minecraft.world.item.SuspiciousStewItem.DEFAULT_DURATION) effectData.putInt(CraftMetaSuspiciousStew.DURATION.NBT, effect.getDuration()); // Paper - don't save duration if it's the default value
+ effectList.add(effectData);
+ }
+ }