Skip to content

Commit

Permalink
Update Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jun 13, 2024
1 parent 2a7fc43 commit e234432
Show file tree
Hide file tree
Showing 28 changed files with 98 additions and 103 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ version=1.20.6-R0.1-SNAPSHOT

mcVersion=1.20.6
org.gradle.jvmargs=-Xmx2G
paperRef=bd5867a96f792f0eb32c1d249bb4bbc1d8338d14
paperRef=79e2cb620ef03539390d97940824b38b707918f5
preVersion=false
updatingMinecraft=true
46 changes: 21 additions & 25 deletions patches/api/0007-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,10 @@ index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..00000000000000000000000000000000
- }
-}
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
deleted file mode 100644
index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..0000000000000000000000000000000000000000
index 2d87237ea99d42c6ce896d52a1b2e5c3ec4d4568..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
--- a/src/main/java/co/aikar/timings/TimingHistory.java
+++ /dev/null
@@ -1,355 +0,0 @@
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -1,352 +0,0 @@
-/*
- * This file is licensed under the MIT License (MIT).
- *
Expand Down Expand Up @@ -878,17 +877,14 @@ index 02e88db63be2d5e31da6b65157ba7b971b1f10f3..00000000000000000000000000000000
- }
- }
- ),
- toObjectMapper(input.tileEntityCounts.entrySet(),
- new Function<Map.Entry<Material, Counter>, JSONPair>() {
- @NotNull
- @Override
- public JSONPair apply(Map.Entry<Material, Counter> entry) {
- tileEntityTypeSet.add(entry.getKey());
- return pair(
- String.valueOf(entry.getKey().ordinal()),
- entry.getValue().count()
- );
- }
- toObjectMapper(
- input.tileEntityCounts.entrySet(),
- entry -> {
- tileEntityTypeSet.add(entry.getKey());
- return pair(
- String.valueOf(entry.getKey().ordinal()),
- entry.getValue().count()
- );
- }
- )
- );
Expand Down Expand Up @@ -2114,26 +2110,26 @@ index abe256e1e45ce28036da4aa1586715bc8a1a3414..b359306500e640f4b0761ae9aa996cf6
}

diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..014f9c30440981d251e54b289682015baae1fe90 100644
index 5df19bd701c67506689fc7f49d91f99ebfbc83f0..940565704d0e8914a76cf25daf7d1f5ecd99bad4 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -38,7 +38,6 @@ public class SimpleCommandMap implements CommandMap {
@@ -39,7 +39,6 @@ public class SimpleCommandMap implements CommandMap {
register("bukkit", new VersionCommand("version"));
register("bukkit", new ReloadCommand("reload"));
//register("bukkit", new PluginsCommand("plugins")); // Paper
- register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper
}

public void setFallbackCommands() {
@@ -70,7 +69,6 @@ public class SimpleCommandMap implements CommandMap {
@@ -71,7 +70,6 @@ public class SimpleCommandMap implements CommandMap {
*/
@Override
public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) {
- command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper
label = label.toLowerCase(java.util.Locale.ENGLISH).trim();
fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim();
label = label.toLowerCase(Locale.ROOT).trim();
fallbackPrefix = fallbackPrefix.toLowerCase(Locale.ROOT).trim();
boolean registered = register(label, command, false, fallbackPrefix);
@@ -152,17 +150,9 @@ public class SimpleCommandMap implements CommandMap {
@@ -153,17 +151,9 @@ public class SimpleCommandMap implements CommandMap {
return false;
}

Expand All @@ -2152,10 +2148,10 @@ index c3a9cf65db73ed534bf20996c7f05b5eb0aaebe1..014f9c30440981d251e54b289682015b
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
//target.timings.stopTiming(); // Spigot // Paper
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 07a9c9e254188c251165ca84c8e961fccda01175..9eb02f8fb4d581349c4752ccb396dc4fdbd940c3 100644
index 003bece642b682985625db93cad93026352bfc66..308245714a0a830d92568f7bb1f4bb9c45828345 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -719,12 +719,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -720,12 +720,7 @@ public final class SimplePluginManager implements PluginManager {
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
}

Expand All @@ -2169,7 +2165,7 @@ index 07a9c9e254188c251165ca84c8e961fccda01175..9eb02f8fb4d581349c4752ccb396dc4f
}

@NotNull
@@ -954,8 +949,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -955,8 +950,7 @@ public final class SimplePluginManager implements PluginManager {

@Override
public boolean useTimings() {
Expand All @@ -2179,7 +2175,7 @@ index 07a9c9e254188c251165ca84c8e961fccda01175..9eb02f8fb4d581349c4752ccb396dc4f
}

/**
@@ -964,7 +958,6 @@ public final class SimplePluginManager implements PluginManager {
@@ -965,7 +959,6 @@ public final class SimplePluginManager implements PluginManager {
* @param use True if per event timing code should be used
*/
public void useTimings(boolean use) {
Expand Down
4 changes: 2 additions & 2 deletions patches/api/0008-Force-peaceful-mode-switch.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Subject: [PATCH] Force peaceful mode switch


diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 26622cafbb9811fafe18d5dd9b25f56960154772..260704ce884e7549279d8744524b18993661b6fa 100644
index fdb87adfb8d6eff2bfabe7a41398c53d15d4cd98..531a6cae97fe2a415cf906108a0899bf04e613d8 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -4317,6 +4317,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -4344,6 +4344,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
void setSendViewDistance(int viewDistance);
// Paper end - view distance api

Expand Down
4 changes: 2 additions & 2 deletions patches/api/0010-Bytebuf-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ index 98ca0f656ea3a5be30ad49bc7fb22c886adbef03..79ad3c362e5437b28e44270a9c7b8947
+ // Leaves end - Bytebuf API
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index f2e1b98880503a9933a20ebcf0ba91413c859a08..ee8bcc5b50bff84b18abed6f5e82c55899367827 100644
index eb34f22e973fe46529eb93f435f5bf7f85091404..ba79992f0c170ab1c0db402698feb5071fe8cf62 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3802,6 +3802,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3850,6 +3850,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
boolean isChunkSent(long chunkKey);
// Paper end

Expand Down
6 changes: 3 additions & 3 deletions patches/server/0001-Build-changes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ index 790bad0494454ca12ee152e3de6da3da634d9b20..c060857cb0551fff8f5033553b887f3a
private static final String BUILD_DEV = "DEV";

diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0ed42fa899721f83b598db05be1b5f321af3614a..9cd75d163e81f812e8dcd3c010b4a715d2bcf804 100644
index 3751c2a077bd13bac330b93c6efc2a640a17f4f2..2235e5cfd853216fd79cf26244f9f029af1fc3b4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1165,7 +1165,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand All @@ -186,7 +186,7 @@ index 0ed42fa899721f83b598db05be1b5f321af3614a..9cd75d163e81f812e8dcd3c010b4a715

public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 2eb9c584cc77237f1c82d880a51a3f8b51008d73..559649d0a134c29215f3783996fd80d81c149bec 100644
index ad967cc2283f902c76e48a59d59cf0dbdacbb5e3..422d87c1503340f3efe50785c4ad0cef6cf67702 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -231,9 +231,10 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
Expand Down Expand Up @@ -215,7 +215,7 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..3952428c02fe87477f4139f4fa983815

javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index e02102280ed1dc300191d19bbca8f00e17701753..9164d33b564970d83d11c6544db5697ff9eff32f 100644
index b86ba59158964f73abd6622341a9acb98a33fa44..1155fc80c0292c8d7efb21dbac3d984176fcaa2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -303,7 +303,7 @@ public class Main {
Expand Down
29 changes: 14 additions & 15 deletions patches/server/0003-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ index 57e76b53e5e314c3e6b8856010f7a84188121582..d6daa27a8d7aca00b181e90d789f4249
} catch (Exception exception) {
if (exception instanceof ReportedException) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9cd75d163e81f812e8dcd3c010b4a715d2bcf804..026dc226ace6b067df8987f10039d4c037c47124 100644
index 2235e5cfd853216fd79cf26244f9f029af1fc3b4..1f973ed9bb9c753b81979085a6fea45b65165fa3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,9 +3,6 @@ package net.minecraft.server;
Expand Down Expand Up @@ -1089,7 +1089,7 @@ index 9cd75d163e81f812e8dcd3c010b4a715d2bcf804..026dc226ace6b067df8987f10039d4c0
this.profiler.popPush("send chunks");
iterator = this.playerList.getPlayers().iterator();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 559649d0a134c29215f3783996fd80d81c149bec..340d1b6797d56e2ebdce2d8d7cae62780470e1b7 100644
index 422d87c1503340f3efe50785c4ad0cef6cf67702..340d1b6797d56e2ebdce2d8d7cae62780470e1b7 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -63,7 +63,6 @@ import org.apache.logging.log4j.Level;
Expand Down Expand Up @@ -1120,7 +1120,7 @@ index 559649d0a134c29215f3783996fd80d81c149bec..340d1b6797d56e2ebdce2d8d7cae6278
}
// Paper start
command.set(event.getCommand());
- if (event.getCommand().toLowerCase().startsWith("timings") && event.getCommand().toLowerCase().matches("timings (report|paste|get|merged|seperate)")) {
- if (event.getCommand().toLowerCase(java.util.Locale.ROOT).startsWith("timings") && event.getCommand().toLowerCase(java.util.Locale.ROOT).matches("timings (report|paste|get|merged|seperate)")) {
- org.bukkit.command.BufferedCommandSender sender = new org.bukkit.command.BufferedCommandSender();
- Waitable<String> waitable = new Waitable<>() {
- @Override
Expand Down Expand Up @@ -1222,7 +1222,7 @@ index 7fb9ba3dadb1eca4a1000ea8cf4d13fed2b7db1e..dc20b051d4f14ce4e0b5a0114e02d157

}
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index b99f50604bafecbc68835974c9ed0caa91911a40..256ad83f10e6df5d32959d38eeabc126b9b7b190 100644
index fcecfda569d2a8d6b8a7e228831f822fb7327748..ffab3e27c0d9da2a380a14b6f6ebb243a6fb5e8d 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -274,10 +274,8 @@ public class ServerChunkCache extends ChunkSource {
Expand Down Expand Up @@ -1255,13 +1255,12 @@ index b99f50604bafecbc68835974c9ed0caa91911a40..256ad83f10e6df5d32959d38eeabc126
}
// Paper end - Incremental chunk and player saving

@@ -472,26 +466,21 @@ public class ServerChunkCache extends ChunkSource {
@@ -472,26 +466,20 @@ public class ServerChunkCache extends ChunkSource {
@Override
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
this.level.getProfiler().push("purge");
- this.level.timings.doChunkMap.startTiming(); // Spigot
+ // this.level.timings.doChunkMap.startTiming(); // Spigot // Leaves - delete Timings
if (this.level.tickRateManager().runsNormally() || !tickChunks) {
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
this.distanceManager.purgeStaleTickets();
}

Expand All @@ -1283,7 +1282,7 @@ index b99f50604bafecbc68835974c9ed0caa91911a40..256ad83f10e6df5d32959d38eeabc126
this.level.getProfiler().pop();
this.clearCache();
}
@@ -507,13 +496,11 @@ public class ServerChunkCache extends ChunkSource {
@@ -507,13 +495,11 @@ public class ServerChunkCache extends ChunkSource {
gameprofilerfiller.push("pollingChunks");
gameprofilerfiller.push("filteringLoadedChunks");
// Paper - optimise chunk tick iteration
Expand All @@ -1297,15 +1296,15 @@ index b99f50604bafecbc68835974c9ed0caa91911a40..256ad83f10e6df5d32959d38eeabc126
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
int naturalSpawnChunkCount = k;
@@ -538,7 +525,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -538,7 +524,6 @@ public class ServerChunkCache extends ChunkSource {
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
}
// Paper end - Optional per player mob spawns
- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings

this.lastSpawnState = spawnercreature_d;
gameprofilerfiller.popPush("spawnAndTick");
@@ -647,19 +633,14 @@ public class ServerChunkCache extends ChunkSource {
@@ -647,19 +632,14 @@ public class ServerChunkCache extends ChunkSource {
}
}
// Paper end - optimise chunk tick iteration
Expand All @@ -1325,7 +1324,7 @@ index b99f50604bafecbc68835974c9ed0caa91911a40..256ad83f10e6df5d32959d38eeabc126
// Paper start - optimise chunk tick iteration
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
@@ -673,8 +654,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -673,8 +653,6 @@ public class ServerChunkCache extends ChunkSource {
}
}
// Paper end - optimise chunk tick iteration
Expand Down Expand Up @@ -1588,7 +1587,7 @@ index a46bf73c608641bf1f00fd55242de71a0f2ee06e..9b15a2a966de203ada8894a9354ff8e0
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ce01fe82dc1eaaf06ca317ddbc62b7d1b87a48b2..4506a2fe4e55e8372b71650f019c810998a69a33 100644
index 21e61bb75ac7ce468bc757633ce678b21bcb9deb..5b5d8d2430f2b92f56ea3fb0e9a35aa4b9aea48f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -150,7 +150,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
Expand Down Expand Up @@ -1816,7 +1815,7 @@ index 14ee7b5b9b804bebd4e2a846b238547a28a36035..33673bde99023af6a136270091959cca
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 9164d33b564970d83d11c6544db5697ff9eff32f..361763f59b33fdacbfe2523eb7a0fa0840fa7439 100644
index 1155fc80c0292c8d7efb21dbac3d984176fcaa2d..77dc69ecec095b4d4129913846a12e5c86f21df5 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -346,8 +346,8 @@ public class Main {
Expand Down Expand Up @@ -1974,10 +1973,10 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab3
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 4788a591f40f506d81b10fd9f6ab68f308a68e23..b39f7aa828b08d8403278700bf44a086af53fa78 100644
index f99353a60e3f236735ef6e2e6f13381b50ae9b7b..5e42a3392fa03813e3e58e80299625993c560396 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -219,7 +219,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -220,7 +220,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
// Paper start
@Override
public void reportTimings() {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0005-Update-version-fetcher-repo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..917ffaae401f3374d07d7fb7c024234a
if (data == null) {
return null;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index b39f7aa828b08d8403278700bf44a086af53fa78..db0e4b9bb8509727f924e0eb3ad007ebca423315 100644
index 5e42a3392fa03813e3e58e80299625993c560396..1fed83a95ae6f3fc805fe5c2e303f4089de194e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -502,7 +502,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -503,7 +503,7 @@ public final class CraftMagicNumbers implements UnsafeValues {

@Override
public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
Expand Down
Loading

0 comments on commit e234432

Please sign in to comment.