Files
Purpur/patches/server/0084-Entities-can-use-portals.patch
granny f289b6ad9a Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@55475f0 [ci skip] Fix typos
PaperMC/Paper@f8e2a67 Check for AbstractBoat instead of Boat in EAR ignore list
PaperMC/Paper@8dc42fa Add API to check if the server is sleeping (#11605)
PaperMC/Paper@817550c Add API to allow/disallow tick sleeping (#11611)
PaperMC/Paper@915637d Run 'freeze' listeners before tag events (#11606)
PaperMC/Paper@751e9bd Fix jukebox component (#11642)
PaperMC/Paper@f241260 Make TypedKey an actual Key (#11641)
PaperMC/Paper@860d948 Support tags for more SimpleRegistry (#11607)
PaperMC/Paper@aee6f7a Correctly mirror vanilla non-exact ingredients (#11651)
PaperMC/Paper@eef40b7 Configurable Entity Despawn Time (#11454)
PaperMC/Paper@edabff8 Correctly damage tick wolf after armor block (#11653)
PaperMC/Paper@6051dac Painting variant registry modification API (#11648)
PaperMC/Paper@bb32b05 Call ProjectileHitEvent for entity hits (#11652)
2024-11-23 16:20:43 -08:00

48 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
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ea9d118f99a62004db8fc093ff67794a1ec99ac9..2add41657b8f868bcd4755ca843e457b8dfc7ef0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3482,7 +3482,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)) {
if (!this.portalProcess.isInsidePortalThisTick()) {
this.portalProcess.updateEntryPosition(pos.immutable());
@@ -4201,7 +4201,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 canTeleport(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 3fb03b012873999e2ff82b480908655303e47aaf..b901f058f82033fe1750bfc4fb472c80268f1920 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -101,12 +101,14 @@ public class PurpurWorldConfig {
public boolean disableDropsOnCrammingDeath = false;
public boolean milkCuresBadOmen = true;
public double tridentLoyaltyVoidReturnHeight = 0.0D;
+ public boolean entitiesCanUsePortals = true;
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);
milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen);
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
+ entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
}
public int elytraDamagePerSecond = 1;