mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 13:57:35 +01:00
update configurate (#9230)
This commit is contained in:
parent
c18dea2d80
commit
c4f40ca864
@ -19,16 +19,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- Villager entityvillager = (Villager) other;
|
||||
-
|
||||
- if (world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
||||
+ // Paper start
|
||||
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != 0.0 && (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 || world.getDifficulty() == Difficulty.NORMAL || world.getDifficulty() == Difficulty.HARD) && other instanceof Villager) {
|
||||
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance == -1.0 && world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
|
||||
return flag;
|
||||
}
|
||||
+ if (this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > this.level().paperConfig().entities.behavior.zombieVillagerInfectionChance) {
|
||||
+ return flag;
|
||||
+ } // Paper end
|
||||
+
|
||||
+ Villager entityvillager = (Villager) other;
|
||||
- return flag;
|
||||
- }
|
||||
+ final double fallbackChance = world.getDifficulty() == Difficulty.HARD ? 1d : world.getDifficulty() == Difficulty.NORMAL ? 0.5d : 0d; // Paper
|
||||
+ if (this.random.nextDouble() < world.paperConfig().entities.behavior.zombieVillagerInfectionChance.or(fallbackChance) && other instanceof Villager entityvillager) { // Paper
|
||||
// CraftBukkit start
|
||||
flag = Zombie.zombifyVillager(world, entityvillager, this.blockPosition(), this.isSilent(), CreatureSpawnEvent.SpawnReason.INFECTION) == null;
|
||||
}
|
||||
|
@ -26,22 +26,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
|
||||
@@ -0,0 +0,0 @@ public class GlobalConfiguration extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
|
||||
public class Misc extends ConfigurationPart {
|
||||
+
|
||||
+ public ChatThreads chatThreads;
|
||||
public class ChatThreads extends ConfigurationPart.Post {
|
||||
private int chatExecutorCoreSize = -1;
|
||||
private int chatExecutorMaxSize = -1;
|
||||
|
||||
@Override
|
||||
public void postProcess() {
|
||||
- // TODO: FILL
|
||||
@PostProcess
|
||||
private void postProcess() {
|
||||
- // TODO: fill in separate patch
|
||||
+ //noinspection ConstantConditions
|
||||
+ if (net.minecraft.server.MinecraftServer.getServer() == null) return; // In testing env, this will be null here
|
||||
+ int _chatExecutorMaxSize = (chatExecutorMaxSize <= 0) ? Integer.MAX_VALUE : chatExecutorMaxSize; // This is somewhat dumb, but, this is the default, do we cap this?;
|
||||
+ int _chatExecutorCoreSize = Math.max(chatExecutorCoreSize, 0);
|
||||
+ int _chatExecutorMaxSize = (this.chatExecutorMaxSize <= 0) ? Integer.MAX_VALUE : this.chatExecutorMaxSize; // This is somewhat dumb, but, this is the default, do we cap this?;
|
||||
+ int _chatExecutorCoreSize = Math.max(this.chatExecutorCoreSize, 0);
|
||||
+
|
||||
+ if (_chatExecutorMaxSize < _chatExecutorCoreSize) {
|
||||
+ _chatExecutorMaxSize = _chatExecutorCoreSize;
|
||||
|
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
} else {
|
||||
DimensionType dimensionType = world.dimensionType();
|
||||
- int i = dimensionType.monsterSpawnBlockLightLimit();
|
||||
+ int i = world.getLevel().paperConfig().entities.spawning.monsterSpawnMaxLightLevel >= 0 ? world.getLevel().paperConfig().entities.spawning.monsterSpawnMaxLightLevel : dimensionType.monsterSpawnBlockLightLimit(); // Paper
|
||||
+ int i = world.getLevel().paperConfig().entities.spawning.monsterSpawnMaxLightLevel.or(dimensionType.monsterSpawnBlockLightLimit()); // Paper
|
||||
if (i < 15 && world.getBrightness(LightLayer.BLOCK, pos) > i) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
|
@ -5192,7 +5192,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ try {
|
||||
+ result.add(Permission.loadPermission(entry.getKey().toString(), (Map<?, ?>) entry.getValue(), permissionDefault, result));
|
||||
+ } catch (Throwable ex) {
|
||||
+ throw new SerializationException(null, "Error loading permission %s".formatted(entry.getKey()), ex);
|
||||
+ throw new SerializationException((Type) null, "Error loading permission %s".formatted(entry.getKey()), ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user