PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/MultifaceBlock.patch
CraftBukkit/Spigot 43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00

38 lines
2 KiB
Diff

--- a/net/minecraft/world/level/block/MultifaceBlock.java
+++ b/net/minecraft/world/level/block/MultifaceBlock.java
@@ -133,7 +133,7 @@
return (IBlockData) Arrays.stream(blockactioncontext.getNearestLookingDirections()).map((enumdirection) -> {
return this.getStateForPlacement(iblockdata, world, blockposition, enumdirection);
- }).filter(Objects::nonNull).findFirst().orElse((Object) null);
+ }).filter(Objects::nonNull).findFirst().orElse(null); // CraftBukkit - decompile error
}
@Nullable
@@ -225,7 +225,7 @@
if (optional.isPresent()) {
Pair<BlockPosition, EnumDirection> pair = (Pair) optional.get();
- return this.spreadToFace(generatoraccess, (BlockPosition) pair.getFirst(), (EnumDirection) pair.getSecond(), flag);
+ return this.spreadToFace(generatoraccess, (BlockPosition) pair.getFirst(), (EnumDirection) pair.getSecond(), flag, blockposition); // CraftBukkit
} else {
return false;
}
@@ -270,7 +270,7 @@
}
}
- private boolean spreadToFace(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, boolean flag) {
+ private boolean spreadToFace(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, boolean flag, BlockPosition source) { // CraftBukkit
IBlockData iblockdata = generatoraccess.getBlockState(blockposition);
IBlockData iblockdata1 = this.getStateForPlacement(iblockdata, generatoraccess, blockposition, enumdirection);
@@ -279,7 +279,7 @@
generatoraccess.getChunk(blockposition).markPosForPostprocessing(blockposition);
}
- return generatoraccess.setBlock(blockposition, iblockdata1, 2);
+ return org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, source, blockposition, iblockdata1, 2); // CraftBukkit
} else {
return false;
}