mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 02:25:51 +01:00
fix
This commit is contained in:
parent
939aa76bf3
commit
f54a237a0d
@ -136,6 +136,7 @@ # Patches
|
||||
| server | Option for simpler Villagers | tr7zw | |
|
||||
| server | Origami Server Config | Phoenix616 | |
|
||||
| server | Patch Paper to use fast item merge raytracing | Paul Sauve | |
|
||||
| server | Per World Spawn Limits | Chase Whipple | |
|
||||
| server | Per entity (type) collision settings | MrIvanPlays | tr7zw |
|
||||
| api | Per player viewdistances | Spottedleaf | |
|
||||
| api | PlayerAttackEntityEvent | Ivan Pekov | |
|
||||
|
@ -0,0 +1,65 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Chase Whipple <chasewhip20@gmail.com>
|
||||
Date: Thu, 26 Mar 2020 21:45:54 -0600
|
||||
Subject: [PATCH] Per World Spawn Limits
|
||||
|
||||
This patch is licensed under the MIT license. See /licenses/MIT.md.
|
||||
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
index 4e21f6b4c02b97be4f15f5ba53fe280df2c48a46..181e9009545a7085110b378264c8efcbdd6b9ecc 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
@@ -325,6 +325,22 @@ public final class TuinityConfig {
|
||||
final int threads = this.getInt("tick-threads", -1);
|
||||
this.threads = threads == -1 ? TuinityConfig.tickThreads : threads;
|
||||
}*/
|
||||
+
|
||||
+ public int spawnLimitMonsters;
|
||||
+ public int spawnLimitAnimals;
|
||||
+ public int spawnLimitWaterAmbient;
|
||||
+ public int spawnLimitWaterAnimals;
|
||||
+ public int spawnLimitAmbient;
|
||||
+
|
||||
+ private void perWorldSpawnLimit() {
|
||||
+ final String path = "spawn-limits";
|
||||
+
|
||||
+ this.spawnLimitMonsters = this.getIntRaw(path + ".monsters", -1);
|
||||
+ this.spawnLimitAnimals = this.getIntRaw(path + ".animals", -1);
|
||||
+ this.spawnLimitWaterAmbient = this.getIntRaw(path + ".water-ambient", -1);
|
||||
+ this.spawnLimitWaterAnimals = this.getIntRaw(path + ".water-animals", -1);
|
||||
+ this.spawnLimitAmbient = this.getIntRaw(path + ".ambient", -1);
|
||||
+ }
|
||||
}
|
||||
|
||||
}
|
||||
\ No newline at end of file
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 41ef459b6574f5abf24e51280210f16322b6a0ed..8a81022634d11a050243d39e128c9f50b0d09a51 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -353,13 +353,20 @@ public class CraftWorld implements World {
|
||||
this.generator = gen;
|
||||
|
||||
environment = env;
|
||||
+ // Tuinity start - per world spawn limits
|
||||
+ this.monsterSpawn = world.tuinityConfig.spawnLimitMonsters;
|
||||
+ this.animalSpawn = world.tuinityConfig.spawnLimitAnimals;
|
||||
+ this.waterAmbientSpawn = world.tuinityConfig.spawnLimitWaterAmbient;
|
||||
+ this.waterAnimalSpawn = world.tuinityConfig.spawnLimitWaterAnimals;
|
||||
+ this.ambientSpawn = world.tuinityConfig.spawnLimitAmbient;
|
||||
// Paper start - per world spawn limits
|
||||
- this.monsterSpawn = this.world.paperConfig.spawnLimitMonsters;
|
||||
- this.animalSpawn = this.world.paperConfig.spawnLimitAnimals;
|
||||
- this.waterAnimalSpawn = this.world.paperConfig.spawnLimitWaterAnimals;
|
||||
- this.waterAmbientSpawn = this.world.paperConfig.spawnLimitWaterAmbient;
|
||||
- this.ambientSpawn = this.world.paperConfig.spawnLimitAmbient;
|
||||
+ if (this.monsterSpawn == -1) this.monsterSpawn = this.world.paperConfig.spawnLimitMonsters;
|
||||
+ if (this.animalSpawn == -1) this.animalSpawn = this.world.paperConfig.spawnLimitAnimals;
|
||||
+ if (this.waterAnimalSpawn == -1) this.waterAnimalSpawn = this.world.paperConfig.spawnLimitWaterAnimals;
|
||||
+ if (this.waterAmbientSpawn == -1) this.waterAmbientSpawn = this.world.paperConfig.spawnLimitWaterAmbient;
|
||||
+ if (this.ambientSpawn == -1) this.ambientSpawn = this.world.paperConfig.spawnLimitAmbient;
|
||||
// Paper end
|
||||
+ // Tuinity end - per world spawn limits
|
||||
}
|
||||
|
||||
@Override
|
@ -6,10 +6,10 @@ Subject: [PATCH] Revert getChunkAt(Async) retaining chunks for long periods of
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 41ef459b6574f5abf24e51280210f16322b6a0ed..95c678efcc5ed39ad78d9543a194270427aa2813 100644
|
||||
index 8a81022634d11a050243d39e128c9f50b0d09a51..cbeb3daf2b0bec9687c1111557c7487595953624 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -433,14 +433,7 @@ public class CraftWorld implements World {
|
||||
@@ -440,14 +440,7 @@ public class CraftWorld implements World {
|
||||
|
||||
@Override
|
||||
public Chunk getChunkAt(int x, int z) {
|
||||
@ -25,7 +25,7 @@ index 41ef459b6574f5abf24e51280210f16322b6a0ed..95c678efcc5ed39ad78d9543a1942704
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -2669,7 +2662,7 @@ public class CraftWorld implements World {
|
||||
@@ -2676,7 +2669,7 @@ public class CraftWorld implements World {
|
||||
}
|
||||
return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> {
|
||||
net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null);
|
@ -24,7 +24,7 @@ and an action can be defined: DROP or KICK
|
||||
If interval or rate are less-than 0, the limit is ignored
|
||||
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
index 4e21f6b4c02b97be4f15f5ba53fe280df2c48a46..66e7e1d2efaea6f16219013bb30b93a1cb5abad0 100644
|
||||
index 181e9009545a7085110b378264c8efcbdd6b9ecc..27d901c1d2e25ec5c70526cb99cc157ef19c9ba5 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
@@ -1,6 +1,7 @@
|
@ -22,10 +22,10 @@ index e50731723d266ba65b2163df2e935afb8b013a93..a6736d15282715d920bab85eb92074cd
|
||||
}
|
||||
value.append("},");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 95c678efcc5ed39ad78d9543a194270427aa2813..d66a3441c8e31da87b4e434b1b718d8e6e936953 100644
|
||||
index cbeb3daf2b0bec9687c1111557c7487595953624..ff3c84fb6f398e68cf9421dd9f8f22e7af74c970 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -730,6 +730,30 @@ public class CraftWorld implements World {
|
||||
@@ -737,6 +737,30 @@ public class CraftWorld implements World {
|
||||
return ret.entrySet().stream().collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, (entry) -> entry.getValue().build()));
|
||||
}
|
||||
|
@ -3709,7 +3709,7 @@ index 0000000000000000000000000000000000000000..0e4442a94559346b19a536d35ce5def6
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
index 66e7e1d2efaea6f16219013bb30b93a1cb5abad0..d050c959baf2b6265547164db56161110d3c500e 100644
|
||||
index 27d901c1d2e25ec5c70526cb99cc157ef19c9ba5..db1c938896fa6521c6cd279e10b91e5f94573088 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
@@ -232,6 +232,12 @@ public final class TuinityConfig {
|
@ -9,7 +9,7 @@ Configurable under
|
||||
`send-full-pos-for-hard-colliding-entities`
|
||||
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
index d050c959baf2b6265547164db56161110d3c500e..2f88f4fedb2dac875f82040b09a2ff03a141981f 100644
|
||||
index db1c938896fa6521c6cd279e10b91e5f94573088..4417fc3644d4f10419290e60b63b73bb7fbe6d63 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
@@ -238,6 +238,12 @@ public final class TuinityConfig {
|
@ -1032,7 +1032,7 @@ index 0000000000000000000000000000000000000000..0d577aa1c7868ce89c3902535adcb554
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
index 2f88f4fedb2dac875f82040b09a2ff03a141981f..739df84a0b5a9e54cc00b095e2636d154260e91d 100644
|
||||
index 4417fc3644d4f10419290e60b63b73bb7fbe6d63..48ad624592e59911d781b3cec92eea9d0ed92e0e 100644
|
||||
--- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
+++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java
|
||||
@@ -244,6 +244,25 @@ public final class TuinityConfig {
|
||||
@ -1750,10 +1750,10 @@ index 3fe1508b091e1fd0325eae50138d02fa6445c9ff..a19a26a88f247d359354902efeece992
|
||||
return new Vec3D((double) baseblockposition.getX() + 0.5D, (double) baseblockposition.getY() + 0.5D, (double) baseblockposition.getZ() + 0.5D);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index d66a3441c8e31da87b4e434b1b718d8e6e936953..811f702c00addc9f9cf467833d350bb472bf9bc5 100644
|
||||
index ff3c84fb6f398e68cf9421dd9f8f22e7af74c970..fddf35e6fa91f8eb838979b66c7e8ea22440951c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2711,14 +2711,14 @@ public class CraftWorld implements World {
|
||||
@@ -2718,14 +2718,14 @@ public class CraftWorld implements World {
|
||||
throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
|
||||
}
|
||||
PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
|
||||
@ -1770,7 +1770,7 @@ index d66a3441c8e31da87b4e434b1b718d8e6e936953..811f702c00addc9f9cf467833d350bb4
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2727,11 +2727,22 @@ public class CraftWorld implements World {
|
||||
@@ -2734,11 +2734,22 @@ public class CraftWorld implements World {
|
||||
throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]");
|
||||
}
|
||||
PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap;
|
@ -166,7 +166,7 @@ index c6c34babd618d201bab26eb9e9edaa6e68d510bf..d827e18d8c3b9b5869dbb1e233f415ba
|
||||
|
||||
protected PlayerChunkMap.a e() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 811f702c00addc9f9cf467833d350bb472bf9bc5..3562c20dee06913d03aee49d12cb27831c008842 100644
|
||||
index fddf35e6fa91f8eb838979b66c7e8ea22440951c..d4ed84e5825e5fb544980a20f0ac4eec48ddd799 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -298,7 +298,7 @@ public class CraftWorld implements World {
|
||||
@ -187,7 +187,7 @@ index 811f702c00addc9f9cf467833d350bb472bf9bc5..3562c20dee06913d03aee49d12cb2783
|
||||
if (chunkHolder.getChunk() != null) {
|
||||
++ret;
|
||||
}
|
||||
@@ -481,13 +481,16 @@ public class CraftWorld implements World {
|
||||
@@ -488,13 +488,16 @@ public class CraftWorld implements World {
|
||||
public Chunk[] getLoadedChunks() {
|
||||
// Paper start
|
||||
if (Thread.currentThread() != world.getMinecraftWorld().serverThread) {
|
@ -1,4 +1,4 @@
|
||||
name=Tuinity
|
||||
useBlackList=True
|
||||
list=server/Properly-handle-cancellation-of-projectile-hit-event.patch,server/Improved-oversized-chunk-data-packet-handling.patch,server/Per-World-Spawn-Limits.patch
|
||||
list=server/Properly-handle-cancellation-of-projectile-hit-event.patch,server/Improved-oversized-chunk-data-packet-handling.patch
|
||||
branch=origin/master
|
||||
|
Loading…
Reference in New Issue
Block a user