summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/EntitySnowman.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java
index bf8cf840..09afbc42 100644
--- a/src/main/java/net/minecraft/server/EntitySnowman.java
+++ b/src/main/java/net/minecraft/server/EntitySnowman.java
@@ -1,7 +1,11 @@
package net.minecraft.server;
import java.util.List;
+// Craftbukkit start
+import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.block.EntityBlockFormEvent;
+// Craftbukkit end
public class EntitySnowman extends EntityGolem {
@@ -39,7 +43,17 @@ public class EntitySnowman extends EntityGolem {
int l = MathHelper.floor(this.locZ + (double) ((float) (i / 2 % 2 * 2 - 1) * 0.25F));
if (this.world.getTypeId(j, k, l) == 0 && this.world.getWorldChunkManager().a(j, k, l) < 0.8F && Block.SNOW.canPlace(this.world, j, k, l)) {
- this.world.setTypeId(j, k, l, Block.SNOW.id);
+ // CraftBukkit start
+ BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState();
+ blockState.setTypeId(Block.SNOW.id);
+
+ EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState);
+ this.world.getServer().getPluginManager().callEvent(event);
+
+ if(!event.isCancelled()) {
+ blockState.update(true);
+ }
+ // CraftBukkit end
}
}
}
@@ -89,4 +103,4 @@ public class EntitySnowman extends EntityGolem {
CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}
-}
+} \ No newline at end of file