Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -33,7 +33,7 @@
private EntityFishingHook(EntityTypes<? extends EntityFishingHook> entitytypes, World world, int i, int j) {
super(entitytypes, world);
this.syncronizedRandom = RandomSource.create();
@@ -148,12 +167,12 @@
@@ -152,12 +171,12 @@
EntityHuman entityhuman = this.getPlayerOwner();
if (entityhuman == null) {
@@ -48,7 +48,7 @@
return;
}
} else {
@@ -254,7 +273,7 @@
@@ -259,7 +278,7 @@
if (!entityhuman.isRemoved() && entityhuman.isAlive() && (flag || flag1) && this.distanceToSqr((Entity) entityhuman) <= 1024.0D) {
return false;
} else {
@@ -57,7 +57,7 @@
return true;
}
}
@@ -262,7 +281,7 @@
@@ -267,7 +286,7 @@
private void checkCollision() {
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity);
@@ -66,7 +66,7 @@
}
@Override
@@ -295,11 +314,11 @@
@@ -300,11 +319,11 @@
int i = 1;
BlockPosition blockposition1 = blockposition.above();
@@ -80,7 +80,7 @@
--i;
}
@@ -309,6 +328,10 @@
@@ -314,6 +333,10 @@
this.timeUntilLured = 0;
this.timeUntilHooked = 0;
this.getEntityData().set(EntityFishingHook.DATA_BITING, false);
@@ -91,7 +91,7 @@
}
} else {
float f;
@@ -342,6 +365,13 @@
@@ -347,6 +370,13 @@
worldserver.sendParticles(Particles.FISHING, d0, d1, d2, 0, (double) (-f4), 0.01D, (double) f3, 1.0D);
}
} else {
@@ -105,7 +105,7 @@
this.playSound(SoundEffects.FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F);
double d3 = this.getY() + 0.5D;
@@ -374,12 +404,16 @@
@@ -379,12 +409,16 @@
}
if (this.timeUntilLured <= 0) {
@@ -126,7 +126,7 @@
}
}
@@ -447,6 +481,14 @@
@@ -452,6 +486,14 @@
int i = 0;
if (this.hookedIn != null) {
@@ -141,7 +141,7 @@
this.pullEntity(this.hookedIn);
CriterionTriggers.FISHING_ROD_HOOKED.trigger((EntityPlayer) entityhuman, itemstack, this, Collections.emptyList());
this.level().broadcastEntityEvent(this, (byte) 31);
@@ -462,6 +504,15 @@
@@ -467,6 +509,15 @@
while (iterator.hasNext()) {
ItemStack itemstack1 = (ItemStack) iterator.next();
EntityItem entityitem = new EntityItem(this.level(), this.getX(), this.getY(), this.getZ(), itemstack1);
@@ -157,7 +157,7 @@
double d0 = entityhuman.getX() - this.getX();
double d1 = entityhuman.getY() - this.getY();
double d2 = entityhuman.getZ() - this.getZ();
@@ -469,7 +520,11 @@
@@ -474,7 +525,11 @@
entityitem.setDeltaMovement(d0 * 0.1D, d1 * 0.1D + Math.sqrt(Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2)) * 0.08D, d2 * 0.1D);
this.level().addFreshEntity(entityitem);
@@ -170,7 +170,7 @@
if (itemstack1.is(TagsItem.FISHES)) {
entityhuman.awardStat(StatisticList.FISH_CAUGHT, 1);
}
@@ -479,10 +534,27 @@
@@ -484,10 +539,27 @@
}
if (this.onGround()) {
@@ -199,7 +199,7 @@
return i;
} else {
return 0;
@@ -515,8 +587,15 @@
@@ -520,8 +592,15 @@
@Override
public void remove(Entity.RemovalReason entity_removalreason) {
@@ -216,3 +216,12 @@
}
@Override
@@ -575,7 +654,7 @@
int i = packetplayoutspawnentity.getData();
EntityFishingHook.LOGGER.error("Failed to recreate fishing hook on client. {} (id: {}) is not a valid owner.", this.level().getEntity(i), i);
- this.discard();
+ this.discard(null); // CraftBukkit - add Bukkit remove cause
}
}