SPIGOT-6657: Add getPlayer to SheepDyeWoolEvent

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-07-18 11:08:18 +10:00
parent 5eb7a2ed61
commit fd8748b4bd

View file

@ -16,7 +16,7 @@
- entitysheep.setColor(this.dyeColor);
+ // CraftBukkit start
+ byte bColor = (byte) this.dyeColor.getColorIndex();
+ SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByWoolData(bColor));
+ SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByWoolData(bColor), (org.bukkit.entity.Player) entityhuman.getBukkitEntity());
+ entitysheep.level.getCraftServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {