From 24520501a5d46d20f751db7bff633f569399bd3b Mon Sep 17 00:00:00 2001 From: MrPowerGamerBR Date: Mon, 25 Nov 2024 15:44:57 -0300 Subject: [PATCH] Fix crash when using the Blazing Simple Farm Checks due to the registry not existing --- .../0009-Blazingly-Simple-Farm-Checks.patch | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/patches/server/0009-Blazingly-Simple-Farm-Checks.patch b/patches/server/0009-Blazingly-Simple-Farm-Checks.patch index 6f0b576..09de20b 100644 --- a/patches/server/0009-Blazingly-Simple-Farm-Checks.patch +++ b/patches/server/0009-Blazingly-Simple-Farm-Checks.patch @@ -109,10 +109,18 @@ index c3dba0c2c94f3804338f86621dc42405e380a6b3..bfa98fe6df8e61512d913f98710d369d int xOff = pos.getX(); int yOff = pos.getY(); diff --git a/src/main/java/net/minecraft/world/level/block/StemBlock.java b/src/main/java/net/minecraft/world/level/block/StemBlock.java -index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..4b46fbb7a03de8f2616a398c6fa3794da60a1eea 100644 +index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..ad2a81ca11d5e6fcf5899051c5b0af9b5398f1ac 100644 --- a/src/main/java/net/minecraft/world/level/block/StemBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StemBlock.java -@@ -73,6 +73,56 @@ public class StemBlock extends BushBlock implements BonemealableBlock { +@@ -7,6 +7,7 @@ import java.util.Optional; + import net.minecraft.core.BlockPos; + import net.minecraft.core.Direction; + import net.minecraft.core.Registry; ++import net.minecraft.core.registries.BuiltInRegistries; + import net.minecraft.core.registries.Registries; + import net.minecraft.resources.ResourceKey; + import net.minecraft.server.level.ServerLevel; +@@ -73,6 +74,56 @@ public class StemBlock extends BushBlock implements BonemealableBlock { @Override protected void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { if (world.getRawBrightness(pos, 0) >= 9) { @@ -144,7 +152,7 @@ index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..4b46fbb7a03de8f2616a398c6fa3794d + BlockState iblockdata1 = world.getBlockState(blockposition1.below()); + + if (world.getBlockState(blockposition1).isAir() && (iblockdata1.is(Blocks.FARMLAND) || iblockdata1.is(BlockTags.DIRT))) { -+ Registry iregistry = world.registryAccess().get(Registries.BLOCK).get().value(); ++ Registry iregistry = BuiltInRegistries.BLOCK; + Optional optional = iregistry.getOptional(this.fruit); + Optional optional1 = iregistry.getOptional(this.attachedStem); + @@ -169,7 +177,7 @@ index 76109aceb24a4719d49c1a55e3621cf2a63bbe16..4b46fbb7a03de8f2616a398c6fa3794d float f = CropBlock.getGrowthSpeed(this, world, pos); if (random.nextFloat() < ((this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / (100.0f * (Math.floor((25.0F / f) + 1))))) { // Spigot - SPIGOT-7159: Better modifier resolution -@@ -102,7 +152,8 @@ public class StemBlock extends BushBlock implements BonemealableBlock { +@@ -102,7 +153,8 @@ public class StemBlock extends BushBlock implements BonemealableBlock { } } }