PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockMushroom.patch
CraftBukkit/Spigot db4af65c2e SPIGOT-7581: Fix typo in BlockMushroom
By: md_5 <git@md-5.net>
2024-02-09 19:00:25 +11:00

30 lines
1.4 KiB
Diff

--- a/net/minecraft/world/level/block/BlockMushroom.java
+++ b/net/minecraft/world/level/block/BlockMushroom.java
@@ -20,6 +20,10 @@
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
+// CraftBukkit start
+import org.bukkit.TreeType;
+// CraftBukkit end
+
public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
public static final MapCodec<BlockMushroom> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
@@ -75,7 +79,7 @@
}
if (worldserver.isEmptyBlock(blockposition2) && iblockdata.canSurvive(worldserver, blockposition2)) {
- worldserver.setBlock(blockposition2, iblockdata, 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, iblockdata, 2); // CraftBukkit
}
}
@@ -101,6 +105,7 @@
return false;
} else {
worldserver.removeBlock(blockposition, false);
+ BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.RED_MUSHROOM; // CraftBukkit
if (((WorldGenFeatureConfigured) ((Holder) optional.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition)) {
return true;
} else {