mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-04 15:31:43 +00:00
26 lines
1.4 KiB
Diff
26 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Samsuik <kfian294ma4@gmail.com>
|
|
Date: Fri, 23 Feb 2024 14:40:32 +0000
|
|
Subject: [PATCH] Old enchanted golden apples
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 8ea2e719d0396f7cf96d3d0f943ac68eda250851..26b030fd6e5443228e4a82376ddb5642d97ea423 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -4524,7 +4524,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
Item item = stack.getItem();
|
|
|
|
if (item.isEdible()) {
|
|
+ // Sakura start - old enchanted golden apples
|
|
List<Pair<MobEffectInstance, Float>> list = item.getFoodProperties().getEffects();
|
|
+ if (this.level().sakuraConfig().players.combat.oldEnchantedGoldenApple && item.getFoodProperties() == net.minecraft.world.food.Foods.ENCHANTED_GOLDEN_APPLE) {
|
|
+ list = new ArrayList<>(2);
|
|
+ list.add(new Pair(new MobEffectInstance(MobEffects.REGENERATION, 600, 4), 1.0F));
|
|
+ list.add(new Pair(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 1), 1.0F));
|
|
+ }
|
|
+ // Sakura end - old enchanted golden apples
|
|
Iterator iterator = list.iterator();
|
|
|
|
while (iterator.hasNext()) {
|