Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
Readd Jettpack server patch (0017)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Nov 13, 2022
1 parent 4f95759 commit b6ef919
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 22 deletions.
34 changes: 30 additions & 4 deletions patches/server/0009-JettPack-Server-Patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ index 50a9f33aa31e9273c7c52d4bb2b02f0f884f7ba5..76bb6cc0d28227afd6c0a62c1a13537d
});
return Collections.unmodifiableCollection(list);
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
index 9b22034aa655ceb0da151d9d8ca3147f6487889a..4e0caf5dc8de00066819f40de52ec90559964f65 100644
index 46e3e884890a23f5f90efc795a21566dd40804df..ef48024a21401c8c3543628e5da35f21d8d52a61 100644
--- a/src/main/java/net/minecraft/util/Mth.java
+++ b/src/main/java/net/minecraft/util/Mth.java
@@ -25,7 +25,7 @@ public class Mth {
Expand Down Expand Up @@ -935,8 +935,29 @@ index 1ec9a48f2f44f5bd647e0661423ae90970aee262..5b5e91a4fd837093d012845a9024a588
int i = this.getCurrentSwingDuration();

if (this.swinging) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index d5e3bd662da349fc2ee58c7800d79c60300f33b3..4a63fdd784c4c214e3790936f2f759b335b664d3 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -841,7 +841,7 @@ public abstract class Mob extends LivingEntity {
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
// Paper start - optimise checkDespawn
Player entityhuman = this.level.findNearbyPlayer(this, level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard() + 1, EntitySelector.affectsSpawning); // Paper
- if (entityhuman == null) {
+ if (entityhuman == null || this.level.prismarineConfig.despawnMobWhenNoPlayerIsOnRange) { // Prismarine
entityhuman = ((ServerLevel)this.level).playersAffectingSpawning.isEmpty() ? null : ((ServerLevel)this.level).playersAffectingSpawning.get(0);
}
// Paper end - optimise checkDespawn
@@ -863,6 +863,7 @@ public abstract class Mob extends LivingEntity {
} else if (d0 < (double) l) {
this.noActionTime = 0;
}
+ } else if (this.level.prismarineConfig.despawnMobWhenNoPlayerIsOnRange) { this.discard(); // Prismarine
}

} else {
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 00fc98797aea23e1f586b8e7f85fc27e2019352f..d281138a381a516804eef0da9dabd27e1e92145f 100644
index 2c915c765ceef3ec28f5a58fa9a587282c1a906a..2840b720b6fb8d74710845d9186e565f3f99b10b 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -19,8 +19,8 @@ import org.slf4j.Logger;
Expand Down Expand Up @@ -1429,17 +1450,22 @@ index eb01aab61aa3383e39120c7dfb60d9c9a4b801d1..da4b140a10687dde0e40da12baf68d63
}
\ No newline at end of file
diff --git a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
index cf494171713b5fc12e9627774f2705b911b54bd2..c66135f75f95a10dd49cfb67ed8d84317715193d 100644
index cf494171713b5fc12e9627774f2705b911b54bd2..17471282fd5820705b24a88888495d33d81b492c 100644
--- a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
+++ b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
@@ -74,4 +74,9 @@ public class PrismarineWorldConfig {
@@ -74,4 +74,14 @@ public class PrismarineWorldConfig {
final Map<String, Object> value = PrismarineConfig.getMap("world-settings." + worldName + "." + path, null);
return value.isEmpty() ? fallback : value;
}
+
+ public double fishingRodLength = 1024.0D;
+ private void fishingRodLength() {
+ fishingRodLength = getDouble("fishing-rod-length", fishingRodLength);
+ }
+
+ public boolean despawnMobWhenNoPlayerIsOnRange = false;
+ private void despawnMobWhenNoPlayerIsOnRange() {
+ despawnMobWhenNoPlayerIsOnRange = getBoolean("despawn-mob-when-no-player-is-on-range", despawnMobWhenNoPlayerIsOnRange);
+ }
}
\ No newline at end of file
Expand Down
15 changes: 4 additions & 11 deletions patches/server/0018-Implement-FixMySpawnR.patch
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,12 @@ index f0b0e19ed20967cae12195707007532fbab185f8..5ad659c4af922cb7d928968e453984a8
}

