Update to Minecraft 1.20.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-09-22 02:40:00 +10:00
parent 193398c0ff
commit 8a3c8cfcd4
238 changed files with 2448 additions and 2344 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/EntityHuman.java
+++ b/net/minecraft/world/entity/player/EntityHuman.java
@@ -118,6 +118,20 @@
@@ -117,6 +117,20 @@
import net.minecraft.world.scores.ScoreboardTeamBase;
import org.slf4j.Logger;
@@ -21,7 +21,7 @@
public abstract class EntityHuman extends EntityLiving {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -131,7 +145,8 @@
@@ -132,7 +146,8 @@
public static final float SWIMMING_BB_HEIGHT = 0.6F;
public static final float DEFAULT_EYE_HEIGHT = 1.62F;
public static final EntitySize STANDING_DIMENSIONS = EntitySize.scalable(0.6F, 1.8F);
@@ -31,7 +31,7 @@
private static final int FLY_ACHIEVEMENT_SPEED = 25;
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);
@@ -141,10 +156,10 @@
@@ -142,10 +157,10 @@
protected static final DataWatcherObject<NBTTagCompound> DATA_SHOULDER_RIGHT = DataWatcher.defineId(EntityHuman.class, DataWatcherRegistry.COMPOUND_TAG);
private long timeEntitySatOnShoulder;
private final PlayerInventory inventory = new PlayerInventory(this);
@@ -44,7 +44,7 @@
protected int jumpTriggerTime;
public float oBob;
public float bob;
@@ -173,6 +188,16 @@
@@ -174,6 +189,16 @@
public EntityFishingHook fishing;
protected float hurtDir;
@@ -61,7 +61,7 @@
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.lastItemInMainHand = ItemStack.EMPTY;
@@ -312,7 +337,7 @@
@@ -313,7 +338,7 @@
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
@@ -70,7 +70,7 @@
}
}
@@ -478,8 +503,14 @@
@@ -483,8 +508,14 @@
public void rideTick() {
if (!this.level().isClientSide && this.wantsToStopRiding() && this.isPassenger()) {
this.stopRiding();
@@ -87,7 +87,7 @@
double d0 = this.getX();
double d1 = this.getY();
double d2 = this.getZ();
@@ -506,7 +537,8 @@
@@ -511,7 +542,8 @@
if (this.level().getDifficulty() == EnumDifficulty.PEACEFUL && this.level().getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
if (this.getHealth() < this.getMaxHealth() && this.tickCount % 20 == 0) {
@@ -97,7 +97,7 @@
}
if (this.foodData.needsFood() && this.tickCount % 10 == 0) {
@@ -665,6 +697,13 @@
@@ -671,6 +703,13 @@
@Nullable
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
@@ -111,7 +111,7 @@
if (itemstack.isEmpty()) {
return null;
} else {
@@ -699,6 +738,33 @@
@@ -705,6 +744,33 @@
entityitem.setDeltaMovement((double) (-f3 * f2 * 0.3F) + Math.cos((double) f5) * (double) f6, (double) (-f1 * 0.3F + 0.1F + (this.random.nextFloat() - this.random.nextFloat()) * 0.1F), (double) (f4 * f2 * 0.3F) + Math.sin((double) f5) * (double) f6);
}
@@ -145,7 +145,7 @@
return entityitem;
}
}
@@ -789,7 +855,7 @@
@@ -795,7 +861,7 @@
}
if (nbttagcompound.contains("LastDeathLocation", 10)) {
@@ -154,7 +154,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -822,7 +888,7 @@
@@ -828,7 +894,7 @@
}
this.getLastDeathLocation().flatMap((globalpos) -> {
@@ -163,7 +163,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -849,12 +915,12 @@
@@ -855,12 +921,12 @@
return false;
} else {
if (!this.level().isClientSide) {
@@ -178,7 +178,7 @@
}
if (this.level().getDifficulty() == EnumDifficulty.EASY) {
@@ -866,7 +932,13 @@
@@ -872,7 +938,13 @@
}
}
@@ -193,7 +193,7 @@
}
}
}
@@ -886,10 +958,29 @@
@@ -892,10 +964,29 @@
}
public boolean canHarmPlayer(EntityHuman entityhuman) {
@@ -226,7 +226,7 @@
}
@Override
@@ -931,8 +1022,13 @@
@@ -937,8 +1028,13 @@
}
}
@@ -241,7 +241,7 @@
if (!this.isInvulnerableTo(damagesource)) {
f = this.getDamageAfterArmorAbsorb(damagesource, f);
f = this.getDamageAfterMagicAbsorb(damagesource, f);
@@ -947,7 +1043,7 @@
@@ -953,7 +1049,7 @@
}
if (f != 0.0F) {
@@ -250,7 +250,7 @@
this.getCombatTracker().recordDamage(damagesource, f);
this.setHealth(this.getHealth() - f);
if (f < 3.4028235E37F) {
@@ -957,6 +1053,7 @@
@@ -963,6 +1059,7 @@
this.gameEvent(GameEvent.ENTITY_DAMAGE);
}
}
@@ -258,7 +258,7 @@
}
@Override
@@ -1121,7 +1218,7 @@
@@ -1127,7 +1224,7 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -267,7 +267,7 @@
if (f > 0.0F || f1 > 0.0F) {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
@@ -1160,8 +1257,15 @@
@@ -1166,8 +1263,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isOnFire()) {
@@ -285,7 +285,7 @@
}
}
@@ -1189,8 +1293,11 @@
@@ -1195,8 +1299,11 @@
EntityLiving entityliving = (EntityLiving) iterator.next();
if (entityliving != this && entityliving != entity && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
@@ -298,7 +298,7 @@
}
}
@@ -1199,9 +1306,26 @@
@@ -1205,9 +1312,26 @@
}
if (entity instanceof EntityPlayer && entity.hurtMarked) {
@@ -325,7 +325,7 @@
}
if (flag2) {
@@ -1246,7 +1370,14 @@
@@ -1252,7 +1376,14 @@
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -341,7 +341,7 @@
}
if (this.level() instanceof WorldServer && f5 > 2.0F) {
@@ -1256,12 +1387,17 @@
@@ -1262,12 +1393,17 @@
}
}
@@ -360,7 +360,7 @@
}
}
@@ -1338,6 +1474,12 @@
@@ -1344,6 +1480,12 @@
}
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
@@ -373,7 +373,7 @@
this.startSleeping(blockposition);
this.sleepCounter = 0;
return Either.right(Unit.INSTANCE);
@@ -1425,9 +1567,9 @@
@@ -1431,9 +1573,9 @@
super.jumpFromGround();
this.awardStat(StatisticList.JUMP);
if (this.isSprinting()) {
@@ -385,7 +385,7 @@
}
}
@@ -1457,7 +1599,11 @@
@@ -1463,7 +1605,11 @@
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.resetFallDistance();
@@ -398,7 +398,7 @@
} else {
super.travel(vec3d);
}
@@ -1492,19 +1638,19 @@
@@ -1498,19 +1644,19 @@
i = Math.round((float) Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2) * 100.0F);
if (i > 0) {
this.awardStat(StatisticList.SWIM_ONE_CM, i);
@@ -421,7 +421,7 @@
}
} else if (this.onClimbable()) {
if (d1 > 0.0D) {
@@ -1515,13 +1661,13 @@
@@ -1521,13 +1667,13 @@
if (i > 0) {
if (this.isSprinting()) {
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
@@ -438,7 +438,7 @@
}
}
} else if (this.isFallFlying()) {
@@ -1587,12 +1733,24 @@
@@ -1593,12 +1739,24 @@
}
public void startFallFlying() {
@@ -464,7 +464,7 @@
}
@Override
@@ -1706,10 +1864,21 @@
@@ -1712,10 +1870,21 @@
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
@@ -487,7 +487,7 @@
}
}
@@ -1795,13 +1964,20 @@
@@ -1801,13 +1970,20 @@
@Override
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -511,7 +511,7 @@
}
}
@@ -1840,26 +2016,31 @@
@@ -1846,26 +2022,31 @@
protected void removeEntitiesOnShoulder() {
if (this.timeEntitySatOnShoulder + 20L < this.level().getGameTime()) {