mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@512995c Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7359) PaperMC/Paper@0a9602c [ci skip] Fix multiple ItemStack array nullability mistakes (#7055)
49 lines
3.1 KiB
Diff
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 8a70a018d3b3942e412f1b6ca0ecc11355ec8759..dd5b304376b5c18324bc9ba02ef52a53f4f694f5 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -2757,7 +2757,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
public void handleInsidePortal(BlockPos pos) {
|
|
if (this.isOnPortalCooldown()) {
|
|
this.setPortalCooldown();
|
|
- } else {
|
|
+ } else if (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur
|
|
if (!this.level.isClientSide && !pos.equals(this.portalEntrancePos)) {
|
|
this.portalEntrancePos = pos.immutable();
|
|
}
|
|
@@ -3418,7 +3418,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
|
}
|
|
|
|
public boolean canChangeDimensions() {
|
|
- return isAlive() && valid; // Paper
|
|
+ return isAlive() && valid && (level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Paper // Purpur
|
|
}
|
|
|
|
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index b631a21ee4eb646d86532dd11784bd7c705eb3ee..f6d4be9b81b82e7ae46f7694b824a06b3f6272ed 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -97,6 +97,7 @@ 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;
|
|
public double voidDamageHeight = -64.0D;
|
|
@@ -105,6 +106,7 @@ public class PurpurWorldConfig {
|
|
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);
|
|
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
|