9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-22 08:19:19 +00:00

update upstream

This commit is contained in:
NONPLAYT
2025-01-14 18:34:27 +03:00
parent 19381f1623
commit c3c3cc7987
18 changed files with 70 additions and 86 deletions

View File

@@ -1,6 +1,6 @@
--- a/purpur-api/build.gradle.kts
+++ b/purpur-api/build.gradle.kts
@@ -106,17 +_,21 @@
@@ -104,17 +_,21 @@
java {
srcDir(generatedApiPath)
srcDir(file("../paper-api/src/main/java"))
@@ -22,7 +22,7 @@
}
}
}
@@ -166,6 +_,15 @@
@@ -161,6 +_,15 @@
pomProps.get().asFile.writeText("version=$projectVersion")
}
}

View File

@@ -1285,7 +1285,7 @@ index df142a89b8c43acb81eb383eac0ef048a1f49a6e..00000000000000000000000000000000
-}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
deleted file mode 100644
index 213c89fddc9413246443d66506ba5437bdb60dce..0000000000000000000000000000000000000000
index 627922fa5c65e9b77e79cd896c8c52889f5a0cc5..0000000000000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/Timings.java
+++ /dev/null
@@ -1,324 +0,0 @@
@@ -1613,7 +1613,6 @@ index 213c89fddc9413246443d66506ba5437bdb60dce..00000000000000000000000000000000
- return TimingsManager.getHandler(groupName, name, groupHandler);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
deleted file mode 100644
index 04d0dc27406e9f96224f88edb1c535176e84d395..0000000000000000000000000000000000000000
@@ -2107,7 +2106,7 @@ index 632c4961515f5052551f841cfa840e60bba7a257..00000000000000000000000000000000
-}
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
deleted file mode 100644
index 6e361e97c62b93589bba834b3106ed92574ec603..0000000000000000000000000000000000000000
index b4249da3eb26eae26ec000cc4d56cd21ac2fc6d5..0000000000000000000000000000000000000000
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
@@ -2161,7 +2160,7 @@ index 6e361e97c62b93589bba834b3106ed92574ec603..00000000000000000000000000000000
- public CustomTimingsHandler(@NotNull String name) {
- Timing timing;
-
- new AuthorNagException("Deprecated use of CustomTimingsHandler. Please Switch to Timings.of ASAP").printStackTrace();
- new AuthorNagException("Deprecated use of CustomTimingsHandler. Timings has been removed.").printStackTrace();
- try {
- final Method ofSafe = TimingsManager.class.getDeclaredMethod("getHandler", String.class, String.class, Timing.class);
- ofSafe.setAccessible(true);

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2295,6 +_,13 @@
@@ -2342,6 +_,13 @@
}
// Purpur end

View File

@@ -1,6 +1,6 @@
--- a/purpur-server/build.gradle.kts
+++ b/purpur-server/build.gradle.kts
@@ -21,6 +_,7 @@
@@ -22,6 +_,7 @@
// gitFilePatches = true
val purpur = forks.register("purpur") {
@@ -8,11 +8,12 @@
upstream.patchDir("paperServer") {
upstreamPath = "paper-server"
excludes = setOf("src/minecraft", "patches", "build.gradle.kts")
@@ -29,7 +_,22 @@
@@ -29,7 +_,23 @@
outputDir = rootDirectory.dir("paper-server")
}
}
- activeFork = purpur
+
+ val divinemc = forks.register("divinemc") {
+ forks = purpur
+ upstream.patchRepo("paperServer") {
@@ -46,18 +47,18 @@
+ resources { srcDir("../purpur-server/src/test/resources") }
}
}
val log4jPlugins = sourceSets.create("log4jPlugins") {
@@ -146,7 +_,7 @@
// Paper end - configure mockito agent that is needed in newer java versions
}
dependencies {
- implementation(project(":purpur-api"))
+ implementation(project(":divinemc-api")) // DivineMC
implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
// Paper start
implementation("ca.spottedleaf:concurrentutil:0.0.3")
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
@@ -208,26 +_,35 @@
// Paper end - spark
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
@@ -207,26 +_,35 @@
implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT")
}
+// DivineMC start - hide irrelevant compilation warnings
@@ -78,14 +79,14 @@
+ val buildTime = Instant.now() // DivineMC - Build time to current, we dont have a build server rn
val gitHash = git.exec(providers, "rev-parse", "--short=7", "HEAD").get().trim()
val implementationVersion = "$mcVersion-${build ?: "DEV"}-$gitHash"
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim() // Paper
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim() // Paper
val date = git.exec(providers, "show", "-s", "--format=%ci", gitHash).get().trim()
val gitBranch = git.exec(providers, "rev-parse", "--abbrev-ref", "HEAD").get().trim()
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Purpur", // Purpur
+ "Implementation-Title" to "DivineMC", // DivineMC
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date, // Paper
"Implementation-Vendor" to date,
- "Specification-Title" to "Purpur", // Purpur
+ "Specification-Title" to "DivineMC", // DivineMC
"Specification-Version" to project.version,
@@ -97,4 +98,4 @@
+ "Brand-Name" to "DivineMC", // DivineMC
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch, // Paper
"Git-Branch" to gitBranch,

View File

@@ -34,7 +34,7 @@ index 1638eccef431fb68775af624110f1968f0c6dabd..2799db1223c9f279322869bdd19605e6
if (entity.getLastHurtByMob() instanceof ServerPlayer serverPlayer) {
DamageSource damageSource = entity.getLastDamageSource() == null
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
index c1ae7755e8d6fa8501d2210dab7605d993c55722..83eff9d2a9cdceca8b8b88410d57cc7cb9bcbfcb 100644
index 761fdcd4a4e18f45547afd8edff44f61c6eeacb4..03264d2b170002c640cec34530909ebb34c7e54e 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
@@ -81,7 +81,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -60,7 +60,7 @@ index c1ae7755e8d6fa8501d2210dab7605d993c55722..83eff9d2a9cdceca8b8b88410d57cc7c
@@ -144,7 +155,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
) {
super(pos, data, level, net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(Registries.BIOME), inhabitedTime, sections, blendingData); // Paper - Anti-Xray - The world isn't ready yet, use server singleton for registry
this.level = (net.minecraft.server.level.ServerLevel) level; // CraftBukkit - type
this.level = (ServerLevel) level; // CraftBukkit - type
- this.gameEventListenerRegistrySections = new Int2ObjectOpenHashMap<>();
+ this.gameEventListenerRegistrySections = new GameEventListenerRegistry[getGameEventSectionLength(this.getSectionsCount())]; // DivineMC - Petal: Reduce work done by game event system

View File

@@ -44,10 +44,10 @@ index 131923282c9ecbcb1d7f45a826da907c02bd2716..e7c0de38ef689510860dc0b626f74461
private static double getBeardContribution(int x, int y, int z, int height) {
diff --git a/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index d77016287f5f9a0964d56f05d2d5256ef2e6e86c..40d4555607915709099a94f83df78a744d2827e7 100644
index 65728ef17e63d71833677fdcbd5bb90794b4822b..832a26760a777fe2d62f2f5f7a885bae63f67517 100644
--- a/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -69,8 +69,10 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
@@ -68,8 +68,10 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
Aquifer.FluidStatus fluidStatus = new Aquifer.FluidStatus(-54, Blocks.LAVA.defaultBlockState());
int seaLevel = settings.seaLevel();
Aquifer.FluidStatus fluidStatus1 = new Aquifer.FluidStatus(seaLevel, settings.defaultFluid());

View File

@@ -106,10 +106,10 @@ index 5ec864a48aa2582458f741b9e81be8805d55913c..db08fe9ad7789876efb657c4274b84b1
}
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 9fe0f9004066522df8eaf9b77968755c9e69a6bd..84bd8a066bc5e89f657118748eee232a4a824a83 100644
index 398c1733824b689520170de0be94006731afa5cd..b38e6837c6582e63089c67ae6450a0281ceb49b2 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -310,10 +310,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -312,10 +312,24 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
public void send(Packet<?> packet) {

View File

@@ -1,16 +0,0 @@
--- a/net/minecraft/server/commands/LocateCommand.java
+++ b/net/minecraft/server/commands/LocateCommand.java
@@ -200,8 +_,10 @@
}
private static float dist(int x1, int z1, int x2, int z2) {
- int i = x2 - x1;
- int i1 = z2 - z1;
- return Mth.sqrt(i * i + i1 * i1);
+ // DivineMC start - Fix MC-177381
+ double i = x2 - x1;
+ double j = z2 - z1;
+ return (float) Math.hypot(i, j);
+ // DivineMC end
}
}

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
@@ -407,7 +_,10 @@
@@ -408,7 +_,10 @@
}
if (this.entity instanceof LivingEntity) {
@@ -12,7 +12,7 @@
if (!attributesToSync.isEmpty()) {
// CraftBukkit start - Send scaled max health
if (this.entity instanceof ServerPlayer serverPlayer) {
@@ -417,7 +_,7 @@
@@ -418,7 +_,7 @@
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), attributesToSync));
}

