mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 18:07:39 +01:00
SPIGOT-2886: Call BlockFormEvent when Lava and Water collide
This commit is contained in:
parent
caf86c88a9
commit
f9eddf3f6e
@ -24,7 +24,7 @@
|
||||
int i = ((Integer) iblockdata.get(BlockFlowing.LEVEL)).intValue();
|
||||
byte b0 = 1;
|
||||
|
||||
@@ -88,6 +98,12 @@
|
||||
@@ -88,9 +98,16 @@
|
||||
IBlockData iblockdata2 = world.getType(blockposition.down());
|
||||
|
||||
if (this.h(world, blockposition.down(), iblockdata2)) {
|
||||
@ -35,9 +35,14 @@
|
||||
+ }
|
||||
+ if (!event.isCancelled()) {
|
||||
if (this.material == Material.LAVA && world.getType(blockposition.down()).getMaterial() == Material.WATER) {
|
||||
world.setTypeUpdate(blockposition.down(), Blocks.STONE.getBlockData());
|
||||
- world.setTypeUpdate(blockposition.down(), Blocks.STONE.getBlockData());
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition.down(), Blocks.STONE, null)){
|
||||
this.fizz(world, blockposition.down());
|
||||
@@ -99,6 +115,8 @@
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,6 +116,8 @@
|
||||
} else {
|
||||
this.flow(world, blockposition.down(), iblockdata2, i + 8);
|
||||
}
|
||||
@ -46,7 +51,7 @@
|
||||
} else if (i >= 0 && (i == 0 || this.g(world, blockposition.down(), iblockdata2))) {
|
||||
Set set = this.c(world, blockposition);
|
||||
|
||||
@@ -116,14 +134,23 @@
|
||||
@@ -116,14 +135,23 @@
|
||||
while (iterator1.hasNext()) {
|
||||
EnumDirection enumdirection1 = (EnumDirection) iterator1.next();
|
||||
|
||||
|
27
nms-patches/BlockFluids.patch
Normal file
27
nms-patches/BlockFluids.patch
Normal file
@ -0,0 +1,27 @@
|
||||
--- a/net/minecraft/server/BlockFluids.java
|
||||
+++ b/net/minecraft/server/BlockFluids.java
|
||||
@@ -163,14 +163,20 @@
|
||||
Integer integer = (Integer) iblockdata.get(BlockFluids.LEVEL);
|
||||
|
||||
if (integer.intValue() == 0) {
|
||||
- world.setTypeUpdate(blockposition, Blocks.OBSIDIAN.getBlockData());
|
||||
- this.fizz(world, blockposition);
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, Blocks.OBSIDIAN, null)) {
|
||||
+ this.fizz(world, blockposition);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
|
||||
if (integer.intValue() <= 4) {
|
||||
- world.setTypeUpdate(blockposition, Blocks.COBBLESTONE.getBlockData());
|
||||
- this.fizz(world, blockposition);
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, Blocks.COBBLESTONE, null)) {
|
||||
+ this.fizz(world, blockposition);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user