Updated Upstream(Folia)

This commit is contained in:
MrHua269
2025-02-03 07:30:11 +08:00
parent 1cecb38fee
commit 0e93cb6f59
41 changed files with 20 additions and 135 deletions

View File

@@ -2,7 +2,7 @@ group = me.earthme.luminol
version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4
foliaRef=873afea9394264ac3a6788075f773bcb9ea95635
foliaRef=5558184374432285853a2e8464251c4b774e9270
org.gradle.configuration-cache=true
org.gradle.caching=true

View File

@@ -5,7 +5,6 @@ Subject: [PATCH] Skip collision check if the block is not belong to current
tick region
A temporary fix of these issues:
https://github.com/PaperMC/Folia/issues/324
https://github.com/PaperMC/Folia/issues/311
Due to that mojang won't ignore the blocks the entity passed by, and sometimes the old position may not be updated and it points to a block that we don't own it, and it will access it during applyEffectsFromBlocks.So the best way to fix that is to skip the collision check of that block because it was already not owned by us and it's not necessary to check it
@@ -14,7 +13,7 @@ Related to mojang's bug fix:
https://bugs.mojang.com/browse/MC-92875
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 1868cb351d030d1997b5c81a184657085261c2f3..215462da04ca040e25d3cbfcbdbedfbca14e8224 100644
index aa4337942b4b9b7dd746b9b9c5a052d626b1e72c..61814607a6c8e4ce8d07645f005ea8d53f624c95 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1675,6 +1675,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess

View File

