From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Mon, 17 Aug 2020 19:32:05 -0500 Subject: [PATCH] Entities can use portals diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 8911eb7f6f307c7846eeb10f68e5cd231bd22e1b..acf10656ea445554ee537dcb2f23164ee77e4d60 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -3277,7 +3277,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void setAsInsidePortal(Portal portal, BlockPos pos) { if (this.isOnPortalCooldown()) { this.setPortalCooldown(); - } else { + } else if (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur - Entities can use portals if (this.portalProcess != null && this.portalProcess.isSamePortal(portal)) { this.portalProcess.updateEntryPosition(pos.immutable()); this.portalProcess.setAsInsidePortalThisTick(true); @@ -3902,7 +3902,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess // CraftBukkit end public boolean canUsePortal(boolean allowVehicles) { - return (allowVehicles || !this.isPassenger()) && this.isAlive(); + return (allowVehicles || !this.isPassenger()) && this.isAlive() && (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Purpur - Entities can use portals } public boolean canChangeDimensions(Level from, Level to) { diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 45238996bb7ee057ab981178baf56194411d5b77..96dc75c3ab53dbd2df040c84ddf878881d26a051 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -99,12 +99,14 @@ public class PurpurWorldConfig { public boolean useBetterMending = false; public boolean boatEjectPlayersOnLand = false; public boolean disableDropsOnCrammingDeath = false; + public boolean entitiesCanUsePortals = true; public boolean milkCuresBadOmen = true; public double tridentLoyaltyVoidReturnHeight = 0.0D; private void miscGameplayMechanicsSettings() { useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending); boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand); disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath); + 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); }