summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/PathfinderGoalEatTile.java')
-rw-r--r--src/main/java/net/minecraft/server/PathfinderGoalEatTile.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
index 68ad1063..1feced1a 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java
@@ -18,7 +18,7 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
}
public boolean a() {
- if (this.b.aB().nextInt(this.b.isBaby() ? 50 : 1000) != 0) {
+ if (this.b.aE().nextInt(this.b.isBaby() ? 50 : 1000) != 0) {
return false;
} else {
int i = MathHelper.floor(this.b.locX);
@@ -57,17 +57,16 @@ public class PathfinderGoalEatTile extends PathfinderGoal {
if (this.c.getTypeId(i, j, k) == Block.LONG_GRASS.id) {
// CraftBukkit start
if (!CraftEventFactory.callEntityChangeBlockEvent(this.b.getBukkitEntity(), this.b.world.getWorld().getBlockAt(i, j, k), Material.AIR).isCancelled()) {
- this.c.triggerEffect(2001, i, j, k, Block.LONG_GRASS.id + 4096);
- this.c.setTypeId(i, j, k, 0);
- this.b.aH();
+ this.c.setAir(i, j, k, false);
+ this.b.aK();
}
// CraftBukkit end
} else if (this.c.getTypeId(i, j - 1, k) == Block.GRASS.id) {
// CraftBukkit start
if (!CraftEventFactory.callEntityChangeBlockEvent(this.b.getBukkitEntity(), this.b.world.getWorld().getBlockAt(i, j - 1, k), Material.DIRT).isCancelled()) {
this.c.triggerEffect(2001, i, j - 1, k, Block.GRASS.id);
- this.c.setTypeId(i, j - 1, k, Block.DIRT.id);
- this.b.aH();
+ this.c.setTypeIdAndData(i, j - 1, k, Block.DIRT.id, 0, 2);
+ this.b.aK();
}
// CraftBukkit end
}