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

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
@@ -50,6 +50,11 @@
@@ -52,6 +52,11 @@
import net.minecraft.world.level.pathfinder.Pathfinder;
import net.minecraft.world.level.pathfinder.PathfinderNormal;
@@ -11,37 +11,30 @@
+
public class Goat extends EntityAnimal {
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.b(0.9F, 1.3F).a(0.7F);
@@ -137,13 +142,13 @@
public static final EntitySize LONG_JUMPING_DIMENSIONS = EntitySize.scalable(0.9F, 1.3F).scale(0.7F);
@@ -139,7 +144,7 @@
@Override
public BehaviorController<Goat> getBehaviorController() {
- return super.getBehaviorController();
+ return (BehaviorController<Goat>) super.getBehaviorController(); // CraftBukkit - decompile error
public BehaviorController<Goat> getBrain() {
- return super.getBrain();
+ return (BehaviorController<Goat>) super.getBrain(); // CraftBukkit - decompile error
}
@Override
protected void mobTick() {
this.level.getMethodProfiler().enter("goatBrain");
- this.getBehaviorController().a((WorldServer) this.level, (EntityLiving) this);
+ this.getBehaviorController().a((WorldServer) this.level, this); // CraftBukkit - decompile error
this.level.getMethodProfiler().exit();
this.level.getMethodProfiler().enter("goatActivityUpdate");
GoatAi.b(this);
@@ -175,8 +180,15 @@
ItemStack itemstack = entityhuman.b(enumhand);
@@ -177,8 +182,15 @@
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;
+ }
+ // CraftBukkit end
entityhuman.playSound(this.t(), 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
entityhuman.playSound(this.getMilkingSound(), 1.0F, 1.0F);
- 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);