View File

@@ -21,7 +21,7 @@
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
@@ -4253,6 +_,7 @@
@@ -4251,6 +_,7 @@
}
public final void setBoundingBox(AABB bb) {

View File

@@ -9,7 +9,7 @@
return;
}
// CraftBukkit end
@@ -2664,6 +_,7 @@
@@ -2666,6 +_,7 @@
}
protected void updateSwingTime() {
@@ -17,7 +17,7 @@
int currentSwingDuration = this.getCurrentSwingDuration();
if (this.swinging) {
this.swingTime++;
@@ -3148,7 +_,13 @@
@@ -3150,7 +_,13 @@
}
protected float getFlyingSpeed() {
@@ -32,7 +32,7 @@
}
public float getSpeed() {
@@ -3615,6 +_,7 @@
@@ -3617,6 +_,7 @@
protected void updateFallFlying() {
this.checkSlowFallDistance();
if (!this.level().isClientSide) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -1872,6 +_,11 @@
@@ -1877,6 +_,11 @@
}
public void causeFoodExhaustion(float exhaustion, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason reason) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] DivineMC Configuration
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 109e569b7ba6419d60c6490b588937579b4f6878..26f5026134e37e37236dfba9fd881021d7f8666e 100644
index 4a9258b62db3a9d1150f0dfbe916fa549b596686..bfccf82b57c23537e83bc0b83feef5e632cabef7 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -94,7 +94,7 @@ public abstract class Configurations<G, W> {
@@ -59,10 +59,10 @@ index 109e569b7ba6419d60c6490b588937579b4f6878..26f5026134e37e37236dfba9fd881021
+ // DivineMC end - DivineMC Configuration
}
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index 9f87f3da8e3f8cb16ea8f04cc233e143b174a709..1384abb3f98719d8f16ddb4cc48da71c18619606 100644
index e319d6337811051de478d584a37015c450960701..6955c448adc0a995c6bbe6d507eee4232ffda5b1 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -327,7 +327,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -331,7 +331,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
}
@@ -71,7 +71,7 @@ index 9f87f3da8e3f8cb16ea8f04cc233e143b174a709..1384abb3f98719d8f16ddb4cc48da71c
return createWorldContextMap(level.levelStorageAccess.levelDirectory.path(), level.serverLevelData.getLevelName(), level.dimension().location(), level.spigotConfig, level.registryAccess(), level.getGameRules());
}
@@ -430,17 +430,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -434,17 +434,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
}
@@ -89,7 +89,7 @@ index 9f87f3da8e3f8cb16ea8f04cc233e143b174a709..1384abb3f98719d8f16ddb4cc48da71c
@Deprecated
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
YamlConfiguration config = new YamlConfiguration();
@@ -463,9 +452,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -467,9 +456,16 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
// Symlinks are not correctly checked in createDirectories
@@ -133,10 +133,10 @@ index 05339a176083af667c16f77d76dc1878dafce3f0..0a1428b826fe4057058cf24284bd5f6f
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c68b97ab916746570229cef37357756b6df44baf..b8bc80e60dc36bfe9aac83d7f46b79303b7d66cf 100644
index cc80fb07272393acc1b7d5f269789fd92eb10dfc..64f0c861c6ff4e523a882c11aef26f801fc14487 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1101,6 +1101,7 @@ public final class CraftServer implements Server {
@@ -1102,6 +1102,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
@@ -144,7 +144,7 @@ index c68b97ab916746570229cef37357756b6df44baf..b8bc80e60dc36bfe9aac83d7f46b7930
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
@@ -3124,6 +3125,13 @@ public final class CraftServer implements Server {
@@ -3130,6 +3131,13 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Optimize default values for configs
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..c10aa23e8f742bef703247b76109778ec5c2ecd8 100644
index d4a0b684e7e5a5d7ea1106d0adeccf12d501676c..5ff509211843028ed692b37e286db425607bfed3 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -336,9 +336,9 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -340,9 +340,9 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean fixEntityPositionDesync = true;
public boolean loadPermissionsYmlBeforePlugins = true;
@Constraints.Min(4)
@@ -21,10 +21,10 @@ index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..c10aa23e8f742bef703247b76109778e
public boolean strictAdvancementDimensionCheck = false;
public IntOr.Default compressionLevel = IntOr.Default.USE_DEFAULT;
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fecf9a4c63c 100644
index a426ba82af695426952bb5e04fa721e6ccff2f89..6ae624f873c77625c7ff9a1b94ff015cc6d321f0 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -156,9 +156,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -145,9 +145,9 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
@@ -37,7 +37,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
}
public Markers markers;
@@ -281,8 +281,8 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -270,8 +270,8 @@ public class WorldConfiguration extends ConfigurationPart {
public Behavior behavior;
public class Behavior extends ConfigurationPart {
@@ -48,7 +48,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
public int experienceMergeMaxValue = -1;
public boolean shouldRemoveDragon = false;
public boolean zombiesTargetTurtleEggs = true;
@@ -306,7 +306,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -295,7 +295,7 @@ public class WorldConfiguration extends ConfigurationPart {
public int playerInsomniaStartTicks = 72000;
public int phantomsSpawnAttemptMinSeconds = 60;
public int phantomsSpawnAttemptMaxSeconds = 119;
@@ -57,7 +57,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
@BelowZeroToEmpty
public DoubleOr.Default zombieVillagerInfectionChance = DoubleOr.Default.USE_DEFAULT;
public MobsCanAlwaysPickUpLoot mobsCanAlwaysPickUpLoot;
@@ -317,7 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -306,7 +306,7 @@ public class WorldConfiguration extends ConfigurationPart {
}
public boolean disablePlayerCrits = false;
@@ -66,7 +66,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
@Comment("Prevents merging items that are not on the same y level, preventing potential visual artifacts.")
public boolean onlyMergeItemsHorizontally = false;
public PillagerPatrols pillagerPatrols;
@@ -415,7 +415,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -404,7 +404,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Environment extends ConfigurationPart {
public boolean disableThunder = false;
public boolean disableIceAndSnow = false;
@@ -75,7 +75,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false;
public FrostedIce frostedIce;
@@ -465,7 +465,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -453,7 +453,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Maps extends ConfigurationPart {
public int itemFrameCursorLimit = 128;
@@ -84,7 +84,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
}
public Fixes fixes;
@@ -491,7 +491,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -479,7 +479,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Hopper extends ConfigurationPart {
public boolean cooldownWhenFull = true;
public boolean disableMoveEvent = false;
@@ -93,7 +93,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
}
public Collisions collisions;
@@ -499,9 +499,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -487,9 +487,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Collisions extends ConfigurationPart {
public boolean onlyPlayersCollide = false;
public boolean allowVehicleCollisions = true;
@@ -105,7 +105,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
public boolean allowPlayerCrammingDamage = false;
}
@@ -509,18 +509,31 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -497,18 +497,31 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
@@ -147,7 +147,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
});
public boolean flushRegionsOnSave = false;
}
@@ -535,13 +548,13 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -523,13 +536,13 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates;
public class TickRates extends ConfigurationPart {
@@ -166,7 +166,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
}
@Setting(FeatureSeedsGeneration.FEATURE_SEEDS_KEY)
@@ -550,7 +563,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -538,7 +551,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class FeatureSeeds extends ConfigurationPart {
@SuppressWarnings("unused") // Is used in FeatureSeedsGeneration
@Setting(FeatureSeedsGeneration.GENERATE_KEY)
@@ -175,7 +175,7 @@ index 229404b8583adc9723e3186775f38fdb97daacbc..a308eb1e2d43627c5f92e5b625024fec
@Setting(FeatureSeedsGeneration.FEATURES_KEY)
public Reference2LongMap<Holder<ConfiguredFeature<?, ?>>> features = new Reference2LongOpenHashMap<>();
@@ -571,9 +584,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -559,9 +572,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart {
public int lightQueueSize = 20;

View File

@@ -1,6 +1,6 @@
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -285,6 +_,7 @@
@@ -286,6 +_,7 @@
protected final DedicatedPlayerList playerList;
private final Map<String, World> worlds = new LinkedHashMap<String, World>();
// private final Map<Class<?>, Registry<?>> registries = new HashMap<>(); // Paper - replace with RegistryAccess
@@ -8,7 +8,7 @@
private YamlConfiguration configuration;
private YamlConfiguration commandsConfiguration;
private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
@@ -1535,6 +_,7 @@
@@ -1536,6 +_,7 @@
this.getLogger().log(Level.SEVERE, null, ex);
}
@@ -16,7 +16,7 @@
this.worlds.remove(world.getName().toLowerCase(Locale.ROOT));
this.console.removeLevel(handle);
return true;
@@ -1553,6 +_,7 @@
@@ -1554,6 +_,7 @@
@Override
public World getWorld(UUID uid) {
@@ -24,7 +24,7 @@
for (World world : this.worlds.values()) {
if (world.getUID().equals(uid)) {
return world;
@@ -1576,6 +_,7 @@
@@ -1577,6 +_,7 @@
System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world.");
return;
}

View File

@@ -1,3 +0,0 @@
--- a/src/main/resources/data/.paperassetsroot
+++ b/src/main/resources/data/.paperassetsroot
@@ -1,0 +_,0 @@

View File

@@ -31,6 +31,7 @@ import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Reference2LongMap;
import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.component.DataComponentType;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
@@ -128,15 +129,17 @@ public class DivineConfigurations extends Configurations<DivineGlobalConfigurati
}
@Override
protected YamlConfigurationLoader.Builder createGlobalLoaderBuilder() {
return super.createGlobalLoaderBuilder()
.defaultOptions(DivineConfigurations::defaultGlobalOptions);
protected YamlConfigurationLoader.Builder createGlobalLoaderBuilder(RegistryAccess registryAccess) {
return super.createGlobalLoaderBuilder(registryAccess)
.defaultOptions((options) -> defaultGlobalOptions(registryAccess, options));
}
private static ConfigurationOptions defaultGlobalOptions(ConfigurationOptions options) {
private static ConfigurationOptions defaultGlobalOptions(RegistryAccess registryAccess, ConfigurationOptions options) {
return options
.header(GLOBAL_HEADER)
.serializers(builder -> builder.register(new PacketClassSerializer()));
.serializers(builder -> builder.register(new PacketClassSerializer())
.register(new RegistryValueSerializer<>(new TypeToken<DataComponentType<?>>() {}, registryAccess, Registries.DATA_COMPONENT_TYPE, false))
);
}
@Override
@@ -250,7 +253,7 @@ public class DivineConfigurations extends Configurations<DivineGlobalConfigurati
public void reloadConfigs(MinecraftServer server) {
try {
this.initializeGlobalConfiguration(reloader(this.globalConfigClass, DivineGlobalConfiguration.get()));
this.initializeGlobalConfiguration(server.registryAccess(), reloader(this.globalConfigClass, DivineGlobalConfiguration.get()));
this.initializeWorldDefaultsConfiguration(server.registryAccess());
for (ServerLevel level : server.getAllLevels()) {
this.createWorldConfig(PaperConfigurations.createWorldContextMap(level), reloader(this.worldConfigClass, level.divineConfig()));

View File

@@ -2,7 +2,7 @@ group = space.bxteam.divinemc
mcVersion = 1.21.4
version = 1.21.4-R0.1-SNAPSHOT
purpurRef = ad38c53a655585a430dcd2ae79b99f576dd53b4a
purpurRef = 233fcce716fe202a5c0b4084c03a11dfe7a81e2e
org.gradle.configuration-cache=true
org.gradle.caching = true