From 53e4333bfcef1bea3221400800d433c10d3f71a9 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Sat, 3 May 2025 00:24:41 +0800 Subject: [PATCH] fix: rebuild Entity portal-teleport speed fix --- .../0052-Portal-Behavior-Modifiers.patch | 55 +++---------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/luminol-server/minecraft-patches/features/0052-Portal-Behavior-Modifiers.patch b/luminol-server/minecraft-patches/features/0052-Portal-Behavior-Modifiers.patch index 50deeef..159936d 100644 --- a/luminol-server/minecraft-patches/features/0052-Portal-Behavior-Modifiers.patch +++ b/luminol-server/minecraft-patches/features/0052-Portal-Behavior-Modifiers.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Portal Behavior Modifiers diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 2ea6160492cb23e96271dfbfd3bd35fe03109d6a..2871980e53a66bdacf7c00e7045ad01d68a972d3 100644 +index 2ea6160492cb23e96271dfbfd3bd35fe03109d6a..36bddc5f5a05044b995e0b87f2c9105a6acfe8fd 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 - this.setPortalCooldown(); +@@ -1149,7 +1149,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + //Luminol end + try { + // Paper end - detailed watchdog information +- if (this.noPhysics) { ++ if (this.noPhysics || this.portalProcess != null) { // Luminol - Entity portal-teleport speed fix + this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { - if (this.portalProcess == null || !this.portalProcess.isSamePortal(portal)) { -- this.portalProcess = new PortalProcessor(portal, pos.immutable()); -+ this.portalProcess = new PortalProcessor(portal, pos.immutable(), this.getDeltaMovement()); // Luminol - Entity portal-teleport speed fix - } else if (!this.portalProcess.isInsidePortalThisTick()) { - this.portalProcess.updateEntryPosition(pos.immutable()); - this.portalProcess.setAsInsidePortalThisTick(true); + this.wasOnFire = this.isOnFire(); @@ -3829,20 +3829,27 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess EntityTreeNode curr; @@ -73,43 +73,6 @@ index 2ea6160492cb23e96271dfbfd3bd35fe03109d6a..2871980e53a66bdacf7c00e7045ad01d // Kaiiju start - vanilla end teleportation /*if (teleportComplete != null) { teleportComplete.accept(teleported); -diff --git a/net/minecraft/world/entity/PortalProcessor.java b/net/minecraft/world/entity/PortalProcessor.java -index 46d989aef0eceebd98bfd93999153319de77a8a0..6e9171fa0c636439bd96401ea9e5fe80ffdc8bdd 100644 ---- a/net/minecraft/world/entity/PortalProcessor.java -+++ b/net/minecraft/world/entity/PortalProcessor.java -@@ -9,12 +9,14 @@ import net.minecraft.world.level.portal.TeleportTransition; - public class PortalProcessor { - private final Portal portal; - private BlockPos entryPosition; -+ private net.minecraft.world.phys.Vec3 speedVec3; // Luminol - Entity portal-teleport speed fix - private int portalTime; - private boolean insidePortalThisTick; - -- public PortalProcessor(Portal portal, BlockPos entryPosition) { -+ public PortalProcessor(Portal portal, BlockPos entryPosition, net.minecraft.world.phys.Vec3 speedVec3) { // Luminol - Entity portal-teleport speed fix - this.portal = portal; - this.entryPosition = entryPosition; -+ this.speedVec3 = speedVec3; // Luminol - Entity portal-teleport speed fix - this.insidePortalThisTick = true; - } - -@@ -35,7 +37,15 @@ public class PortalProcessor { - - // Folia start - region threading - public boolean portalAsync(ServerLevel sourceWorld, Entity portalTarget) { -- return this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition); -+ // Luminol start - Entity portal-teleport speed fix -+ net.minecraft.world.phys.Vec3 oldSpeed = portalTarget.getDeltaMovement(); -+ portalTarget.setDeltaMovement(this.speedVec3); -+ boolean flag = this.portal.portalAsync(sourceWorld, portalTarget, this.entryPosition); -+ if (!flag) { -+ portalTarget.setDeltaMovement(oldSpeed); -+ } -+ return flag; -+ // Luminol end - Entity portal-teleport speed fix - } - // Folia end - region threading - diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java index 88570bb4aa02896545805d7721c45cf9599befea..bbf9748a36404139356db606dbb3b0cc13c66b50 100644 --- a/net/minecraft/world/entity/item/PrimedTnt.java