mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@afb5b13 Replace SimpleRandom with (Simple)ThreadUnsafeRandom PaperMC/Paper@d38624b Do not call modifyEntityTrackingRange on own range PaperMC/Paper@cb2ab7d Remove string dupe exploit setting (#11670) PaperMC/Paper@5f6a796 deprecate adventure key() methods where applicable PaperMC/Paper@78fd8f9 Copy items when constructing ClientboundSetCursorItemPacket PaperMC/Paper@0cc7bd4 Use Player view distance for PlayerNaturallySpawnCreaturesEvent
48 lines
3.1 KiB
Diff
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 3e16f8ec52ff60f696a4a29dfbb9217b0c29106b..59000a7519071010d03063359c4508426753fe7c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -3438,7 +3438,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());
|
|
@@ -4157,7 +4157,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 b04c1c2534bec8f2eee873b43969843f54644dca..a28548332baf610521a308a560a858b3fc737b60 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;
|