Update to Minecraft 1.19.4

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-03-15 03:30:00 +11:00
parent 90a887a912
commit 40076782ed
227 changed files with 2788 additions and 1621 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
@@ -19,6 +19,11 @@
@@ -20,6 +20,11 @@
import net.minecraft.world.level.block.BlockFireAbstract;
import net.minecraft.world.level.dimension.end.EnderDragonBattle;
@@ -12,7 +12,7 @@
public class EntityEnderCrystal extends Entity {
private static final DataWatcherObject<Optional<BlockPosition>> DATA_BEAM_TARGET = DataWatcher.defineId(EntityEnderCrystal.class, DataWatcherRegistry.OPTIONAL_BLOCK_POS);
@@ -54,7 +59,11 @@
@@ -55,7 +60,11 @@
BlockPosition blockposition = this.blockPosition();
if (((WorldServer) this.level).dragonFight() != null && this.level.getBlockState(blockposition).isAir()) {
@@ -25,7 +25,7 @@
}
}
@@ -94,11 +103,24 @@
@@ -95,11 +104,24 @@
return false;
} else {
if (!this.isRemoved() && !this.level.isClientSide) {
@@ -35,8 +35,8 @@
+ }
+ // CraftBukkit end
this.remove(Entity.RemovalReason.KILLED);
if (!damagesource.isExplosion()) {
DamageSource damagesource1 = damagesource.getEntity() != null ? DamageSource.explosion(this, damagesource.getEntity()) : null;
if (!damagesource.is(DamageTypeTags.IS_EXPLOSION)) {
DamageSource damagesource1 = damagesource.getEntity() != null ? this.damageSources().explosion(this, damagesource.getEntity()) : null;
- this.level.explode(this, damagesource1, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), 6.0F, false, World.a.BLOCK);
+ // CraftBukkit start

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon.java
@@ -50,6 +50,18 @@
@@ -51,6 +51,18 @@
import net.minecraft.world.phys.Vec3D;
import org.slf4j.Logger;
@@ -19,15 +19,23 @@
public class EntityEnderDragon extends EntityInsentient implements IMonster {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -86,6 +98,7 @@
@@ -87,6 +99,7 @@
private final PathPoint[] nodes = new PathPoint[24];
private final int[] nodeAdjacency = new int[24];
private final Path openSet = new Path();
+ private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
+ private final Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
public EntityEnderDragon(EntityTypes<? extends EntityEnderDragon> entitytypes, World world) {
super(EntityTypes.ENDER_DRAGON, world);
@@ -233,7 +246,7 @@
@@ -101,6 +114,7 @@
}
this.phaseManager = new DragonControllerManager(this);
+ this.explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.Effect.DESTROY); // CraftBukkit
}
public static AttributeProvider.Builder createAttributes() {
@@ -234,7 +248,7 @@
Vec3D vec3d1 = idragoncontroller.getFlyTargetLocation();
@@ -36,7 +44,7 @@
d0 = vec3d1.x - this.getX();
d1 = vec3d1.y - this.getY();
d2 = vec3d1.z - this.getZ();
@@ -374,7 +387,14 @@
@@ -375,7 +389,14 @@
if (this.nearestCrystal.isRemoved()) {
this.nearestCrystal = null;
} else if (this.tickCount % 10 == 0 && this.getHealth() < this.getMaxHealth()) {
@@ -52,7 +60,7 @@
}
}
@@ -449,6 +469,9 @@
@@ -450,6 +471,9 @@
int j1 = MathHelper.floor(axisalignedbb.maxZ);
boolean flag = false;
boolean flag1 = false;
@@ -62,7 +70,7 @@
for (int k1 = i; k1 <= l; ++k1) {
for (int l1 = j; l1 <= i1; ++l1) {
@@ -458,7 +481,11 @@
@@ -459,7 +483,11 @@
if (!iblockdata.isAir() && !iblockdata.is(TagsBlock.DRAGON_TRANSPARENT)) {
if (this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && !iblockdata.is(TagsBlock.DRAGON_IMMUNE)) {
@@ -75,7 +83,7 @@
} else {
flag = true;
}
@@ -467,6 +494,51 @@
@@ -468,6 +496,51 @@
}
}
@@ -127,7 +135,7 @@
if (flag1) {
BlockPosition blockposition1 = new BlockPosition(i + this.random.nextInt(l - i + 1), j + this.random.nextInt(i1 - j + 1), k + this.random.nextInt(j1 - k + 1));
@@ -531,6 +603,21 @@
@@ -532,6 +605,21 @@
}
@@ -149,7 +157,7 @@
@Override
protected void tickDeath() {
if (this.dragonFight != null) {
@@ -546,15 +633,20 @@
@@ -547,15 +635,20 @@
this.level.addParticle(Particles.EXPLOSION_EMITTER, this.getX() + (double) f, this.getY() + 2.0D + (double) f1, this.getZ() + (double) f2, 0.0D, 0.0D, 0.0D);
}
@@ -171,16 +179,16 @@
EntityExperienceOrb.award((WorldServer) this.level, this.position(), MathHelper.floor((float) short0 * 0.08F));
}
@@ -567,7 +659,7 @@
this.setYRot(this.getYRot() + 20.0F);
this.yBodyRot = this.getYRot();
@@ -566,7 +659,7 @@
this.move(EnumMoveType.SELF, new Vec3D(0.0D, 0.10000000149011612D, 0.0D));
if (this.dragonDeathTime == 200 && this.level instanceof WorldServer) {
- if (flag) {
+ if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp
EntityExperienceOrb.award((WorldServer) this.level, this.position(), MathHelper.floor((float) short0 * 0.2F));
}
@@ -788,6 +880,7 @@
@@ -787,6 +880,7 @@
super.addAdditionalSaveData(nbttagcompound);
nbttagcompound.putInt("DragonPhase", this.phaseManager.getCurrentPhase().getPhase().getId());
nbttagcompound.putInt("DragonDeathTime", this.dragonDeathTime);
@@ -188,7 +196,7 @@
}
@Override
@@ -801,6 +894,11 @@
@@ -800,6 +894,11 @@
this.dragonDeathTime = nbttagcompound.getInt("DragonDeathTime");
}