mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-21 07:49:18 +00:00
Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@248ba17 Updated Upstream (Paper)
This commit is contained in:
@@ -2,7 +2,7 @@ group = space.bxteam.divinemc
|
|||||||
|
|
||||||
mcVersion = 1.20.6
|
mcVersion = 1.20.6
|
||||||
version = 1.20.6-R0.1-SNAPSHOT
|
version = 1.20.6-R0.1-SNAPSHOT
|
||||||
purpurRef = 3d2569397afa45a8988762081cdff594e96a2c6c
|
purpurRef = 248ba175af2e1e472aff4eb6bcaa7ea0f7741dd5
|
||||||
|
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
|
|||||||
@@ -196,10 +196,10 @@ index c366d84518979e842a6f10f969a5951539ecac93..b44daf19e76e9729980a4c871edd31dc
|
|||||||
stringbuilder.append("// ");
|
stringbuilder.append("// ");
|
||||||
stringbuilder.append(CrashReport.getErrorComment());
|
stringbuilder.append(CrashReport.getErrorComment());
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index 71705ccbc0cce88382b1fb536271773a332ad3a2..acb0e7d4cb383a37b18d5981ee55e78e08a66922 100644
|
index 330bae815c0a332e3dc9fa7b224c9f92098199b9..a57ea225fb9951421d2026928c26f351d1b58cca 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -962,7 +962,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -959,7 +959,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
shutdownThread = Thread.currentThread();
|
shutdownThread = Thread.currentThread();
|
||||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
if (!isSameThread()) {
|
if (!isSameThread()) {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ index 957da64ddd0a56f457122a3f590b45e348f22382..f7db49d673853f31eacc76f5286b6a52
|
|||||||
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
this.setFlightAllowed(dedicatedserverproperties.allowFlight);
|
||||||
this.setMotd(dedicatedserverproperties.motd);
|
this.setMotd(dedicatedserverproperties.motd);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index eda2f8cc034cf46293be1be117a60cf8b663c303..6a3c349cb36a0c89747cf4665e7bc272d6c59365 100644
|
index 487bb3e75afc5871a79506a54f0f4af806460b14..a128e56bb835e2c8f4551a235f4832fd00611273 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -81,6 +81,7 @@ import net.minecraft.world.level.storage.WritableLevelData;
|
@@ -81,6 +81,7 @@ import net.minecraft.world.level.storage.WritableLevelData;
|
||||||
@@ -53,7 +53,7 @@ index eda2f8cc034cf46293be1be117a60cf8b663c303..6a3c349cb36a0c89747cf4665e7bc272
|
|||||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||||
public static BlockPos lastPhysicsProblem; // Spigot
|
public static BlockPos lastPhysicsProblem; // Spigot
|
||||||
private org.spigotmc.TickLimiter entityLimiter;
|
private org.spigotmc.TickLimiter entityLimiter;
|
||||||
@@ -261,6 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -252,6 +254,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||||
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
|
||||||
@@ -62,7 +62,7 @@ index eda2f8cc034cf46293be1be117a60cf8b663c303..6a3c349cb36a0c89747cf4665e7bc272
|
|||||||
this.generator = gen;
|
this.generator = gen;
|
||||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index ccdf1b7b86895fe469476112277b5f76f7f02bf0..dd0f1013f3de00d67e6b3d69ed09176176bc6a0b 100644
|
index 6e78500a6265b0192095379704b1d661ef56ba32..ab9065c2d21f713b366e5cfd1534538fd2617782 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -263,6 +263,8 @@ import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
@@ -263,6 +263,8 @@ import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||||
@@ -98,7 +98,7 @@ index ccdf1b7b86895fe469476112277b5f76f7f02bf0..dd0f1013f3de00d67e6b3d69ed091761
|
|||||||
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||||
|
|
||||||
@@ -3112,6 +3117,13 @@ public final class CraftServer implements Server {
|
@@ -3107,6 +3112,13 @@ public final class CraftServer implements Server {
|
||||||
}
|
}
|
||||||
// Purpur end
|
// Purpur end
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Original code by Titaniumtown, modified by NONPLAYT
|
|||||||
You can find the original code on https://gitlab.com/Titaniumtown/JettPack
|
You can find the original code on https://gitlab.com/Titaniumtown/JettPack
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 6a3c349cb36a0c89747cf4665e7bc272d6c59365..02899e5bdb23d8e032c721beaac3f280201394b2 100644
|
index a128e56bb835e2c8f4551a235f4832fd00611273..3cef82714ce25d84d4f28da4d671b1fbcf5107a6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -175,8 +175,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -175,8 +175,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@@ -19,7 +19,7 @@ index 6a3c349cb36a0c89747cf4665e7bc272d6c59365..02899e5bdb23d8e032c721beaac3f280
|
|||||||
private int tileTickPosition;
|
private int tileTickPosition;
|
||||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||||
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
||||||
@@ -342,8 +340,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -333,8 +331,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
});
|
});
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Optimize CraftServer.getWorld(UUID)
|
|||||||
Original code by MultiPaper - https://github.com/MultiPaper/MultiPaper
|
Original code by MultiPaper - https://github.com/MultiPaper/MultiPaper
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index dd0f1013f3de00d67e6b3d69ed09176176bc6a0b..9d3d7118bae9315b08291e3f5a2052e2100c0037 100644
|
index ab9065c2d21f713b366e5cfd1534538fd2617782..318cc15ec0a1a70d32e2637b08c48677d38d14a3 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -264,6 +264,7 @@ import javax.annotation.Nullable; // Paper
|
@@ -264,6 +264,7 @@ import javax.annotation.Nullable; // Paper
|
||||||
@@ -25,7 +25,7 @@ index dd0f1013f3de00d67e6b3d69ed09176176bc6a0b..9d3d7118bae9315b08291e3f5a2052e2
|
|||||||
private YamlConfiguration configuration;
|
private YamlConfiguration configuration;
|
||||||
private YamlConfiguration commandsConfiguration;
|
private YamlConfiguration commandsConfiguration;
|
||||||
private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
|
private final Yaml yaml = new Yaml(new SafeConstructor(new LoaderOptions()));
|
||||||
@@ -1469,6 +1471,7 @@ public final class CraftServer implements Server {
|
@@ -1464,6 +1466,7 @@ public final class CraftServer implements Server {
|
||||||
this.getLogger().log(Level.SEVERE, null, ex);
|
this.getLogger().log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ index dd0f1013f3de00d67e6b3d69ed09176176bc6a0b..9d3d7118bae9315b08291e3f5a2052e2
|
|||||||
this.worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
this.worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
||||||
this.console.removeLevel(handle);
|
this.console.removeLevel(handle);
|
||||||
return true;
|
return true;
|
||||||
@@ -1487,6 +1490,7 @@ public final class CraftServer implements Server {
|
@@ -1482,6 +1485,7 @@ public final class CraftServer implements Server {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public World getWorld(UUID uid) {
|
public World getWorld(UUID uid) {
|
||||||
@@ -41,7 +41,7 @@ index dd0f1013f3de00d67e6b3d69ed09176176bc6a0b..9d3d7118bae9315b08291e3f5a2052e2
|
|||||||
for (World world : this.worlds.values()) {
|
for (World world : this.worlds.values()) {
|
||||||
if (world.getUID().equals(uid)) {
|
if (world.getUID().equals(uid)) {
|
||||||
return world;
|
return world;
|
||||||
@@ -1510,6 +1514,7 @@ public final class CraftServer implements Server {
|
@@ -1505,6 +1509,7 @@ public final class CraftServer implements Server {
|
||||||
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.");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -863,7 +863,7 @@ index 8c134a642ccaf3530022f2e675a858d726e1dda4..d6daa27a8d7aca00b181e90d789f4249
|
|||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
if (exception instanceof ReportedException) {
|
if (exception instanceof ReportedException) {
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d89da96cb 100644
|
index a57ea225fb9951421d2026928c26f351d1b58cca..9fa1c5d6a8f313cd3d0f99131da60b640fff5587 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -3,7 +3,6 @@ package net.minecraft.server;
|
@@ -3,7 +3,6 @@ package net.minecraft.server;
|
||||||
@@ -883,7 +883,7 @@ index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d
|
|||||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
||||||
|
|
||||||
private static MinecraftServer SERVER; // Paper
|
private static MinecraftServer SERVER; // Paper
|
||||||
@@ -978,7 +975,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -975,7 +972,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
|
|
||||||
MinecraftServer.LOGGER.info("Stopping server");
|
MinecraftServer.LOGGER.info("Stopping server");
|
||||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||||
@@ -891,7 +891,7 @@ index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d
|
|||||||
// Purpur start
|
// Purpur start
|
||||||
if (upnp) {
|
if (upnp) {
|
||||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
||||||
@@ -1490,34 +1486,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1487,34 +1483,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -945,7 +945,7 @@ index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end - execute chunk tasks mid tick
|
// Paper end - execute chunk tasks mid tick
|
||||||
@@ -1592,15 +1583,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1589,15 +1580,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||||
@@ -963,7 +963,7 @@ index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d
|
|||||||
// Paper end
|
// Paper end
|
||||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||||
|
|
||||||
@@ -1637,9 +1627,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1634,9 +1624,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Paper end - Incremental chunk and player saving
|
// Paper end - Incremental chunk and player saving
|
||||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||||
// Paper start - move executeAll() into full server tick timing
|
// Paper start - move executeAll() into full server tick timing
|
||||||
@@ -974,7 +974,7 @@ index acb0e7d4cb383a37b18d5981ee55e78e08a66922..08ec1a1c9b4a044c2ae6da145f09645d
|
|||||||
// Paper end
|
// Paper end
|
||||||
// Paper start - Server Tick Events
|
// Paper start - Server Tick Events
|
||||||
long endTime = System.nanoTime();
|
long endTime = System.nanoTime();
|
||||||
@@ -1662,7 +1650,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -1659,7 +1647,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
this.logTickMethodTime(i);
|
this.logTickMethodTime(i);
|
||||||
//this.profiler.pop(); // Purpur
|
//this.profiler.pop(); // Purpur
|
||||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||||
@@ -1168,7 +1168,7 @@ index 09a7b418ddf564c0be13297f7c216db2e7ae1578..1e26b1099139d76e49fce14ee72061e1
|
|||||||
this.scanRate = senseInterval;
|
this.scanRate = senseInterval;
|
||||||
this.timeToTick = (long)RANDOM.nextInt(senseInterval);
|
this.timeToTick = (long)RANDOM.nextInt(senseInterval);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 02899e5bdb23d8e032c721beaac3f280201394b2..0011a17fa517c7540099829623db360940ee548c 100644
|
index 3cef82714ce25d84d4f28da4d671b1fbcf5107a6..de44d842af2113af8dcd3791171c3a9d5ef88cde 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -173,7 +173,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -173,7 +173,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
@@ -1179,7 +1179,7 @@ index 02899e5bdb23d8e032c721beaac3f280201394b2..0011a17fa517c7540099829623db3609
|
|||||||
public static BlockPos lastPhysicsProblem; // Spigot
|
public static BlockPos lastPhysicsProblem; // Spigot
|
||||||
private int tileTickPosition;
|
private int tileTickPosition;
|
||||||
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
|
||||||
@@ -339,7 +338,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -330,7 +329,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||||
});
|
});
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -1187,7 +1187,7 @@ index 02899e5bdb23d8e032c721beaac3f280201394b2..0011a17fa517c7540099829623db3609
|
|||||||
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
|
||||||
// Paper start - optimise collisions
|
// Paper start - optimise collisions
|
||||||
this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
|
this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
|
||||||
@@ -1342,9 +1340,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -1333,9 +1331,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
}
|
}
|
||||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||||
|
|
||||||
|
|||||||
@@ -86,45 +86,11 @@ index 2934f0cf0ef09c84739312b00186c2ef0019a165..4405fa692b9994d14205fdc85ddf9f6c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
|
||||||
index 7f6d1ccd147e5593412567bb2934ce5662da7ef0..8b232e22b1db41043ccc38e672c9bb3bcb28c8d6 100644
|
|
||||||
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
|
||||||
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
|
||||||
@@ -9,7 +9,6 @@ import net.minecraft.nbt.CompoundTag;
|
|
||||||
import net.minecraft.resources.ResourceKey;
|
|
||||||
import net.minecraft.util.worldupdate.WorldUpgrader;
|
|
||||||
import net.minecraft.world.level.ChunkPos;
|
|
||||||
-import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
|
||||||
import net.minecraft.world.level.chunk.storage.ChunkStorage;
|
|
||||||
import net.minecraft.world.level.chunk.storage.RegionFileStorage;
|
|
||||||
@@ -19,6 +18,9 @@ import net.minecraft.world.level.storage.DimensionDataStorage;
|
|
||||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
+import org.bukkit.Bukkit;
|
|
||||||
+import org.bukkit.craftbukkit.CraftWorld;
|
|
||||||
+
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
@@ -97,8 +99,10 @@ public class ThreadedWorldUpgrader {
|
|
||||||
"region"
|
|
||||||
);
|
|
||||||
|
|
||||||
+ space.bxteam.divinemc.region.RegionFileFormat formatName = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle().divinemcConfig.regionFormatName;
|
|
||||||
+ int linearCompression = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle().divinemcConfig.regionFormatLinearCompressionLevel;
|
|
||||||
final WorldInfo info = new WorldInfo(() -> worldPersistentData,
|
|
||||||
- new ChunkStorage(storageInfo, regionFolder.toPath(), this.dataFixer, false), this.removeCaches, this.dimensionType, this.generatorKey);
|
|
||||||
+ new ChunkStorage(formatName, linearCompression, storageInfo, regionFolder.toPath(), this.dataFixer, false), this.removeCaches, this.dimensionType, this.generatorKey);
|
|
||||||
|
|
||||||
long expectedChunks = (long)regionFiles.length * (32L * 32L);
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
index eca0c8afe003e0c3155aded8b5a9855ad0952e60..0271452c3ddf2e95df3f6f8a6b1cbe3b76678658 100644
|
index 9fa1c5d6a8f313cd3d0f99131da60b640fff5587..0fab6be4b5c5fcf539238b5f67cc9f8e0aac8af4 100644
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||||
@@ -887,7 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -884,7 +884,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
|
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
|
||||||
if (flush) {
|
if (flush) {
|
||||||
@@ -133,7 +99,7 @@ index eca0c8afe003e0c3155aded8b5a9855ad0952e60..0271452c3ddf2e95df3f6f8a6b1cbe3b
|
|||||||
}
|
}
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
}
|
}
|
||||||
@@ -911,7 +911,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
@@ -908,7 +908,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||||
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
|
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,15 +180,15 @@ index 90aa52efeb8ae92bf981a973415d1c11c46386d1..d2e4587af693c819edd151cd93bfb4b6
|
|||||||
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
|
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
|
||||||
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
|
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
|
||||||
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
index 3e582c49069f2a820ba3baac03917493877d9875..595a946b4f0e30e88f28e182d506375fea9f109b 100644
|
index 954d468459fe167ede0e7fca5b9f99da565d59e1..ea6f0abe2341fc549ba75cb213305c054b635fc0 100644
|
||||||
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||||
@@ -76,7 +76,7 @@ public class WorldUpgrader {
|
@@ -76,7 +76,7 @@ public class WorldUpgrader {
|
||||||
volatile int skipped;
|
volatile int skipped;
|
||||||
final Reference2FloatMap<ResourceKey<Level>> progressMap = Reference2FloatMaps.synchronize(new Reference2FloatOpenHashMap());
|
final Reference2FloatMap<ResourceKey<Level>> progressMap = Reference2FloatMaps.synchronize(new Reference2FloatOpenHashMap());
|
||||||
volatile Component status = Component.translatable("optimizeWorld.stage.counting");
|
volatile Component status = Component.translatable("optimizeWorld.stage.counting");
|
||||||
- public static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
|
- static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
|
||||||
+ public static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.(linear | mca)$"); // DivineMC
|
+ static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.(linear | mca)$"); // DivineMC
|
||||||
final DimensionDataStorage overworldDataStorage;
|
final DimensionDataStorage overworldDataStorage;
|
||||||
|
|
||||||
public WorldUpgrader(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, RegistryAccess dynamicRegistryManager, boolean eraseCache, boolean recreateRegionFiles) {
|
public WorldUpgrader(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, RegistryAccess dynamicRegistryManager, boolean eraseCache, boolean recreateRegionFiles) {
|
||||||
@@ -466,7 +432,7 @@ index 1362a47943cf1a51a185a15094b1f74c94bf40ef..66caa91f56a4e9afaf1e501f80ad7cd5
|
|||||||
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
|
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
|
||||||
return NbtIo.read((java.io.DataInput) out);
|
return NbtIo.read((java.io.DataInput) out);
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5d4e48e82 100644
|
index 1090b7e36e3c1c105bc36135b82751c651f237d4..c2ebcc3428a7048039bb5e2a393f4820c394ec3c 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||||
@@ -21,10 +21,14 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -21,10 +21,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
@@ -513,13 +479,11 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,30 +99,30 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -94,29 +102,29 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
return null;
|
// Paper end
|
||||||
}
|
|
||||||
}
|
// Paper start
|
||||||
-
|
|
||||||
- public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) {
|
- public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) {
|
||||||
+
|
|
||||||
+ public synchronized space.bxteam.divinemc.region.AbstractRegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { // DivineMC
|
+ public synchronized space.bxteam.divinemc.region.AbstractRegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { // DivineMC
|
||||||
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
|
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
|
||||||
}
|
}
|
||||||
@@ -551,7 +515,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
return regionfile;
|
return regionfile;
|
||||||
@@ -125,28 +133,41 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -127,28 +135,41 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
}
|
}
|
||||||
// Paper end - cache regionfile does not exist state
|
// Paper end - cache regionfile does not exist state
|
||||||
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
|
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
|
||||||
@@ -600,7 +564,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
return regionfile1;
|
return regionfile1;
|
||||||
@@ -158,7 +179,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -160,7 +181,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,7 +573,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
synchronized (regionfile) {
|
synchronized (regionfile) {
|
||||||
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||||
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||||
@@ -193,14 +214,14 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -195,14 +216,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
@Nullable
|
@Nullable
|
||||||
public CompoundTag read(ChunkPos pos) throws IOException {
|
public CompoundTag read(ChunkPos pos) throws IOException {
|
||||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||||
@@ -626,7 +590,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
|
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
|
||||||
// if we decide to re-read
|
// if we decide to re-read
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -210,7 +231,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -212,7 +233,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
|
|
||||||
// Paper start
|
// Paper start
|
||||||
if (regionfile.isOversized(pos.x, pos.z)) {
|
if (regionfile.isOversized(pos.x, pos.z)) {
|
||||||
@@ -635,7 +599,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
return readOversizedChunk(regionfile, pos);
|
return readOversizedChunk(regionfile, pos);
|
||||||
}
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
@@ -224,12 +245,12 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -226,12 +247,12 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
if (this.isChunkData) {
|
if (this.isChunkData) {
|
||||||
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
|
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
|
||||||
if (!chunkPos.equals(pos)) {
|
if (!chunkPos.equals(pos)) {
|
||||||
@@ -651,7 +615,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,13 +284,13 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -265,13 +286,13 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
|
|
||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
} finally { // Paper start
|
} finally { // Paper start
|
||||||
@@ -667,7 +631,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
if (regionfile == null) {
|
if (regionfile == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -300,7 +321,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -302,7 +323,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
|
|
||||||
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
@@ -676,7 +640,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
if (nbt == null && regionfile == null) {
|
if (nbt == null && regionfile == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -355,7 +376,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -357,7 +378,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
// Paper end - Chunk save reattempt
|
// Paper end - Chunk save reattempt
|
||||||
// Paper start - rewrite chunk system
|
// Paper start - rewrite chunk system
|
||||||
} finally {
|
} finally {
|
||||||
@@ -685,7 +649,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
}
|
}
|
||||||
// Paper end - rewrite chunk system
|
// Paper end - rewrite chunk system
|
||||||
}
|
}
|
||||||
@@ -365,7 +386,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -367,7 +388,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||||
|
|
||||||
while (objectiterator.hasNext()) {
|
while (objectiterator.hasNext()) {
|
||||||
@@ -694,7 +658,7 @@ index f6e3b745fc417354380d4a969f83aee430bad785..155bc3d2ef7945a44421c660834641d5
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
regionfile.close();
|
regionfile.close();
|
||||||
@@ -381,7 +402,7 @@ public class RegionFileStorage implements AutoCloseable {
|
@@ -383,7 +404,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||||
|
|
||||||
while (objectiterator.hasNext()) {
|
while (objectiterator.hasNext()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user