diff --git a/patches/net/minecraft/world/entity/animal/Parrot.java.patch b/patches/net/minecraft/world/entity/animal/Parrot.java.patch index 5a8c938be5..0fbb41823f 100644 --- a/patches/net/minecraft/world/entity/animal/Parrot.java.patch +++ b/patches/net/minecraft/world/entity/animal/Parrot.java.patch @@ -34,12 +34,14 @@ return getImitatedSound(list.get(p_218240_.nextInt(list.size()))); } else { return SoundEvents.PARROT_AMBIENT; -@@ -329,6 +_,8 @@ +@@ -329,7 +_,9 @@ } private static SoundEvent getImitatedSound(EntityType p_29409_) { +- return MOB_SOUND_MAP.getOrDefault(p_29409_, SoundEvents.PARROT_AMBIENT); + var imitation = p_29409_.builtInRegistryHolder().getData(net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps.PARROT_IMITATIONS); + if (imitation != null) return imitation.sound(); - return MOB_SOUND_MAP.getOrDefault(p_29409_, SoundEvents.PARROT_AMBIENT); ++ return SoundEvents.PARROT_AMBIENT; } + @Override diff --git a/patches/net/minecraft/world/level/block/ComposterBlock.java.patch b/patches/net/minecraft/world/level/block/ComposterBlock.java.patch index fd6fc537dc..9a3dc8180a 100644 --- a/patches/net/minecraft/world/level/block/ComposterBlock.java.patch +++ b/patches/net/minecraft/world/level/block/ComposterBlock.java.patch @@ -4,7 +4,7 @@ public static final int MIN_LEVEL = 0; public static final int MAX_LEVEL = 7; public static final IntegerProperty LEVEL = BlockStateProperties.LEVEL_COMPOSTER; -+ /** @deprecated Neo: Use the {@link net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps#COMPOSTABLES compostable} data map instead, as this field will be ignored starting with 1.20.5. */ ++ /** @deprecated Neo: Use the {@link net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps#COMPOSTABLES compostable} data map instead */ + @Deprecated public static final Object2FloatMap COMPOSTABLES = new Object2FloatOpenHashMap<>(); private static final int AABB_SIDE_THICKNESS = 2; @@ -70,6 +70,6 @@ + public static float getValue(ItemStack item) { + var value = item.getItemHolder().getData(net.neoforged.neoforge.registries.datamaps.builtin.NeoForgeDataMaps.COMPOSTABLES); + if (value != null) return value.chance(); -+ return COMPOSTABLES.getFloat(item.getItem()); ++ return -1f; } } diff --git a/patches/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch b/patches/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch index 5f7807cc05..a62dbf7b2b 100644 --- a/patches/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch +++ b/patches/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch @@ -21,7 +21,7 @@ static int getGameEventFrequency(ResourceKey p_316800_) { - return VIBRATION_FREQUENCY_FOR_EVENT.applyAsInt(p_316800_); + var holder = net.minecraft.core.registries.BuiltInRegistries.GAME_EVENT.getHolder(p_316800_); -+ return holder.isPresent() ? getGameEventFrequency(holder.get()) : VIBRATION_FREQUENCY_FOR_EVENT.applyAsInt(p_316800_); ++ return holder.map(VibrationSystem::getGameEventFrequency).orElse(0); } static ResourceKey getResonanceEventByFrequency(int p_282105_) {