Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -13,11 +13,11 @@
public EntityCow(EntityTypes<? extends EntityCow> entitytypes, World world) {
@@ -82,8 +87,16 @@
ItemStack itemstack = entityhuman.b(enumhand);
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
if (itemstack.a(Items.BUCKET) && !this.isBaby()) {
if (itemstack.is(Items.BUCKET) && !this.isBaby()) {
+ // CraftBukkit start - Got milk?
+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.level, entityhuman, this.getChunkCoordinates(), this.getChunkCoordinates(), null, itemstack, Items.MILK_BUCKET);
+ org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) entityhuman.level, entityhuman, this.blockPosition(), this.blockPosition(), null, itemstack, Items.MILK_BUCKET);
+
+ if (event.isCancelled()) {
+ return EnumInteractionResult.PASS;
@@ -25,8 +25,8 @@
+ // CraftBukkit end
+
entityhuman.playSound(SoundEffects.COW_MILK, 1.0F, 1.0F);
- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.createItemStack());
+ ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
- ItemStack itemstack1 = ItemLiquidUtil.createFilledResult(itemstack, entityhuman, Items.MILK_BUCKET.getDefaultInstance());
+ ItemStack itemstack1 = ItemLiquidUtil.createFilledResult(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
entityhuman.a(enumhand, itemstack1);
return EnumInteractionResult.a(this.level.isClientSide);
entityhuman.setItemInHand(enumhand, itemstack1);
return EnumInteractionResult.sidedSuccess(this.level.isClientSide);