Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/item/ItemDye.java
+++ b/net/minecraft/world/item/ItemDye.java
@@ -8,6 +8,8 @@
@@ -11,6 +11,8 @@
import net.minecraft.world.entity.animal.EntitySheep;
import net.minecraft.world.entity.player.EntityHuman;
@@ -8,16 +8,16 @@
+
public class ItemDye extends Item {
private static final Map<EnumColor, ItemDye> a = Maps.newEnumMap(EnumColor.class);
@@ -26,7 +28,17 @@
if (entitysheep.isAlive() && !entitysheep.isSheared() && entitysheep.getColor() != this.b) {
if (!entityhuman.world.isClientSide) {
- entitysheep.setColor(this.b);
private static final Map<EnumColor, ItemDye> ITEM_BY_COLOR = Maps.newEnumMap(EnumColor.class);
@@ -30,7 +32,17 @@
if (entitysheep.isAlive() && !entitysheep.isSheared() && entitysheep.getColor() != this.dyeColor) {
entitysheep.level.playSound(entityhuman, (Entity) entitysheep, SoundEffects.DYE_USE, SoundCategory.PLAYERS, 1.0F, 1.0F);
if (!entityhuman.level.isClientSide) {
- entitysheep.setColor(this.dyeColor);
+ // CraftBukkit start
+ byte bColor = (byte) this.b.getColorIndex();
+ byte bColor = (byte) this.dyeColor.getColorIndex();
+ SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByWoolData(bColor));
+ entitysheep.world.getServer().getPluginManager().callEvent(event);
+ entitysheep.level.getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) {
+ return EnumInteractionResult.PASS;