Fix folia nether portal ticket placement
This commit is contained in:
+66
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user