45 lines
3.0 KiB
Diff
45 lines
3.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <wangxyper@163.com>
|
|
Date: Sun, 12 Jan 2025 10:23:13 +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 34e31fa13e5107f13e166f694fafe58e306330ae..c444c4b7dc8454abd257030a8c59b9b22b9013d9 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 float fallDamagePerDistance = 0.0F;
|
|
@Nullable
|
|
public CompoundTag blockData;
|
|
- public boolean forceTickAfterTeleportToDuplicate;
|
|
+ public boolean forceTickAfterTeleportToDuplicate = me.earthme.luminol.config.modules.fixes.UnsafeTeleportationConfig.enabled; // Luminol - Unsafe teleportation
|
|
protected static final EntityDataAccessor<BlockPos> DATA_START_POS = SynchedEntityData.defineId(FallingBlockEntity.class, EntityDataSerializers.BLOCK_POS);
|
|
public boolean autoExpire = true; // Paper - Expand FallingBlock API
|
|
|
|
@@ -387,7 +387,7 @@ public class FallingBlockEntity extends Entity {
|
|
ResourceKey<Level> resourceKey1 = this.level().dimension();
|
|
boolean flag = (resourceKey1 == Level.END || resourceKey == Level.END) && resourceKey1 != resourceKey;
|
|
Entity entity = super.teleport(teleportTransition);
|
|
- this.forceTickAfterTeleportToDuplicate = entity != null && flag && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper
|
|
+ this.forceTickAfterTeleportToDuplicate = entity != null && flag && (io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation || me.earthme.luminol.config.modules.fixes.UnsafeTeleportationConfig.enabled); // Paper // Luminol - Unsafe teleportation
|
|
return entity;
|
|
}
|
|
}
|
|
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
|
|
index 6e495b2c4176d5a30ea911f8e44a22655df92ef6..cd12e35d784c8ac4737fa617d2e78cef6606299f 100644
|
|
--- a/net/minecraft/world/level/block/EndPortalBlock.java
|
|
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
|
|
@@ -69,6 +69,11 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
|
|
if (level.paperConfig().misc.disableEndCredits) {serverPlayer.seenCredits = true; return;} // Paper - Option to disable end credits
|
|
serverPlayer.showEndCredits();
|
|
} else {
|
|
+ // Luminol start - unsafe teleportation
|
|
+ if (me.earthme.luminol.config.modules.fixes.UnsafeTeleportationConfig.enabled && !(entity instanceof net.minecraft.world.entity.player.Player)) {
|
|
+ entity.endPortalLogicAsync(pos);
|
|
+ }
|
|
+ // Luminol end
|
|
entity.setAsInsidePortal(this, pos);
|
|
}
|
|
}
|