mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 12:05:59 +03:00
32 lines
1.8 KiB
Diff
32 lines
1.8 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/ai/EntityAIEatGrass.java
|
|
@@ -1,5 +1,8 @@
|
|
package net.minecraft.entity.ai;
|
|
|
|
+import org.bukkit.Material;
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+
|
|
import com.google.common.base.Predicate;
|
|
import com.google.common.base.Predicates;
|
|
import net.minecraft.block.Block;
|
|
@@ -70,7 +73,8 @@
|
|
|
|
if (IS_TALL_GRASS.apply(this.entityWorld.getBlockState(blockpos)))
|
|
{
|
|
- if (this.entityWorld.getGameRules().getBoolean("mobGriefing"))
|
|
+ // CraftBukkit
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.grassEaterEntity, this.grassEaterEntity.worldObj.getWorld().getBlockAt(blockpos.getX(), blockpos.getY(), blockpos.getZ()), Material.AIR, !this.entityWorld.getGameRules().getBoolean("mobGriefing")).isCancelled())
|
|
{
|
|
this.entityWorld.destroyBlock(blockpos, false);
|
|
}
|
|
@@ -83,7 +87,8 @@
|
|
|
|
if (this.entityWorld.getBlockState(blockpos1).getBlock() == Blocks.GRASS)
|
|
{
|
|
- if (this.entityWorld.getGameRules().getBoolean("mobGriefing"))
|
|
+ // CraftBukkit
|
|
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this.grassEaterEntity, this.grassEaterEntity.worldObj.getWorld().getBlockAt(blockpos1.getX(), blockpos1.getY(), blockpos1.getZ()), Material.AIR, !this.entityWorld.getGameRules().getBoolean("mobGriefing")).isCancelled())
|
|
{
|
|
this.entityWorld.playEvent(2001, blockpos1, Block.getIdFromBlock(Blocks.GRASS));
|
|
this.entityWorld.setBlockState(blockpos1, Blocks.DIRT.getDefaultState(), 2);
|