[Bleeding] Implemented Sheep, Shear and EntityChangeBlock API. Thanks

tips48! Closes BUKKIT-512
This commit is contained in:
Aidan Matzko
2012-01-21 21:28:32 -05:00
committed by EvilSeph
parent 229337bc8f
commit 93bc8ecd93
2 changed files with 63 additions and 8 deletions

View File

@@ -113,7 +113,18 @@ public class ItemDye extends Item {
int i = BlockCloth.d(itemstack.getData());
if (!entitysheep.isSheared() && entitysheep.getColor() != i) {
entitysheep.setColor(i);
// CraftBukkit start
byte bColor = new Integer(i).byteValue();
org.bukkit.event.entity.SheepDyeWoolEvent event = new org.bukkit.event.entity.SheepDyeWoolEvent(entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor));
entitysheep.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
int iColor = new Byte(event.getColor().getData()).intValue();
entitysheep.setColor(iColor);
// CraftBukkit end
--itemstack.count;
}
}