Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/nms-patches/FluidTypeFlowing.patch

47 Zeilen
2.3 KiB
Diff

2018-07-15 02:00:00 +02:00
--- a/net/minecraft/server/FluidTypeFlowing.java
+++ b/net/minecraft/server/FluidTypeFlowing.java
2018-12-25 22:00:00 +01:00
@@ -10,6 +10,11 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
2018-07-15 02:00:00 +02:00
+// CraftBukkit start
+import org.bukkit.block.BlockFace;
+import org.bukkit.craftbukkit.block.CraftBlock;
+import org.bukkit.event.block.BlockFromToEvent;
+// CraftBukkit end
public abstract class FluidTypeFlowing extends FluidType {
2018-12-25 22:00:00 +01:00
@@ -141,6 +146,15 @@
2018-07-15 02:00:00 +02:00
Fluid fluid1 = this.a((IWorldReader) generatoraccess, blockposition1, iblockdata1);
2018-12-06 00:00:00 +01:00
if (this.a(generatoraccess, blockposition, iblockdata, EnumDirection.DOWN, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
2018-07-15 02:00:00 +02:00
+ // CraftBukkit start
+ org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition);
+ BlockFromToEvent event = new BlockFromToEvent(source, BlockFace.DOWN);
+ generatoraccess.getMinecraftWorld().getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.a(generatoraccess, blockposition1, iblockdata1, EnumDirection.DOWN, fluid1);
if (this.a((IWorldReader) generatoraccess, blockposition) >= 3) {
this.a(generatoraccess, blockposition, fluid, iblockdata);
2018-12-25 22:00:00 +01:00
@@ -171,6 +185,15 @@
2018-07-15 02:00:00 +02:00
IBlockData iblockdata1 = generatoraccess.getType(blockposition1);
2018-12-06 00:00:00 +01:00
if (this.a(generatoraccess, blockposition, iblockdata, enumdirection, blockposition1, iblockdata1, generatoraccess.getFluid(blockposition1), fluid1.c())) {
2018-07-15 02:00:00 +02:00
+ // CraftBukkit start
+ org.bukkit.block.Block source = CraftBlock.at(generatoraccess, blockposition);
+ BlockFromToEvent event = new BlockFromToEvent(source, org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(enumdirection));
+ generatoraccess.getMinecraftWorld().getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ continue;
+ }
+ // CraftBukkit end
this.a(generatoraccess, blockposition1, iblockdata1, enumdirection, fluid1);
}
}