@@ -1,87 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Fri, 31 Jan 2025 12:54:45 +0800
Subject: [PATCH] Merge paper #12047
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
index ba8b5a0ebe652bfaf5c1498c19d12a91a192bf8e..8b661a11ed798186335b4ea6b907eb719cbbf722 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
@@ -40,10 +40,10 @@ public final class ActivationRange {
}
static Activity[] VILLAGER_PANIC_IMMUNITIES = {
- Activity.HIDE,
- Activity.PRE_RAID,
- Activity.RAID,
- Activity.PANIC
+ Activity.HIDE,
+ Activity.PRE_RAID,
+ Activity.RAID,
+ Activity.PANIC
};
private static int checkInactiveWakeup(final Entity entity) {
@@ -85,28 +85,28 @@ public final class ActivationRange {
* @return boolean If it should always tick.
*/
public static boolean initializeEntityActivationState(final Entity entity, final SpigotWorldConfig config) {
- return (entity.activationType == ActivationType.MISC && config.miscActivationRange == 0)
- || (entity.activationType == ActivationType.RAIDER && config.raiderActivationRange == 0)
- || (entity.activationType == ActivationType.ANIMAL && config.animalActivationRange == 0)
- || (entity.activationType == ActivationType.MONSTER && config.monsterActivationRange == 0)
- || (entity.activationType == ActivationType.VILLAGER && config.villagerActivationRange <= 0)
- || (entity.activationType == ActivationType.WATER && config.waterActivationRange <= 0)
- || (entity.activationType == ActivationType.FLYING_MONSTER && config.flyingMonsterActivationRange <= 0)
- || entity instanceof EyeOfEnder
- || entity instanceof Player
- || entity instanceof ThrowableProjectile
- || entity instanceof EnderDragon
- || entity instanceof EnderDragonPart
- || entity instanceof WitherBoss
- || entity instanceof AbstractHurtingProjectile
- || entity instanceof LightningBolt
- || entity instanceof PrimedTnt
- || entity instanceof net.minecraft.world.entity.item.FallingBlockEntity
- || entity instanceof net.minecraft.world.entity.vehicle.AbstractMinecart
- || entity instanceof net.minecraft.world.entity.vehicle.AbstractBoat
- || entity instanceof EndCrystal
- || entity instanceof FireworkRocketEntity
- || entity instanceof ThrownTrident;
+ return (entity.activationType == ActivationType.MISC && config.miscActivationRange <= 0) // Luminol - Merge paper #12047
+ || (entity.activationType == ActivationType.RAIDER && config.raiderActivationRange <= 0) // Luminol - Merge paper #12047
+ || (entity.activationType == ActivationType.ANIMAL && config.animalActivationRange <= 0) // Luminol - Merge paper #12047
+ || (entity.activationType == ActivationType.MONSTER && config.monsterActivationRange <= 0) // Luminol - Merge paper #12047
+ || (entity.activationType == ActivationType.VILLAGER && config.villagerActivationRange <= 0)
+ || (entity.activationType == ActivationType.WATER && config.waterActivationRange <= 0)
+ || (entity.activationType == ActivationType.FLYING_MONSTER && config.flyingMonsterActivationRange <= 0)
+ || entity instanceof EyeOfEnder
+ || entity instanceof Player
+ || entity instanceof ThrowableProjectile
+ || entity instanceof EnderDragon
+ || entity instanceof EnderDragonPart
+ || entity instanceof WitherBoss
+ || entity instanceof AbstractHurtingProjectile
+ || entity instanceof LightningBolt
+ || entity instanceof PrimedTnt
+ || entity instanceof net.minecraft.world.entity.item.FallingBlockEntity
+ || entity instanceof net.minecraft.world.entity.vehicle.AbstractMinecart
+ || entity instanceof net.minecraft.world.entity.vehicle.AbstractBoat
+ || entity instanceof EndCrystal
+ || entity instanceof FireworkRocketEntity
+ || entity instanceof ThrownTrident;
}
/**
@@ -234,8 +234,8 @@ public final class ActivationRange {
if (entity instanceof final Bee bee) {
final BlockPos movingTarget = bee.getMovingTarget();
if (bee.isAngry() ||
- (bee.getHivePos() != null && bee.getHivePos().equals(movingTarget)) ||
- (bee.getSavedFlowerPos() != null && bee.getSavedFlowerPos().equals(movingTarget))
+ (bee.getHivePos() != null && bee.getHivePos().equals(movingTarget)) ||
+ (bee.getSavedFlowerPos() != null && bee.getSavedFlowerPos().equals(movingTarget))
) {
return 20;
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Kaiiju Vanilla end portal teleportation
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 215462da04ca040e25d3cbfcbdbedfbca14e8224..8ce478d0c582e3c9c605b11a90271e95be5d0408 100644
index 61814607a6c8e4ce8d07645f005ea8d53f624c95..5979893976ab8c59a17e306cd91c9a4f5cd3738e 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -110,6 +110,7 @@ import net.minecraft.world.level.block.Rotation;
@@ -16,7 +16,7 @@ index 215462da04ca040e25d3cbfcbdbedfbca14e8224..8ce478d0c582e3c9c605b11a90271e95
import net.minecraft.world.level.entity.EntityAccess;
import net.minecraft.world.level.entity.EntityInLevelCallback;
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
@@ -4278,13 +4279,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4280,13 +4281,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
targetPos, 16, // load 16 blocks to be safe from block physics
ca.spottedleaf.concurrentutil.util.Priority.HIGH,
(chunks) -> {
@@ -37,7 +37,7 @@ index 215462da04ca040e25d3cbfcbdbedfbca14e8224..8ce478d0c582e3c9c605b11a90271e95
TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET),
org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL
)
@@ -4480,6 +4486,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4482,6 +4488,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
@@ -48,7 +48,7 @@ index 215462da04ca040e25d3cbfcbdbedfbca14e8224..8ce478d0c582e3c9c605b11a90271e95
Vec3 initialPosition = this.position();
ChunkPos initialPositionChunk = new ChunkPos(
@@ -4544,9 +4554,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4546,9 +4556,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postTeleportTransition().onTransition(teleported);
}

View File

@@ -159,10 +159,10 @@ index 23b342cc31c7e72ade0e1ccad86a9ccf34380f13..249cb7326c8e4012dcffdb6bbb7bfc1f
+ // KioCG end
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 8ce478d0c582e3c9c605b11a90271e95be5d0408..023b06e104e45ad7fb52e33b4ea785cd07ae0592 100644
index 5979893976ab8c59a17e306cd91c9a4f5cd3738e..4f0ea00cd601c62926220400c8e3597815dc4d15 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -5965,4 +5965,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5967,4 +5967,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((ServerLevel) this.level).isPositionEntityTicking(this.blockPosition());
}
// Paper end - Expose entity id counter

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Pufferfish Cache climbing check for activation
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
index 8b661a11ed798186335b4ea6b907eb719cbbf722..956807b34d5fda666966d23d46a7ae4ec5055071 100644
index c260741a87513b89a5cc62c543fb9f990f86491e..beb9b3b3cd5ca60bd2cdada937bff8a1da639da5 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
@@ -225,7 +225,7 @@ public final class ActivationRange {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Gale Variable entity wake-up duration
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
index 956807b34d5fda666966d23d46a7ae4ec5055071..3a1c4f9f44026dcff7f4a32bb3ceaf79963389ed 100644
index beb9b3b3cd5ca60bd2cdada937bff8a1da639da5..3c9fc433155dd235668ded700d51d95434ba745f 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
@@ -54,27 +54,39 @@ public final class ActivationRange {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Gale Skip entity move if movement is zero
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 023b06e104e45ad7fb52e33b4ea785cd07ae0592..406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9 100644
index 4f0ea00cd601c62926220400c8e3597815dc4d15..a826320496a7a211cc07518adedfec9bdf8728b8 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1104,7 +1104,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -23,7 +23,7 @@ index 023b06e104e45ad7fb52e33b4ea785cd07ae0592..406c382ae2fdaa7d8996d250487bbdfb
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -5044,6 +5051,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -5046,6 +5053,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setBoundingBox(AABB bb) {

View File

@@ -19,10 +19,10 @@ index 9fd3fe181df2ce6dbe695f6463d3940ac4c01167..822d401150d3764004b2570da828b4f6
);
});
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3731d9611 100644
index a826320496a7a211cc07518adedfec9bdf8728b8..89e99679d91b960dc7c46782c127ab2ed3226110 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4164,6 +4164,35 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4166,6 +4166,35 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// TODO any events that can modify go HERE
@@ -58,7 +58,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3
// check for same region
if (destination == this.level()) {
@@ -4280,7 +4309,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4282,7 +4311,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// we just select the spawn position
case END: {
if (destination.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.END) {
@@ -80,7 +80,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3
// need to load chunks so we can create the platform
destination.moonrise$loadChunksAsync(
targetPos, 16, // load 16 blocks to be safe from block physics
@@ -4305,7 +4347,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4307,7 +4349,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
);
} else {
@@ -102,7 +102,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3
// need to load chunk for heightmap
destination.moonrise$loadChunksAsync(
spawnPos, 0,
@@ -4355,8 +4410,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4357,8 +4412,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
WorldBorder destinationBorder = destination.getWorldBorder();
double dimensionScale = net.minecraft.world.level.dimension.DimensionType.getTeleportationScale(origin.dimensionType(), destination.dimensionType());
@@ -124,7 +124,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3
ca.spottedleaf.concurrentutil.completable.CallbackCompletable<BlockUtil.FoundRectangle> portalFound
= new ca.spottedleaf.concurrentutil.completable.CallbackCompletable<>();
@@ -4493,9 +4560,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4495,9 +4562,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (!this.canPortalAsync(destination, takePassengers)) {
return false;
}
@@ -144,7 +144,7 @@ index 406c382ae2fdaa7d8996d250487bbdfb7e4bb7f9..e41aef2b9e7204b35202d66eb17985e3
// Kaiiju end
Vec3 initialPosition = this.position();
@@ -4569,6 +4645,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4571,6 +4647,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
tpComplete.accept(teleported);
}
// Kaiiju end

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Leaves Disable moved wrongly threshold
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9c4f1ecf3327c000d48bbcb8f2720b366a0a587d..d949bd77b10722611280ce5930f06dd83174d587 100644
index 8c822dffc114b6aa6ddf2443606a1f9dc9262c45..60d8e9aca76614ca4ed235e96e0e9867a40e8bf5 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -579,7 +579,7 @@ public class ServerGamePacketListenerImpl

View File

@@ -5,7 +5,6 @@ Subject: [PATCH] Skip collision check if the block is not belong to current
tick region
A temporary fix of these issues:
https://github.com/PaperMC/Folia/issues/324
https://github.com/PaperMC/Folia/issues/311
Due to that mojang won't ignore the blocks the entity passed by, and sometimes the old position may not be updated and it points to a block that we don't own it, and it will access it during applyEffectsFromBlocks.So the best way to fix that is to skip the collision check of that block because it was already not owned by us and it's not necessary to check it

View File

@@ -1,26 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <wangxyper@163.com>
Date: Fri, 31 Jan 2025 12:54:46 +0800
Subject: [PATCH] Merge paper #12047
diff --git a/src/main/java/io/papermc/paper/entity/activation/ActivationType.java b/src/main/java/io/papermc/paper/entity/activation/ActivationType.java
index 01fef8353934f22a5176e731847d3df4a7df5306..f707c982ce1f650eaf8c6501b816bb5717cb0a45 100644
--- a/src/main/java/io/papermc/paper/entity/activation/ActivationType.java
+++ b/src/main/java/io/papermc/paper/entity/activation/ActivationType.java
@@ -28,7 +28,7 @@ public enum ActivationType {
* @return activation type
*/
public static ActivationType activationTypeFor(final Entity entity) {
- if (entity instanceof WaterAnimal) {
+ if (entity instanceof WaterAnimal || entity instanceof net.minecraft.world.entity.animal.AgeableWaterCreature) { // Luminol - Merge paper #12047
return ActivationType.WATER;
} else if (entity instanceof Villager) {
return ActivationType.VILLAGER;
@@ -44,4 +44,4 @@ public enum ActivationType {
return ActivationType.MISC;
}
}
-}
+}
\ No newline at end of file