1.21.6-pre2

This commit is contained in:
Bjarne Koll
2025-06-02 17:02:22 +02:00
parent 1366eaa540
commit 4b6fae1079
6 changed files with 70 additions and 70 deletions

View File

@@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.21.6-R0.1-SNAPSHOT
mcVersion=1.21.6-pre1
mcVersion=1.21.6-pre2
# Set to true while updating Minecraft version
updatingMinecraft=true

View File

@@ -15,7 +15,7 @@ plugins {
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
dependencies {
mache("io.papermc:mache:1.21.6-pre1+build.2")
mache("io.papermc:mache:1.21.6-pre2+build.2")
paperclip("io.papermc:paperclip:3.0.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

View File

@@ -161,7 +161,7 @@
profilerFiller.push("purge");
- if (this.level.tickRateManager().runsNormally() || !tickChunks) {
+ if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
this.ticketStorage.purgeStaleTickets();
this.ticketStorage.purgeStaleTickets(this.chunkMap);
}
@@ -388,12 +_,20 @@

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/util/datafix/DataFixers.java
+++ b/net/minecraft/util/datafix/DataFixers.java
@@ -513,6 +_,24 @@
@@ -515,6 +_,24 @@
Schema schema44 = builder.addSchema(1456, SAME_NAMESPACED);
builder.addFixer(new EntityItemFrameDirectionFix(schema44, false));
Schema schema45 = builder.addSchema(1458, V1458::new);

View File

@@ -581,7 +581,7 @@
BlockPos blockPos = this.mainSupportingBlockPos.get();
if (!(yOffset > 1.0E-5F)) {
return blockPos;
@@ -1164,7 +_,7 @@
@@ -1163,7 +_,7 @@
|| this.collidedWithShapeMovingFrom(vec3, vec31, entityInsideCollisionShape.move(new Vec3(pos)).toAabbs());
if (flag) {
try {
@@ -590,7 +590,7 @@
blockState.entityInside(this.level(), pos, this, stepBasedCollector);
this.onInsideBlock(blockState);
} catch (Throwable var14) {
@@ -1179,7 +_,7 @@
@@ -1178,7 +_,7 @@
boolean flag1 = this.collidedWithFluid(blockState.getFluidState(), pos, vec3, vec31);
if (flag1) {
@@ -599,7 +599,7 @@
blockState.getFluidState().entityInside(this.level(), pos, this, stepBasedCollector);
}
@@ -1595,6 +_,7 @@
@@ -1594,6 +_,7 @@
this.setXRot(Mth.clamp(xRot, -90.0F, 90.0F) % 360.0F);
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
@@ -607,7 +607,7 @@
}
public void absSnapTo(double x, double y, double z) {
@@ -1604,6 +_,7 @@
@@ -1603,6 +_,7 @@
this.yo = y;
this.zo = d1;
this.setPos(d, y, d1);
@@ -615,7 +615,7 @@
}
public void snapTo(Vec3 pos) {
@@ -1623,11 +_,19 @@
@@ -1622,11 +_,19 @@
}
public void snapTo(double x, double y, double z, float yRot, float xRot) {
@@ -635,7 +635,7 @@
}
public final void setOldPosAndRot() {
@@ -1694,6 +_,7 @@
@@ -1693,6 +_,7 @@
public void push(Entity entity) {
if (!this.isPassengerOfSameVehicle(entity)) {
if (!entity.noPhysics && !this.noPhysics) {
@@ -643,7 +643,7 @@
double d = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
double max = Mth.absMax(d, d1);
@@ -1727,7 +_,21 @@
@@ -1726,7 +_,21 @@
}
public void push(double x, double y, double z) {
@@ -666,7 +666,7 @@
this.hasImpulse = true;
}
@@ -1834,8 +_,20 @@
@@ -1833,8 +_,20 @@
}
public boolean isPushable() {
@@ -687,7 +687,7 @@
public void awardKillScore(Entity entity, DamageSource damageSource) {
if (entity instanceof ServerPlayer) {
@@ -1862,15 +_,23 @@
@@ -1861,15 +_,23 @@
}
public boolean saveAsPassenger(ValueOutput output) {
@@ -715,7 +715,7 @@
return true;
}
}
@@ -1881,14 +_,35 @@
@@ -1880,14 +_,35 @@
}
public void saveWithoutId(ValueOutput output) {
@@ -751,7 +751,7 @@
output.store("Rotation", Vec2.CODEC, new Vec2(this.getYRot(), this.getXRot()));
output.putDouble("fall_distance", this.fallDistance);
output.putShort("Fire", (short)this.remainingFireTicks);
@@ -1896,7 +_,29 @@
@@ -1895,7 +_,29 @@
output.putBoolean("OnGround", this.onGround());
output.putBoolean("Invulnerable", this.invulnerable);
output.putInt("PortalCooldown", this.portalCooldown);
@@ -781,7 +781,7 @@
output.storeNullable("CustomName", ComponentSerialization.CODEC, this.getCustomName());
if (this.isCustomNameVisible()) {
output.putBoolean("CustomNameVisible", this.isCustomNameVisible());
@@ -1919,9 +_,12 @@
@@ -1918,9 +_,12 @@
output.putInt("TicksFrozen", this.getTicksFrozen());
}
@@ -796,7 +796,7 @@
if (!this.tags.isEmpty()) {
output.store("Tags", TAG_LIST_CODEC, List.copyOf(this.tags));
@@ -1931,13 +_,13 @@
@@ -1930,13 +_,13 @@
output.store("data", CustomData.CODEC, this.customData);
}
@@ -812,7 +812,7 @@
valueOutputList.discardLast();
}
}
@@ -1946,6 +_,34 @@
@@ -1945,6 +_,34 @@
output.discard("Passengers");
}
}
@@ -847,7 +847,7 @@
} catch (Throwable var7) {
CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
@@ -1957,7 +_,7 @@
@@ -1956,7 +_,7 @@
public void load(ValueInput input) {
try {
Vec3 vec3 = input.read("Pos", Vec3.CODEC).orElse(Vec3.ZERO);
@@ -856,7 +856,7 @@
Vec2 vec2 = input.read("Rotation", Vec2.CODEC).orElse(Vec2.ZERO);
this.setDeltaMovement(Math.abs(vec31.x) > 10.0 ? 0.0 : vec31.x, Math.abs(vec31.y) > 10.0 ? 0.0 : vec31.y, Math.abs(vec31.z) > 10.0 ? 0.0 : vec31.z);
this.hasImpulse = true;
@@ -1989,7 +_,20 @@
@@ -1988,7 +_,20 @@
this.setNoGravity(input.getBooleanOr("NoGravity", false));
this.setGlowingTag(input.getBooleanOr("Glowing", false));
this.setTicksFrozen(input.getIntOr("TicksFrozen", 0));
@@ -878,7 +878,7 @@
this.customData = input.read("data", CustomData.CODEC).orElse(CustomData.EMPTY);
this.tags.clear();
input.read("Tags", TAG_LIST_CODEC).ifPresent(this.tags::addAll);
@@ -2000,6 +_,59 @@
@@ -1999,6 +_,59 @@
} else {
throw new IllegalStateException("Entity has invalid rotation");
}
@@ -938,7 +938,7 @@
} catch (Throwable var7) {
CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
@@ -2014,13 +_,24 @@
@@ -2013,13 +_,24 @@
@Nullable
public final String getEncodeId() {
@@ -964,7 +964,7 @@
protected abstract void addAdditionalSaveData(ValueOutput output);
@Nullable
@@ -2040,11 +_,63 @@
@@ -2039,11 +_,63 @@
@Nullable
public ItemEntity spawnAtLocation(ServerLevel level, ItemStack stack, Vec3 offset) {
@@ -1029,7 +1029,7 @@
level.addFreshEntity(itemEntity);
return itemEntity;
}
@@ -2090,6 +_,15 @@
@@ -2089,6 +_,15 @@
for (Leashable leashable1 : list) {
if (leashable1.canHaveALeashAttachedTo(this)) {
@@ -1045,7 +1045,7 @@
leashable1.setLeashedTo(this, true);
flag = true;
}
@@ -2117,11 +_,14 @@
@@ -2116,11 +_,14 @@
if (this.isAlive() && this instanceof Leashable leashable2) {
if (leashable2.getLeashHolder() == player) {
if (!this.level().isClientSide()) {
@@ -1064,7 +1064,7 @@
this.gameEvent(GameEvent.ENTITY_INTERACT, player);
this.playSound(SoundEvents.LEAD_UNTIED);
@@ -2134,9 +_,24 @@
@@ -2133,9 +_,24 @@
if (itemInHand1.is(Items.LEAD) && !(leashable2.getLeashHolder() instanceof Player)) {
if (!this.level().isClientSide() && leashable2.canHaveALeashAttachedTo(player)) {
if (leashable2.isLeashed()) {
@@ -1090,7 +1090,7 @@
leashable2.setLeashedTo(player, true);
this.playSound(SoundEvents.LEAD_TIED);
itemInHand1.shrink(1);
@@ -2151,7 +_,12 @@
@@ -2150,7 +_,12 @@
}
public boolean shearOffAllLeashConnections(@Nullable Player player) {
@@ -1104,7 +1104,7 @@
if (flag && this.level() instanceof ServerLevel serverLevel) {
serverLevel.playSound(null, this.blockPosition(), SoundEvents.SHEARS_SNIP, player != null ? player.getSoundSource() : this.getSoundSource());
}
@@ -2160,15 +_,36 @@
@@ -2159,15 +_,36 @@
}
public boolean dropAllLeashConnections(@Nullable Player player) {
@@ -1145,7 +1145,7 @@
}
if (flag) {
@@ -2192,7 +_,9 @@
@@ -2191,7 +_,9 @@
this.gameEvent(GameEvent.SHEAR, player);
this.playSound(equippable.shearingSound().value());
if (this.level() instanceof ServerLevel serverLevel) {
@@ -1155,7 +1155,7 @@
}
return true;
@@ -2264,11 +_,11 @@
@@ -2263,11 +_,11 @@
}
public boolean startRiding(Entity vehicle, boolean force) {
@@ -1169,7 +1169,7 @@
return false;
} else {
for (Entity entity = vehicle; entity.vehicle != null; entity = entity.vehicle) {
@@ -2278,6 +_,27 @@
@@ -2277,6 +_,27 @@
}
if (force || this.canRide(vehicle) && vehicle.canAddPassenger(this)) {
@@ -1197,7 +1197,7 @@
if (this.isPassenger()) {
this.stopRiding();
}
@@ -2306,15 +_,26 @@
@@ -2305,15 +_,26 @@
}
public void removeVehicle() {
@@ -1226,7 +1226,7 @@
}
protected void addPassenger(Entity passenger) {
@@ -2338,10 +_,43 @@
@@ -2337,10 +_,43 @@
}
}
@@ -1271,7 +1271,7 @@
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
this.passengers = ImmutableList.of();
} else {
@@ -2351,6 +_,7 @@
@@ -2350,6 +_,7 @@
passenger.boardingCooldown = 60;
this.gameEvent(GameEvent.ENTITY_DISMOUNT, passenger);
}
@@ -1279,7 +1279,7 @@
}
protected boolean canAddPassenger(Entity passenger) {
@@ -2434,8 +_,8 @@
@@ -2433,8 +_,8 @@
TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this);
if (portalDestination != null) {
ServerLevel level = portalDestination.newLevel();
@@ -1290,7 +1290,7 @@
this.teleport(portalDestination);
}
}
@@ -2516,7 +_,7 @@
@@ -2515,7 +_,7 @@
}
public boolean isCrouching() {
@@ -1299,7 +1299,7 @@
}
public boolean isSprinting() {
@@ -2532,7 +_,7 @@
@@ -2531,7 +_,7 @@
}
public boolean isVisuallySwimming() {
@@ -1308,7 +1308,7 @@
}
public boolean isVisuallyCrawling() {
@@ -2540,6 +_,13 @@
@@ -2539,6 +_,13 @@
}
public void setSwimming(boolean swimming) {
@@ -1322,7 +1322,7 @@
this.setSharedFlag(4, swimming);
}
@@ -2578,6 +_,7 @@
@@ -2577,6 +_,7 @@
@Nullable
public PlayerTeam getTeam() {
@@ -1330,7 +1330,7 @@
return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName());
}
@@ -2594,7 +_,11 @@
@@ -2593,7 +_,11 @@
}
public void setInvisible(boolean invisible) {
@@ -1343,7 +1343,7 @@
}
public boolean getSharedFlag(int flag) {
@@ -2611,7 +_,7 @@
@@ -2610,7 +_,7 @@
}
public int getMaxAirSupply() {
@@ -1352,7 +1352,7 @@
}
public int getAirSupply() {
@@ -2619,10 +_,22 @@
@@ -2618,10 +_,22 @@
}
public void setAirSupply(int air) {
@@ -1376,7 +1376,7 @@
this.setTicksFrozen(0);
}
@@ -2649,11 +_,43 @@
@@ -2648,11 +_,43 @@
public void thunderHit(ServerLevel level, LightningBolt lightning) {
this.setRemainingFireTicks(this.remainingFireTicks + 1);
@@ -1424,7 +1424,7 @@
}
public void onAboveBubbleColumn(boolean downwards, BlockPos pos) {
@@ -2809,26 +_,30 @@
@@ -2808,26 +_,30 @@
return this.removalReason != null
? String.format(
Locale.ROOT,
@@ -1458,7 +1458,7 @@
);
}
@@ -2852,6 +_,13 @@
@@ -2851,6 +_,13 @@
}
public void restoreFrom(Entity entity) {
@@ -1472,7 +1472,7 @@
try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(this.problemPath(), LOGGER)) {
TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector, entity.registryAccess());
entity.saveWithoutId(tagValueOutput);
@@ -2864,7 +_,56 @@
@@ -2863,7 +_,56 @@
@Nullable
public Entity teleport(TeleportTransition teleportTransition) {
@@ -1529,7 +1529,7 @@
ServerLevel level = teleportTransition.newLevel();
boolean flag = level.dimension() != serverLevel.dimension();
if (!teleportTransition.asPassenger()) {
@@ -2913,10 +_,15 @@
@@ -2912,10 +_,15 @@
profilerFiller.pop();
return null;
} else {
@@ -1546,7 +1546,7 @@
for (Entity entity2 : list) {
entity2.startRiding(entityx, true);
@@ -2999,9 +_,17 @@
@@ -2998,9 +_,17 @@
}
protected void removeAfterChangingDimensions() {
@@ -1567,7 +1567,7 @@
}
if (this instanceof WaypointTransmitter waypointTransmitter && this.level instanceof ServerLevel serverLevel) {
@@ -3013,11 +_,37 @@
@@ -3012,11 +_,37 @@
return PortalShape.getRelativePosition(portal, axis, this.position(), this.getDimensions(this.getPose()));
}
@@ -1605,7 +1605,7 @@
if (fromLevel.dimension() == Level.END && toLevel.dimension() == Level.OVERWORLD) {
for (Entity entity : this.getPassengers()) {
if (entity instanceof ServerPlayer serverPlayer && !serverPlayer.seenCredits) {
@@ -3125,8 +_,14 @@
@@ -3124,8 +_,14 @@
return this.entityData.get(DATA_CUSTOM_NAME_VISIBLE);
}
@@ -1622,7 +1622,7 @@
return entity != null;
}
@@ -3240,7 +_,26 @@
@@ -3239,7 +_,26 @@
}
public final void setBoundingBox(AABB bb) {
@@ -1650,7 +1650,7 @@
}
public final float getEyeHeight(Pose pose) {
@@ -3272,6 +_,12 @@
@@ -3271,6 +_,12 @@
}
public void stopSeenByPlayer(ServerPlayer serverPlayer) {
@@ -1663,7 +1663,7 @@
}
public float rotate(Rotation transformRotation) {
@@ -3305,7 +_,7 @@
@@ -3304,7 +_,7 @@
}
@Nullable
@@ -1672,7 +1672,7 @@
return null;
}
@@ -3337,21 +_,32 @@
@@ -3336,21 +_,32 @@
}
private Stream<Entity> getIndirectPassengersStream() {
@@ -1706,7 +1706,7 @@
}
public int countPlayerPassengers() {
@@ -3359,6 +_,7 @@
@@ -3358,6 +_,7 @@
}
public boolean hasExactlyOnePlayerPassenger() {
@@ -1714,7 +1714,7 @@
return this.countPlayerPassengers() == 1;
}
@@ -3441,9 +_,38 @@
@@ -3440,9 +_,38 @@
return 0;
}
@@ -1754,7 +1754,7 @@
);
}
@@ -3501,6 +_,11 @@
@@ -3500,6 +_,11 @@
vec3 = vec3.add(flow);
i++;
}
@@ -1766,7 +1766,7 @@
}
}
}
@@ -3598,7 +_,9 @@
@@ -3597,7 +_,9 @@
}
public void setDeltaMovement(Vec3 deltaMovement) {
@@ -1776,7 +1776,7 @@
}
public void addDeltaMovement(Vec3 addend) {
@@ -3661,9 +_,45 @@
@@ -3660,9 +_,45 @@
return this.getZ((2.0 * this.random.nextDouble() - 1.0) * scale);
}
@@ -1822,7 +1822,7 @@
int floor = Mth.floor(x);
int floor1 = Mth.floor(y);
int floor2 = Mth.floor(z);
@@ -3686,6 +_,12 @@
@@ -3685,6 +_,12 @@
}
}
}
@@ -1835,7 +1835,7 @@
}
public void checkDespawn() {
@@ -3739,6 +_,12 @@
@@ -3738,6 +_,12 @@
return this.getTicksFrozen() > 0;
}
@@ -1848,7 +1848,7 @@
public float getYRot() {
return this.yRot;
}
@@ -3789,7 +_,9 @@
@@ -3788,7 +_,9 @@
}
@Override
@@ -1859,7 +1859,7 @@
if (this.removalReason == null) {
this.removalReason = removalReason;
}
@@ -3801,12 +_,28 @@
@@ -3800,12 +_,28 @@
this.getPassengers().forEach(Entity::stopRiding);
this.levelCallback.onRemove(removalReason);
this.onRemoval(removalReason);
@@ -1888,7 +1888,7 @@
@Override
public void setLevelCallback(EntityInLevelCallback levelCallback) {
this.levelCallback = levelCallback;
@@ -3991,4 +_,14 @@
@@ -3990,4 +_,14 @@
return this.save;
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/TicketStorage.java
+++ b/net/minecraft/world/level/TicketStorage.java
@@ -161,7 +_,7 @@
@@ -163,7 +_,7 @@
}
private static boolean isTicketSameTypeAndLevel(Ticket first, Ticket second) {
@@ -9,16 +9,16 @@
}
public int getTicketLevelAt(long chunkPos, boolean requireSimulation) {
@@ -264,7 +_,7 @@
@@ -272,7 +_,7 @@
}
public void deactivateTicketsOnClosing() {
- this.removeTicketIf(ticket -> ticket.getType() != TicketType.UNKNOWN, this.deactivatedTickets);
+ this.removeTicketIf(ticket -> ticket.getType() != TicketType.UNKNOWN && ticket.getType() != TicketType.CHUNK_LOAD && ticket.getType() != TicketType.FUTURE_AWAIT, this.deactivatedTickets);
- this.removeTicketIf((_long, ticket) -> ticket.getType() != TicketType.UNKNOWN, this.deactivatedTickets);
+ this.removeTicketIf((_long, ticket) -> ticket.getType() != TicketType.UNKNOWN && ticket.getType() != TicketType.CHUNK_LOAD && ticket.getType() != TicketType.FUTURE_AWAIT, this.deactivatedTickets);
}
public void removeTicketIf(Predicate<Ticket> predicate, @Nullable Long2ObjectOpenHashMap<List<Ticket>> tickets) {
@@ -369,4 +_,19 @@
public void removeTicketIf(BiPredicate<Long, Ticket> biPredicate, @Nullable Long2ObjectOpenHashMap<List<Ticket>> map) {
@@ -378,4 +_,19 @@
public interface ChunkUpdated {
void update(long chunkPos, int i, boolean ticketLevel);
}