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/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -122,8 +122,65 @@
@@ -124,8 +124,65 @@
import net.minecraft.world.scores.ScoreboardTeamBase;
import org.slf4j.Logger;
@@ -66,7 +66,7 @@
private static final Logger LOGGER = LogUtils.getLogger();
public static final String ID_TAG = "id";
public static final String PASSENGERS_TAG = "Passengers";
@@ -234,6 +291,25 @@
@@ -236,6 +293,25 @@
public boolean hasVisualFire;
@Nullable
private IBlockData feetBlockState;
@@ -92,7 +92,7 @@
public Entity(EntityTypes<?> entitytypes, World world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -365,6 +441,12 @@
@@ -367,6 +443,12 @@
public void onClientRemoval() {}
public void setPose(EntityPose entitypose) {
@@ -105,7 +105,7 @@
this.entityData.set(Entity.DATA_POSE, entitypose);
}
@@ -389,6 +471,33 @@
@@ -391,6 +473,33 @@
}
protected void setRot(float f, float f1) {
@@ -139,7 +139,7 @@
this.setYRot(f % 360.0F);
this.setXRot(f1 % 360.0F);
}
@@ -430,6 +539,15 @@
@@ -432,6 +541,15 @@
this.baseTick();
}
@@ -155,7 +155,7 @@
public void baseTick() {
this.level.getProfiler().push("entityBaseTick");
this.feetBlockState = null;
@@ -444,7 +562,7 @@
@@ -446,7 +564,7 @@
this.walkDistO = this.walkDist;
this.xRotO = this.getXRot();
this.yRotO = this.getYRot();
@@ -164,7 +164,7 @@
if (this.canSpawnSprintParticle()) {
this.spawnSprintParticle();
}
@@ -479,6 +597,10 @@
@@ -481,6 +599,10 @@
if (this.isInLava()) {
this.lavaHurt();
this.fallDistance *= 0.5F;
@@ -175,7 +175,7 @@
}
this.checkOutOfWorld();
@@ -522,15 +644,48 @@
@@ -524,15 +646,48 @@
public void lavaHurt() {
if (!this.fireImmune()) {
@@ -196,7 +196,7 @@
+ this.setSecondsOnFire(15, false);
+ }
+ CraftEventFactory.blockDamage = (lastLavaContact) == null ? null : org.bukkit.craftbukkit.block.CraftBlock.at(level, lastLavaContact);
if (this.hurt(DamageSource.LAVA, 4.0F)) {
if (this.hurt(this.damageSources().lava(), 4.0F)) {
this.playSound(SoundEffects.GENERIC_BURN, 0.4F, 2.0F + this.random.nextFloat() * 0.4F);
}
+ CraftEventFactory.blockDamage = null;
@@ -225,7 +225,7 @@
int j = i * 20;
if (this instanceof EntityLiving) {
@@ -644,6 +799,28 @@
@@ -646,6 +801,28 @@
block.updateEntityAfterFallOn(this.level, this);
}
@@ -254,7 +254,7 @@
if (this.onGround) {
block.stepOn(this.level, blockposition, iblockdata, this);
}
@@ -946,6 +1123,20 @@
@@ -948,6 +1125,20 @@
return SoundEffects.GENERIC_SPLASH;
}
@@ -274,8 +274,8 @@
+
protected void checkInsideBlocks() {
AxisAlignedBB axisalignedbb = this.getBoundingBox();
BlockPosition blockposition = new BlockPosition(axisalignedbb.minX + 1.0E-7D, axisalignedbb.minY + 1.0E-7D, axisalignedbb.minZ + 1.0E-7D);
@@ -1305,6 +1496,7 @@
BlockPosition blockposition = BlockPosition.containing(axisalignedbb.minX + 1.0E-7D, axisalignedbb.minY + 1.0E-7D, axisalignedbb.minZ + 1.0E-7D);
@@ -1311,6 +1502,7 @@
this.yo = d1;
this.zo = d4;
this.setPos(d3, d1, d4);
@@ -283,7 +283,7 @@
}
public void moveTo(Vec3D vec3d) {
@@ -1495,6 +1687,12 @@
@@ -1505,6 +1697,12 @@
return false;
}
@@ -296,7 +296,7 @@
public void awardKillScore(Entity entity, int i, DamageSource damagesource) {
if (entity instanceof EntityPlayer) {
CriterionTriggers.ENTITY_KILLED_PLAYER.trigger((EntityPlayer) entity, this, damagesource);
@@ -1528,7 +1726,7 @@
@@ -1538,7 +1736,7 @@
} else {
String s = this.getEncodeId();
@@ -305,7 +305,7 @@
return false;
} else {
nbttagcompound.putString("id", s);
@@ -1553,6 +1751,18 @@
@@ -1563,6 +1761,18 @@
Vec3D vec3d = this.getDeltaMovement();
nbttagcompound.put("Motion", this.newDoubleList(vec3d.x, vec3d.y, vec3d.z));
@@ -324,7 +324,7 @@
nbttagcompound.put("Rotation", this.newFloatList(this.getYRot(), this.getXRot()));
nbttagcompound.putFloat("FallDistance", this.fallDistance);
nbttagcompound.putShort("Fire", (short) this.remainingFireTicks);
@@ -1561,6 +1771,25 @@
@@ -1571,6 +1781,25 @@
nbttagcompound.putBoolean("Invulnerable", this.invulnerable);
nbttagcompound.putInt("PortalCooldown", this.portalCooldown);
nbttagcompound.putUUID("UUID", this.getUUID());
@@ -350,7 +350,7 @@
IChatBaseComponent ichatbasecomponent = this.getCustomName();
if (ichatbasecomponent != null) {
@@ -1628,6 +1857,11 @@
@@ -1638,6 +1867,11 @@
}
}
@@ -362,7 +362,7 @@
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
@@ -1711,6 +1945,45 @@
@@ -1721,6 +1955,45 @@
} else {
throw new IllegalStateException("Entity has invalid position");
}
@@ -408,7 +408,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Entity being loaded");
@@ -1786,9 +2059,22 @@
@@ -1796,9 +2069,22 @@
} else if (this.level.isClientSide) {
return null;
} else {
@@ -431,7 +431,7 @@
this.level.addFreshEntity(entityitem);
return entityitem;
}
@@ -1882,7 +2168,7 @@
@@ -1894,7 +2180,7 @@
this.setPose(EntityPose.STANDING);
this.vehicle = entity;
@@ -440,7 +440,7 @@
entity.getIndirectPassengersStream().filter((entity2) -> {
return entity2 instanceof EntityPlayer;
}).forEach((entity2) -> {
@@ -1913,7 +2199,7 @@
@@ -1925,7 +2211,7 @@
Entity entity = this.vehicle;
this.vehicle = null;
@@ -449,7 +449,7 @@
}
}
@@ -1926,10 +2212,31 @@
@@ -1934,10 +2220,31 @@
this.removeVehicle();
}
@@ -482,9 +482,9 @@
if (this.passengers.isEmpty()) {
this.passengers = ImmutableList.of(entity);
} else {
@@ -1945,12 +2252,32 @@
}
@@ -1954,12 +2261,32 @@
this.gameEvent(GameEvent.ENTITY_MOUNT, entity);
}
+ return true; // CraftBukkit
}
@@ -516,15 +516,15 @@
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
this.passengers = ImmutableList.of();
} else {
@@ -1961,6 +2288,7 @@
@@ -1971,6 +2298,7 @@
entity.boardingCooldown = 60;
this.gameEvent(GameEvent.ENTITY_DISMOUNT, entity);
}
+ return true; // CraftBukkit
}
protected boolean canAddPassenger(Entity entity) {
@@ -2023,14 +2351,20 @@
@@ -2037,14 +2365,20 @@
if (this.isInsidePortal) {
MinecraftServer minecraftserver = worldserver.getServer();
@@ -548,7 +548,7 @@
this.level.getProfiler().pop();
}
@@ -2148,6 +2482,13 @@
@@ -2164,6 +2498,13 @@
}
public void setSwimming(boolean flag) {
@@ -562,7 +562,7 @@
this.setSharedFlag(4, flag);
}
@@ -2193,8 +2534,12 @@
@@ -2209,8 +2550,12 @@
return this.getTeam() != null ? this.getTeam().isAlliedTo(scoreboardteambase) : false;
}
@@ -576,7 +576,7 @@
}
public boolean getSharedFlag(int i) {
@@ -2213,7 +2558,7 @@
@@ -2229,7 +2574,7 @@
}
public int getMaxAirSupply() {
@@ -585,7 +585,7 @@
}
public int getAirSupply() {
@@ -2221,7 +2566,18 @@
@@ -2237,7 +2582,18 @@
}
public void setAirSupply(int i) {
@@ -605,7 +605,7 @@
}
public int getTicksFrozen() {
@@ -2248,11 +2604,41 @@
@@ -2264,11 +2620,41 @@
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
this.setRemainingFireTicks(this.remainingFireTicks + 1);
@@ -624,9 +624,8 @@
+ this.setSecondsOnFire(entityCombustEvent.getDuration(), false);
+ }
+ // CraftBukkit end
}
- this.hurt(DamageSource.LIGHTNING_BOLT, 5.0F);
+ }
+
+ // CraftBukkit start
+ if (thisBukkitEntity instanceof Hanging) {
+ HangingBreakByEntityEvent hangingEvent = new HangingBreakByEntityEvent((Hanging) thisBukkitEntity, stormBukkitEntity);
@@ -635,13 +634,14 @@
+ if (hangingEvent.isCancelled()) {
+ return;
+ }
+ }
+
}
- this.hurt(this.damageSources().lightningBolt(), 5.0F);
+ if (this.fireImmune()) {
+ return;
+ }
+ CraftEventFactory.entityDamage = entitylightning;
+ if (!this.hurt(DamageSource.LIGHTNING_BOLT, 5.0F)) {
+ if (!this.hurt(this.damageSources().lightningBolt(), 5.0F)) {
+ CraftEventFactory.entityDamage = null;
+ return;
+ }
@@ -649,7 +649,7 @@
}
public void onAboveBubbleCol(boolean flag) {
@@ -2417,15 +2803,38 @@
@@ -2433,15 +2819,38 @@
@Nullable
public Entity changeDimension(WorldServer worldserver) {
@@ -690,7 +690,7 @@
this.level.getProfiler().popPush("reloading");
Entity entity = this.getType().create(worldserver);
@@ -2434,9 +2843,17 @@
@@ -2450,9 +2859,17 @@
entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot());
entity.setDeltaMovement(shapedetectorshape.speed);
worldserver.addDuringTeleport(entity);
@@ -710,7 +710,7 @@
}
this.removeAfterChangingDimensions();
@@ -2457,20 +2874,34 @@
@@ -2473,20 +2890,34 @@
@Nullable
protected ShapeDetectorShape findDimensionEntryPoint(WorldServer worldserver) {
@@ -750,7 +750,7 @@
IBlockData iblockdata = this.level.getBlockState(this.portalEntrancePos);
EnumDirection.EnumAxis enumdirection_enumaxis;
Vec3D vec3d;
@@ -2487,8 +2918,8 @@
@@ -2503,8 +2934,8 @@
vec3d = new Vec3D(0.5D, 0.0D, 0.0D);
}
@@ -761,7 +761,7 @@
}
} else {
BlockPosition blockposition1;
@@ -2498,8 +2929,14 @@
@@ -2514,8 +2945,14 @@
} else {
blockposition1 = worldserver.getHeightmapPos(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSharedSpawnPos());
}
@@ -777,7 +777,7 @@
}
}
@@ -2507,8 +2944,23 @@
@@ -2523,8 +2960,23 @@
return BlockPortalShape.getRelativePosition(blockutil_rectangle, enumdirection_enumaxis, this.position(), this.getDimensions(this.getPose()));
}
@@ -803,7 +803,7 @@
}
public boolean canChangeDimensions() {
@@ -2731,7 +3183,26 @@
@@ -2773,7 +3225,26 @@
}
public final void setBoundingBox(AxisAlignedBB axisalignedbb) {
@@ -831,7 +831,7 @@
}
protected float getEyeHeight(EntityPose entitypose, EntitySize entitysize) {
@@ -3023,6 +3494,11 @@
@@ -3084,6 +3555,11 @@
vec3d = vec3d.add(vec3d1);
++k1;
}