9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-19 14:59:32 +00:00
Files
LeavesMC/leaves-server/minecraft-patches/features/0117-Vanilla-portal-handle.patch
2025-08-12 21:52:25 +08:00

41 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Thu, 15 May 2025 12:17:30 +0800
Subject: [PATCH] Vanilla portal handle
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index f5ed9965394eb075faf92515181c2446981e24a2..0a29cf071cefe14f1862d4bd5ddcacff42fe9f15 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -836,6 +836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit start
public void postTick() {
+ if (org.leavesmc.leaves.LeavesConfig.fix.vanillaPortalHandle) return; // Leaves - vanilla
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle
if (!(this instanceof ServerPlayer) && this.isAlive()) { // Paper - don't attempt to teleport dead entities
this.handlePortal();
@@ -856,7 +857,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.boardingCooldown--;
}
- if (this instanceof ServerPlayer) this.handlePortal(); // CraftBukkit - Moved up to postTick
+ if (org.leavesmc.leaves.LeavesConfig.fix.vanillaPortalHandle || this instanceof ServerPlayer) this.handlePortal(); // CraftBukkit - Moved up to postTick // Leaves - vanilla
if (this.canSpawnSprintParticle()) {
this.spawnSprintParticle();
}
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 7e61d68b36ca2768f70dc1fc130a8d7b95347b6b..8e73204f6e7d159d66c3d90c7e2845bfde867e7a 100644
--- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -293,7 +293,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
}
this.checkBelowWorld();
- // this.handlePortal(); // CraftBukkit - handled in postTick
+ if (org.leavesmc.leaves.LeavesConfig.fix.vanillaPortalHandle) this.handlePortal(); // CraftBukkit - handled in postTick // Leaves - vanilla
this.behavior.tick();
// CraftBukkit start
org.bukkit.World bworld = this.level().getWorld();