Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 9e444c5

Browse files
authored
Add Entities can use portals patch back (PurpurMC#1571)
1 parent b3623fa commit 9e444c5

211 files changed

Lines changed: 804 additions & 804 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

patches/dropped-server/0083-Entities-can-use-portals-configuration.patch renamed to patches/server/0084-Entities-can-use-portals.patch

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
33
Date: Mon, 17 Aug 2020 19:32:05 -0500
4-
Subject: [PATCH] Entities can use portals configuration
4+
Subject: [PATCH] Entities can use portals
55

66

77
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
8-
index b3fe632b18e5dfa18d37ef23a5a62f3a0f9ccf42..e29f56c83e8ce237e9135fabcf2381130a1a790d 100644
8+
index 02e31827de699c6df409fbc3b88f7ded68236e20..51eebbee1c46062b35a2703713f2e1dfafcb0b26 100644
99
--- a/src/main/java/net/minecraft/world/entity/Entity.java
1010
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
11-
@@ -3225,7 +3225,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
12-
public void handleInsidePortal(BlockPos pos) {
11+
@@ -3266,7 +3266,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
12+
public void setAsInsidePortal(Portal portal, BlockPos pos) {
1313
if (this.isOnPortalCooldown()) {
1414
this.setPortalCooldown();
1515
- } else {
16-
+ } else if (level().purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur
17-
if (!this.level().isClientSide && !pos.equals(this.portalEntrancePos)) {
18-
this.portalEntrancePos = pos.immutable();
19-
}
20-
@@ -3919,7 +3919,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
21-
}
16+
+ } else if (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer) { // Purpur - Entities can use portals
17+
if (this.portalProcess != null && this.portalProcess.isSamePortal(portal)) {
18+
this.portalProcess.updateEntryPosition(pos.immutable());
19+
this.portalProcess.setAsInsidePortalThisTick(true);
20+
@@ -3889,7 +3889,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
21+
// CraftBukkit end
2222

23-
public boolean canChangeDimensions() {
24-
- return !this.isPassenger() && !this.isVehicle() && isAlive() && valid; // Paper - Fix item duplication and teleport issues
25-
+ return !this.isPassenger() && !this.isVehicle() && isAlive() && valid && (level().purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Paper - Fix item duplication and teleport issues // Purpur
23+
public boolean canUsePortal(boolean allowVehicles) {
24+
- return (allowVehicles || !this.isPassenger()) && this.isAlive();
25+
+ return (allowVehicles || !this.isPassenger()) && this.isAlive() && (this.level.purpurConfig.entitiesCanUsePortals || this instanceof ServerPlayer); // Purpur - Entities can use portals
2626
}
2727

28-
public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) {
28+
public boolean canChangeDimensions(Level from, Level to) {
2929
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
30-
index 56f34c0a0f7bc94a90bb1db32f8e30a590a3b38c..1f25407aafba71762a482f0b1982302fed14387f 100644
30+
index b3a9e307d1bed0c53a42119fa74c3a0f1be12d36..9f00ee2e9882226973c6846211574809c18b52bc 100644
3131
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
3232
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
33-
@@ -98,6 +98,7 @@ public class PurpurWorldConfig {
33+
@@ -99,6 +99,7 @@ public class PurpurWorldConfig {
3434
public boolean useBetterMending = false;
3535
public boolean boatEjectPlayersOnLand = false;
3636
public boolean disableDropsOnCrammingDeath = false;
3737
+ public boolean entitiesCanUsePortals = true;
3838
public boolean milkCuresBadOmen = true;
3939
public double tridentLoyaltyVoidReturnHeight = 0.0D;
4040
public double voidDamageHeight = -64.0D;
41-
@@ -106,6 +107,7 @@ public class PurpurWorldConfig {
41+
@@ -107,6 +108,7 @@ public class PurpurWorldConfig {
4242
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
4343
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
4444
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);

patches/server/0084-Customizable-wither-health-and-healing.patch renamed to patches/server/0085-Customizable-wither-health-and-healing.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ index 0e2e7f935deb674bfcbdf4f1ba7de7834ed1c61a..e3ee5d5eb80d689eb77731b3f26d0c31
2323

2424
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
2525
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
26-
index b3a9e307d1bed0c53a42119fa74c3a0f1be12d36..36b2b377f3253e5013c307b82c6ed893d5b58ffd 100644
26+
index 9f00ee2e9882226973c6846211574809c18b52bc..0fbb32272453df331df54e8eda37da0b9b7af954 100644
2727
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
2828
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
29-
@@ -1861,6 +1861,8 @@ public class PurpurWorldConfig {
29+
@@ -1863,6 +1863,8 @@ public class PurpurWorldConfig {
3030
public double witherMaxY = 320D;
3131
public double witherMaxHealth = 300.0D;
3232
public double witherScale = 1.0D;
@@ -35,7 +35,7 @@ index b3a9e307d1bed0c53a42119fa74c3a0f1be12d36..36b2b377f3253e5013c307b82c6ed893
3535
private void witherSettings() {
3636
witherRidable = getBoolean("mobs.wither.ridable", witherRidable);
3737
witherRidableInWater = getBoolean("mobs.wither.ridable-in-water", witherRidableInWater);
38-
@@ -1877,6 +1879,8 @@ public class PurpurWorldConfig {
38+
@@ -1879,6 +1881,8 @@ public class PurpurWorldConfig {
3939
}
4040
witherMaxHealth = getDouble("mobs.wither.attributes.max_health", witherMaxHealth);
4141
witherScale = Mth.clamp(getDouble("mobs.wither.attributes.scale", witherScale), 0.0625D, 16.0D);

patches/server/0085-Allow-toggling-special-MobSpawners-per-world.patch renamed to patches/server/0086-Allow-toggling-special-MobSpawners-per-world.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ index c72b6ea5530e54fc373c701028e1c147cea34b59..96e9fce5f9084737d2fcf4deb8330573
5959
if (spawnplacementtype.isSpawnPositionOk(world, blockposition2, EntityType.WANDERING_TRADER)) {
6060
blockposition1 = blockposition2;
6161
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
62-
index 36b2b377f3253e5013c307b82c6ed893d5b58ffd..e43e5facf44978994c8a515a20906dc8fbf8b9b8 100644
62+
index 0fbb32272453df331df54e8eda37da0b9b7af954..03aa9b6bc1095475c21a93544c14e5f5bfa1e141 100644
6363
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
6464
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
6565
@@ -70,6 +70,12 @@ public class PurpurWorldConfig {
@@ -75,7 +75,7 @@ index 36b2b377f3253e5013c307b82c6ed893d5b58ffd..e43e5facf44978994c8a515a20906dc8
7575
private double getDouble(String path, double def) {
7676
PurpurConfig.config.addDefault("world-settings.default." + path, def);
7777
return PurpurConfig.config.getDouble("world-settings." + worldName + "." + path, PurpurConfig.config.getDouble("world-settings.default." + path));
78-
@@ -234,6 +240,21 @@ public class PurpurWorldConfig {
78+
@@ -236,6 +242,21 @@ public class PurpurWorldConfig {
7979
}
8080
}
8181

patches/server/0086-Raid-cooldown-setting.patch renamed to patches/server/0087-Raid-cooldown-setting.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ index 8c60f71270d909c10e6617eb64b8fdb42deb73e9..eedce2a3d67d875d5174ee125e267948
4949
if (!raid.isStarted() && !this.raidMap.containsKey(raid.getId())) {
5050
this.raidMap.put(raid.getId(), raid);
5151
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
52-
index e43e5facf44978994c8a515a20906dc8fbf8b9b8..092b8854470cb034205f2cf708186d559be5d609 100644
52+
index 03aa9b6bc1095475c21a93544c14e5f5bfa1e141..0549d17b69e869d9014040528e9163d56a316972 100644
5353
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
5454
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
55-
@@ -109,6 +109,7 @@ public class PurpurWorldConfig {
55+
@@ -110,6 +110,7 @@ public class PurpurWorldConfig {
5656
public double tridentLoyaltyVoidReturnHeight = 0.0D;
5757
public double voidDamageHeight = -64.0D;
5858
public double voidDamageDealt = 4.0D;
5959
+ public int raidCooldownSeconds = 0;
6060
private void miscGameplayMechanicsSettings() {
6161
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
6262
boatEjectPlayersOnLand = getBoolean("gameplay-mechanics.boat.eject-players-on-land", boatEjectPlayersOnLand);
63-
@@ -117,6 +118,7 @@ public class PurpurWorldConfig {
63+
@@ -119,6 +120,7 @@ public class PurpurWorldConfig {
6464
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
6565
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
6666
voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);

patches/server/0087-Despawn-rate-config-options-per-projectile-type.patch renamed to patches/server/0088-Despawn-rate-config-options-per-projectile-type.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ This patch's implementation has been removed in favor of Pufferfish's entity-tim
77
The config remains for migration purposes.
88

99
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
10-
index 092b8854470cb034205f2cf708186d559be5d609..6cda920dca61ce781ecfb4b49da31e7c297d3b39 100644
10+
index 0549d17b69e869d9014040528e9163d56a316972..f10a009ad72789015861fbc35d490f6c72dd036c 100644
1111
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
1212
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
13-
@@ -315,6 +315,40 @@ public class PurpurWorldConfig {
13+
@@ -317,6 +317,40 @@ public class PurpurWorldConfig {
1414
});
1515
}
1616

patches/server/0088-Add-option-to-disable-zombie-aggressiveness-towards-.patch renamed to patches/server/0089-Add-option-to-disable-zombie-aggressiveness-towards-.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,18 @@ index ada1f9f9bf8770c48ff25d562cf84cb04be17ca2..21e0028ad33f8de0211dd733d98a00af
7070
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
7171
}
7272
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
73-
index 6cda920dca61ce781ecfb4b49da31e7c297d3b39..e7b7ec38bd2be51a03dace23d0af90d72404d9e8 100644
73+
index f10a009ad72789015861fbc35d490f6c72dd036c..b7af904f30fdbb9a3f680d1d8244edf1e0061e25 100644
7474
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
7575
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
76-
@@ -2003,6 +2003,7 @@ public class PurpurWorldConfig {
76+
@@ -2005,6 +2005,7 @@ public class PurpurWorldConfig {
7777
public boolean zombieJockeyOnlyBaby = true;
7878
public double zombieJockeyChance = 0.05D;
7979
public boolean zombieJockeyTryExistingChickens = true;
8080
+ public boolean zombieAggressiveTowardsVillagerWhenLagging = true;
8181
private void zombieSettings() {
8282
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
8383
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
84-
@@ -2018,6 +2019,7 @@ public class PurpurWorldConfig {
84+
@@ -2020,6 +2021,7 @@ public class PurpurWorldConfig {
8585
zombieJockeyOnlyBaby = getBoolean("mobs.zombie.jockey.only-babies", zombieJockeyOnlyBaby);
8686
zombieJockeyChance = getDouble("mobs.zombie.jockey.chance", zombieJockeyChance);
8787
zombieJockeyTryExistingChickens = getBoolean("mobs.zombie.jockey.try-existing-chickens", zombieJockeyTryExistingChickens);

patches/server/0089-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch renamed to patches/server/0090-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch

File renamed without changes.

patches/server/0090-Flying-squids-Oh-my.patch renamed to patches/server/0091-Flying-squids-Oh-my.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ index 522dabcf6ec8b19902890718717fc890d430c750..ea80eca266500f93fa9c00962d078ec2
5858
float g = Mth.cos(f) * 0.2F;
5959
float h = -0.1F + this.squid.getRandom().nextFloat() * 0.2F;
6060
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
61-
index e7b7ec38bd2be51a03dace23d0af90d72404d9e8..a0e89374b94852352400d5089052433b6de0fd92 100644
61+
index b7af904f30fdbb9a3f680d1d8244edf1e0061e25..8ee07ea25cbc5d59b972116c09ec57f0a679aa93 100644
6262
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
6363
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
64-
@@ -969,11 +969,13 @@ public class PurpurWorldConfig {
64+
@@ -971,11 +971,13 @@ public class PurpurWorldConfig {
6565
public boolean glowSquidControllable = true;
6666
public double glowSquidMaxHealth = 10.0D;
6767
public double glowSquidScale = 1.0D;
@@ -75,15 +75,15 @@ index e7b7ec38bd2be51a03dace23d0af90d72404d9e8..a0e89374b94852352400d5089052433b
7575
}
7676

7777
public boolean goatRidable = false;
78-
@@ -1660,6 +1662,7 @@ public class PurpurWorldConfig {
78+
@@ -1662,6 +1664,7 @@ public class PurpurWorldConfig {
7979
public double squidScale = 1.0D;
8080
public boolean squidImmuneToEAR = true;
8181
public double squidOffsetWaterCheck = 0.0D;
8282
+ public boolean squidsCanFly = false;
8383
private void squidSettings() {
8484
squidRidable = getBoolean("mobs.squid.ridable", squidRidable);
8585
squidControllable = getBoolean("mobs.squid.controllable", squidControllable);
86-
@@ -1672,6 +1675,7 @@ public class PurpurWorldConfig {
86+
@@ -1674,6 +1677,7 @@ public class PurpurWorldConfig {
8787
squidScale = Mth.clamp(getDouble("mobs.squid.attributes.scale", squidScale), 0.0625D, 16.0D);
8888
squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
8989
squidOffsetWaterCheck = getDouble("mobs.squid.water-offset-check", squidOffsetWaterCheck);

patches/server/0091-Infinity-bow-settings.patch renamed to patches/server/0092-Infinity-bow-settings.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..4db2032178471860baddc6b669c9a4f8
3030
} else {
3131
user.startUsingItem(hand);
3232
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
33-
index a0e89374b94852352400d5089052433b6de0fd92..85e16939a1ac27037b1959e4fc1ec57324a7c11e 100644
33+
index 8ee07ea25cbc5d59b972116c09ec57f0a679aa93..22522af6a0b0894c798399456303d951ca884fe6 100644
3434
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
3535
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
36-
@@ -137,6 +137,11 @@ public class PurpurWorldConfig {
36+
@@ -139,6 +139,11 @@ public class PurpurWorldConfig {
3737
entityLifeSpan = getInt("gameplay-mechanics.entity-lifespan", entityLifeSpan);
3838
}
3939

patches/server/0092-Configurable-daylight-cycle.patch renamed to patches/server/0093-Configurable-daylight-cycle.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ index 648aa9ec26ee2291a0caf2c61a3da4429566c343..ce5da7fc2d94a4b54e2a33de1e3ac629
8888
public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) {
8989
Iterator iterator = this.customSpawners.iterator();
9090
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
91-
index 85e16939a1ac27037b1959e4fc1ec57324a7c11e..fde8c013bb398f924d8c6a7fbfabf276f0a96936 100644
91+
index 22522af6a0b0894c798399456303d951ca884fe6..34aafc5bac4e7876fdf50289748df5070126139e 100644
9292
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
9393
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
94-
@@ -121,6 +121,13 @@ public class PurpurWorldConfig {
94+
@@ -123,6 +123,13 @@ public class PurpurWorldConfig {
9595
raidCooldownSeconds = getInt("gameplay-mechanics.raid-cooldown-seconds", raidCooldownSeconds);
9696
}
9797

0 commit comments

Comments
 (0)