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

@@ -93,9 +93,9 @@
if (!flag && !ItemStack.isSameItemSameTags(itemstack, itemstack1) && !this.firstTick) {
Equipable equipable = Equipable.get(itemstack1);
if (equipable != null && !this.isSpectator() && equipable.getEquipmentSlot() == enumitemslot) {
- if (!this.level().isClientSide() && !this.isSilent()) {
+ if (!this.level().isClientSide() && !this.isSilent() && !silent) { // CraftBukkit
if (!this.level().isClientSide() && !this.isSpectator()) {
- if (!this.isSilent() && equipable != null && equipable.getEquipmentSlot() == enumitemslot) {
+ if (!this.isSilent() && equipable != null && equipable.getEquipmentSlot() == enumitemslot && !silent) { // CraftBukkit
this.level().playSound((EntityHuman) null, this.getX(), this.getY(), this.getZ(), equipable.getEquipSound(), this.getSoundSource(), 1.0F, 1.0F);
}
@@ -211,7 +211,7 @@
iterator.remove();
}
@@ -976,18 +1092,48 @@
@@ -976,19 +1092,49 @@
return this.addEffect(mobeffect, (Entity) null);
}
@@ -235,6 +235,7 @@
return false;
} else {
MobEffect mobeffect1 = (MobEffect) this.activeEffects.get(mobeffect.getEffect());
boolean flag = false;
+ // CraftBukkit start
+ boolean override = false;
@@ -251,17 +252,17 @@
if (mobeffect1 == null) {
this.activeEffects.put(mobeffect.getEffect(), mobeffect);
this.onEffectAdded(mobeffect, entity);
return true;
flag = true;
- } else if (mobeffect1.update(mobeffect)) {
+ // CraftBukkit start
+ } else if (event.isOverride()) {
+ mobeffect1.update(mobeffect);
this.onEffectUpdated(mobeffect1, true, entity);
+ // CraftBukkit end
return true;
} else {
return false;
@@ -1024,13 +1170,39 @@
flag = true;
}
@@ -1026,13 +1172,39 @@
return this.getMobType() == EnumMonsterType.UNDEAD;
}
@@ -302,7 +303,7 @@
if (mobeffect != null) {
this.onEffectRemoved(mobeffect);
@@ -1098,20 +1270,55 @@
@@ -1130,20 +1302,55 @@
}
@@ -359,7 +360,7 @@
this.entityData.set(EntityLiving.DATA_HEALTH_ID, MathHelper.clamp(f, 0.0F, this.getMaxHealth()));
}
@@ -1125,7 +1332,7 @@
@@ -1157,7 +1364,7 @@
return false;
} else if (this.level().isClientSide) {
return false;
@@ -368,7 +369,7 @@
return false;
} else if (damagesource.is(DamageTypeTags.IS_FIRE) && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false;
@@ -1136,10 +1343,11 @@
@@ -1168,10 +1375,11 @@
this.noActionTime = 0;
float f1 = f;
@@ -382,7 +383,7 @@
this.hurtCurrentlyUsedShield(f);
f2 = f;
f = 0.0F;
@@ -1163,23 +1371,33 @@
@@ -1195,23 +1403,33 @@
this.walkAnimation.setSpeed(1.5F);
boolean flag1 = true;
@@ -421,7 +422,7 @@
this.hurtHelmet(damagesource, f);
f *= 0.75F;
}
@@ -1297,19 +1515,32 @@
@@ -1329,19 +1547,32 @@
EnumHand[] aenumhand = EnumHand.values();
int i = aenumhand.length;
@@ -458,7 +459,7 @@
EntityPlayer entityplayer = (EntityPlayer) this;
entityplayer.awardStat(StatisticList.ITEM_USED.get(Items.TOTEM_OF_UNDYING));
@@ -1317,14 +1548,16 @@
@@ -1350,14 +1581,16 @@
}
this.setHealth(1.0F);
@@ -480,7 +481,7 @@
}
}
@@ -1433,14 +1666,22 @@
@@ -1466,14 +1699,22 @@
IBlockData iblockdata = Blocks.WITHER_ROSE.defaultBlockState();
if (this.level().getBlockState(blockposition).isAir() && iblockdata.canSurvive(this.level(), blockposition)) {
@@ -505,7 +506,7 @@
this.level().addFreshEntity(entityitem);
}
}
@@ -1460,21 +1701,40 @@
@@ -1493,21 +1734,40 @@
boolean flag = this.lastHurtByPlayerTime > 0;
@@ -549,7 +550,7 @@
}
@@ -1565,6 +1825,28 @@
@@ -1599,6 +1859,28 @@
return itemstack.getEatingSound();
}
@@ -578,7 +579,7 @@
public Optional<BlockPosition> getLastClimbablePos() {
return this.lastClimbablePos;
}
@@ -1611,9 +1893,14 @@
@@ -1645,9 +1927,14 @@
int i = this.calculateFallDamage(f, f1);
if (i > 0) {
@@ -594,7 +595,7 @@
return true;
} else {
return flag;
@@ -1665,7 +1952,7 @@
@@ -1699,7 +1986,7 @@
protected float getDamageAfterArmorAbsorb(DamageSource damagesource, float f) {
if (!damagesource.is(DamageTypeTags.BYPASSES_ARMOR)) {
@@ -603,7 +604,7 @@
f = CombatMath.getDamageAfterAbsorb(f, (float) this.getArmorValue(), (float) this.getAttributeValue(GenericAttributes.ARMOR_TOUGHNESS));
}
@@ -1678,7 +1965,8 @@
@@ -1712,7 +1999,8 @@
} else {
int i;
@@ -613,7 +614,7 @@
i = (this.getEffect(MobEffects.DAMAGE_RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
@@ -1711,16 +1999,125 @@
@@ -1745,16 +2033,125 @@
}
}
@@ -747,7 +748,7 @@
if (f2 > 0.0F && f2 < 3.4028235E37F) {
Entity entity = damagesource.getEntity();
@@ -1731,13 +2128,47 @@
@@ -1765,13 +2162,47 @@
}
}
@@ -797,7 +798,7 @@
}
public CombatTracker getCombatTracker() {
@@ -1758,8 +2189,18 @@
@@ -1796,8 +2227,18 @@
}
public final void setArrowCount(int i) {
@@ -817,7 +818,7 @@
public final int getStingerCount() {
return (Integer) this.entityData.get(EntityLiving.DATA_STINGER_COUNT_ID);
@@ -2001,6 +2442,12 @@
@@ -2039,6 +2480,12 @@
public abstract ItemStack getItemBySlot(EnumItemSlot enumitemslot);
@@ -830,7 +831,7 @@
@Override
public abstract void setItemSlot(EnumItemSlot enumitemslot, ItemStack itemstack);
@@ -2238,6 +2685,7 @@
@@ -2273,6 +2720,7 @@
}
if (this.onGround() && !this.level().isClientSide) {
@@ -838,7 +839,7 @@
this.setSharedFlag(7, false);
}
} else {
@@ -2809,6 +3257,7 @@
@@ -2837,6 +3285,7 @@
}
if (!this.level().isClientSide) {
@@ -846,7 +847,7 @@
this.setSharedFlag(7, flag);
}
@@ -2968,14 +3417,21 @@
@@ -3027,14 +3476,21 @@
@Override
public boolean isPickable() {
@@ -870,7 +871,7 @@
@Override
public float getYHeadRot() {
return this.yHeadRot;
@@ -3170,7 +3626,26 @@
@@ -3229,7 +3685,26 @@
} else {
if (!this.useItem.isEmpty() && this.isUsingItem()) {
this.triggerItemUseEffects(this.useItem, 16);
@@ -898,7 +899,7 @@
if (itemstack != this.useItem) {
this.setItemInHand(enumhand, itemstack);
@@ -3248,6 +3723,12 @@
@@ -3307,6 +3782,12 @@
}
public boolean randomTeleport(double d0, double d1, double d2, boolean flag) {
@@ -911,7 +912,7 @@
double d3 = this.getX();
double d4 = this.getY();
double d5 = this.getZ();
@@ -3272,16 +3753,41 @@
@@ -3331,16 +3812,41 @@
}
if (flag2) {
@@ -956,7 +957,7 @@
} else {
if (flag) {
world.broadcastEntityEvent(this, (byte) 46);
@@ -3291,7 +3797,7 @@
@@ -3350,7 +3856,7 @@
((EntityCreature) this).getNavigation().stop();
}
@@ -965,7 +966,7 @@
}
}
@@ -3374,7 +3880,7 @@
@@ -3439,7 +3945,7 @@
}
public void stopSleeping() {
@@ -974,7 +975,7 @@
World world = this.level();
java.util.Objects.requireNonNull(world);
@@ -3408,7 +3914,7 @@
@@ -3473,7 +3979,7 @@
@Nullable
public EnumDirection getBedOrientation() {
@@ -983,7 +984,7 @@
return blockposition != null ? BlockBed.getBedOrientation(this.level(), blockposition) : null;
}
@@ -3456,7 +3962,7 @@
@@ -3521,7 +4027,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {