mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-20 23:03:48 -07:00
Use CraftEventFactory for BlockFormEvent
This commit is contained in:
@@ -21,22 +21,12 @@
|
||||
}
|
||||
|
||||
if (!this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
@@ -73,7 +78,17 @@
|
||||
@@ -73,7 +78,7 @@
|
||||
BlockPosition blockposition = new BlockPosition(i, j, k);
|
||||
|
||||
if (this.world.getType(blockposition).getMaterial() == Material.AIR && this.world.getBiome(blockposition).a(blockposition) < 0.8F && Blocks.SNOW_LAYER.canPlace(this.world, blockposition)) {
|
||||
- this.world.setTypeUpdate(blockposition, Blocks.SNOW_LAYER.getBlockData());
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.block.BlockState blockState = this.world.getWorld().getBlockAt(i, j, k).getState();
|
||||
+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.SNOW_LAYER));
|
||||
+
|
||||
+ EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState);
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if(!event.isCancelled()) {
|
||||
+ blockState.update(true);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this.world, blockposition, Blocks.SNOW_LAYER, this); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user