Compare commits

...

4 Commits

Author SHA1 Message Date
MrHua269
a7899ce2a0 Fix off region thrown egg new entity creating
should set pos before so that we could correctly modify the entity's other attribute on-region without triggering the async catchers
2025-06-05 21:12:44 +08:00
MrHua269
e963af5628 Removed useless patch
End gateway searching is already fixed in sync teleportation patch now
2025-05-31 18:16:54 +08:00
MrHua269
b74abd342b Fix mispatched entity custom spawning logic
we should use local players as each tickregion will only foreach their own player entities so that we won't come across async accessing world data
2025-05-31 16:36:36 +08:00
MrHua269
63507137a0 Ver 1.21.5 2025-05-30 20:26:15 +08:00
13 changed files with 70 additions and 25 deletions

View File

@@ -1,10 +1,10 @@
name: Luminol CI - dev/1.21.5
name: Luminol CI - ver/1.21.5
on:
push:
branches: [ "dev/1.21.5" ]
branches: [ "ver/1.21.5" ]
pull_request:
branches: [ "dev/1.21.5" ]
branches: [ "ver/1.21.5" ]
permissions: write-all
@@ -67,6 +67,6 @@ jobs:
artifacts: |
${{ env.jar_dir }}
generateReleaseNotes: true
prerelease: true
prerelease: false
makeLatest: ${{ env.make_latest }}
token: "${{ secrets.GITHUB_TOKEN }}"

View File

@@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sun, 9 Mar 2025 11:39:01 +0800
Subject: [PATCH] Do not search the block out of current region
Skip getting the blocks don't belong to current tickregion.
notice: this bug is actually caused by another bug of the teleportAsync implementation.
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index fc529ece01d8a85e600eb8910662010ab6851d82..7364515b7e489c5e97c7ca693458ff2ae9335c6e 100644
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -432,6 +432,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
if (i != 0 || i1 != 0 || allowBedrock) {
for (int y = level.getMaxY(); y > (blockPos == null ? level.getMinY() : blockPos.getY()); y--) {
BlockPos blockPos1 = new BlockPos(pos.getX() + i, y, pos.getZ() + i1);
+ if (!ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor((Level) level, blockPos1)) continue; // Luminol - Do not search the block out of current region as we might be at the edge of the tickregion
BlockState blockState = level.getBlockState(blockPos1);
if (blockState.isCollisionShapeFullBlock(level, blockPos1) && (allowBedrock || !blockState.is(Blocks.BEDROCK))) {
blockPos = blockPos1;

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Sat, 31 May 2025 16:28:19 +0800
Subject: [PATCH] Fix mispatched entity custom spawning logic
we should use local players as each tickregion will only foreach their own player entities so that we won't come across async accessing world data
diff --git a/net/minecraft/world/entity/npc/CatSpawner.java b/net/minecraft/world/entity/npc/CatSpawner.java
index f5d27988605d48cdf314f28ba332f33f0a314266..39b506dad0601b2d75acb14989f2758132155d1b 100644
--- a/net/minecraft/world/entity/npc/CatSpawner.java
+++ b/net/minecraft/world/entity/npc/CatSpawner.java
@@ -27,7 +27,7 @@ public class CatSpawner implements CustomSpawner {
worldData.catSpawnerNextTick--; // Folia - region threading
if (worldData.catSpawnerNextTick <= 0) { // Folia - region threading
worldData.catSpawnerNextTick = 1200; // Folia - region threading
- Player randomPlayer = level.getRandomPlayer();
+ Player randomPlayer = level.getRandomLocalPlayer(); // Luminol - Fix mispatched entity custom spawning logic - Use local players for only the players in current tickregion
if (randomPlayer != null) {
RandomSource randomSource = level.random;
int i = (8 + randomSource.nextInt(24)) * (randomSource.nextBoolean() ? -1 : 1);
diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java
index a7f56126a26e1fca86c39d8d656b648f5d6bb4ca..4626ee9f4410d8fd683db17b49ef79ab67eeda5f 100644
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -40,7 +40,7 @@ public class PhantomSpawner implements CustomSpawner {
worldData.phantomSpawnerNextTick += (spawnAttemptMinSeconds + randomSource.nextInt(spawnAttemptMaxSeconds - spawnAttemptMinSeconds + 1)) * 20; // Folia - region threading
// Paper end - Ability to control player's insomnia and phantoms
if (level.getSkyDarken() >= 5 || !level.dimensionType().hasSkyLight()) {
- for (ServerPlayer serverPlayer : level.players()) {
+ for (ServerPlayer serverPlayer : level.getLocalPlayers()) { // Luminol - Fix mispatched entity custom spawning logic - Use local players for only the players in current tickregion
if (!serverPlayer.isSpectator() && (!level.paperConfig().entities.behavior.phantomsDoNotSpawnOnCreativePlayers || !serverPlayer.isCreative())) { // Paper - Add phantom creative and insomniac controls
BlockPos blockPos = serverPlayer.blockPosition();
if (!level.dimensionType().hasSkyLight() || blockPos.getY() >= level.getSeaLevel() && level.canSeeSky(blockPos)) {

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Thu, 5 Jun 2025 21:11:31 +0800
Subject: [PATCH] Fix off region thrown egg new entity creating
should set pos before so that we could correctly modify the entity's other attribute on-region without triggering the async catchers
diff --git a/net/minecraft/world/entity/projectile/ThrownEgg.java b/net/minecraft/world/entity/projectile/ThrownEgg.java
index 73ec34b43f3fb2aa3edc3f1cb48a923d1fa32036..5d2f80c4dd8cb6726b0f42891d4ddbc85bf153a7 100644
--- a/net/minecraft/world/entity/projectile/ThrownEgg.java
+++ b/net/minecraft/world/entity/projectile/ThrownEgg.java
@@ -97,17 +97,18 @@ public class ThrownEgg extends ThrowableItemProjectile {
for (int i1 = 0; i1 < i; i1++) {
net.minecraft.world.entity.Entity chicken = newEntityType.create(this.level(), net.minecraft.world.entity.EntitySpawnReason.TRIGGERED); // CraftBukkit
if (chicken != null) {
+ chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); // Luminol - Fix off region thrown egg - move up
// CraftBukkit start
if (chicken.getBukkitEntity() instanceof org.bukkit.entity.Ageable ageable) {
ageable.setBaby();
}
// CraftBukkit end
- chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
+ // chicken.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F); // Luminol - Fix off region thrown egg - move up
// CraftBukkit start
if (chicken instanceof Chicken realChicken) {
Optional.ofNullable(this.getItem().get(DataComponents.CHICKEN_VARIANT))
- .flatMap(eitherHolder -> eitherHolder.unwrap(this.registryAccess()))
- .ifPresent(realChicken::setVariant);
+ .flatMap(eitherHolder -> eitherHolder.unwrap(this.registryAccess()))
+ .ifPresent(realChicken::setVariant);
}
// CraftBukkit end
if (!chicken.fudgePositionAfterSizeChange(ZERO_SIZED_DIMENSIONS)) {