diff --git a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
index c66135f75f95a10dd49cfb67ed8d84317715193d..69901d7855af3ceaf0890ccb2811e41f513bff5f 100644
index 17471282fd5820705b24a88888495d33d81b492c..2b79fbb3387fb1026dfcd56e906bb315b335a2ea 100644
--- a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
+++ b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
@@ -74,9 +74,15 @@ public class PrismarineWorldConfig {
final Map<String, Object> value = PrismarineConfig.getMap("world-settings." + worldName + "." + path, null);
return value.isEmpty() ? fallback : value;
}
-
+
public double fishingRodLength = 1024.0D;
+
private void fishingRodLength() {
fishingRodLength = getDouble("fishing-rod-length", fishingRodLength);
@@ -84,4 +84,9 @@ public class PrismarineWorldConfig {
private void despawnMobWhenNoPlayerIsOnRange() {
despawnMobWhenNoPlayerIsOnRange = getBoolean("despawn-mob-when-no-player-is-on-range", despawnMobWhenNoPlayerIsOnRange);
}
+
+ public int timerTimeOut = 0;
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0025-Various-boat-tweaks.patch
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ index ba14657c6911bfd54da6ee9e248b3a050455d68a..3ac698a2c24bfdeb0b0433c0978f6ef7
public void openCustomInventoryScreen(Player player) {
player.openMenu(this);
diff --git a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
index 69901d7855af3ceaf0890ccb2811e41f513bff5f..2ded0f556bef879bd0c0da0c53b04c2c8315ab5d 100644
index 2b79fbb3387fb1026dfcd56e906bb315b335a2ea..81081434bbe8248ab97792311836504f4f6b9f24 100644
--- a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
+++ b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
@@ -85,4 +85,9 @@ public class PrismarineWorldConfig {
@@ -89,4 +89,9 @@ public class PrismarineWorldConfig {
private void timerTimeOut() {
timerTimeOut = getInt("timer-time-out", timerTimeOut);
}
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0036-Add-option-to-configure-portal-size.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ index 9c1dcbe8293f68f5e9026ff6acecf0c7cb31f73f..e0f433e23e4b5c334ab64cf2569fbd1c

// CraftBukkit start - return boolean
diff --git a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
index 2ded0f556bef879bd0c0da0c53b04c2c8315ab5d..7e7580b865b3a375b059bd4052a25797a9ea880b 100644
index 81081434bbe8248ab97792311836504f4f6b9f24..bec40a7442ae7976f05eb5bf4ca3a744403160f8 100644
--- a/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
+++ b/src/main/java/net/prismarineteam/prismarine/PrismarineWorldConfig.java
@@ -90,4 +90,15 @@ public class PrismarineWorldConfig {
@@ -94,4 +94,15 @@ public class PrismarineWorldConfig {
private void boatSettings() {
boatBreakWhenLand = getBoolean("entity.boat.break-when-land", boatBreakWhenLand);
}
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0037-Force-despawn-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ index ccb5ad57f173ba27ab1d4a87e6323565248a2bf4..1dc720ca3844ef3a9bad7e470f67fb23
return this.getPosition(delta).add(0.0D, (double) this.eyeHeight * 0.7D, 0.0D);
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index d5e3bd662da349fc2ee58c7800d79c60300f33b3..4fe0cf5364dcedbff3a9287e565b1bedcd8031a4 100644
index 4a63fdd784c4c214e3790936f2f759b335b664d3..e9fc05533d3f92836f8c6c93364d85c7a35b48b0 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -136,6 +136,7 @@ public abstract class Mob extends LivingEntity {
Expand All @@ -37,8 +37,8 @@ index d5e3bd662da349fc2ee58c7800d79c60300f33b3..4fe0cf5364dcedbff3a9287e565b1bed
+ } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence() || this.forceDespawn) { // Prismarine
// Paper start - optimise checkDespawn
Player entityhuman = this.level.findNearbyPlayer(this, level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard() + 1, EntitySelector.affectsSpawning); // Paper
if (entityhuman == null) {
@@ -870,6 +871,13 @@ public abstract class Mob extends LivingEntity {
if (entityhuman == null || this.level.prismarineConfig.despawnMobWhenNoPlayerIsOnRange) { // Prismarine
@@ -871,6 +872,13 @@ public abstract class Mob extends LivingEntity {
}
}

Expand Down

0 comments on commit b6ef919

Please sign in to comment.