3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-23 23:00:08 +01:00
Paper/nms-patches/BlockMushroom.patch
2020-06-25 10:00:00 +10:00

42 Zeilen
2.0 KiB
Diff

--- a/net/minecraft/server/BlockMushroom.java
+++ b/net/minecraft/server/BlockMushroom.java
@@ -3,6 +3,10 @@
import java.util.Iterator;
import java.util.Random;
+// CraftBukkit start
+import org.bukkit.TreeType;
+// CraftBukkit end
+
public class BlockMushroom extends BlockPlant implements IBlockFragilePlantElement {
protected static final VoxelShape a = Block.a(5.0D, 0.0D, 5.0D, 11.0D, 6.0D, 11.0D);
@@ -45,7 +49,7 @@
}
if (worldserver.isEmpty(blockposition2) && iblockdata.canPlace(worldserver, blockposition2)) {
- worldserver.setTypeAndData(blockposition2, iblockdata, 2);
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, iblockdata, 2); // CraftBukkit
}
}
@@ -69,14 +73,16 @@
WorldGenFeatureConfigured worldgenfeatureconfigured;
if (this == Blocks.BROWN_MUSHROOM) {
- worldgenfeatureconfigured = WorldGenerator.HUGE_BROWN_MUSHROOM.b((WorldGenFeatureConfiguration) BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM);
+ BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit
+ worldgenfeatureconfigured = WorldGenerator.HUGE_BROWN_MUSHROOM.b(BiomeDecoratorGroups.HUGE_BROWN_MUSHROOM); // CraftBukkit - decompile error
} else {
if (this != Blocks.RED_MUSHROOM) {
worldserver.setTypeAndData(blockposition, iblockdata, 3);
return false;
}
- worldgenfeatureconfigured = WorldGenerator.HUGE_RED_MUSHROOM.b((WorldGenFeatureConfiguration) BiomeDecoratorGroups.HUGE_RED_MUSHROOM);
+ BlockSapling.treeType = TreeType.RED_MUSHROOM; // CraftBukkit
+ worldgenfeatureconfigured = WorldGenerator.HUGE_RED_MUSHROOM.b(BiomeDecoratorGroups.HUGE_RED_MUSHROOM); // CraftBukkit - decompile error
}
if (worldgenfeatureconfigured.a(worldserver, worldserver.getStructureManager(), worldserver.getChunkProvider().getChunkGenerator(), random, blockposition)) {