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/PathfinderGoalEatTile.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/PathfinderGoalEatTile.patch')
-rw-r--r-- | nms-patches/PathfinderGoalEatTile.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/nms-patches/PathfinderGoalEatTile.patch b/nms-patches/PathfinderGoalEatTile.patch new file mode 100644 index 00000000..88f1cd79 --- /dev/null +++ b/nms-patches/PathfinderGoalEatTile.patch @@ -0,0 +1,34 @@ +--- ../work/decompile-bb26c12b/net/minecraft/server/PathfinderGoalEatTile.java 2014-11-27 08:59:46.821421318 +1100 ++++ src/main/java/net/minecraft/server/PathfinderGoalEatTile.java 2014-11-27 08:42:10.108850996 +1100 +@@ -3,6 +3,11 @@ + import com.google.common.base.Predicate; + import com.google.common.base.Predicates; + ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.Material; ++// CraftBukkit end ++ + public class PathfinderGoalEatTile extends PathfinderGoal { + + private static final Predicate b = BlockStatePredicate.a((Block) Blocks.TALLGRASS).a(BlockLongGrass.TYPE, Predicates.equalTo(EnumTallGrassType.GRASS)); +@@ -50,7 +55,8 @@ + BlockPosition blockposition = new BlockPosition(this.c.locX, this.c.locY, this.c.locZ); + + if (PathfinderGoalEatTile.b.apply(this.d.getType(blockposition))) { +- if (this.d.getGameRules().getBoolean("mobGriefing")) { ++ // CraftBukkit ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.c, this.c.world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), Material.AIR, !this.d.getGameRules().getBoolean("mobGriefing")).isCancelled()) { + this.d.setAir(blockposition, false); + } + +@@ -59,7 +65,8 @@ + BlockPosition blockposition1 = blockposition.down(); + + if (this.d.getType(blockposition1).getBlock() == Blocks.GRASS) { +- if (this.d.getGameRules().getBoolean("mobGriefing")) { ++ // CraftBukkit ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this.c, this.c.world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ()), Material.DIRT, !this.d.getGameRules().getBoolean("mobGriefing")).isCancelled()) { + this.d.triggerEffect(2001, blockposition1, Block.getId(Blocks.GRASS)); + this.d.setTypeAndData(blockposition1, Blocks.DIRT.getBlockData(), 2); + } |