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@99b1bf9 Use new ClientboundPlayerRotationPacket for setting player rotation PaperMC/Paper@40211a0 Update Gradle wrapper to 8.10.2 PaperMC/Paper@49eae0d remove some leftovers PaperMC/Paper@d576cfc cleanup bugfix patch PaperMC/Paper@1196ab5 Avoid issues with certain tasks not processing during sleep (#11526) PaperMC/Paper@fe2f3d4 Fix portal exit resulting in bad teleport transition
47 lines
3.0 KiB
Diff
47 lines
3.0 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 ba4b903b034131cfc244a74fad9f6070b764ac32..6ed1567d1133cad36a4825aad9757baf23dd11aa 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -3473,7 +3473,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());
|
|
@@ -4192,7 +4192,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 9f2192a5a22827a6d453fc326fffe161ff42aac1..ec22d8f33387615b46a578be746f79b624674055 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -100,11 +100,13 @@ public class PurpurWorldConfig {
|
|
public boolean boatEjectPlayersOnLand = false;
|
|
public boolean disableDropsOnCrammingDeath = false;
|
|
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);
|
|
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
|
+ entitiesCanUsePortals = getBoolean("gameplay-mechanics.entities-can-use-portals", entitiesCanUsePortals);
|
|
}
|
|
|
|
public int elytraDamagePerSecond = 1;
|