2014-11-28 19:23:19 +08:00
|
|
|
--- ../work/decompile-8eb82bde//net/minecraft/server/ItemDye.java 2014-11-28 11:22:56.042823161 +0000
|
|
|
|
+++ src/main/java/net/minecraft/server/ItemDye.java 2014-11-28 11:01:54.000000000 +0000
|
2014-11-26 05:32:16 +08:00
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
+import org.bukkit.event.entity.SheepDyeWoolEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class ItemDye extends Item {
|
|
|
|
|
|
|
|
public static final int[] a = new int[] { 1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
|
|
|
|
@@ -89,6 +91,17 @@
|
|
|
|
EnumColor enumcolor = EnumColor.fromInvColorIndex(itemstack.getData());
|
|
|
|
|
|
|
|
if (!entitysheep.isSheared() && entitysheep.getColor() != enumcolor) {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ byte bColor = (byte) enumcolor.getColorIndex();
|
|
|
|
+ SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor));
|
|
|
|
+ entitysheep.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ enumcolor = EnumColor.fromColorIndex((byte) event.getColor().getWoolData());
|
|
|
|
+ // CraftBukkit end
|
|
|
|
entitysheep.setColor(enumcolor);
|
|
|
|
--itemstack.count;
|
|
|
|
}
|