2017-06-03 09:39:03 +02:00
|
|
|
--- a/net/minecraft/server/BlockConcretePowder.java
|
|
|
|
+++ b/net/minecraft/server/BlockConcretePowder.java
|
2018-07-15 02:00:00 +02:00
|
|
|
@@ -1,5 +1,10 @@
|
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.block.CraftBlockState;
|
|
|
|
+import org.bukkit.event.block.BlockFormEvent;
|
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
|
|
|
public class BlockConcretePowder extends BlockFalling {
|
|
|
|
|
|
|
|
private final IBlockData a;
|
|
|
|
@@ -10,8 +15,8 @@
|
2017-06-03 09:39:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(World world, BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {
|
|
|
|
- if (iblockdata1.getMaterial().isLiquid()) {
|
2018-07-15 02:00:00 +02:00
|
|
|
- world.setTypeAndData(blockposition, this.a, 3);
|
|
|
|
+ if (iblockdata1.getMaterial().isLiquid() && !(world.getType(blockposition).getBlock() instanceof BlockConcretePowder)) { // CraftBukkit - don't double concrete
|
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition, this.a, 3);
|
2017-06-03 09:39:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2018-07-15 02:00:00 +02:00
|
|
|
@@ -45,6 +50,20 @@
|
|
|
|
}
|
2017-06-03 09:39:03 +02:00
|
|
|
|
2018-07-15 02:00:00 +02:00
|
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
|
|
- return a((IBlockAccess) generatoraccess, blockposition) ? this.a : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (a((IBlockAccess) generatoraccess, blockposition)) {
|
|
|
|
+ CraftBlockState blockState = CraftBlockState.getBlockState(generatoraccess, blockposition);
|
|
|
|
+ blockState.setData(this.a);
|
|
|
|
+
|
|
|
|
+ BlockFormEvent event = new BlockFormEvent(blockState.getBlock(), blockState);
|
|
|
|
+ generatoraccess.getMinecraftWorld().getMinecraftServer().server.getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ return blockState.getHandle();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
}
|