mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes : 2db85c5 fix: origin world can be unknown while knowing location 903fa9a Enable chunk load for feature search by default
63 lines
3.3 KiB
Diff
63 lines
3.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Wed, 9 Jun 2021 11:03:40 -0500
|
|
Subject: [PATCH] Add toggle for end portal safe teleporting
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 139c69f92addd4f886e09997e4a77f445528a588..2815a7fb9d8640ec7e0ff3b54e189a7657e4b6d9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2608,7 +2608,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
}
|
|
|
|
this.E();
|
|
- this.tickEndPortal(); // Paper - make end portalling safe
|
|
+ if (world.purpurConfig.endPortalSafeTeleporting) this.tickEndPortal(); // Paper - make end portalling safe // Purpur
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
|
index 31eabc40562462f98cc039a55453f200ca4eaa5c..56e81e3e2bbe87d28440ddb9a6285c781ec6530e 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/BlockEnderPortal.java
|
|
@@ -60,6 +60,22 @@ public class BlockEnderPortal extends BlockTileEntity {
|
|
// return; // CraftBukkit - always fire event in case plugins wish to change it
|
|
}
|
|
|
|
+ // Purpur start
|
|
+ if (!world.purpurConfig.endPortalSafeTeleporting) {
|
|
+ // CraftBukkit start - Entity in portal
|
|
+ EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
|
+ world.getServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (entity instanceof EntityPlayer) {
|
|
+ ((EntityPlayer) entity).changeDimension(worldserver, PlayerTeleportEvent.TeleportCause.END_PORTAL);
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+ entity.teleportTo(worldserver, null);
|
|
+ return;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
// Paper start - move all of this logic into portal tick
|
|
entity.portalWorld = ((WorldServer)world);
|
|
entity.portalBlock = blockposition.immutableCopy();
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index bd434559414a209db9e13c49303cab4a9f84ac15..5f1bfe41b9f7f24b86e72ea3b57acb3a7da95ad3 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -553,6 +553,11 @@ public class PurpurWorldConfig {
|
|
dragonEggTeleport = getBoolean("blocks.dragon_egg.teleport", dragonEggTeleport);
|
|
}
|
|
|
|
+ public boolean endPortalSafeTeleporting = true;
|
|
+ private void endPortalSettings() {
|
|
+ endPortalSafeTeleporting = getBoolean("blocks.end_portal.safe-teleporting", endPortalSafeTeleporting);
|
|
+ }
|
|
+
|
|
public boolean snowOnBlueIce = true;
|
|
public boolean mobsSpawnOnPackedIce = true;
|
|
public boolean mobsSpawnOnBlueIce = true;
|