Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: moved Paper's honey bottle cure poison to default food prop…
…erties
  • Loading branch information
RealRONiN committed Oct 8, 2022
commit 4e45b8d109ebdc3ea7e39e457bb4ffc3e62aad1f
28 changes: 24 additions & 4 deletions patches/server/0309-Cure-effects-food-property.patch
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ index 6c945ae8fe8b1517e312c688f829fab41f12d9f4..770e17097c72e5e7359e5df147f855a6
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/food/Foods.java b/src/main/java/net/minecraft/world/food/Foods.java
index 71beab673f04cd051c46ea37f8c847316885d38d..2cf57404e55c4a7955aa3efd390c9ec8f8185e8e 100644
index 71beab673f04cd051c46ea37f8c847316885d38d..93b103866af9cf0c57e51f22a794869762c468d3 100644
--- a/src/main/java/net/minecraft/world/food/Foods.java
+++ b/src/main/java/net/minecraft/world/food/Foods.java
@@ -14,7 +14,7 @@ public class Foods {
Expand All @@ -164,7 +164,8 @@ index 71beab673f04cd051c46ea37f8c847316885d38d..2cf57404e55c4a7955aa3efd390c9ec8
+ public static final FoodProperties ENCHANTED_GOLDEN_APPLE = (new FoodProperties.Builder()).nutrition(4).saturationMod(1.2F).effectToAdd(new MobEffectInstance(MobEffects.REGENERATION, 400, 1), 1.0F).effectToAdd(new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 6000, 0), 1.0F).effectToAdd(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 6000, 0), 1.0F).effectToAdd(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 3), 1.0F).alwaysEat().build();
+ public static final FoodProperties GOLDEN_APPLE = (new FoodProperties.Builder()).nutrition(4).saturationMod(1.2F).effectToAdd(new MobEffectInstance(MobEffects.REGENERATION, 100, 1), 1.0F).effectToAdd(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 0), 1.0F).alwaysEat().build();
public static final FoodProperties GOLDEN_CARROT = (new FoodProperties.Builder()).nutrition(6).saturationMod(1.2F).build();
public static final FoodProperties HONEY_BOTTLE = (new FoodProperties.Builder()).nutrition(6).saturationMod(0.1F).build();
- public static final FoodProperties HONEY_BOTTLE = (new FoodProperties.Builder()).nutrition(6).saturationMod(0.1F).build();
+ public static final FoodProperties HONEY_BOTTLE = (new FoodProperties.Builder()).nutrition(6).saturationMod(0.1F).effectToCure(MobEffects.POISON).build();
public static final FoodProperties MELON_SLICE = (new FoodProperties.Builder()).nutrition(2).saturationMod(0.3F).build();
public static final FoodProperties MUSHROOM_STEW = stew(6).build();
public static final FoodProperties MUTTON = (new FoodProperties.Builder()).nutrition(2).saturationMod(0.3F).meat().build();
Expand Down Expand Up @@ -193,10 +194,29 @@ index 71beab673f04cd051c46ea37f8c847316885d38d..2cf57404e55c4a7955aa3efd390c9ec8
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
index c8d6b5e60b6c8c612fa8580c63a32c4a8f8b0a7b..777f10294e0672a94daa9e49153b116f636ba72e 100644
index c8d6b5e60b6c8c612fa8580c63a32c4a8f8b0a7b..4729a3506ad3a70c6a511d8fe68c7c027f3f4890 100644
--- a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
+++ b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
@@ -70,4 +70,4 @@ public class HoneyBottleItem extends Item {
@@ -7,7 +7,6 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
-import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
@@ -27,10 +26,6 @@ public class HoneyBottleItem extends Item {
serverPlayer.awardStat(Stats.ITEM_USED.get(this));
}

- if (!world.isClientSide) {
- user.removeEffect(MobEffects.POISON, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper
- }
-
if (stack.isEmpty()) {
return new ItemStack(Items.GLASS_BOTTLE);
} else {
@@ -70,4 +65,4 @@ public class HoneyBottleItem extends Item {
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
return ItemUtils.startUsingInstantly(world, user, hand);
}
Expand Down