Update to Minecraft 1.14.2

This commit is contained in:
md_5
2019-05-28 06:30:00 +10:00
parent fcb9f90bf3
commit cb3d14c5a7
57 changed files with 385 additions and 394 deletions

View File

@@ -72,7 +72,7 @@
}
}
@@ -286,6 +326,18 @@
@@ -290,6 +330,18 @@
this.world.getMethodProfiler().exit();
}
@@ -91,7 +91,7 @@
protected void b(BlockPosition blockposition) {
int i = EnchantmentManager.a(Enchantments.FROST_WALKER, this);
@@ -310,19 +362,19 @@
@@ -314,19 +366,19 @@
protected void cn() {
++this.deathTicks;
@@ -120,7 +120,7 @@
this.die();
@@ -495,6 +547,17 @@
@@ -499,6 +551,17 @@
}
}
@@ -138,7 +138,7 @@
if (nbttagcompound.hasKeyOfType("Health", 99)) {
this.setHealth(nbttagcompound.getFloat("Health"));
}
@@ -530,9 +593,32 @@
@@ -536,9 +599,32 @@
}
@@ -171,7 +171,7 @@
try {
while (iterator.hasNext()) {
MobEffectList mobeffectlist = (MobEffectList) iterator.next();
@@ -540,6 +626,12 @@
@@ -546,6 +632,12 @@
if (!mobeffect.tick(this)) {
if (!this.world.isClientSide) {
@@ -184,7 +184,7 @@
iterator.remove();
this.b(mobeffect);
}
@@ -550,6 +642,17 @@
@@ -556,6 +648,17 @@
} catch (ConcurrentModificationException concurrentmodificationexception) {
;
}
@@ -202,7 +202,7 @@
if (this.updateEffects) {
if (!this.world.isClientSide) {
@@ -659,7 +762,13 @@
@@ -665,7 +768,13 @@
this.datawatcher.set(EntityLiving.e, 0);
}
@@ -216,7 +216,7 @@
if (this.world.isClientSide) {
return false;
} else {
@@ -668,7 +777,14 @@
@@ -674,7 +783,14 @@
boolean flag;
for (flag = false; iterator.hasNext(); flag = true) {
@@ -232,7 +232,7 @@
iterator.remove();
}
@@ -693,18 +809,44 @@
@@ -699,18 +815,44 @@
return (MobEffect) this.effects.get(mobeffectlist);
}
@@ -278,7 +278,7 @@
return true;
} else {
return false;
@@ -728,13 +870,39 @@
@@ -734,13 +876,39 @@
return this.getMonsterType() == EnumMonsterType.UNDEAD;
}
@@ -319,7 +319,7 @@
if (mobeffect != null) {
this.b(mobeffect);
@@ -771,20 +939,55 @@
@@ -777,20 +945,55 @@
}
@@ -376,7 +376,7 @@
this.datawatcher.set(EntityLiving.HEALTH, MathHelper.a(f, 0.0F, this.getMaxHealth()));
}
@@ -794,7 +997,7 @@
@@ -800,7 +1003,7 @@
return false;
} else if (this.world.isClientSide) {
return false;
@@ -385,7 +385,7 @@
return false;
} else if (damagesource.p() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false;
@@ -806,17 +1009,19 @@
@@ -812,17 +1015,19 @@
this.ticksFarFromPlayer = 0;
float f1 = f;
@@ -408,7 +408,7 @@
this.damageShield(f);
f2 = f;
f = 0.0F;
@@ -836,20 +1041,39 @@
@@ -842,20 +1047,39 @@
if ((float) this.noDamageTicks > 10.0F) {
if (f <= this.lastDamage) {
@@ -450,7 +450,7 @@
this.az = 0.0F;
Entity entity1 = damagesource.getEntity();
@@ -970,19 +1194,29 @@
@@ -976,19 +1200,29 @@
EnumHand[] aenumhand = EnumHand.values();
int i = aenumhand.length;
@@ -484,7 +484,7 @@
EntityPlayer entityplayer = (EntityPlayer) this;
entityplayer.b(StatisticList.ITEM_USED.b(Items.TOTEM_OF_UNDYING));
@@ -990,13 +1224,15 @@
@@ -996,13 +1230,15 @@
}
this.setHealth(1.0F);
@@ -504,7 +504,7 @@
}
}
@@ -1109,6 +1345,12 @@
@@ -1115,6 +1351,12 @@
if (this.isDropExperience() && this.world.getGameRules().getBoolean("doMobLoot")) {
this.a(damagesource, flag);
this.dropDeathLoot(damagesource, i, flag);
@@ -517,7 +517,7 @@
}
this.cE();
@@ -1212,8 +1454,13 @@
@@ -1218,8 +1460,13 @@
int i = MathHelper.f((f - 3.0F - f2) * f1);
if (i > 0) {
@@ -532,7 +532,7 @@
int j = MathHelper.floor(this.locX);
int k = MathHelper.floor(this.locY - 0.20000000298023224D);
int l = MathHelper.floor(this.locZ);
@@ -1240,7 +1487,7 @@
@@ -1246,7 +1493,7 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@@ -541,7 +541,7 @@
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.getAttributeInstance(GenericAttributes.ARMOR_TOUGHNESS).getValue());
}
@@ -1253,7 +1500,8 @@
@@ -1259,7 +1506,8 @@
} else {
int i;
@@ -551,7 +551,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
@@ -1284,28 +1532,170 @@
@@ -1290,28 +1538,170 @@
}
}
@@ -570,7 +570,10 @@
+ public Double apply(Double f) {
+ if ((damagesource == DamageSource.ANVIL || damagesource == DamageSource.FALLING_BLOCK) && !EntityLiving.this.getEquipment(EnumItemSlot.HEAD).isEmpty()) {
+ return -(f - (f * 0.75F));
+
- f = Math.max(f - this.getAbsorptionHearts(), 0.0F);
- this.setAbsorptionHearts(this.getAbsorptionHearts() - (f1 - f));
- float f2 = f1 - f;
+ }
+ return -0.0;
+ }
@@ -627,7 +630,7 @@
+ }
+ };
+ float absorptionModifier = absorption.apply((double) f).floatValue();
+
+ EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption);
+ if (event.isCancelled()) {
+ return false;
@@ -659,10 +662,7 @@
+ float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT));
+ this.damageArmor(armorDamage);
+ }
- f = Math.max(f - this.getAbsorptionHearts(), 0.0F);
- this.setAbsorptionHearts(this.getAbsorptionHearts() - (f1 - f));
- float f2 = f1 - f;
+
+ // Apply blocking code // PAIL: steal from above
+ if (event.getDamage(DamageModifier.BLOCKING) < 0) {
+ this.world.broadcastEntityEffect(this, (byte) 29); // SPIGOT-4635 - shield damage sound
@@ -670,10 +670,10 @@
+ Entity entity = damagesource.j();
+
+ if (entity instanceof EntityLiving) {
+ this.d((EntityLiving) entity);
+ this.shieldBlock((EntityLiving) entity);
+ }
+ }
+
+ absorptionModifier = (float) -event.getDamage(DamageModifier.ABSORPTION);
+ this.setAbsorptionHearts(Math.max(this.getAbsorptionHearts() - absorptionModifier, 0.0F));
+ float f2 = absorptionModifier;
@@ -732,7 +732,7 @@
}
public CombatTracker getCombatTracker() {
@@ -1373,6 +1763,7 @@
@@ -1379,6 +1769,7 @@
public AttributeMapBase getAttributeMap() {
if (this.attributeMap == null) {
this.attributeMap = new AttributeMapServer();
@@ -740,7 +740,7 @@
}
return this.attributeMap;
@@ -1719,6 +2110,7 @@
@@ -1725,6 +2116,7 @@
}
if (this.onGround && !this.world.isClientSide) {
@@ -748,7 +748,7 @@
this.setFlag(7, false);
}
} else {
@@ -2100,6 +2492,7 @@
@@ -2106,6 +2498,7 @@
}
if (!this.world.isClientSide) {
@@ -756,7 +756,7 @@
this.setFlag(7, flag);
}
@@ -2228,12 +2621,12 @@
@@ -2234,12 +2627,12 @@
@Override
public boolean isInteractable() {
@@ -771,7 +771,7 @@
}
@Override
@@ -2404,7 +2797,27 @@
@@ -2410,7 +2803,27 @@
protected void q() {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@@ -800,7 +800,7 @@
this.dp();
}
@@ -2489,10 +2902,18 @@
@@ -2495,10 +2908,18 @@
}
if (flag2) {
@@ -822,7 +822,7 @@
}
}
@@ -2579,7 +3000,7 @@
@@ -2585,7 +3006,7 @@
}
public void dy() {
@@ -831,7 +831,7 @@
World world = this.world;
this.world.getClass();
@@ -2641,7 +3062,7 @@
@@ -2647,7 +3068,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getLeft() != null && world.random.nextFloat() < (Float) pair.getRight()) {