mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-19 15:09:27 +00:00
Update upstream (yay finally)
Not tested in production yet, but soon it will be
This commit is contained in:
@@ -2,7 +2,7 @@ group=net.sparklypower.sparklypaper
|
||||
version=1.20.4-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion=1.20.4
|
||||
paperRef=351923d17e3b5f2a2a3ed848c171d7d2b077a55a
|
||||
paperRef=4939f8711884901ddf1c56337f606de71cdae78d
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] new fork who dis - Rebrand to SparklyPaper and Build Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 50cc3c1e5968d95a21133e4d554a93e181aba0f6..3f0c449c373c015c1cf10165ff402e29e82ac5de 100644
|
||||
index 3b86451bdc939aec0ec6b4bf82a789cab38345b4..32fa3dbf6975b1435bbfc7bbd1094687b7e882f7 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -20,7 +20,7 @@ minecraft {
|
||||
@@ -14,6 +14,6 @@ index 50cc3c1e5968d95a21133e4d554a93e181aba0f6..3f0c449c373c015c1cf10165ff402e29
|
||||
implementation("com.squareup:javapoet:1.13.0")
|
||||
- implementation(project(":paper-api"))
|
||||
+ implementation(project(":sparklypaper-api")) // SparklyPaper
|
||||
implementation("io.github.classgraph:classgraph:4.8.47")
|
||||
}
|
||||
|
||||
group = "io.papermc.paper"
|
||||
|
||||
@@ -3,7 +3,6 @@ From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Sat, 12 Jun 2021 16:40:34 +0200
|
||||
Subject: [PATCH] new fork who dis - Rebrand to SparklyPaper and Build Changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 58da26ad2f128ba0b66f86820f60853f4be352f0..f2c2d7af8d3647879702c27e8a0ee62e76afd6e7 100644
|
||||
--- a/build.gradle.kts
|
||||
@@ -66,23 +65,23 @@ index 58da26ad2f128ba0b66f86820f60853f4be352f0..f2c2d7af8d3647879702c27e8a0ee62e
|
||||
standardInput = System.`in`
|
||||
workingDir = rootProject.layout.projectDirectory
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 34f19ac897a30c0c4e3ab406013fcca1c8b7db93..f1c65967b74e79452870438eea0942cc700fe0e9 100644
|
||||
index d06185566b447c432d4dc2e3ba04d121bcdbc71b..8f250966ab5e4576e3a57beba2e417d53713e84e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1855,7 +1855,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return "SparklyPaper"; // SparklyPaper - SparklyPaper > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
- return "Paper"; // Paper
|
||||
+ return "SparklyPaper"; // SparklyPaper // "Paper"; // Paper
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index e011cfcdda2e0a609d4158b0454bdf046b04c9d9..3b28e079dcfba5ca3de2aad903f95c142e73e6a3 100644
|
||||
index 9f7ed337463cc9bb370a5541d9de5cd8f9c1a78a..404e5715a43068fb3338e7bcef52f8967e1e4bb4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -266,7 +266,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@@ -105,7 +104,7 @@ index 774556a62eb240da42e84db4502e2ed43495be17..22e504565de83f976c8b2996f0b2207b
|
||||
|
||||
if (stream != null) {
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..d502b0d45bc950a586049dd5cd242319da5ba721 100644
|
||||
index 9e638f72f180ff5ef63ec3dd6cf548c53f7bd4a5..7de20ceb7ba52178b1939deb01dbe3d51a52dfb0 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -126,12 +125,12 @@ index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..d502b0d45bc950a586049dd5cd242319
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -190,7 +190,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -189,7 +189,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
}
|
||||
// Paper end - Different message for short timeout
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to SparklyPaper!):" ); // SparklyPaper - branding changes // Paper
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
|
||||
@@ -5,13 +5,13 @@ Subject: [PATCH] SparklyPaper config files
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 58536aabf607015939a1326f80207c0a06eed8ff..b69860955a6c1efb68b17e1fc9b0c42771f40e15 100644
|
||||
index 68d268b6fff126e8645b6deec3fb549ea2286b77..d61cf0d713dcdef5a7081142838ee6960593fe95 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -218,6 +218,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this);
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
|
||||
@@ -219,6 +219,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
+ // SparklyPaper start
|
||||
+ try {
|
||||
+ net.sparklypower.sparklypaper.configs.SparklyPaperConfigUtils.INSTANCE.init((java.io.File) options.valueOf("sparklypaper-settings"));
|
||||
@@ -21,25 +21,25 @@ index 58536aabf607015939a1326f80207c0a06eed8ff..b69860955a6c1efb68b17e1fc9b0c427
|
||||
+ }
|
||||
+ net.sparklypower.sparklypaper.SparklyPaperCommands.INSTANCE.registerCommands(this);
|
||||
+ // SparklyPaper end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 0b56e5f7f18fc4286992af22d402205b771165a3..f5e3c87581cbdc762806ad4412b68d3c84612b88 100644
|
||||
index 19f23a6c8fb5c02843c27fb8a242ec9d0d1b538b..e199c852f4c493dbe6ab776d18b91a53e5a36f7c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -179,6 +179,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end
|
||||
@@ -173,6 +173,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end - add paper world config
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
+ public net.sparklypower.sparklypaper.configs.SparklyPaperWorldConfig sparklyPaperConfig; // SparklyPaper
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -216,6 +217,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor
|
||||
@@ -210,6 +211,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
+ this.sparklyPaperConfig = net.sparklypower.sparklypaper.configs.SparklyPaperConfigUtils.INSTANCE.getWorldSettings(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // SparklyPaper
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
@@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..bc0ec96f91f7c9ab9f9a865a50f69707
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 3b28e079dcfba5ca3de2aad903f95c142e73e6a3..64044cb5888c72797c369b5d015297677b20419a 100644
|
||||
index 404e5715a43068fb3338e7bcef52f8967e1e4bb4..3754360b3be729e7fa03697543e219506a5499b4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -112,6 +112,7 @@ import net.minecraft.world.level.storage.PrimaryLevelData;
|
||||
@@ -127,7 +127,7 @@ index 3b28e079dcfba5ca3de2aad903f95c142e73e6a3..64044cb5888c72797c369b5d01529767
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -1037,6 +1038,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1054,6 +1055,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);
|
||||
@@ -135,7 +135,7 @@ index 3b28e079dcfba5ca3de2aad903f95c142e73e6a3..64044cb5888c72797c369b5d01529767
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
|
||||
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
|
||||
@@ -1052,6 +1054,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1069,6 +1071,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
@@ -143,7 +143,7 @@ index 3b28e079dcfba5ca3de2aad903f95c142e73e6a3..64044cb5888c72797c369b5d01529767
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -1067,6 +1070,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1084,6 +1087,7 @@ public final class CraftServer implements Server {
|
||||
this.reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
|
||||
@@ -152,7 +152,7 @@ index 3b28e079dcfba5ca3de2aad903f95c142e73e6a3..64044cb5888c72797c369b5d01529767
|
||||
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index a74a8a027c99eef199c1a6a54232ac2c8ffb9d08..73a358912fccd70b350d75e857a2affc5480473a 100644
|
||||
index ce341f42b3a5e17fb6d1f7de8057e73137ae2a6e..8851fd0dbca2d788b16dec92a121ad00f209459a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -174,6 +174,14 @@ public class Main {
|
||||
|
||||
@@ -11,7 +11,7 @@ data is already available in the blockPosition struct, so we use that
|
||||
instead of re-doing the casting.
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
index 200ed770b57e1a9240abf0473968d4b85cbefe3c..0acc7cfc0fb0264dd76a58f7582e79d83fa040eb 100644
|
||||
index 850f75172e9efa72cabb8e5bd124b96a0b1a945f..3db1de70c76e1427e257d988d1a7f26e986b5617 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
|
||||
@@ -212,7 +212,7 @@ public final class MCUtil {
|
||||
@@ -24,10 +24,10 @@ index 200ed770b57e1a9240abf0473968d4b85cbefe3c..0acc7cfc0fb0264dd76a58f7582e79d8
|
||||
|
||||
public static long getCoordinateKey(final ChunkPos pair) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0c46a4aeafd03fbbfd590b0362d41bf2b1d5ca74..aa6045039450c4cce8d9481aa7f56867dd15c0fa 100644
|
||||
index 906eded9a2ab61737a30cfe89292a71237ce4eb7..b0b9e07da81ca0c2a0e915afbcd1a50a39e3bf20 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -307,7 +307,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -308,7 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
public double yo;
|
||||
public double zo;
|
||||
private Vec3 position;
|
||||
|
||||
@@ -11,15 +11,15 @@ now is just updating dirty map/decoration data.
|
||||
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 35674f92a67f93382103c2766df4b678ba5c862f..bfdd0ce9acfae75a403d3689b391dd8fff7416a0 100644
|
||||
index 529ab44baaf573b97cf7e89560c548642733188f..7ee0335b02741f6b06d0c697a19faf479db2ae4b 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -111,29 +111,42 @@ public class ServerEntity {
|
||||
|
||||
Entity entity = this.entity;
|
||||
|
||||
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Only tick item frames if players can see it
|
||||
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Only tick item frames if players can see it // Paper
|
||||
- if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame) { // Paper - Perf: Only tick item frames if players can see it
|
||||
+ if (!this.trackedPlayers.isEmpty() && entity instanceof ItemFrame frame && frame.cachedMapId != null) { // Paper - Perf: Only tick item frames if players can see it // Paper
|
||||
ItemFrame entityitemframe = (ItemFrame) entity;
|
||||
|
||||
if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
|
||||
@@ -28,7 +28,7 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..bfdd0ce9acfae75a403d3689b391dd8f
|
||||
|
||||
- if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
|
||||
+ if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 /*&& itemstack.getItem() instanceof MapItem*/) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable // Paper - skip redundant getItem
|
||||
Integer integer = entityitemframe.cachedMapId; // Paper
|
||||
Integer integer = entityitemframe.cachedMapId; // Paper - Perf: Cache map ids on item frames
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(integer, this.level);
|
||||
|
||||
if (worldmap != null) {
|
||||
@@ -62,7 +62,7 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..bfdd0ce9acfae75a403d3689b391dd8f
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,6 +379,19 @@ public class ServerEntity {
|
||||
@@ -372,6 +385,19 @@ public class ServerEntity {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,13 +83,13 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..bfdd0ce9acfae75a403d3689b391dd8f
|
||||
|
||||
private void sendDirtyEntityData() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index 69912c5b300b67394dce3876d2d96872033cf156..bde22dcbc67211a62c2280b0c6cf5b85aa3b96eb 100644
|
||||
index 80303f9466b8c7097151be313afc9a383693d18a..4ddcda7783750e485e283a7f7df3f52c9bed5c45 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -483,6 +483,16 @@ public class ItemFrame extends HangingEntity {
|
||||
}
|
||||
this.setItem(ItemStack.fromBukkitCopy(event.getItemStack()));
|
||||
// Paper end
|
||||
// Paper end - Add PlayerItemFrameChangeEvent
|
||||
+ // Paper start - add decoration and mark everything dirty for other players who are already tracking this frame
|
||||
+ final ItemStack item = this.getItem();
|
||||
+ if (item.is(Items.FILLED_MAP)) {
|
||||
@@ -104,7 +104,7 @@ index 69912c5b300b67394dce3876d2d96872033cf156..bde22dcbc67211a62c2280b0c6cf5b85
|
||||
if (!player.getAbilities().instabuild) {
|
||||
itemstack.shrink(1);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
index e4c4948e076cd64686dfd16ae0568fafc1437140..fec7d474df8cfc8c36f5a69faac7ad03ad648d45 100644
|
||||
index 45269115e63cfc3bd7dc740a5694e2cc7c35bcb1..ad0c4660dd15a7dc6cf3639223dda5d704f96a4c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
||||
@@ -67,6 +67,16 @@ public class MapItemSavedData extends SavedData {
|
||||
|
||||
@@ -9,10 +9,10 @@ The "distanceToSqr" call is a bit expensive, so avoiding it is pretty nice, arou
|
||||
We could also check if the x,y,z coordinates are equal, but for now, let's just keep the identity check, which also helps us since Minecraft's code does reuse the original delta movement Vec3 object
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index bfdd0ce9acfae75a403d3689b391dd8fff7416a0..71d6f63feb8548181882c481f53c810baf8c1e07 100644
|
||||
index 7ee0335b02741f6b06d0c697a19faf479db2ae4b..056b3dd172a7b8d1bf5ac76d88d373fae0b85a8f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -215,12 +215,14 @@ public class ServerEntity {
|
||||
@@ -221,12 +221,14 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Skip dirty stats copy when requesting player stats
|
||||
There's literally only one getDirty call. Because the map was only retrieved once, we don't actually need to create a copy of the map just to iterate it, we can just access it directly and clear it manually after use.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
index 9bb8d4d7be6a937980aa653db82be084d066a563..e93722fd8b7a97037914beddbace9a0de5dca8b4 100644
|
||||
index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..8685cb5bbfa26b0d77c6fdde8cf2dc8bebc06585 100644
|
||||
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -85,12 +85,16 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
@@ -90,12 +90,16 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
this.dirty.add(stat);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ index 9bb8d4d7be6a937980aa653db82be084d066a563..e93722fd8b7a97037914beddbace9a0d
|
||||
|
||||
public void parseLocal(DataFixer dataFixer, String json) {
|
||||
try {
|
||||
@@ -238,7 +242,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
@@ -243,7 +247,7 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
|
||||
public void sendStats(ServerPlayer player) {
|
||||
Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap();
|
||||
@@ -35,7 +35,7 @@ index 9bb8d4d7be6a937980aa653db82be084d066a563..e93722fd8b7a97037914beddbace9a0d
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Stat<?> statistic = (Stat) iterator.next();
|
||||
@@ -246,6 +250,8 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
@@ -251,6 +255,8 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
object2intmap.put(statistic, this.getValue(statistic));
|
||||
}
|
||||
|
||||
|
||||
@@ -73,18 +73,20 @@ index 62484ebf4550b05182f693a3180bbac5d5fd906d..67800e426445060a8343e27a7452b8d7
|
||||
throw new IllegalStateException("Ticking retired scheduler");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f1c65967b74e79452870438eea0942cc700fe0e9..4820e5ae050966d89a0d0b587c83537d4a1e1393 100644
|
||||
index 8f250966ab5e4576e3a57beba2e417d53713e84e..3aab37ae2ef5a359b09c885f0988aa7be84b0159 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper start - lag compensation
|
||||
public static final long SERVER_INIT = System.nanoTime();
|
||||
// Paper end - lag compensation
|
||||
@@ -312,7 +312,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
-
|
||||
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
|
||||
+
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -1640,6 +1641,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
@@ -1637,6 +1638,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@@ -101,9 +103,9 @@ index f1c65967b74e79452870438eea0942cc700fe0e9..4820e5ae050966d89a0d0b587c83537d
|
||||
+ }
|
||||
+ /*
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final Entity entity : level.getEntityLookup().getAllCopy()) {
|
||||
for (final Entity entity : level.getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1651,6 +1664,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1648,6 +1661,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -113,7 +115,7 @@ index f1c65967b74e79452870438eea0942cc700fe0e9..4820e5ae050966d89a0d0b587c83537d
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
this.profiler.push("commandFunctions");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 1727e932ac6b9ca09b5df96f9547ff125114e15a..bcb1f764702dce94e9989c2a3cb745ff6e60753b 100644
|
||||
index 8698104e3eb98e2cc5da5de87a8f538860c1d91d..72debf1e3da28531420e13b3c2eb8ef0cfe070d0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -68,7 +68,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
|
||||
@@ -4,8 +4,21 @@ Date: Mon, 20 Nov 2023 20:17:56 -0300
|
||||
Subject: [PATCH] Blazingly Simple Farm Checks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3aab37ae2ef5a359b09c885f0988aa7be84b0159..ccf79aef050e2ef1ece1631e5bb165ef7fe3bca6 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -313,7 +313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
-
|
||||
+
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
index 9550ce8588c6aa3ba4cbbbb86912eae2b452eb01..622413a5f9a472a759e9cc869ee7cdb223880188 100644
|
||||
index 5b96d1ae4bd8546311e986bc312b1f85883a67f4..ec20b138642b080c9d0050cbdb8c6d593264ecd5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
|
||||
@@ -81,6 +81,57 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
|
||||
@@ -76,7 +89,7 @@ index 9550ce8588c6aa3ba4cbbbb86912eae2b452eb01..622413a5f9a472a759e9cc869ee7cdb2
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
index 59bbdead2ebd8965d222540c7243dde051bbcc4b..e7cc73fe8f7aaa1f66c598c9018983319db4213f 100644
|
||||
index 6e4c852c93f2418ea69e485ed3a10cbe3a6e3bd2..fc2703fcf1639a85518330e4ffcd0c23fd6e118f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
|
||||
@@ -92,6 +92,19 @@ public class FarmBlock extends Block {
|
||||
@@ -96,8 +109,8 @@ index 59bbdead2ebd8965d222540c7243dde051bbcc4b..e7cc73fe8f7aaa1f66c598c901898331
|
||||
+ return;
|
||||
+ }
|
||||
+ // SparklyPaper end
|
||||
if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper
|
||||
if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper
|
||||
if (i > 0 && world.paperConfig().tickRates.wetFarmland != 1 && (world.paperConfig().tickRates.wetFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.wetFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
if (i == 0 && world.paperConfig().tickRates.dryFarmland != 1 && (world.paperConfig().tickRates.dryFarmland < 1 || (net.minecraft.server.MinecraftServer.currentTick + pos.hashCode()) % world.paperConfig().tickRates.dryFarmland != 0)) { return; } // Paper - Configurable random tick rates for blocks
|
||||
|
||||
@@ -150,7 +163,7 @@ public class FarmBlock extends Block {
|
||||
return world.getBlockState(pos.above()).is(BlockTags.MAINTAINS_FARMLAND);
|
||||
@@ -105,7 +118,7 @@ index 59bbdead2ebd8965d222540c7243dde051bbcc4b..e7cc73fe8f7aaa1f66c598c901898331
|
||||
|
||||
- private static boolean isNearWater(LevelReader world, BlockPos pos) {
|
||||
+ public static boolean isNearWater(LevelReader world, BlockPos pos) { // SparklyPaper - make public for the Blazingly simple farm checks
|
||||
// Paper start - remove abstract block iteration
|
||||
// Paper start - Perf: remove abstract block iteration
|
||||
int xOff = pos.getX();
|
||||
int yOff = pos.getY();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/StemBlock.java b/src/main/java/net/minecraft/world/level/block/StemBlock.java
|
||||
|
||||
@@ -10,22 +10,22 @@ Caches when Bat's spooky season starts and ends, and when Skeleton and Zombies h
|
||||
Avoids unnecessary date checks, even tho that this shouldn't really improve performance that much... unless you have a lot of bats/zombies/skeletons spawning.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 4820e5ae050966d89a0d0b587c83537d4a1e1393..f43060555bf02f13268b284606045fce2b3e911a 100644
|
||||
index ccf79aef050e2ef1ece1631e5bb165ef7fe3bca6..f2edb992729325140d4b2f6f347c3bd8c6394a77 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -315,6 +315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public static final long SERVER_INIT = System.nanoTime();
|
||||
// Paper end - lag compensation
|
||||
@@ -313,6 +313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
+ public net.sparklypower.sparklypaper.HalloweenManager halloweenManager = new net.sparklypower.sparklypaper.HalloweenManager(); // SparklyPaper - Spooky month optimizations
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index b69860955a6c1efb68b17e1fc9b0c42771f40e15..734fd1ced38a16649177bb941e76d9ca66dceac5 100644
|
||||
index d61cf0d713dcdef5a7081142838ee6960593fe95..4c549a2656183e4e4bbaf3f7d5169f3d258e81ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -227,6 +227,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -228,6 +228,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
net.sparklypower.sparklypaper.SparklyPaperCommands.INSTANCE.registerCommands(this);
|
||||
// SparklyPaper end
|
||||
@@ -33,11 +33,11 @@ index b69860955a6c1efb68b17e1fc9b0c42771f40e15..734fd1ced38a16649177bb941e76d9ca
|
||||
+ halloweenManager.startHalloweenEpochTask();
|
||||
+ halloweenManager.waitUntilEpochHasBeenUpdated();
|
||||
+ // SparklyPaper end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // Paper - init PaperBrigadierProvider
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..2588e7eb1f55d3f01f4f8d794a59f3ba16f5985a 100644
|
||||
index 44fa2d4f90389f5526746bd94a2450c03340bd0b..ed4e7673bfcc02d077b61cab5898f4199ada4d03 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
||||
@@ -231,7 +231,7 @@ public class Bat extends AmbientCreature {
|
||||
@@ -67,11 +67,11 @@ index 6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba..2588e7eb1f55d3f01f4f8d794a59f3ba
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index b319021b22c5dceba6199ed27814b2dcf47b8d50..4e7f19215bafc8ff6b06abc08076a154df5307aa 100644
|
||||
index 586e3e92ccc275446df6dbbff9bf010a37a9aa8f..aaab68a2e5f28b4da0cb5bb7bca42ac08fa9d7bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -162,10 +162,12 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper
|
||||
this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper - Add world settings for mobs picking up loot
|
||||
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
|
||||
LocalDate localdate = LocalDate.now();
|
||||
- int i = localdate.get(ChronoField.DAY_OF_MONTH);
|
||||
@@ -87,7 +87,7 @@ index b319021b22c5dceba6199ed27814b2dcf47b8d50..4e7f19215bafc8ff6b06abc08076a154
|
||||
this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 753defa8f8b48d004a2a53b2fc322fd9c083d95e..cc7073efaa9984c95b125878df94556b1e865c7a 100644
|
||||
index 5c40e994007dbf46ebc12c1e6a6ca90379471b74..5a7919f05f0f4785d3ac98df067a53c53a7d4f73 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -553,10 +553,11 @@ public class Zombie extends Monster {
|
||||
|
||||
@@ -11,7 +11,7 @@ So instead of paying the price on each tick, we pay the price when the chunk is
|
||||
Which, if you think about it, is actually better, since we tick chunks more than we load chunks
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
index 17ba07cbd4792f63d88ce29d00da280f30c4abff..8e8aad958c96fa1df3d906ec120a89adecae38c4 100644
|
||||
index f164256d59b761264876ca0c85f812d101bfd5de..10465a33d90a1e43b9dbd7764c895dd39ef11b1a 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
@@ -106,6 +106,14 @@ public final class NearbyPlayers {
|
||||
@@ -30,10 +30,10 @@ index 17ba07cbd4792f63d88ce29d00da280f30c4abff..8e8aad958c96fa1df3d906ec120a89ad
|
||||
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..22213a52c5d546145d8b8de929af61e49d40375d 100644
|
||||
index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..53bce70f5cc14672d41618747d3919429896001f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -617,7 +617,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -609,7 +609,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
// Paper start - optimise chunk tick iteration
|
||||
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
|
||||
|
||||
@@ -14,11 +14,11 @@ This seems stupid, but it does seem that it improves the performance a bit, and
|
||||
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d9cd497bc1b654030ff1a597f038b6a881df9f6b..5c70baf0113004e5c5cbc2fd6a6d34c75cf65217 100644
|
||||
index 5a7278b093e37b95fb005ad5cc3cac90ac36f8fb..6f886a44c4320df46c86f62ce2d6f070a9ca877f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1435,7 +1435,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - check Y
|
||||
@@ -1425,7 +1425,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - Configurable entity tracking range by Y
|
||||
|
||||
// CraftBukkit start - respect vanish API
|
||||
- if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits
|
||||
@@ -27,19 +27,19 @@ index d9cd497bc1b654030ff1a597f038b6a881df9f6b..5c70baf0113004e5c5cbc2fd6a6d34c7
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index da63b4050be25dcb91d04df8c2fcc643cbb0751d..bd4ca61dd2bb238bb05a64724e9926ede7063eef 100644
|
||||
index 206520f6f20b2e48b1eefdd4edb26510b88e4c92..715d9811a58a9224c72a923e4a74c76bd2b1e5f0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -181,7 +181,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -187,7 +187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private boolean hasPlayedBefore = false;
|
||||
private final ConversationTracker conversationTracker = new ConversationTracker();
|
||||
private final Set<String> channels = new HashSet<String>();
|
||||
- private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
|
||||
+ private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // SparklyPaper - optimize canSee checks
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||
private int hash = 0;
|
||||
@@ -2138,9 +2138,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2141,9 +2141,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
||||
Date: Tue, 26 Dec 2023 16:45:54 -0300
|
||||
Subject: [PATCH] Revert "Fix MC-117075: TE Unload Lag Spike"
|
||||
Date: Sun, 18 Feb 2024 14:22:37 -0300
|
||||
Subject: [PATCH] Revert "Fix MC-117075: Block entity unload lag spike"
|
||||
|
||||
This reverts commit f5e3e154a00754c18d557401cfb8d4aad5bc45e9.
|
||||
This reverts commit f3453b204569ea865cc1d1302edb6d125e7f0cb3.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index fdb86e3bcd48c9a27ca91e105bcd035de5781923..ed736827a7741a54e3a712cf5fcd19195aebaee5 100644
|
||||
index e199c852f4c493dbe6ab776d18b91a53e5a36f7c..06fe87cf8bd0e48885ae5f1773bcd603b4335b5e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1281,8 +1281,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1276,8 +1276,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
- var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - use removeAll
|
||||
- toRemove.add(null);
|
||||
- var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
|
||||
- toRemove.add(null); // Paper - Fix MC-117075
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1291,7 +1289,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1286,7 +1284,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
- toRemove.add(tickingblockentity); // Paper - use removeAll
|
||||
- toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
|
||||
+ this.blockEntityTickers.remove(this.tileTickPosition--);
|
||||
// Spigot end
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
@@ -1302,7 +1300,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1297,7 +1295,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end - execute chunk tasks during tick
|
||||
}
|
||||
}
|
||||
- this.blockEntityTickers.removeAll(toRemove);
|
||||
- this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
this.timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
@@ -8,19 +8,19 @@ We replaced the `blockEntityTickers` list with a custom list based on fastutil's
|
||||
This is WAY FASTER than using `removeAll` with a list of entries to be removed, because we don't need to calculate the identity of each block entity to be removed, and we can jump directly to where the search should begin, giving a performance boost for small removals (because we don't need to loop thru the entire list to find what element should be removed) and a performance boost for big removals (no need to calculate the identity of each block entity).
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index ed736827a7741a54e3a712cf5fcd19195aebaee5..7681bce91247c13c8211ed6fd2a2998b815604f0 100644
|
||||
index 06fe87cf8bd0e48885ae5f1773bcd603b4335b5e..3558e39fe8bde6bb4133cfef211a5bf9251db0de 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -120,7 +120,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -115,7 +115,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public static final int TICKS_PER_DAY = 24000;
|
||||
public static final int MAX_ENTITY_SPAWN_Y = 20000000;
|
||||
public static final int MIN_ENTITY_SPAWN_Y = -20000000;
|
||||
- protected final List<TickingBlockEntity> blockEntityTickers = Lists.newArrayList(); public final int getTotalTileEntityTickers() { return this.blockEntityTickers.size(); } // Paper
|
||||
+ protected final net.sparklypower.sparklypaper.BlockEntityTickersList blockEntityTickers = new net.sparklypower.sparklypaper.BlockEntityTickersList(); public final int getTotalTileEntityTickers() { return this.blockEntityTickers.size(); } // Paper // SparklyPaper - optimize block entity removals
|
||||
- public final List<TickingBlockEntity> blockEntityTickers = Lists.newArrayList(); // Paper - public
|
||||
+ public final net.sparklypower.sparklypaper.BlockEntityTickersList blockEntityTickers = new net.sparklypower.sparklypaper.BlockEntityTickersList(); // Paper - public // SparklyPaper - optimize block entity removals
|
||||
protected final NeighborUpdater neighborUpdater;
|
||||
private final List<TickingBlockEntity> pendingBlockEntityTickers = Lists.newArrayList();
|
||||
private boolean tickingBlockEntities;
|
||||
@@ -1289,7 +1289,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1284,7 +1284,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
@@ -29,7 +29,7 @@ index ed736827a7741a54e3a712cf5fcd19195aebaee5..7681bce91247c13c8211ed6fd2a2998b
|
||||
// Spigot end
|
||||
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
||||
tickingblockentity.tick();
|
||||
@@ -1300,7 +1300,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1295,7 +1295,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Paper end - execute chunk tasks during tick
|
||||
}
|
||||
}
|
||||
@@ -144,109 +144,3 @@ index 0000000000000000000000000000000000000000..7affec7e343c39a83390ae13ce23f3bf
|
||||
+ size = j;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/kotlin/net/sparklypower/sparklypaper/BlockEntityTickersList.java b/src/main/kotlin/net/sparklypower/sparklypaper/BlockEntityTickersList.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7affec7e343c39a83390ae13ce23f3bfa0db1eb6
|
||||
--- /dev/null
|
||||
+++ b/src/main/kotlin/net/sparklypower/sparklypaper/BlockEntityTickersList.java
|
||||
@@ -0,0 +1,100 @@
|
||||
+package net.sparklypower.sparklypaper;
|
||||
+
|
||||
+import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
+import net.minecraft.world.level.block.entity.TickingBlockEntity;
|
||||
+
|
||||
+import java.util.Arrays;
|
||||
+import java.util.Collection;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.Set;
|
||||
+
|
||||
+/**
|
||||
+ * A list for ServerLevel's blockEntityTickers
|
||||
+ *
|
||||
+ * This list is behaves identically to ObjectArrayList, but it has an additional method, `removeAllByIndex`, that allows a list of integers to be passed indicating what
|
||||
+ * indexes should be deleted from the list
|
||||
+ *
|
||||
+ * This is faster than using removeAll, since we don't need to compare the identity of each block entity, and faster than looping thru each index manually and deleting with remove,
|
||||
+ * since we don't need to resize the array every single remove.
|
||||
+ */
|
||||
+public final class BlockEntityTickersList extends ObjectArrayList<TickingBlockEntity> {
|
||||
+ private final IntOpenHashSet toRemove = new IntOpenHashSet();
|
||||
+ private int startSearchFromIndex = -1;
|
||||
+
|
||||
+ /** Creates a new array list with {@link #DEFAULT_INITIAL_CAPACITY} capacity. */
|
||||
+ public BlockEntityTickersList() {
|
||||
+ super();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Creates a new array list and fills it with a given collection.
|
||||
+ *
|
||||
+ * @param c a collection that will be used to fill the array list.
|
||||
+ */
|
||||
+ public BlockEntityTickersList(final Collection<? extends TickingBlockEntity> c) {
|
||||
+ super(c);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Marks an entry as removed
|
||||
+ *
|
||||
+ * @param index the index of the item on the list to be marked as removed
|
||||
+ */
|
||||
+ public void markAsRemoved(final int index) {
|
||||
+ // The block entities list always loop starting from 0, so we only need to check if the startSearchFromIndex is -1 and that's it
|
||||
+ if (this.startSearchFromIndex == -1)
|
||||
+ this.startSearchFromIndex = index;
|
||||
+ this.toRemove.add(index);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Removes elements that have been marked as removed.
|
||||
+ */
|
||||
+ public void removeMarkedEntries() {
|
||||
+ if (this.startSearchFromIndex == -1) // No entries in the list, skip
|
||||
+ return;
|
||||
+
|
||||
+ removeAllByIndex(startSearchFromIndex, toRemove);
|
||||
+ toRemove.clear();
|
||||
+ this.startSearchFromIndex = -1; // Reset the start search index
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Removes elements by their index.
|
||||
+ */
|
||||
+ private void removeAllByIndex(final int startSearchFromIndex, final IntOpenHashSet c) { // can't use Set<Integer> because we want to avoid autoboxing when using contains
|
||||
+ final int requiredMatches = c.size();
|
||||
+ if (requiredMatches == 0)
|
||||
+ return; // exit early, we don't need to do anything
|
||||
+
|
||||
+ final Object[] a = this.a;
|
||||
+ int j = startSearchFromIndex;
|
||||
+ int matches = 0;
|
||||
+ for (int i = startSearchFromIndex; i < size; i++) { // If the user knows the first index to be removed, we can skip a lot of unnecessary comparsions
|
||||
+ if (!c.contains(i)) {
|
||||
+ // TODO: It can be possible to optimize this loop by tracking the start/finish and then using arraycopy to "skip" the elements,
|
||||
+ // this would optimize cases where the index to be removed are far apart, HOWEVER it does have a big performance impact if you are doing
|
||||
+ // "arraycopy" for each element
|
||||
+ a[j++] = a[i];
|
||||
+ } else {
|
||||
+ matches++;
|
||||
+ }
|
||||
+
|
||||
+ if (matches == requiredMatches) { // Exit the loop if we already removed everything, we don't need to check anything else
|
||||
+ // We need to update the final size here, because we know that we already found everything!
|
||||
+ // Because we know that the size must be currentSize - requiredMatches (because we have matched everything), let's update the value
|
||||
+ // However, we need to copy the rest of the stuff over
|
||||
+ if (i != (size - 1)) { // If it isn't the last index...
|
||||
+ // i + 1 because we want to copy the *next* element over
|
||||
+ // and the size - i - 1 is because we want to get the current size, minus the current index (which is i), and then - 1 because we want to copy -1 ahead (remember, we are adding +1 to copy the *next* element)
|
||||
+ System.arraycopy(a, i + 1, a, j, size - i - 1);
|
||||
+ }
|
||||
+ j = size - requiredMatches;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ Arrays.fill(a, j, size, null);
|
||||
+ size = j;
|
||||
+ }
|
||||
+}
|
||||
|
||||
@@ -12,10 +12,10 @@ But here's the thing: We don't care if we have a small performance penalty if th
|
||||
And finally, we also cache the chunk's coordinate key when creating the block entity, which is actually "free" because we just reuse the already cached chunk coordinate key from the chunk!
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 7681bce91247c13c8211ed6fd2a2998b815604f0..608259c6092f5353e818b5fbeb0e1a5249ed136b 100644
|
||||
index 3558e39fe8bde6bb4133cfef211a5bf9251db0de..1008f136ec24efc588b41fe8bf313c926ca000ed 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -1281,6 +1281,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1276,6 +1276,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
|
||||
int tilesThisCycle = 0;
|
||||
@@ -26,7 +26,7 @@ index 7681bce91247c13c8211ed6fd2a2998b815604f0..608259c6092f5353e818b5fbeb0e1a52
|
||||
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
||||
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
||||
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
||||
@@ -1291,13 +1295,25 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1286,13 +1290,25 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
tilesThisCycle--;
|
||||
this.blockEntityTickers.markAsRemoved(this.tileTickPosition); // this.blockEntityTickers.remove(this.tileTickPosition--); // SparklyPaper - optimize block entity removals
|
||||
// Spigot end
|
||||
@@ -65,7 +65,7 @@ index 28e3b73507b988f7234cbf29c4024c88180d0aef..427cf73383155c52bca8fb4b32f43029
|
||||
+ long getChunkCoordinateKey(); // SparklyPaper - optimize tickBlockEntities
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index fa170cc1ce7011d201295b89718292d696c7fc24..1338f91a85f5db6ce78705a0c48bec8a449a6220 100644
|
||||
index 6ec3fc801453fd54c25b642e6fa71c19b463311d..91b538f047428b8836f7ad3b62a0586fb7beb9ec 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -73,6 +73,13 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -82,7 +82,7 @@ index fa170cc1ce7011d201295b89718292d696c7fc24..1338f91a85f5db6ce78705a0c48bec8a
|
||||
};
|
||||
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
|
||||
public boolean loaded;
|
||||
@@ -1090,7 +1097,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1089,7 +1096,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
}
|
||||
|
||||
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
|
||||
@@ -91,7 +91,7 @@ index fa170cc1ce7011d201295b89718292d696c7fc24..1338f91a85f5db6ce78705a0c48bec8a
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -1141,6 +1148,13 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1140,6 +1147,13 @@ public class LevelChunk extends ChunkAccess {
|
||||
public String toString() {
|
||||
return this.ticker + " <wrapped>";
|
||||
}
|
||||
@@ -105,7 +105,7 @@ index fa170cc1ce7011d201295b89718292d696c7fc24..1338f91a85f5db6ce78705a0c48bec8a
|
||||
}
|
||||
|
||||
private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
|
||||
@@ -1148,10 +1162,12 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1147,10 +1161,12 @@ public class LevelChunk extends ChunkAccess {
|
||||
private final T blockEntity;
|
||||
private final BlockEntityTicker<T> ticker;
|
||||
private boolean loggedInvalidBlockState;
|
||||
@@ -119,7 +119,7 @@ index fa170cc1ce7011d201295b89718292d696c7fc24..1338f91a85f5db6ce78705a0c48bec8a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1214,5 +1230,12 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1213,5 +1229,12 @@ public class LevelChunk extends ChunkAccess {
|
||||
|
||||
return "Level ticker for " + s + "@" + this.getPos();
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..601198a33adb29316b0617d5390d1620
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index f43060555bf02f13268b284606045fce2b3e911a..f34a9d3a255ee72e2c467376bd1f7bc2a1309443 100644
|
||||
index f2edb992729325140d4b2f6f347c3bd8c6394a77..2de67af8952f5299476c1eaa979fdcb3fe7d3203 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1730,7 +1730,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1727,7 +1727,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
try {
|
||||
worldserver.timings.doTick.startTiming(); // Spigot
|
||||
@@ -77,10 +77,10 @@ index f43060555bf02f13268b284606045fce2b3e911a..f34a9d3a255ee72e2c467376bd1f7bc2
|
||||
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
||||
regionManager.recalculateRegions();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 676087c3addd712939c865b39ddb5d9f0bc7ce25..6999dde76bb98f9a1cb74a24fa518d705421e58e 100644
|
||||
index 6934e9dac0d69c043b73b7c46d59f2d39b37c67f..9a1f5ce72dbe116c31d9f72a8ad2dfaedf962d7d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -692,6 +692,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -686,6 +686,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
// Paper end - optimise nearby player retrieval
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user