diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-11-26 08:32:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2014-11-28 17:16:30 +1100 |
commit | 24557bc2b37deb6a0edf497d547471832457b1dd (patch) | |
tree | c560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/EntitySnowman.patch | |
parent | a4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff) | |
download | craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip |
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/EntitySnowman.patch')
-rw-r--r-- | nms-patches/EntitySnowman.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nms-patches/EntitySnowman.patch b/nms-patches/EntitySnowman.patch new file mode 100644 index 00000000..67e4371f --- /dev/null +++ b/nms-patches/EntitySnowman.patch @@ -0,0 +1,42 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/EntitySnowman.java 2014-11-27 08:59:46.733421706 +1100 ++++ src/main/java/net/minecraft/server/EntitySnowman.java 2014-11-27 08:42:10.144850927 +1100 +@@ -1,5 +1,11 @@ + package net.minecraft.server; + ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.craftbukkit.util.CraftMagicNumbers; ++import org.bukkit.event.block.EntityBlockFormEvent; ++// CraftBukkit end ++ + public class EntitySnowman extends EntityGolem implements IRangedEntity { + + public EntitySnowman(World world) { +@@ -31,7 +37,7 @@ + } + + if (this.world.getBiome(new BlockPosition(i, 0, k)).a(new BlockPosition(i, j, k)) > 1.0F) { +- this.damageEntity(DamageSource.BURN, 1.0F); ++ this.damageEntity(CraftEventFactory.MELTING, 1.0F); // CraftBukkit - DamageSource.BURN -> CraftEventFactory.MELTING + } + + for (int l = 0; l < 4; ++l) { +@@ -39,7 +45,17 @@ + j = MathHelper.floor(this.locY); + k = MathHelper.floor(this.locZ + (double) ((float) (l / 2 % 2 * 2 - 1) * 0.25F)); + if (this.world.getType(new BlockPosition(i, j, k)).getBlock().getMaterial() == Material.AIR && this.world.getBiome(new BlockPosition(i, 0, k)).a(new BlockPosition(i, j, k)) < 0.8F && Blocks.SNOW_LAYER.canPlace(this.world, new BlockPosition(i, j, k))) { +- this.world.setTypeUpdate(new BlockPosition(i, j, k), 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 + } + } + } |