From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bacteriawa Date: Tue, 21 Apr 2026 01:47:51 +0800 Subject: [PATCH] Add config for unsafe teleportation diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java index 480b6b2405706fd4d7158d0e160adafd84099887..ca8207f7bf6a71ae283c6c9739563e9dfe1f0f02 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -70,7 +70,7 @@ public class FallingBlockEntity extends Entity { public int fallDamageMax = 40; public float fallDamagePerDistance = 0.0F; public @Nullable CompoundTag blockData; - public boolean forceTickAfterTeleportToDuplicate; + public boolean forceTickAfterTeleportToDuplicate = io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled; // Shiroha - Add config for unsafe teleportation protected static final EntityDataAccessor DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS); public boolean autoExpire = true; // Paper - Expand FallingBlock API @@ -384,7 +384,7 @@ public class FallingBlockEntity extends Entity { ResourceKey oldDimension = this.level().dimension(); boolean fromOrToEnd = (oldDimension == Level.END || newDimension == Level.END) && oldDimension != newDimension; Entity newEntity = super.teleport(transition); - this.forceTickAfterTeleportToDuplicate = newEntity != null && fromOrToEnd && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper + this.forceTickAfterTeleportToDuplicate = newEntity != null && fromOrToEnd && (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation || io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled); // Paper // Shiroha - Add config for unsafe teleportation return newEntity; } } diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java index d42bb2a1721e4ab8c9956e18c3ca418b8d648c59..1bb9e32fd0f112deeec936976da0899dae301e56 100644 --- a/net/minecraft/world/level/block/EndPortalBlock.java +++ b/net/minecraft/world/level/block/EndPortalBlock.java @@ -76,6 +76,12 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal { if (level.paperConfig().misc.disableEndCredits) {player.seenCredits = true; return;} // Paper - Option to disable end credits player.showEndCredits(); } else { + // Shiroha start - Add config for unsafe teleportation + if (io.nanachiyo0721.shiroha.config.modules.fixes.UnsafeTeleportationConfig.enabled && !(entity instanceof net.minecraft.world.entity.player.Player)) { + entity.endPortalLogicAsync(pos); + return; + } + // Shiroha end entity.setAsInsidePortal(this, pos); } }