mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-03 22:16:38 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@84f6e6e Fix max temper API for llama (#10823) PaperMC/Paper@672c077 handle BODY slot for non-mobs (#10822) PaperMC/Paper@716b868 Use RegistryOps for loadAdvancement (#10799) PaperMC/Paper@d9e659a Allow firework effects with no colors (#10814) PaperMC/Paper@7e2b682 Fix skipping custom block entity tag (#10812) PaperMC/Paper@ed85aac Flatten namespaced vanilla command alias redirects (#10821) PaperMC/Paper@a31dc90 Several fixes and new api for experience merging/stacking (#9242) PaperMC/Paper@efd91e5 Add registry-related argument types (#10770) PaperMC/Paper@27d2ed8 Extend fishing API (#10634) PaperMC/Paper@0fcf3e3 Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784) PaperMC/Paper@8e6554a Fix sending disconnect packet in phases where it doesn't exist PaperMC/Paper@06e69c8 Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826) PaperMC/Paper@a47e11d fix knockback events (#10831) PaperMC/Paper@3181470 Add entity heal API (#10267) PaperMC/Paper@0513374 Fire TabCompleteEvent for legacy commands (#10834) PaperMC/Paper@5d8e53d Fix CommandSourceStack#bypassSelectorPermissions (#10837) PaperMC/Paper@ac64751 Use RegistryOps in the correct places (#10843) PaperMC/Paper@54fbd0c clarify what getEntityId actually returns (#10839) PaperMC/Paper@b8f2101 Only assign blockstate data if super ctor did not (#10841) PaperMC/Paper@4f13be9 Do not perform chunk existance check for I/O scheduling PaperMC/Paper@79c1ce1 Add since to deprecated for removals (#10848) PaperMC/Paper@88d76d9 Make Bogged implement Shearable (#10844) PaperMC/Paper@bd5867a Handle alpha channel from potion_contents component (#10808)
43 lines
2.5 KiB
Diff
43 lines
2.5 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 c9f23149df9bb0a2a73abb6e16ff9673562d60eb..f917b484f73ed44a6ad7be6aa049e18a13520594 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -4487,6 +4487,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
|
|
public ItemStack eat(Level world, ItemStack stack) {
|
|
FoodProperties foodinfo = (FoodProperties) stack.get(DataComponents.FOOD);
|
|
+ // Sakura start - old enchanted golden apple
|
|
+ if (this.level().sakuraConfig().players.combat.oldEnchantedGoldenApple && foodinfo == net.minecraft.world.food.Foods.ENCHANTED_GOLDEN_APPLE) {
|
|
+ foodinfo = net.minecraft.world.food.Foods.LEGACY_ENCHANTED_GOLDEN_APPLE;
|
|
+ }
|
|
+ // Sakura end - old enchanted golden apple
|
|
|
|
if (foodinfo != null) {
|
|
world.playSound((net.minecraft.world.entity.player.Player) null, this.getX(), this.getY(), this.getZ(), this.getEatingSound(stack), SoundSource.NEUTRAL, 1.0F, 1.0F + (world.random.nextFloat() - world.random.nextFloat()) * 0.4F);
|
|
diff --git a/src/main/java/net/minecraft/world/food/Foods.java b/src/main/java/net/minecraft/world/food/Foods.java
|
|
index 60fd0e89552aeaa78b98dda32caa6766097d3108..7ced9d09ad09b53979214dae57a6347620e55569 100644
|
|
--- a/src/main/java/net/minecraft/world/food/Foods.java
|
|
+++ b/src/main/java/net/minecraft/world/food/Foods.java
|
|
@@ -36,6 +36,15 @@ public class Foods {
|
|
.effect(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 3), 1.0F)
|
|
.alwaysEdible()
|
|
.build();
|
|
+ public static final FoodProperties LEGACY_ENCHANTED_GOLDEN_APPLE = new FoodProperties.Builder()
|
|
+ .nutrition(4)
|
|
+ .saturationModifier(1.2F)
|
|
+ .effect(new MobEffectInstance(MobEffects.REGENERATION, 600, 4), 1.0F)
|
|
+ .effect(new MobEffectInstance(MobEffects.DAMAGE_RESISTANCE, 6000, 0), 1.0F)
|
|
+ .effect(new MobEffectInstance(MobEffects.FIRE_RESISTANCE, 6000, 0), 1.0F)
|
|
+ .effect(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 0), 1.0F)
|
|
+ .alwaysEdible()
|
|
+ .build();
|
|
public static final FoodProperties GOLDEN_APPLE = new FoodProperties.Builder()
|
|
.nutrition(4)
|
|
.saturationModifier(1.2F)
|