Update to Minecraft 1.19.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-07-28 04:00:00 +10:00
parent 7c33b52741
commit f8db65033c
41 changed files with 654 additions and 579 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/EntityHuman.java
+++ b/net/minecraft/world/entity/player/EntityHuman.java
@@ -116,6 +116,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();
@@ -129,7 +143,8 @@
@@ -130,7 +144,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);
@@ -139,10 +154,10 @@
@@ -140,10 +155,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 WardenSpawnTracker wardenSpawnTracker = new WardenSpawnTracker(0, 0, 0);
protected int jumpTriggerTime;
public float oBob;
@@ -173,6 +188,16 @@
@@ -174,6 +189,16 @@
@Nullable
public EntityFishingHook fishing;
@@ -61,7 +61,7 @@
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile, @Nullable ProfilePublicKey profilepublickey) {
super(EntityTypes.PLAYER, world);
this.lastItemInMainHand = ItemStack.EMPTY;
@@ -314,7 +339,7 @@
@@ -315,7 +340,7 @@
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
@@ -70,7 +70,7 @@
}
}
@@ -506,7 +531,8 @@
@@ -507,7 +532,8 @@
if (this.level.getDifficulty() == EnumDifficulty.PEACEFUL && this.level.getGameRules().getBoolean(GameRules.RULE_NATURAL_REGENERATION)) {
if (this.getHealth() < this.getMaxHealth() && this.tickCount % 20 == 0) {
@@ -80,7 +80,7 @@
}
if (this.foodData.needsFood() && this.tickCount % 10 == 0) {
@@ -670,6 +696,13 @@
@@ -671,6 +697,13 @@
@Nullable
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
@@ -94,7 +94,7 @@
if (itemstack.isEmpty()) {
return null;
} else {
@@ -704,6 +737,33 @@
@@ -705,6 +738,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);
}
@@ -128,7 +128,7 @@
return entityitem;
}
}
@@ -780,7 +840,7 @@
@@ -781,7 +841,7 @@
this.setScore(nbttagcompound.getInt("Score"));
this.foodData.readAdditionalSaveData(nbttagcompound);
if (nbttagcompound.contains("warden_spawn_tracker", 10)) {
@@ -137,7 +137,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -804,7 +864,7 @@
@@ -805,7 +865,7 @@
}
if (nbttagcompound.contains("LastDeathLocation", 10)) {
@@ -146,7 +146,7 @@
Logger logger1 = EntityHuman.LOGGER;
Objects.requireNonNull(logger1);
@@ -826,7 +886,7 @@
@@ -827,7 +887,7 @@
nbttagcompound.putInt("XpSeed", this.enchantmentSeed);
nbttagcompound.putInt("Score", this.getScore());
this.foodData.addAdditionalSaveData(nbttagcompound);
@@ -155,7 +155,7 @@
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -844,7 +904,7 @@
@@ -845,7 +905,7 @@
}
this.getLastDeathLocation().flatMap((globalpos) -> {
@@ -164,7 +164,7 @@
Logger logger1 = EntityHuman.LOGGER;
Objects.requireNonNull(logger1);
@@ -871,12 +931,12 @@
@@ -872,12 +932,12 @@
return false;
} else {
if (!this.level.isClientSide) {
@@ -179,7 +179,7 @@
}
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
@@ -888,7 +948,13 @@
@@ -889,7 +949,13 @@
}
}
@@ -194,7 +194,7 @@
}
}
}
@@ -908,10 +974,29 @@
@@ -909,10 +975,29 @@
}
public boolean canHarmPlayer(EntityHuman entityhuman) {
@@ -227,7 +227,7 @@
}
@Override
@@ -953,8 +1038,13 @@
@@ -954,8 +1039,13 @@
}
}
@@ -242,7 +242,7 @@
if (!this.isInvulnerableTo(damagesource)) {
f = this.getDamageAfterArmorAbsorb(damagesource, f);
f = this.getDamageAfterMagicAbsorb(damagesource, f);
@@ -969,7 +1059,7 @@
@@ -970,7 +1060,7 @@
}
if (f != 0.0F) {
@@ -251,7 +251,7 @@
float f3 = this.getHealth();
this.setHealth(this.getHealth() - f);
@@ -980,6 +1070,7 @@
@@ -981,6 +1071,7 @@
}
}
@@ -259,7 +259,7 @@
}
@Override
@@ -1139,7 +1230,7 @@
@@ -1140,7 +1231,7 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -268,7 +268,7 @@
if (f > 0.0F || f1 > 0.0F) {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
@@ -1178,8 +1269,15 @@
@@ -1179,8 +1270,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isOnFire()) {
@@ -286,7 +286,7 @@
}
}
@@ -1207,8 +1305,11 @@
@@ -1208,8 +1306,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) {
@@ -299,7 +299,7 @@
}
}
@@ -1217,9 +1318,26 @@
@@ -1218,9 +1319,26 @@
}
if (entity instanceof EntityPlayer && entity.hurtMarked) {
@@ -326,7 +326,7 @@
}
if (flag2) {
@@ -1264,7 +1382,14 @@
@@ -1265,7 +1383,14 @@
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -342,7 +342,7 @@
}
if (this.level instanceof WorldServer && f5 > 2.0F) {
@@ -1274,12 +1399,17 @@
@@ -1275,12 +1400,17 @@
}
}
@@ -361,8 +361,8 @@
}
}
@@ -1357,6 +1487,12 @@
public void updateTutorialInventoryAction(ItemStack itemstack, ItemStack itemstack1, ClickAction clickaction) {}
@@ -1362,6 +1492,12 @@
}
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
+ // CraftBukkit start
@@ -374,7 +374,7 @@
this.startSleeping(blockposition);
this.sleepCounter = 0;
return Either.right(Unit.INSTANCE);
@@ -1441,9 +1577,9 @@
@@ -1446,9 +1582,9 @@
super.jumpFromGround();
this.awardStat(StatisticList.JUMP);
if (this.isSprinting()) {
@@ -386,7 +386,7 @@
}
}
@@ -1477,7 +1613,11 @@
@@ -1482,7 +1618,11 @@
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.flyingSpeed = f;
this.resetFallDistance();
@@ -399,7 +399,7 @@
} else {
super.travel(vec3d);
}
@@ -1512,19 +1652,19 @@
@@ -1517,19 +1657,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);
@@ -422,7 +422,7 @@
}
} else if (this.onClimbable()) {
if (d1 > 0.0D) {
@@ -1535,13 +1675,13 @@
@@ -1540,13 +1680,13 @@
if (i > 0) {
if (this.isSprinting()) {
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
@@ -439,7 +439,7 @@
}
}
} else if (this.isFallFlying()) {
@@ -1607,12 +1747,24 @@
@@ -1617,12 +1757,24 @@
}
public void startFallFlying() {
@@ -465,7 +465,7 @@
}
@Override
@@ -1703,10 +1855,21 @@
@@ -1713,10 +1865,21 @@
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
@@ -488,7 +488,7 @@
}
}
@@ -1792,13 +1955,20 @@
@@ -1802,13 +1965,20 @@
@Override
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -512,7 +512,7 @@
}
}
@@ -1837,26 +2007,31 @@
@@ -1847,26 +2017,31 @@
protected void removeEntitiesOnShoulder() {
if (this.timeEntitySatOnShoulder + 20L < this.level.getGameTime()) {