Files
Purpur/patches/server/0106-Entities-can-use-portals-configuration.patch
BillyGalbreath 1d3f710297 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
840e72091 [CI-SKIP] [Auto] Rebuild Patches
a33232d4a Add beacon activation and deactivation events (#5121)
bc7ea673a Add internal channel initialization listeners (#5557)
b28ad17ac Check for world change in MoveEvent API methods
3095c7592 [Auto] Updated Upstream (CraftBukkit)
f56989c97 Add RespawnFlags to PlayerRespawnEvent (#5533)
7579c2667 Add more API to PlayerMoveEvent (#5553)
2021-04-30 16:18:11 -05:00

49 lines
3.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 17 Aug 2020 19:32:05 -0500
Subject: [PATCH] Entities can use portals configuration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 4e1363050bef7fff9117250b79cbf35bf6bfc537..918edab475a8d33a253e3d6cd3c5655748d10dc0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2554,7 +2554,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
public void d(BlockPosition blockposition) {
if (this.ai()) {
this.resetPortalCooldown();
- } else {
+ } else if (world.purpurConfig.entitiesCanUsePortals || this instanceof EntityPlayer) { // Purpur
if (!this.world.isClientSide && !blockposition.equals(this.ac)) {
this.ac = blockposition.immutableCopy();
}
@@ -3134,7 +3134,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
}
public boolean canPortal() {
- return isAlive() && valid; // Paper
+ return isAlive() && valid && (world.purpurConfig.entitiesCanUsePortals || this instanceof EntityPlayer); // Paper // Purpur
}
public float a(Explosion explosion, IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, float f) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 8db7dca08fe4f0e88c950179f62ecd0d17bc329c..d6bf755d3f978adaec04e5feaab659445d49305e 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -192,6 +192,7 @@ public class PurpurWorldConfig {
public boolean boatEjectPlayersOnLand = false;
public boolean disableDropsOnCrammingDeath = false;
public boolean entitiesPickUpLootBypassMobGriefing = false;
+ public boolean entitiesCanUsePortals = true;
public boolean milkCuresBadOmen = true;
public double tridentLoyaltyVoidReturnHeight = 0.0D;
public double voidDamageHeight = -64.0D;
@@ -200,6 +201,7 @@ public class PurpurWorldConfig {
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
+ entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);