Compare commits

..

1 Commits

Author SHA1 Message Date
MrHua269
8668ac45f4 Fix off tickregion sync teleport & tidy patches 2025-04-29 23:06:36 +08:00
34 changed files with 57 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Correct player respawn place
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 884d338e00017ff351b91c70fb51186cbdfb1fe6..d0853f44f1b4c88ba62a74db9e49a32709685425 100644
index 3bc0fc1d411d3c5e206695510ec9288ffbf8c277..b6df8df78105e08ca7be82524685d8b9422abf21 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -472,8 +472,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add missing teleportation apis for folia
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 3bc0fc1d411d3c5e206695510ec9288ffbf8c277..c2562b8f7ca3bc815a5abe5ae00a6fe1654b002d 100644
index b6df8df78105e08ca7be82524685d8b9422abf21..98ce0736c18cbb09704ef7ca6b67866d5736f7c7 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1661,6 +1661,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -1673,6 +1673,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
if (respawnComplete != null) {
respawnComplete.accept(ServerPlayer.this);
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Leaves Fix SculkCatalyst exp skip
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index c2562b8f7ca3bc815a5abe5ae00a6fe1654b002d..884d338e00017ff351b91c70fb51186cbdfb1fe6 100644
index 98ce0736c18cbb09704ef7ca6b67866d5736f7c7..d0853f44f1b4c88ba62a74db9e49a32709685425 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -1346,7 +1346,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -1358,7 +1358,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
}
// SPIGOT-5478 must be called manually now
@@ -17,7 +17,7 @@ index c2562b8f7ca3bc815a5abe5ae00a6fe1654b002d..884d338e00017ff351b91c70fb51186c
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {
// Paper start - PlayerDeathEvent#getItemsToKeep
@@ -1380,6 +1380,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -1392,6 +1392,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.setClientLoaded(false);
}
@@ -34,7 +34,7 @@ index c2562b8f7ca3bc815a5abe5ae00a6fe1654b002d..884d338e00017ff351b91c70fb51186c
AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0);
this.level()
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 015a6c45241148eb5a26f9494ca731354273f3cd..1df158d30622ea71fcc937140c682d0e994d54c1 100644
index 2293c3db45e9ecce4e0d4b2f87b8e90228e44d94..658aa09aecf8d64145feedb82dc9be2a55201450 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -293,6 +293,7 @@ public abstract class LivingEntity extends Entity implements Attackable {

View File

@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Bacteriawa <A3167717663@hotmail.com>
Date: Thu, 7 Nov 2024 21:50:47 +0100
Subject: [PATCH] Lithium: fast util
Subject: [PATCH] Lithium: Fast util
This patch is based on the following mixins:
* "net/caffeinemc/mods/lithium/mixin/math/fast_util/DirectionMixin.java"

View File

@@ -12,10 +12,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
index 2293c3db45e9ecce4e0d4b2f87b8e90228e44d94..015a6c45241148eb5a26f9494ca731354273f3cd 100644
index 658aa09aecf8d64145feedb82dc9be2a55201450..1df158d30622ea71fcc937140c682d0e994d54c1 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
@@ -2642,6 +2642,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2644,6 +2644,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {
@@ -23,7 +23,7 @@ index 2293c3db45e9ecce4e0d4b2f87b8e90228e44d94..015a6c45241148eb5a26f9494ca73135
int currentSwingDuration = this.getCurrentSwingDuration();
if (this.swinging) {
this.swingTime++;
@@ -3567,6 +3568,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3569,6 +3570,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected void updateFallFlying() {
this.checkSlowFallDistance();
if (!this.level().isClientSide) {

View File

@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrHua269 <mrhua269@gmail.com>
Date: Thu, 24 Apr 2025 23:11:13 +0800
Subject: [PATCH] Fix off tickregion sync teleport
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index ceca76a5791e319dd7cc4048c9860b1df065b95a..4a0d07a3263704a7c6e6859ddcbe767c202ed794 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4067,6 +4067,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.resetStoredPositions();
}
+ // Luminol start - Fix sync teleport issue
+ private boolean getNearByEdge(int destX, int destZ) {
+ int sizeBx = Math.min(6, (int) (this.bb.maxX - this.bb.minX) + this.level.getCraftServer().getSimulationDistance());
+ int sizeBz = Math.min(6, (int) (this.bb.maxZ - this.bb.minZ) + this.level.getCraftServer().getSimulationDistance());
+
+ return ca.spottedleaf.moonrise.common.util.TickThread.isTickThreadFor(this.level,
+ (destX >> 4) - sizeBx,
+ (destZ >> 4) - sizeBz,
+ (destX >> 4) + sizeBx,
+ (destZ >> 4) + sizeBz);
+ }
+ // Luminol end
+
protected final void transform(TeleportTransition telpeort) {
PositionMoveRotation move = PositionMoveRotation.calculateAbsolute(
PositionMoveRotation.of(this), PositionMoveRotation.of(telpeort), telpeort.relatives()
@@ -4186,10 +4199,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
wrapped.callEvent();
// Luminol end
- // check for same region
if (destination == this.level()) {
Vec3 currPos = this.position();
- if (
+ if (this.getNearByEdge((int) pos.x, (int) pos.z) && // Luminol - Fix sync teleport issue
destination.regioniser.getRegionAtUnsynchronised(
ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkX(currPos), ca.spottedleaf.moonrise.common.util.CoordinateUtils.getChunkZ(currPos)
) == destination.regioniser.getRegionAtUnsynchronised(

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Add afterPortalLogic to process some logics
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index ceca76a5791e319dd7cc4048c9860b1df065b95a..065e74d29eee35e07a0d5db8850dc6f93a9729c0 100644
index 4a0d07a3263704a7c6e6859ddcbe767c202ed794..dc0a9f39751173824d8cef569f94b459ee6e94dc 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4545,6 +4545,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4557,6 +4557,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
@@ -21,7 +21,7 @@ index ceca76a5791e319dd7cc4048c9860b1df065b95a..065e74d29eee35e07a0d5db8850dc6f9
protected boolean portalToAsync(ServerLevel destination, BlockPos portalPos, boolean takePassengers,
PortalType type, java.util.function.Consumer<Entity> teleportComplete) {
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
@@ -4628,6 +4634,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4640,6 +4646,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
info.postTeleportTransition().onTransition(teleported);
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Entity portal-teleport speed fix
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 065e74d29eee35e07a0d5db8850dc6f93a9729c0..920b7a3e6def4ac0078a1e543d7c17f5d4955fc5 100644
index dc0a9f39751173824d8cef569f94b459ee6e94dc..a4e5c5675dc09f598a6ae05d7aea21b48e451b21 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -3304,7 +3304,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess