Fix folia nether portal ticket placement

This commit is contained in:
2026-07-28 19:38:23 +08:00
parent 5970be9c0b
commit 80b61f6757
59 changed files with 72 additions and 6 deletions
@@ -0,0 +1,66 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NanaChiyo0721 <nanachiyo0721@163.com>
Date: Tue, 28 Jul 2026 19:25:20 +0800
Subject: [PATCH] Fix folia nether portal ticket placement
diff --git a/net/minecraft/util/BlockUtil.java b/net/minecraft/util/BlockUtil.java
index ea93ac07ec6d4e83d1d0904daf721132e2bbecc3..947413df55b972a5f866d5717fdb9e925a89ad60 100644
--- a/net/minecraft/util/BlockUtil.java
+++ b/net/minecraft/util/BlockUtil.java
@@ -138,12 +138,20 @@ public class BlockUtil {
public final BlockPos minCorner;
public final int axis1Size;
public final int axis2Size;
+ public BlockPos foundOrigin; // Shiroha - Fix folia nether portal ticket placement
public FoundRectangle(final BlockPos minCorner, final int axis1Size, final int axis2Size) {
this.minCorner = minCorner;
this.axis1Size = axis1Size;
this.axis2Size = axis2Size;
+ this.foundOrigin = minCorner; // Shiroha - Fix folia nether portal ticket placement - prevent edge conditions(idk if someone would do this so just prevent it)
}
+ // Shiroha start - Fix folia nether portal ticket placement
+ public FoundRectangle withFoundOrigin(BlockPos origin) {
+ this.foundOrigin = origin;
+ return this;
+ }
+ // Shiroha end
}
public static class IntBounds {
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4a5266e3e15e765dda4b2aac54bf0eb90291b096..63c1d223d9fc16b4211e992bde3c9f08d3ed15ca 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4723,7 +4723,7 @@ public abstract class Entity
portalInfoCompletable.complete(
new TeleportTransition(destination, Vec3.atCenterOf(targetPos), Vec3.ZERO,
90.0f, 0.0f,
- TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET))
+ TeleportTransition.PLAY_PORTAL_SOUND.then(ent -> ent.placePortalTicket(targetPos))) // Shiroha - Fix folia nether portal ticket placement
);
return;
}
@@ -4735,7 +4735,7 @@ public abstract class Entity
portalInfoCompletable.complete(
net.minecraft.world.level.block.NetherPortalBlock.createDimensionTransition(
destination, portal, originalPortalDirection, relativePos,
- Entity.this, TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET)
+ Entity.this, TeleportTransition.PLAY_PORTAL_SOUND.then(ent -> ent.placePortalTicket(portal.foundOrigin)) // Shiroha - Fix folia nether portal ticket placement
)
);
}
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
index 29fc9521c2c8333c999647dd833899393a838064..9022be7b8c415cd6341f45fa9525c59ec10ff985 100644
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -204,7 +204,7 @@ public class NetherPortalBlock extends Block implements Portal {
return BlockUtil.getLargestRectangleAround(found, portalState.getValue(BlockStateProperties.HORIZONTAL_AXIS), 21, Direction.Axis.Y, 21, (pos) -> {
return world.getBlockStateFromEmptyChunk(pos) == portalState;
- });
+ }).withFoundOrigin(found); // Shiroha - Fix folia nether portal ticket placement
}
// Folia end - region threading
@@ -8,7 +8,7 @@ As part of: Kaiiju (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2e
Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE) Licensed under: GPL-3.0 (https://github.com/KaiijuMC/Kaiiju/blob/c2b7aec8f7b418a39a2ec408e6411e6f752379da/LICENSE)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4a5266e3e15e765dda4b2aac54bf0eb90291b096..bf5b6922fbe7d631c429d337001a4d2cd919fbe3 100644 index 63c1d223d9fc16b4211e992bde3c9f08d3ed15ca..dda97d7e3d3a997ae4a2b6ee1656c165d5f349c4 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -4640,15 +4640,19 @@ public abstract class Entity @@ -4640,15 +4640,19 @@ public abstract class Entity
@@ -171,7 +171,7 @@ index f03fa06c0ba56f7f5e1e45bc1568a490751efde3..eee1c14249addbf4714df733870da974
+ // KioCG end + // KioCG end
} }
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index bf5b6922fbe7d631c429d337001a4d2cd919fbe3..9ec6e74acaf25c33438ca8713b80d5b5a9613b19 100644 index dda97d7e3d3a997ae4a2b6ee1656c165d5f349c4..3f3110efa6a917f5ad3892a57229a8ae937cd023 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -6432,4 +6432,6 @@ public abstract class Entity @@ -6432,4 +6432,6 @@ public abstract class Entity
@@ -240,7 +240,7 @@ index 6e08d50794c4af4405f3e164a3fd46f376b3f78f..dd2d0940eece3e85078e574f66f71a4c
int getContainerSize(); int getContainerSize();
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 9ec6e74acaf25c33438ca8713b80d5b5a9613b19..66f1f80c172e464a57d63679a8d13729c480a1e3 100644 index 3f3110efa6a917f5ad3892a57229a8ae937cd023..34daca8ff9cbd03458ac864ed3d31f6603301864 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -324,7 +324,7 @@ public abstract class Entity @@ -324,7 +324,7 @@ public abstract class Entity
@@ -10,7 +10,7 @@ VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 66f1f80c172e464a57d63679a8d13729c480a1e3..c720d1af1bdd1e9eb8e33129b2fb1abe57685364 100644 index 34daca8ff9cbd03458ac864ed3d31f6603301864..e7497f8f488cf9833b428ce1c82451c902465d19 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -1152,8 +1152,14 @@ public abstract class Entity @@ -1152,8 +1152,14 @@ public abstract class Entity
@@ -20,7 +20,7 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0-only (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0-only (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index c720d1af1bdd1e9eb8e33129b2fb1abe57685364..21dad4bf9e248f9769ff39461cd0fd66c9441600 100644 index e7497f8f488cf9833b428ce1c82451c902465d19..3c055fa3f6641137dda1532a19af8b67caa52143 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -2438,8 +2438,8 @@ public abstract class Entity @@ -2438,8 +2438,8 @@ public abstract class Entity
@@ -7,7 +7,7 @@ License: GPL-3.0-only (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://github.com/GaleMC/Gale Gale - https://github.com/GaleMC/Gale
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 21dad4bf9e248f9769ff39461cd0fd66c9441600..e8991b08105ed611da2f0449f2a47cb0db74fed0 100644 index 3c055fa3f6641137dda1532a19af8b67caa52143..503af0546705e88ec06e064ec1c24f87cb25abeb 100644
--- a/net/minecraft/world/entity/Entity.java --- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java
@@ -1299,8 +1299,17 @@ public abstract class Entity @@ -1299,8 +1299,17 @@ public abstract class Entity