Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/EntityHuman.java
+++ b/net/minecraft/world/entity/player/EntityHuman.java
@@ -117,6 +117,20 @@
@@ -115,6 +115,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();
@@ -130,7 +144,8 @@
@@ -128,7 +142,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);
@@ -140,10 +155,10 @@
@@ -138,10 +153,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);
@@ -41,10 +41,10 @@
public Container containerMenu;
- protected FoodMetaData foodData = new FoodMetaData();
+ protected FoodMetaData foodData = new FoodMetaData(this); // CraftBukkit - add "this" to constructor
protected WardenSpawnTracker wardenSpawnTracker = new WardenSpawnTracker(0, 0, 0);
protected int jumpTriggerTime;
public float oBob;
@@ -174,6 +189,16 @@
public float bob;
@@ -169,6 +184,16 @@
@Nullable
public EntityFishingHook fishing;
@@ -58,10 +58,10 @@
+ }
+ // CraftBukkit end
+
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile, @Nullable ProfilePublicKey profilepublickey) {
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.lastItemInMainHand = ItemStack.EMPTY;
@@ -315,7 +340,7 @@
@@ -308,7 +333,7 @@
ItemStack itemstack = this.getItemBySlot(EnumItemSlot.HEAD);
if (itemstack.is(Items.TURTLE_HELMET) && !this.isEyeInFluid(TagsFluid.WATER)) {
@@ -70,7 +70,7 @@
}
}
@@ -507,7 +532,8 @@
@@ -502,7 +527,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) {
@@ -671,6 +697,13 @@
@@ -666,6 +692,13 @@
@Nullable
public EntityItem drop(ItemStack itemstack, boolean flag, boolean flag1) {
@@ -94,7 +94,7 @@
if (itemstack.isEmpty()) {
return null;
} else {
@@ -705,6 +738,33 @@
@@ -700,6 +733,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,43 +128,25 @@
return entityitem;
}
}
@@ -781,7 +841,7 @@
this.setScore(nbttagcompound.getInt("Score"));
this.foodData.readAdditionalSaveData(nbttagcompound);
if (nbttagcompound.contains("warden_spawn_tracker", 10)) {
- DataResult dataresult = WardenSpawnTracker.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("warden_spawn_tracker")));
+ DataResult<WardenSpawnTracker> dataresult = WardenSpawnTracker.CODEC.parse(new Dynamic(DynamicOpsNBT.INSTANCE, nbttagcompound.get("warden_spawn_tracker"))); // CraftBukkit - decompile error
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -805,7 +865,7 @@
@@ -790,7 +850,7 @@
}
if (nbttagcompound.contains("LastDeathLocation", 10)) {
- DataResult dataresult1 = GlobalPos.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("LastDeathLocation"));
+ DataResult<GlobalPos> dataresult1 = GlobalPos.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("LastDeathLocation")); // CraftBukkit - decompile error
Logger logger1 = EntityHuman.LOGGER;
- DataResult dataresult = GlobalPos.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("LastDeathLocation"));
+ DataResult<GlobalPos> dataresult = GlobalPos.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("LastDeathLocation")); // CraftBukkit - decompile error
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger1);
@@ -827,7 +887,7 @@
nbttagcompound.putInt("XpSeed", this.enchantmentSeed);
nbttagcompound.putInt("Score", this.getScore());
this.foodData.addAdditionalSaveData(nbttagcompound);
- DataResult dataresult = WardenSpawnTracker.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, this.wardenSpawnTracker);
+ DataResult<NBTBase> dataresult = WardenSpawnTracker.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, this.wardenSpawnTracker); // CraftBukkit - decompile error
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger);
@@ -845,7 +905,7 @@
Objects.requireNonNull(logger);
@@ -823,7 +883,7 @@
}
this.getLastDeathLocation().flatMap((globalpos) -> {
- DataResult dataresult1 = GlobalPos.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, globalpos);
+ DataResult<NBTBase> dataresult1 = GlobalPos.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, globalpos); // CraftBukkit - decompile error
Logger logger1 = EntityHuman.LOGGER;
- DataResult dataresult = GlobalPos.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, globalpos);
+ DataResult<NBTBase> dataresult = GlobalPos.CODEC.encodeStart(DynamicOpsNBT.INSTANCE, globalpos); // CraftBukkit - decompile error
Logger logger = EntityHuman.LOGGER;
Objects.requireNonNull(logger1);
@@ -872,12 +932,12 @@
Objects.requireNonNull(logger);
@@ -850,12 +910,12 @@
return false;
} else {
if (!this.level.isClientSide) {
@@ -179,7 +161,7 @@
}
if (this.level.getDifficulty() == EnumDifficulty.EASY) {
@@ -889,7 +949,13 @@
@@ -867,7 +927,13 @@
}
}
@@ -194,7 +176,7 @@
}
}
}
@@ -909,10 +975,29 @@
@@ -887,10 +953,29 @@
}
public boolean canHarmPlayer(EntityHuman entityhuman) {
@@ -227,7 +209,7 @@
}
@Override
@@ -954,8 +1039,13 @@
@@ -932,8 +1017,13 @@
}
}
@@ -242,7 +224,7 @@
if (!this.isInvulnerableTo(damagesource)) {
f = this.getDamageAfterArmorAbsorb(damagesource, f);
f = this.getDamageAfterMagicAbsorb(damagesource, f);
@@ -970,7 +1060,7 @@
@@ -948,7 +1038,7 @@
}
if (f != 0.0F) {
@@ -251,7 +233,7 @@
float f3 = this.getHealth();
this.setHealth(this.getHealth() - f);
@@ -981,6 +1071,7 @@
@@ -959,6 +1049,7 @@
}
}
@@ -259,7 +241,7 @@
}
@Override
@@ -1140,7 +1231,7 @@
@@ -1122,7 +1213,7 @@
f *= 0.2F + f2 * f2 * 0.8F;
f1 *= f2;
@@ -268,7 +250,7 @@
if (f > 0.0F || f1 > 0.0F) {
boolean flag = f2 > 0.9F;
boolean flag1 = false;
@@ -1179,8 +1270,15 @@
@@ -1161,8 +1252,15 @@
if (entity instanceof EntityLiving) {
f3 = ((EntityLiving) entity).getHealth();
if (j > 0 && !entity.isOnFire()) {
@@ -286,7 +268,7 @@
}
}
@@ -1208,8 +1306,11 @@
@@ -1190,8 +1288,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 +281,7 @@
}
}
@@ -1218,9 +1319,26 @@
@@ -1200,9 +1301,26 @@
}
if (entity instanceof EntityPlayer && entity.hurtMarked) {
@@ -326,7 +308,7 @@
}
if (flag2) {
@@ -1265,7 +1383,14 @@
@@ -1247,7 +1365,14 @@
this.awardStat(StatisticList.DAMAGE_DEALT, Math.round(f5 * 10.0F));
if (j > 0) {
@@ -342,7 +324,7 @@
}
if (this.level instanceof WorldServer && f5 > 2.0F) {
@@ -1275,12 +1400,17 @@
@@ -1257,12 +1382,17 @@
}
}
@@ -361,7 +343,7 @@
}
}
@@ -1362,6 +1492,12 @@
@@ -1339,6 +1469,12 @@
}
public Either<EntityHuman.EnumBedResult, Unit> startSleepInBed(BlockPosition blockposition) {
@@ -374,7 +356,7 @@
this.startSleeping(blockposition);
this.sleepCounter = 0;
return Either.right(Unit.INSTANCE);
@@ -1446,9 +1582,9 @@
@@ -1423,9 +1559,9 @@
super.jumpFromGround();
this.awardStat(StatisticList.JUMP);
if (this.isSprinting()) {
@@ -386,7 +368,7 @@
}
}
@@ -1482,7 +1618,11 @@
@@ -1459,7 +1595,11 @@
this.setDeltaMovement(vec3d2.x, d3 * 0.6D, vec3d2.z);
this.flyingSpeed = f;
this.resetFallDistance();
@@ -399,7 +381,7 @@
} else {
super.travel(vec3d);
}
@@ -1517,19 +1657,19 @@
@@ -1494,19 +1634,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 +404,7 @@
}
} else if (this.onClimbable()) {
if (d1 > 0.0D) {
@@ -1540,13 +1680,13 @@
@@ -1517,13 +1657,13 @@
if (i > 0) {
if (this.isSprinting()) {
this.awardStat(StatisticList.SPRINT_ONE_CM, i);
@@ -439,7 +421,7 @@
}
}
} else if (this.isFallFlying()) {
@@ -1617,12 +1757,24 @@
@@ -1589,12 +1729,24 @@
}
public void startFallFlying() {
@@ -465,7 +447,7 @@
}
@Override
@@ -1713,10 +1865,21 @@
@@ -1685,10 +1837,21 @@
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}
@@ -488,7 +470,7 @@
}
}
@@ -1802,13 +1965,20 @@
@@ -1774,13 +1937,20 @@
@Override
public void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack) {
@@ -512,7 +494,7 @@
}
}
@@ -1847,26 +2017,31 @@
@@ -1819,26 +1989,31 @@
protected void removeEntitiesOnShoulder() {
if (this.timeEntitySatOnShoulder + 20L < this.level.getGameTime()) {