Update to Minecraft 1.21.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-12-04 03:20:00 +11:00
parent 267ae64dd6
commit 5381ea78f7
125 changed files with 1383 additions and 1093 deletions

View File

@@ -30,8 +30,8 @@
private static final DataWatcherObject<Float> DATA_PLAYER_ABSORPTION_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.FLOAT);
private static final DataWatcherObject<Integer> DATA_SCORE_ID = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.INT);
protected static final DataWatcherObject<Byte> DATA_PLAYER_MODE_CUSTOMISATION = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.BYTE);
@@ -148,7 +162,7 @@
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
@@ -149,7 +163,7 @@
public static final int CLIENT_LOADED_TIMEOUT_TIME = 60;
private long timeEntitySatOnShoulder;
final PlayerInventory inventory = new PlayerInventory(this);
- protected InventoryEnderChest enderChestInventory = new InventoryEnderChest();
@@ -39,7 +39,7 @@
public final ContainerPlayer inventoryMenu;
public Container containerMenu;
protected FoodMetaData foodData = new FoodMetaData();
@@ -186,6 +200,16 @@
@@ -189,6 +203,16 @@
private boolean ignoreFallDamageFromCurrentImpulse;
private int currentImpulseContextResetGraceTime;
@@ -56,7 +56,7 @@
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.lastItemInMainHand = ItemStack.EMPTY;
@@ -350,7 +374,7 @@
@@ -353,7 +377,7 @@
}
private void turtleHelmetTick() {
@@ -65,7 +65,7 @@
}
private boolean isEquipped(Item item) {
@@ -520,8 +544,14 @@
@@ -523,8 +547,14 @@
public void rideTick() {
if (!this.level().isClientSide && this.wantsToStopRiding() && this.isPassenger()) {
this.stopRiding();
@@ -82,7 +82,7 @@
super.rideTick();
this.oBob = this.bob;
this.bob = 0.0F;
@@ -716,6 +746,13 @@
@@ -719,6 +749,13 @@
@Nullable
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
@@ -96,7 +96,7 @@
if (!itemstack.isEmpty() && this.level().isClientSide) {
this.swing(EnumHand.MAIN_HAND);
}
@@ -806,7 +843,7 @@
@@ -809,7 +846,7 @@
}
if (nbttagcompound.contains("LastDeathLocation", 10)) {
@@ -105,7 +105,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -814,7 +851,7 @@
@@ -817,7 +854,7 @@
}
if (nbttagcompound.contains("current_explosion_impact_pos", 9)) {
@@ -114,7 +114,7 @@
Logger logger1 = EntityHuman.LOGGER;
Objects.requireNonNull(logger1);
@@ -851,7 +888,7 @@
@@ -854,7 +891,7 @@
}
this.getLastDeathLocation().flatMap((globalpos) -> {
@@ -123,7 +123,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -883,10 +920,10 @@
@@ -886,10 +923,10 @@
if (this.isDeadOrDying()) {
return false;
} else {
@@ -136,7 +136,7 @@
}
if (worldserver.getDifficulty() == EnumDifficulty.EASY) {
@@ -898,7 +935,13 @@
@@ -901,7 +938,13 @@
}
}
@@ -151,7 +151,7 @@
}
}
}
@@ -920,10 +963,29 @@
@@ -923,10 +966,29 @@
}
public boolean canHarmPlayer(EntityHuman entityhuman) {
@@ -184,7 +184,7 @@
}
@Override
@@ -963,8 +1025,13 @@
@@ -966,8 +1028,13 @@
}
}
@@ -199,7 +199,7 @@
if (!this.isInvulnerableTo(worldserver, damagesource)) {
f = this.getDamageAfterArmorAbsorb(damagesource, f);
f = this.getDamageAfterMagicAbsorb(damagesource, f);
@@ -979,7 +1046,7 @@
@@ -982,7 +1049,7 @@
}
if (f != 0.0F) {
@@ -208,7 +208,7 @@
this.getCombatTracker().recordDamage(damagesource, f);
this.setHealth(this.getHealth() - f);
if (f < 3.4028235E37F) {
@@ -989,6 +1056,7 @@
@@ -992,6 +1059,7 @@
this.gameEvent(GameEvent.ENTITY_DAMAGE);
}
}
@@ -216,7 +216,7 @@
}
public boolean isTextFilteringEnabled() {
@@ -1141,10 +1209,15 @@
@@ -1144,10 +1212,15 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -233,7 +233,7 @@
if (iprojectile.deflect(ProjectileDeflection.AIM_DEFLECT, this, this, true)) {
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), SoundEffects.PLAYER_ATTACK_NODAMAGE, this.getSoundSource());
return;
@@ -1220,8 +1293,13 @@
@@ -1223,8 +1296,13 @@
if (entityliving2 != this && entityliving2 != entity && !this.isAlliedTo((Entity) entityliving2) && (!(entityliving2 instanceof EntityArmorStand) || !((EntityArmorStand) entityliving2).isMarker()) && this.distanceToSqr((Entity) entityliving2) < 9.0D) {
float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2;
@@ -248,7 +248,7 @@
World world = this.level();
if (world instanceof WorldServer) {
@@ -1237,9 +1315,26 @@
@@ -1240,9 +1318,26 @@
}
if (entity instanceof EntityPlayer && entity.hurtMarked) {
@@ -275,7 +275,7 @@
}
if (flag2) {
@@ -1305,9 +1400,14 @@
@@ -1308,9 +1403,14 @@
}
}
@@ -291,7 +291,7 @@
}
}
@@ -1348,7 +1448,14 @@
@@ -1351,7 +1451,14 @@
@Override
public void remove(Entity.RemovalReason entity_removalreason) {
@@ -307,7 +307,7 @@
this.inventoryMenu.removed(this);
if (this.containerMenu != null && this.hasContainerOpen()) {
this.doCloseContainer();
@@ -1388,6 +1495,12 @@
@@ -1391,6 +1498,12 @@
}
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
@@ -320,7 +320,7 @@
this.startSleeping(blockposition);
this.sleepCounter = 0;
return Either.right(Unit.INSTANCE);
@@ -1542,12 +1655,24 @@
@@ -1545,12 +1658,24 @@
}
public void startFallFlying() {
@@ -346,7 +346,7 @@
}
@Override
@@ -1662,10 +1787,21 @@
@@ -1665,10 +1790,21 @@
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
@@ -369,7 +369,7 @@
}
}
@@ -1745,13 +1881,20 @@
@@ -1748,13 +1884,20 @@
@Override
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -393,7 +393,7 @@
}
}
@@ -1795,26 +1938,31 @@
@@ -1798,26 +1941,31 @@
protected void removeEntitiesOnShoulder() {
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {