diff --git a/.gitignore b/.gitignore index 5fa7c456..6d157b29 100644 --- a/.gitignore +++ b/.gitignore @@ -14,19 +14,16 @@ target/site/surefire-report.html /patches/Akarin/** /patches/Purpur/** /patches/Empirecraft/** -/patches/Papercut/** +/patches/Rainforest/** /patches/Origami/** -/patches/Origami2/** !/patches/Purpur/server.txt !/patches/Purpur/api.txt !/patches/Empirecraft/server.txt !/patches/Empirecraft/api.txt !/patches/Akarin/server.txt !/patches/Akarin/api.txt -!/patches/Papercut/server.txt -!/patches/Papercut/api.txt +!/patches/Rainforest/server.txt +!/patches/Rainforest/api.txt !/patches/Origami/server.txt !/patches/Origami/api.txt -!/patches/Origami2/server.txt -!/patches/Origami2/api.txt yatopia-1.16.1-paperclip.jar diff --git a/.gitmodules b/.gitmodules index 63879fe3..db7d8c9a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,18 +18,9 @@ url = https://github.com/starlis/empirecraft.git branch = master update = merge -[submodule "Papercut"] - path = Papercut - url = https://github.com/Minevictus/Papercut.git - branch = ver/1.16 - update = merge [submodule "Origami"] path = Origami - url = https://github.com/MrIvanPlays/Origami/ - branch = master - update = merge -[submodule "Origami2"] - path = Origami2 url = https://github.com/Minebench/Origami.git - branch = 1.16 - update = merge \ No newline at end of file +[submodule "Rainforest"] + path = Rainforest + url = https://github.com/Proximyst/Rainforest.git diff --git a/Origami b/Origami index 7510dd6f..2a9f9291 160000 --- a/Origami +++ b/Origami @@ -1 +1 @@ -Subproject commit 7510dd6fb0bacf10d86de38599b24b3bee4771fa +Subproject commit 2a9f9291df1953d16b21cdac79d24f99a7c895f9 diff --git a/Origami2 b/Origami2 deleted file mode 160000 index 2a9f9291..00000000 --- a/Origami2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2a9f9291df1953d16b21cdac79d24f99a7c895f9 diff --git a/Papercut b/Papercut deleted file mode 160000 index f521235d..00000000 --- a/Papercut +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f521235dc2dd5deaf57631fe4aa52cbe4d06d64a diff --git a/Purpur b/Purpur index e486798b..9659c3a4 160000 --- a/Purpur +++ b/Purpur @@ -1 +1 @@ -Subproject commit e486798b7df7394bcdf8143b6c96cc0f8f8d4ec2 +Subproject commit 9659c3a4e5394194ec52a1d969087ab7bc7ee08e diff --git a/README.md b/README.md index e510d7d7..ca6b60fd 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,8 @@ ## Introduction ## * [EMC](https://github.com/starlis/empirecraft) * [Lithium](https://github.com/jellysquid3/lithium-fabric) * [Akarin](https://github.com/Akarin-project/Akarin) -* [Papercut](https://github.com/Minevictus/Papercut/) -* [Origami](https://github.com/MrIvanPlays/Origami) -* [Origami(2)](https://github.com/Minebench/Origami) +* [Rainforest](https://github.com/Proixmyst/Rainforest) +* [Origami](https://github.com/Minebench/Origami) * [Purpur](https://github.com/pl3xgaming/Purpur) Notable features are: Async & Optimized Pathfinding, Eigencraft Redstone (1.16), Async Advancements, Optimizer Pathfinder, Ability to slow down villager brains, Ability to disable collisions & collisionboxes, Major Hopper Performance Improvements, Nether TNT Bug + A lot more that all contribute towards ultimate performance. @@ -70,7 +69,7 @@ ## LICENSE Everything is licensed under the MIT license and is free to be used in your own fork. -See [EMC](https://github.com/starlis/empirecraft), [Lithium](https://github.com/jellysquid3/lithium-fabric), [Akarin](https://github.com/Akarin-project/Akarin), [Purpur](https://github.com/pl3xgaming/Purpur), [Papercut](https://github.com/Minevictus/Papercut/), [Origami](https://github.com/MrIvanPlays/Origami), [Origami(2)](https://github.com/Minebench/Origami), and [Tuinity](https://github.com/Spottedleaf/Tuinity) +See [EMC](https://github.com/starlis/empirecraft), [Lithium](https://github.com/jellysquid3/lithium-fabric), [Akarin](https://github.com/Akarin-project/Akarin), [Purpur](https://github.com/pl3xgaming/Purpur), [Rainforest](https://github.com/Proixmyst/Rainforest), [Origami](https://github.com/Minebench/Origami), and [Tuinity](https://github.com/Spottedleaf/Tuinity) for the license of material used/modified by this project. **To use this project you'll have to accept the Mojang EULA!** diff --git a/Rainforest b/Rainforest new file mode 160000 index 00000000..789cc1df --- /dev/null +++ b/Rainforest @@ -0,0 +1 @@ +Subproject commit 789cc1df962877c293716cc86ddeaf8ef06baffd diff --git a/Tuinity b/Tuinity index 650532ad..475ca7cb 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 650532ad9f1d74ee6324e4c63d5e0eaf2ccfdcf3 +Subproject commit 475ca7cbf73456c570adfb0573ea02b87ba5cef4 diff --git a/patches/Origami/api.txt b/patches/Origami/api.txt deleted file mode 100644 index 9af0df19..00000000 --- a/patches/Origami/api.txt +++ /dev/null @@ -1 +0,0 @@ -Remove-reload-command \ No newline at end of file diff --git a/patches/Origami/server.txt b/patches/Origami/server.txt index b5104344..a23f4f46 100644 --- a/patches/Origami/server.txt +++ b/patches/Origami/server.txt @@ -1 +1 @@ -Origami-config&Port-optimized-redstone-algorithm&Optimize-Pathfinder&Optimize-BehaviorController&Better-handling-of-tracker-timings-in-PlayerChunkMap \ No newline at end of file +Origami-Server-Config&Optimize-inventory-API-item-handling&Don-t-load-chunk-with-seed-based-feature-search&Hopper-Optimizations&Don-t-wake-up-entities-when-damage-event-is-cancelle diff --git a/patches/Origami2/api.txt b/patches/Origami2/api.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/patches/Origami2/server.txt b/patches/Origami2/server.txt deleted file mode 100644 index a23f4f46..00000000 --- a/patches/Origami2/server.txt +++ /dev/null @@ -1 +0,0 @@ -Origami-Server-Config&Optimize-inventory-API-item-handling&Don-t-load-chunk-with-seed-based-feature-search&Hopper-Optimizations&Don-t-wake-up-entities-when-damage-event-is-cancelle diff --git a/patches/Papercut/api.txt b/patches/Papercut/api.txt deleted file mode 100644 index 38835306..00000000 --- a/patches/Papercut/api.txt +++ /dev/null @@ -1 +0,0 @@ -Ban-EntityTrackerFixer \ No newline at end of file diff --git a/patches/Papercut/server.txt b/patches/Papercut/server.txt deleted file mode 100644 index f21d9336..00000000 --- a/patches/Papercut/server.txt +++ /dev/null @@ -1 +0,0 @@ -Add-Papercut-config&Apply-advancements-async \ No newline at end of file diff --git a/patches/Rainforest/server.txt b/patches/Rainforest/server.txt new file mode 100644 index 00000000..cd046ff0 --- /dev/null +++ b/patches/Rainforest/server.txt @@ -0,0 +1 @@ +Add-Rainforest-config&Apply-advancements-async&Optimize-Pathfinder-Remove-Streams-Optimized-collect&Optimize-redstone-algorithm&Async-navigation \ No newline at end of file diff --git a/patches/api/0001-Yatopia-API-Bundle.patch b/patches/api/0001-Yatopia-API-Bundle.patch index 1090f673..abbe0ed7 100644 --- a/patches/api/0001-Yatopia-API-Bundle.patch +++ b/patches/api/0001-Yatopia-API-Bundle.patch @@ -3,7 +3,7 @@ From: Bud Gidiere Date: Sat, 1 Aug 2020 15:51:06 -0500 Subject: [PATCH] Yatopia API Bundle -Lagging threshold + Purpur & Papercut & Origami config +Lagging threshold + Purpur & Rainforest & Origami config diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 62cc1c74c11f56dcbd1e24e9c5478497742e6351..0770736b4b52f325027671b43f74ad038c97ce7f 100644 @@ -26,19 +26,21 @@ index 62cc1c74c11f56dcbd1e24e9c5478497742e6351..0770736b4b52f325027671b43f74ad03 + // Purpur end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1f916988bd54e8386011b0d7e82fc9219939a881..6ff5c73f607d1c1a3bc392fda2c0e8b492aab579 100644 +index 1f916988bd54e8386011b0d7e82fc9219939a881..154c24a5a32450636b1c554df1bb5262fa05e9c8 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1463,6 +1463,31 @@ public interface Server extends PluginMessageRecipient { +@@ -1463,6 +1463,33 @@ public interface Server extends PluginMessageRecipient { } // Akarin end - Server config -+ // Papercut start ++ // Rainforest start + @NotNull -+ public org.bukkit.configuration.file.YamlConfiguration getPapercutConfig() ++ public org.bukkit.configuration.file.YamlConfiguration getRainforestConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ // Rainforest end ++ + // Purpur start + @NotNull + public org.bukkit.configuration.file.YamlConfiguration getPurpurConfig() { @@ -61,7 +63,7 @@ index 1f916988bd54e8386011b0d7e82fc9219939a881..6ff5c73f607d1c1a3bc392fda2c0e8b4 /** * Sends the component to the player * -@@ -1563,4 +1588,13 @@ public interface Server extends PluginMessageRecipient { +@@ -1563,4 +1590,13 @@ public interface Server extends PluginMessageRecipient { @NotNull com.destroystokyo.paper.entity.ai.MobGoals getMobGoals(); // Paper end diff --git a/patches/api/0005-Add-getLastTickMs-api.patch b/patches/api/0005-Add-getLastTickMs-api.patch index 80f21ca1..13e54ab9 100644 --- a/patches/api/0005-Add-getLastTickMs-api.patch +++ b/patches/api/0005-Add-getLastTickMs-api.patch @@ -20,10 +20,10 @@ index 0770736b4b52f325027671b43f74ad038c97ce7f..537e7fc9273b7e4ecc88eaad5b1a69d3 + // Yatopia end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 6ff5c73f607d1c1a3bc392fda2c0e8b492aab579..09a710dd500e404b382e75b62f1f2533da270ff3 100644 +index 154c24a5a32450636b1c554df1bb5262fa05e9c8..1eb935b3ba88918f04a075d47b0f514ddc8f2499 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1597,4 +1597,13 @@ public interface Server extends PluginMessageRecipient { +@@ -1599,4 +1599,13 @@ public interface Server extends PluginMessageRecipient { */ boolean isLagging(); // Purpur end diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index b38f3315..6ac42815 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -1,37 +1,98 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bud Gidiere -Date: Fri, 31 Jul 2020 22:39:43 -0500 +Date: Wed, 5 Aug 2020 14:21:05 -0500 Subject: [PATCH] Yatopia Server Fixes diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index 841a8d2b392acdcef90592b841cbbcb2237c6901..c9cd3f6e6bb779ecaf0412c21e0dc654321eb44f 100644 +index 841a8d2b392acdcef90592b841cbbcb2237c6901..1fbbc17f0aa2fc505b87840ffe91ff9a7b4a56fe 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -232,6 +232,8 @@ public class TimingsExport extends Thread { pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report , pair("akarin", mapAsJSON(Bukkit.spigot().getAkarinConfig(), null)) // Akarin - Server config -+ , pair("papercut", mapAsJSON(Bukkit.spigot().getPapercutConfig(), null)) // Papercut + , pair("origami", mapAsJSON(Bukkit.spigot().getOrigamiConfig(), null)) // Origami ++ , pair("rainforest", mapAsJSON(Bukkit.spigot().getRainforestConfig(), null)) // Rainforest )); new TimingsExport(listeners, parent, history).start(); diff --git a/src/main/java/co/aikar/timings/TimingsExport.java.rej b/src/main/java/co/aikar/timings/TimingsExport.java.rej deleted file mode 100644 -index aad8019b2c23b72bfad58a507671cd750bdc1a20..0000000000000000000000000000000000000000 +index 572780ca665c0fb254cc7431af3dd7759a94f26c..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingsExport.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java (rejected hunks) --@@ -231,6 +231,7 @@ public class TimingsExport extends Thread { +-@@ -230,6 +230,7 @@ public class TimingsExport extends Thread { +- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)), - pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), -- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report -- pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report --+ , pair("papercut", mapAsJSON(Bukkit.spigot().getPapercutConfig(), null)) // Papercut +- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)) +-+ , pair("rainforest", mapAsJSON(Bukkit.spigot().getRainforestConfig(), null)) // Rainforest - )); - - new TimingsExport(listeners, parent, history).start(); +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java +index f81bd67a323f2e72bdad76c52016993a0bf88307..98a898f8b8469969e5eb388edb818e519ff68681 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java ++++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java +@@ -439,18 +439,18 @@ public class PaperCommand extends Command { + ChunkProviderServer chunkProviderServer = world.getChunkProvider(); + + Collection entities = world.entitiesById.values(); +- entities.forEach(e -> { +- MinecraftKey key = e.getMinecraftKey(); +- if (e.shouldBeRemoved) return; // Paper ++ for (Entity entity : entities) { ++ MinecraftKey key = entity.getMinecraftKey(); ++ if (entity.shouldBeRemoved) continue; + + MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); +- ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); ++ ChunkCoordIntPair chunk = new ChunkCoordIntPair(entity.chunkX, entity.chunkZ); + info.left++; + info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); +- if (!chunkProviderServer.isInEntityTickingChunk(e)) { ++ if (!chunkProviderServer.isInEntityTickingChunk(entity)) { + nonEntityTicking.merge(key, Integer.valueOf(1), Integer::sum); + } +- }); ++ } + + if (names.size() == 1) { + MinecraftKey name = names.iterator().next(); +diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej b/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej +deleted file mode 100644 +index 8f31dba6a29514aad6e74e265bf000014cd1e3c3..0000000000000000000000000000000000000000 +--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej ++++ /dev/null +@@ -1,26 +0,0 @@ +-diff a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java (rejected hunks) +-@@ -429,18 +439,18 @@ public class PaperCommand extends Command { +- ChunkProviderServer chunkProviderServer = world.getChunkProvider(); +- +- Collection entities = world.entitiesById.values(); +-- entities.forEach(e -> { +-- MinecraftKey key = e.getMinecraftKey(); +-- if (e.shouldBeRemoved) return; // Paper +-+ for (Entity entity : entities) { +-+ MinecraftKey key = entity.getMinecraftKey(); +-+ if (entity.shouldBeRemoved) continue; +- +- MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); +-- ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); +-+ ChunkCoordIntPair chunk = new ChunkCoordIntPair(entity.getChunkX(), entity.getChunkZ()); +- info.left++; +- info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); +-- if (!chunkProviderServer.isInEntityTickingChunk(e)) { +-+ if (!chunkProviderServer.isInEntityTickingChunk(entity)) { +- nonEntityTicking.merge(key, Integer.valueOf(1), Integer::sum); +- } +-- }); +-+ } +- +- if (names.size() == 1) { +- MinecraftKey name = names.iterator().next(); diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java index dee9655b89d061ec8218ea2c54660c6003e8548f..253b73cfc597d4c7106d969be7b18c68166128ae 100644 --- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java @@ -62,26 +123,26 @@ index c9fa39c5b4b013b56720e339463ffcb5fd3c13f9..00000000000000000000000000000000 - - for (final NextTickListEntry toTick : this.toTickThisTick) { diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java -index fe7330fabe386966c2d203a190a00a785ea21be0..3b3c7053c73ac31eb00585c4e1fc19933467205a 100644 +index fe7330fabe386966c2d203a190a00a785ea21be0..bd107a376eaf660ba1ad61c035f8ed2d9d04749c 100644 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java +++ b/src/main/java/de/minebench/origami/OrigamiConfig.java @@ -112,6 +112,19 @@ public final class OrigamiConfig { config.addDefault("worlds.default." + path, Double.valueOf(dfl)); return config.getDouble("worlds." + worldName + "." + path, config.getDouble("worlds.default." + path, dfl)); } -+ ++ + public boolean tickEmptyHoppers = false; + public int fullHopperCooldown = 128; + private void hopperOptimizations() { + tickEmptyHoppers = getBoolean("tick-empty-hoppers", tickEmptyHoppers); + fullHopperCooldown = getInt("ticks-per.full-hopper-cooldown", fullHopperCooldown); + } -+ ++ + public boolean fastFeatureSearchDontLoad = false; + private void fastFeatureSearchDontLoad() { -+ fastFeatureSearchDontLoad = getBoolean("fast-feature-search-dont-load", fastFeatureSearchDontLoad); ++ fastFeatureSearchDontLoad = getBoolean("fast-feature-search-dont-load", fastFeatureSearchDontLoad); + } -+ ++ } } @@ -146,33 +207,68 @@ index d1152585c5f482e554966f965561626c78ac4d3a..00000000000000000000000000000000 - int l = this.chunkMapDistance.b(); - // Paper start - per player mob spawning diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 77b6e4dd34893f0959574f95078bc3fa6896e69c..ad1af2905e4f3e3d05a0dc63859a6e2f3bc43327 100644 +index 77b6e4dd34893f0959574f95078bc3fa6896e69c..7ac6ef0a125499de4b5e6a9ed80f963ba623b9f6 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -181,6 +181,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -181,6 +181,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer // Paper end com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config app.akarin.server.Config.init((java.io.File) options.valueOf("akarin-settings")); // Akarin - Server Config -+ us.minevict.papercut.PapercutConfig.init((java.io.File) options.valueOf("papercut-settings")); // Papercut -+ com.mrivanplays.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - server config ++ com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java.rej b/src/main/java/net/minecraft/server/DedicatedServer.java.rej deleted file mode 100644 -index 6b1dd973eb1e44e530d525981fbe4c698088b9b8..0000000000000000000000000000000000000000 +index 4c2d5b3e080c925d687733ec40d4fb4b22552c96..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/DedicatedServer.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java (rejected hunks) --@@ -171,6 +171,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +-@@ -170,6 +170,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +- com.destroystokyo.paper.PaperConfig.registerCommands(); - com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now - // Paper end -- com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config --+ us.minevict.papercut.PapercutConfig.init((java.io.File) options.valueOf("papercut-settings")); // Papercut +-+ com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest - - this.setPVP(dedicatedserverproperties.pvp); - this.setAllowFlight(dedicatedserverproperties.allowFlight); +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index 83e232deaeb78f0c97bce42d67fc220e8fb88368..bbcded1e80a4b0e4618affd77bcaa6e41589b9fe 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -758,7 +758,11 @@ public abstract class EntityInsentient extends EntityLiving { + this.goalSelector.doTick(); + //this.world.getMethodProfiler().exit(); // Akarin - remove caller + //this.world.getMethodProfiler().enter("navigation"); // Akarin - remove caller +- this.navigation.c(); ++ // Paper start - async navigation ++ if (this.navigation instanceof AsyncNavigationAbstract) ++ ((AsyncNavigationAbstract) this.navigation).asyncTick(); ++ else ++ // Paper end + //this.world.getMethodProfiler().exit(); // Akarin - remove caller + //this.world.getMethodProfiler().enter("mob tick"); // Akarin - remove caller + this.mobTick(); +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java.rej b/src/main/java/net/minecraft/server/EntityInsentient.java.rej +deleted file mode 100644 +index de5ec59cb607030703e7b0361b1fa615b95e289e..0000000000000000000000000000000000000000 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java.rej ++++ /dev/null +@@ -1,13 +0,0 @@ +-diff a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java (rejected hunks) +-@@ -757,6 +758,11 @@ public abstract class EntityInsentient extends EntityLiving { +- this.goalSelector.doTick(); +- this.world.getMethodProfiler().exit(); +- this.world.getMethodProfiler().enter("navigation"); +-+ // Paper start - async navigation +-+ if (this.navigation instanceof AsyncNavigationAbstract) +-+ ((AsyncNavigationAbstract) this.navigation).asyncTick(); +-+ else +-+ // Paper end +- this.navigation.c(); +- this.world.getMethodProfiler().exit(); +- this.world.getMethodProfiler().enter("mob tick"); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java index 70ae2923e21d7a0312e629a903ca9e380d6c6114..d906c5e530c2e7f779df079223aee619a73b5d51 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java @@ -252,7 +348,7 @@ index 74d10212e547adf96762155adb03c0158df00a16..00000000000000000000000000000000 - ran = true; - } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index de1845b3585d7cf96bf26f5859e1cb4820ad2d56..e17119d37577de42f8d52afcfdfee64c33996941 100644 +index ff1692c131b43f217de1fb6657a8274136a3dd08..5960ed2e91008b363dad900c72064055413eafd9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1001,7 +1001,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> 4; + pos.setValues(player.locX(), 0, player.locZ()); + double twoThirdModifier = 2D / 3D; +- MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> { +- if (shouldSkipPrioritization(coord)) return; ++ for (ChunkCoordIntPair coordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance))) { ++ if (shouldSkipPrioritization(coordIntPair)) continue; + +- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); ++ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coordIntPair.x, 0, coordIntPair.z); + // Prioritize immediate + if (dist <= 4 * 4) { +- updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - Math.sqrt(dist))); +- return; ++ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (27 - Math.sqrt(dist))); ++ continue; + } + + // Prioritize nearby chunks +- updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); +- }); ++ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); ++ } + + // Prioritize Frustum near 3 + ChunkCoordIntPair front3 = player.getChunkInFront(3); + pos.setValues(front3.x << 4, 0, front3.z << 4); +- MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> { +- if (shouldSkipPrioritization(coord)) return; ++ for (ChunkCoordIntPair chunkCoordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance))) { ++ if (shouldSkipPrioritization(chunkCoordIntPair)) continue; + +- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); +- updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +- }); ++ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, chunkCoordIntPair.x, 0, chunkCoordIntPair.z); ++ updateChunkPriorityMap(priorities, chunkCoordIntPair.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); ++ } + + // Prioritize Frustum near 5 + if (viewDistance > 4) { + ChunkCoordIntPair front5 = player.getChunkInFront(5); + pos.setValues(front5.x << 4, 0, front5.z << 4); +- MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> { +- if (shouldSkipPrioritization(coord)) return; ++ for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 3)) { ++ if (shouldSkipPrioritization(coord)) continue; + + double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); + updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +- }); ++ } + } + + // Prioritize Frustum far 7 +@@ -1168,7 +1168,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData); @@ -309,11 +556,83 @@ index a91b540a9e35efc8746f74f039a8ab6cfbd37206..546f4c942b047a39e0aec10cc2009b90 if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej b/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej deleted file mode 100644 -index 06b502a43f0e89b1b2cef8c3adb0a4229511846f..0000000000000000000000000000000000000000 +index 759862aba781ec6f1ae0c9a76c4ab6352d603a4c..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej +++ /dev/null -@@ -1,12 +0,0 @@ +@@ -1,84 +0,0 @@ -diff a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java (rejected hunks) +-@@ -480,53 +471,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +- double playerChunkZ = MathHelper.floor(player.locZ()) >> 4; +- pos.setValues(player.locX(), 0, player.locZ()); +- double twoThirdModifier = 2D / 3D; +-- MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> { +-- if (shouldSkipPrioritization(coord)) return; +-+ for (ChunkCoordIntPair coordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance))) { +-+ if (shouldSkipPrioritization(coordIntPair)) continue; +- +-- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); +-+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coordIntPair.x, 0, coordIntPair.z); +- // Prioritize immediate +- if (dist <= 4 * 4) { +-- updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - Math.sqrt(dist))); +-- return; +-+ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (27 - Math.sqrt(dist))); +-+ continue; +- } +- +- // Prioritize nearby chunks +-- updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); +-- }); +-+ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); +-+ } +- +- // Prioritize Frustum near 3 +- ChunkCoordIntPair front3 = player.getChunkInFront(3); +- pos.setValues(front3.x << 4, 0, front3.z << 4); +-- MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> { +-- if (shouldSkipPrioritization(coord)) return; +-+ for (ChunkCoordIntPair chunkCoordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance))) { +-+ if (shouldSkipPrioritization(chunkCoordIntPair)) continue; +- +-- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); +-- updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +-- }); +-+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, chunkCoordIntPair.x, 0, chunkCoordIntPair.z); +-+ updateChunkPriorityMap(priorities, chunkCoordIntPair.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +-+ } +- +- // Prioritize Frustum near 5 +- if (viewDistance > 4) { +- ChunkCoordIntPair front5 = player.getChunkInFront(5); +- pos.setValues(front5.x << 4, 0, front5.z << 4); +-- MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> { +-- if (shouldSkipPrioritization(coord)) return; +-+ for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 4)) { +-+ if (shouldSkipPrioritization(coord)) continue; +- +- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); +- updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +-- }); +-+ } +- } +- +- // Prioritize Frustum far 7 +- if (viewDistance > 6) { +- ChunkCoordIntPair front7 = player.getChunkInFront(7); +- pos.setValues(front7.x << 4, 0, front7.z << 4); +-- MCUtil.getSpiralOutChunks(pos, 3).forEach(coord -> { +-+ for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 3)) { +- if (shouldSkipPrioritization(coord)) { +-- return; +-+ continue; +- } +- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); +- updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); +-- }); +-+ } +- } +- +- pos.close(); -@@ -1122,7 +1131,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - if (ioThrowable != null) { - com.destroystokyo.paper.util.SneakyThrow.sneaky(ioThrowable); @@ -361,10 +680,10 @@ index 8b5d001fb8ecb4a5b96bda6532cf8d5900816290..00000000000000000000000000000000 - IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS, !(iworldreader instanceof World) || !((World) iworldreader).origamiConfig.onlyFindGeneratedFeatures); - if (ichunkaccess == null) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 7e06324777617d38be18e80b8498a74b1b0eb97f..d87d3f274ba1525c13875a92eec9d4c1bd265fa5 100644 +index 2fbbc1588c2943c8998550db4da6642e666650d8..3ff61141aede4b5a09bf83153222de0d14db5ad0 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java -@@ -514,6 +514,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -508,6 +508,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi entityitem = (EntityItem) iterator.next(); } while (!a((IInventory) ihopper, entityitem)); @@ -411,90 +730,63 @@ index 7fe085e48b6ad625a510edf33b112bef24f7d7ad..9459efde54d507231b4aacb7cba14e99 private NonNullList contents; public int c; // PAIL private -> public, rename viewerCount private TileEntityShulkerBox.AnimationPhase i; -diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej -deleted file mode 100644 -index bada470cba41cce9beb9eb04227b42c1d489d731..0000000000000000000000000000000000000000 ---- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej -+++ /dev/null -@@ -1,22 +0,0 @@ --diff a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java (rejected hunks) --@@ -10,7 +11,19 @@ import org.bukkit.entity.HumanEntity; -- -- public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable { -- --- private static final int[] a = IntStream.range(0, 27).toArray(); --+ private static final int[] a; --+ --+ static { --+ int[] arr = new int[10]; --+ int count = 0; --+ for (int i1 = 0; i1 < 27; i1++) { --+ if (arr.length == count) arr = Arrays.copyOf(arr, count * 2); --+ arr[count++] = i1; --+ } --+ arr = Arrays.copyOfRange(arr, 0, count); --+ a = arr; --+ } --+ -- private NonNullList contents; -- private int c; -- private TileEntityShulkerBox.AnimationPhase i; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ce7a742f2a3b5c169b956c1a91819882b9b57955..542b7cb89ac6b216d02bac6563df60d53cc7e9f1 100644 +index 0890bca50858ec8d544be2e1ff4ac2da73c7d830..44af511da96b265a8441052cc87e356e630699a6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -96,6 +96,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -97,6 +97,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config public final app.akarin.server.Config.WorldConfig akarinConfig; // Akarin - Server Config -+ public final us.minevict.papercut.PapercutConfig.WorldConfig papercutConfig; // Papercut + public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur + public final de.minebench.origami.OrigamiConfig.WorldConfig origamiConfig; // Origami - World Config ++ public final RainforestWorldConfig rainforestConfig; // Rainforest public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPosition lastPhysicsProblem; // Spigot -@@ -126,6 +129,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -127,6 +130,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config this.akarinConfig = new app.akarin.server.Config.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Akarin - Server Config -+ this.papercutConfig = new us.minevict.papercut.PapercutConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Papercut + this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur + this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config ++ this.rainforestConfig = new RainforestWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.paperConfig); // Rainforest ++ + this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -646,6 +653,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - this.a(blockposition.south(), block, blockposition); +@@ -637,6 +645,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} + ++ + public void applyPhysics(BlockPosition blockposition, Block block) { + if (captureBlockStates) { return; } // Paper - Cancel all physics during placement + this.a(blockposition.west(), block, blockposition); +@@ -674,6 +683,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + } -+ public void neighborChanged(BlockPosition pos, Block block, BlockPosition parent) { a(pos, block, parent); } // Origami - OBFHELPER - public void a(BlockPosition blockposition, Block block, EnumDirection enumdirection) { - if (enumdirection != EnumDirection.WEST) { - this.a(blockposition.west(), block, blockposition); ++ public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER + public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { + if (!this.isClientSide) { + IBlockData iblockdata = this.getTypeIfLoaded(blockposition); // EMC diff --git a/src/main/java/net/minecraft/server/World.java.rej b/src/main/java/net/minecraft/server/World.java.rej deleted file mode 100644 -index 6f7cf093021998e6ae0178fa851e82437d4f7f86..0000000000000000000000000000000000000000 +index c632cd030e36d8abfd92a14948e4893d885823ad..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/World.java.rej +++ /dev/null -@@ -1,17 +0,0 @@ +@@ -1,9 +0,0 @@ -diff a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java (rejected hunks) --@@ -95,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { -- public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray +-@@ -646,6 +646,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - -- public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config --+ public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur +- } - -- public final co.aikar.timings.WorldTimingsHandler timings; // Paper -- public static BlockPosition lastPhysicsProblem; // Spigot --@@ -124,6 +125,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { -- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper -- this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray -- this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config --+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur -- this.generator = gen; -- this.world = new CraftWorld((WorldServer) this, gen, env); -- this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit +-+ public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER +- public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { +- if (!this.isClientSide) { +- IBlockData iblockdata = this.getType(blockposition); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 64f7fc40a6847ebc6c84b3c179614e186f861e1f..3782d329dc62a9e834f16a9009f4102b5b4aad6f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java @@ -696,38 +988,39 @@ index 120d0df27e76c9beef9f09e6cdc0972454fdd4ca..00000000000000000000000000000000 - } - diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index afaa6ab4744190b134aeb616a1355cefd1333e37..b06f72228df2bd047e378ba750936a1138e72ade 100644 +index afaa6ab4744190b134aeb616a1355cefd1333e37..51c59159e04c6f48cb99f691cb64245973d8e628 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -836,6 +836,10 @@ public final class CraftServer implements Server { +@@ -836,6 +836,9 @@ public final class CraftServer implements Server { com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config app.akarin.server.Config.init((File) console.options.valueOf("akarin-settings")); // Akarin - Server Config -+ us.minevict.papercut.PapercutConfig.init((File) console.options.valueOf("papercut-settings")); // Papercut + net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur -+ com.mrivanplays.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami + de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami - Server Config ++ com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest for (WorldServer world : console.getWorlds()) { world.worldDataServer.setDifficulty(config.difficulty); world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); -@@ -872,6 +876,9 @@ public final class CraftServer implements Server { +@@ -872,6 +875,9 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper world.tuinityConfig.init(); // Tuinity - Server Config world.akarinConfig.init(); // Akarin - Server Config -+ world.papercutConfig.init(); // Papercut ++ world.rainforestConfig.init(); // Rainforest + world.purpurConfig.init(); // Purpur + world.origamiConfig.init(); // Origami - World Config } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper -@@ -2249,6 +2256,25 @@ public final class CraftServer implements Server { +@@ -2249,6 +2255,25 @@ public final class CraftServer implements Server { } // Akarin End - Server Config -+ // Papercut start - add config to timings report ++ // Rainforest start + @Override -+ public YamlConfiguration getPapercutConfig() { return us.minevict.papercut.PapercutConfig.config; } -+ // Papercut end - add config to timings report ++ public YamlConfiguration getRainforestConfig() { ++ return com.proximyst.rainforest.RainforestConfig.config; ++ } ++ // Rainforest end + + // Purpur start + @Override @@ -740,13 +1033,11 @@ index afaa6ab4744190b134aeb616a1355cefd1333e37..b06f72228df2bd047e378ba750936a11 + }*/ + // Purpur end + -+ @Override -+ public YamlConfiguration getOrigamiConfig() { return com.mrivanplays.origami.OrigamiConfig.config; } // Origami - add config to timings report -+ ++ @Override public void restart() { org.spigotmc.RestartCommand.restart(); -@@ -2388,4 +2414,11 @@ public final class CraftServer implements Server { +@@ -2388,4 +2413,11 @@ public final class CraftServer implements Server { return mobGoals; } // Paper end @@ -760,24 +1051,43 @@ index afaa6ab4744190b134aeb616a1355cefd1333e37..b06f72228df2bd047e378ba750936a11 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej b/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej deleted file mode 100644 -index b9d3fb83434a48b328cf0a0ae1ec29d93e87aa3e..0000000000000000000000000000000000000000 +index a3c8dfd94f78b49341e5f5aba1735651096c9d70..0000000000000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej +++ /dev/null -@@ -1,12 +0,0 @@ +@@ -1,31 +0,0 @@ -diff a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (rejected hunks) --@@ -2409,5 +2409,10 @@ public final class CraftServer implements Server { -- public String getServerName() { -- return getProperties().serverName; -- } +-@@ -848,6 +848,7 @@ public final class CraftServer implements Server { +- +- org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot +- com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper +-+ com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest +- for (WorldServer world : console.getWorlds()) { +- world.worldDataServer.setDifficulty(config.difficulty); +- world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); +-@@ -882,6 +883,7 @@ public final class CraftServer implements Server { +- } +- world.spigotConfig.init(); // Spigot +- world.paperConfig.init(); // Paper +-+ world.rainforestConfig.init(); // Rainforest +- } +- +- Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper +-@@ -2238,6 +2240,13 @@ public final class CraftServer implements Server { +- return com.destroystokyo.paper.PaperConfig.config; +- } +- +-+ // Rainforest start +-+ @Override +-+ public YamlConfiguration getRainforestConfig() { +-+ return com.proximyst.rainforest.RainforestConfig.config; +-+ } +-+ // Rainforest end -+ --+ @Override --+ public boolean isLagging() { --+ return getServer().lagging; --+ } -- // Purpur end -- } +- @Override +- public void restart() { +- org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 5d9197e6b27c5fcb5ef5244a82b45052a5dd5b40..2c3f96e9d5e7c2cfd4a3d1aeba27f25c6e8b891b 100644 +index 2d12ad72be927712d38d6fb6991f4af7a196fb9b..1a454f74b322605b1006da5be13760b13cc5f931 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -138,6 +138,7 @@ public class Main { @@ -792,13 +1102,13 @@ index 5d9197e6b27c5fcb5ef5244a82b45052a5dd5b40..2c3f96e9d5e7c2cfd4a3d1aeba27f25c .describedAs("Yml file"); // Akarin End - Server Config -+ // Papercut start -+ acceptsAll(asList("papercut", "papercut-settings"), "File for papercut settings") ++ // Origami Start - Server Config ++ acceptsAll(asList("origami", "origami-settings"), "File for origami settings") + .withRequiredArg() -+ .ofType(File.class) -+ .defaultsTo(new File("papercut.yml")) -+ .describedAs("Yml file"); -+ // Papercut end ++ .ofType(File.class) ++ .defaultsTo(new File("origami.yml")) ++ .describedAs("Yml file"); ++ // Origami end - Server Config + + // Purpur Start + acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings") @@ -811,38 +1121,24 @@ index 5d9197e6b27c5fcb5ef5244a82b45052a5dd5b40..2c3f96e9d5e7c2cfd4a3d1aeba27f25c // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() -@@ -168,6 +185,13 @@ public class Main { - .defaultsTo(new File("origami.yml")) - .describedAs("Yml file"); - // Origami end -+ // Origami Start - Server Config -+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings") -+ .withRequiredArg() -+ .ofType(File.class) -+ .defaultsTo(new File("origami.yml")) -+ .describedAs("Yml file"); -+ // Origami end - Server Config - } - }; - diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java.rej b/src/main/java/org/bukkit/craftbukkit/Main.java.rej deleted file mode 100644 -index 5d35899d1bedbb8643a601a2e1731a9bc66c7b61..0000000000000000000000000000000000000000 +index 916603085d652444027e4513b77293ece84a6c4f..0000000000000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java.rej +++ /dev/null @@ -1,16 +0,0 @@ -diff a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java (rejected hunks) --@@ -146,6 +146,14 @@ public class Main { +-@@ -139,6 +139,14 @@ public class Main { - .describedAs("Yml file"); -- /* Conctete End - Server Config */ +- // Paper end - --+ // Purpur Start --+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings") +-+ // Rainforest start +-+ acceptsAll(asList("rainforest", "rainforest-settings"), "File for rainforest settings") -+ .withRequiredArg() -+ .ofType(File.class) --+ .defaultsTo(new File("purpur.yml")) +-+ .defaultsTo(new File("rainforest.yml")) -+ .describedAs("Yml file"); --+ // Purpur end +-+ // Rainforest end -+ - // Paper start - acceptsAll(asList("server-name"), "Name of the server") diff --git a/patches/server/0003-Brandings.patch b/patches/server/0003-Brandings.patch index 42a62ab5..d658d489 100644 --- a/patches/server/0003-Brandings.patch +++ b/patches/server/0003-Brandings.patch @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..523e3b50d535e91afe8b14fdb53966da +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e17119d37577de42f8d52afcfdfee64c33996941..7cc402a4dfaa2a4bb123c897b05c09190cbdd489 100644 +index 5960ed2e91008b363dad900c72064055413eafd9..ee6a2dbc1306871d9ba621f199054befb09744c2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1515,7 +1515,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Wed, 26 Feb 2020 22:22:02 +0100 +From: Bud Gidiere +Date: Wed, 5 Aug 2020 14:25:50 -0500 Subject: [PATCH] Add GameProfileLookupEvent diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -index 8a18dfcda3c785e9c8bd134f88515e077dbef7dc..f0ccfce3bc7a2308a479fecd6d751bcaa88a0861 100644 +index dd96dd296d042c0625e527b50b3acfc19a2bf43e..0c5f2a010f30eb32bea273d7e65b0741016480e5 100644 --- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -5,9 +5,13 @@ import com.google.common.base.Charsets; @@ -22,35 +22,39 @@ index 8a18dfcda3c785e9c8bd134f88515e077dbef7dc..f0ccfce3bc7a2308a479fecd6d751bca import org.bukkit.craftbukkit.entity.CraftPlayer; import org.spigotmc.SpigotConfig; -@@ -185,13 +189,21 @@ public class CraftPlayerProfile implements PlayerProfile { - +@@ -182,17 +186,24 @@ public class CraftPlayerProfile implements PlayerProfile { + } + public boolean complete(boolean textures, boolean onlineMode) { + MinecraftServer server = MinecraftServer.getServer(); +- boolean isCompleteFromCache = this.completeFromCache(true, onlineMode); if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) { -- GameProfile result = server.getSessionService().fillProfileProperties(profile, true); +- GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true); - if (result != null) { - copyProfileProperties(result, this.profile, true); -- } ++ // Yatopia start ++ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName()); ++ Bukkit.getServer().getPluginManager().callEvent(event); ++ if (event.getGameProfile() != null) { ++ this.profile = event.getGameProfile(); ++ } else { ++ GameProfile result = server.getMinecraftSessionService().fillProfileProperties(profile, true); ++ if (result != null) { ++ copyProfileProperties(result, this.profile, true); ++ } ++ if (this.profile.isComplete()) { ++ server.getUserCache().saveProfile(this.profile); ++ } ++ } ++ // Yatopia end + } - if (this.profile.isComplete()) { - server.getUserCache().saveProfile(this.profile); - } -+ // Yatopia start -+ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName()); -+ Bukkit.getServer().getPluginManager().callEvent(event); -+ if (event.getGameProfile() != null) { -+ this.profile = event.getGameProfile(); -+ } else { -+ GameProfile result = server.getSessionService().fillProfileProperties(profile, true); -+ if (result != null) { -+ copyProfileProperties(result, this.profile, true); -+ } -+ if (this.profile.isComplete()) { -+ server.getUserCache().saveProfile(this.profile); -+ } -+ } -+ // Yatopia end - } +- } return profile.isComplete() && (!onlineMode || !textures || hasTextures()); } + diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java index 579a81e521fdfabfa0318d06c6760a8ab7a88c1e..ceb1f18a49ebc8fbac270d9f221fa44f9baea216 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java diff --git a/patches/server/0005-Add-getLastTickMs-api.patch b/patches/server/0005-Add-getLastTickMs-api.patch index aa2f7e08..3470bc41 100644 --- a/patches/server/0005-Add-getLastTickMs-api.patch +++ b/patches/server/0005-Add-getLastTickMs-api.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add getLastTickMs api diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7cc402a4dfaa2a4bb123c897b05c09190cbdd489..8e5284fd39be45055bec1609f6b8dd05229e6b35 100644 +index ee6a2dbc1306871d9ba621f199054befb09744c2..26ee6e9219059c9f7175148e934d2adec2b336a0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -930,6 +930,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Sun, 2 Aug 2020 11:17:08 -0500 +From: Bud Gidiere +Date: Wed, 5 Aug 2020 08:05:10 -0500 Subject: [PATCH] Add config Yatopia command and basic settings @@ -357,7 +357,7 @@ index 0000000000000000000000000000000000000000..19bea6ee83d8b25da022662253328fb6 +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index ad1af2905e4f3e3d05a0dc63859a6e2f3bc43327..9ba65a7528755f54b9a1c4b1323b6e75de867f14 100644 +index 7ac6ef0a125499de4b5e6a9ed80f963ba623b9f6..0170f25a694e757798ebd4a37c90b1c1e479d3bd 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -7,6 +7,7 @@ import com.mojang.authlib.GameProfileRepository; @@ -368,10 +368,11 @@ index ad1af2905e4f3e3d05a0dc63859a6e2f3bc43327..9ba65a7528755f54b9a1c4b1323b6e75 import java.io.IOException; import java.io.InputStreamReader; import java.net.InetAddress; -@@ -184,6 +185,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - us.minevict.papercut.PapercutConfig.init((java.io.File) options.valueOf("papercut-settings")); // Papercut - com.mrivanplays.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - server config - +@@ -182,7 +183,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config + app.akarin.server.Config.init((java.io.File) options.valueOf("akarin-settings")); // Akarin - Server Config + com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest +- + // Yatopia start + try { + dev.tr7zw.yatopia.YatopiaConfig.init(new File("yatopia.yml")); @@ -385,7 +386,7 @@ index ad1af2905e4f3e3d05a0dc63859a6e2f3bc43327..9ba65a7528755f54b9a1c4b1323b6e75 this.setAllowFlight(dedicatedserverproperties.allowFlight); this.setResourcePack(dedicatedserverproperties.resourcePack, this.aY()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 98c5ecdf8b59670c872cb43593054f5a91d5e9fe..c77bb0b092cf4198edb6334520fd57042b4e171c 100644 +index dd093e3e624158ff87bad59785ed2496f161f64c..ec84bc4dceff76fd2f823a6a9548fdf180291584 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1035,7 +1035,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -398,7 +399,7 @@ index 98c5ecdf8b59670c872cb43593054f5a91d5e9fe..c77bb0b092cf4198edb6334520fd5704 }); StreamAccumulator streamaccumulator = new StreamAccumulator<>(Stream.concat(stream1, stream)); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index d83ad80c08ef7c8a55bae6fd86aefa128c9c8a20..9f2aab1cb100cb6f9048d840db6fc15947a26847 100644 +index 0c862b4604540545206ebe6e08d5d79484414279..da08249ee1c61b7c77b79f491cb8482865ecba3c 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -266,6 +266,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0007-Add-option-for-only-players-to-have-collisions-with.patch b/patches/server/0007-Add-option-for-only-players-to-have-collisions-with.patch index 189bba51..6074155a 100644 --- a/patches/server/0007-Add-option-for-only-players-to-have-collisions-with.patch +++ b/patches/server/0007-Add-option-for-only-players-to-have-collisions-with.patch @@ -19,10 +19,10 @@ index 19bea6ee83d8b25da022662253328fb6384f40d9..2cee6e02a7dcbacb5f002f9c5917a2e2 } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9f2aab1cb100cb6f9048d840db6fc15947a26847..ac029aed60e90072d214399d1f8901957af46ba3 100644 +index da08249ee1c61b7c77b79f491cb8482865ecba3c..2edebae8a1127c9214c7c2974700db9f207fa05f 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2843,40 +2843,46 @@ public abstract class EntityLiving extends Entity { +@@ -2844,40 +2844,46 @@ public abstract class EntityLiving extends Entity { if (i <= 0 && world.paperConfig.maxCollisionsPerEntity <= 0) { return; } diff --git a/patches/server/0010-Player-saving-async-FileIO.patch b/patches/server/0010-Player-saving-async-FileIO.patch index 8a258e21..665825d6 100644 --- a/patches/server/0010-Player-saving-async-FileIO.patch +++ b/patches/server/0010-Player-saving-async-FileIO.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player-saving-async-FileIO diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index 2e88442e13546e9005e3783b09feaddbed7cea16..0f05c8887f5ecd639021e90389e53891b6ad80fc 100644 +index cf539c98073b475eb5b769c8cc11d48a7e6d58f1..5442c28c56f933c63bd611f579d0392876ecc2ef 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java @@ -27,6 +27,8 @@ import java.util.List; @@ -138,7 +138,7 @@ index 2e88442e13546e9005e3783b09feaddbed7cea16..0f05c8887f5ecd639021e90389e53891 } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 2cada09ced1660526e9c112c2c8d92bbf9d6ea98..767ecf5fe63d86522ef8de4c0b4cda2803a5145c 100644 +index e411f6280d07e3f6a953e1fcaffaaa49f85dc7cc..3966bf7160ef5a7ec6944397ffbf51f583875860 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -700,11 +700,23 @@ public abstract class EntityHuman extends EntityLiving { @@ -176,10 +176,10 @@ index 2cada09ced1660526e9c112c2c8d92bbf9d6ea98..767ecf5fe63d86522ef8de4c0b4cda28 nbttagcompound.set("ShoulderEntityLeft", this.getShoulderEntityLeft()); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8b64720f4acf5deb341074cd75f99ca7816f1e41..2e24e2210f91e69ead4f21f2426e5230fb887e53 100644 +index 33c40bf94e74d1ee268fb8ffb809f45b31621df9..c10a1d15bcfe0cb1c2ff6ee7f2881bc2040bcd1d 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -20,6 +20,7 @@ import java.util.Optional; +@@ -19,6 +19,7 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -187,7 +187,7 @@ index 8b64720f4acf5deb341074cd75f99ca7816f1e41..2e24e2210f91e69ead4f21f2426e5230 import javax.annotation.Nullable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -1262,6 +1263,28 @@ public abstract class PlayerList { +@@ -1260,6 +1261,28 @@ public abstract class PlayerList { if (team != null) scoreboard.removeTeam(team); } // Paper end @@ -216,7 +216,7 @@ index 8b64720f4acf5deb341074cd75f99ca7816f1e41..2e24e2210f91e69ead4f21f2426e5230 } // Paper end -@@ -1299,13 +1322,13 @@ public abstract class PlayerList { +@@ -1297,13 +1320,13 @@ public abstract class PlayerList { File file = this.server.a(SavedFile.STATS).toFile(); File file1 = new File(file, uuid + ".json"); diff --git a/patches/server/0011-Modify-default-configs.patch b/patches/server/0011-Modify-default-configs.patch index be072543..ff9edb2c 100644 --- a/patches/server/0011-Modify-default-configs.patch +++ b/patches/server/0011-Modify-default-configs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify default configs diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 56e4359ba32339e1bef58061585ff3e12e4215f3..5465f13cdedcf71310838e8505e94e975180919b 100644 +index 29200d223cf7c5948ebd0907ef5a1d9ea8114c81..1febe2aff4eab2f15e9bc4b21e6d0c350f122c87 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -201,7 +201,7 @@ public class PaperConfig { @@ -18,7 +18,7 @@ index 56e4359ba32339e1bef58061585ff3e12e4215f3..5465f13cdedcf71310838e8505e94e97 TimingsManager.privacy = getBoolean("timings.server-name-privacy", false); TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses")); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e471e764935e2a89560de56959a782b02e5e8fe1..5b9fef2b47b752897ea9153fe818a9c476e689ea 100644 +index 8cc8134f701d2517d134077b2fcd223106c09478..c2d5f7d22beb4c4829dfcb55fa842eaf727e906c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -600,7 +600,7 @@ public class PaperWorldConfig { diff --git a/patches/server/0014-lithium-enum_values.patch b/patches/server/0014-lithium-enum_values.patch index bc236954..29f9cffa 100644 --- a/patches/server/0014-lithium-enum_values.patch +++ b/patches/server/0014-lithium-enum_values.patch @@ -37,10 +37,10 @@ index 4f10ca5ada741b4f5ef941bb9d92a2fa6a7c44ff..3d6f8d948d293ca57bf158bcd1f58e28 if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) { return true; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ac029aed60e90072d214399d1f8901957af46ba3..9780b8602984b5d8fce7d5b38ebcd70955097a56 100644 +index 2edebae8a1127c9214c7c2974700db9f207fa05f..ce96eea39425792eda9aacd656d2bffda8bc3803 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2566,11 +2566,14 @@ public abstract class EntityLiving extends Entity { +@@ -2567,11 +2567,14 @@ public abstract class EntityLiving extends Entity { } } diff --git a/patches/server/0016-lithium-MixinLandPathNodeMaker.patch b/patches/server/0016-lithium-MixinLandPathNodeMaker.patch index 61211652..225f4c39 100644 --- a/patches/server/0016-lithium-MixinLandPathNodeMaker.patch +++ b/patches/server/0016-lithium-MixinLandPathNodeMaker.patch @@ -7,7 +7,7 @@ Original code by JellySquid, licensed under GNU Lesser General Public License v3 you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.15.x/fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 49fc87b6e196d4bde8b99929a4a42f00d2f462e8..97d2b88570037ad9f4efe037ae7410598b031c40 100644 +index 29c978aaa2b9f50f5dba70943653af7658d98fc7..595fb84f280bb10997992cc41ebc512ceaf2d696 100644 --- a/src/main/java/net/minecraft/server/PathfinderNormal.java +++ b/src/main/java/net/minecraft/server/PathfinderNormal.java @@ -4,12 +4,23 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectMap; @@ -34,7 +34,7 @@ index 49fc87b6e196d4bde8b99929a4a42f00d2f462e8..97d2b88570037ad9f4efe037ae741059 protected float j; private final Long2ObjectMap k = new Long2ObjectOpenHashMap(); private final Object2BooleanMap l = new Object2BooleanOpenHashMap(); -@@ -508,13 +519,44 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -509,13 +520,44 @@ public class PathfinderNormal extends PathfinderAbstract { protected static PathType b(IBlockAccess iblockaccess, BlockPosition blockposition) { IBlockData iblockdata = iblockaccess.getTypeIfLoaded(blockposition); // Paper if (iblockdata == null) return PathType.BLOCKED; // Paper @@ -84,7 +84,7 @@ index 49fc87b6e196d4bde8b99929a4a42f00d2f462e8..97d2b88570037ad9f4efe037ae741059 return PathType.DAMAGE_CACTUS; } else if (iblockdata.a(Blocks.SWEET_BERRY_BUSH)) { return PathType.DAMAGE_OTHER; -@@ -540,7 +582,10 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -541,7 +583,10 @@ public class PathfinderNormal extends PathfinderAbstract { } else { Fluid fluid = iblockdata.getFluid(); // Tuinity - remove another getType call diff --git a/patches/server/0021-Optimize-Hopper-logic.patch b/patches/server/0021-Optimize-Hopper-logic.patch index 76ddfab8..44fd26df 100644 --- a/patches/server/0021-Optimize-Hopper-logic.patch +++ b/patches/server/0021-Optimize-Hopper-logic.patch @@ -35,7 +35,7 @@ index a29294fbc7cd6fcfff0df9eadd11de3bd7f1405e..7918382f26807f945dc7966b81c3c1e2 private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index d87d3f274ba1525c13875a92eec9d4c1bd265fa5..7e5e72d06f2b073dd98bb03d57618bdf7d269f91 100644 +index 3ff61141aede4b5a09bf83153222de0d14db5ad0..a5a8528db91c15afcf8c77d5e4727c8e0212bb63 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -46,7 +46,7 @@ index d87d3f274ba1525c13875a92eec9d4c1bd265fa5..7e5e72d06f2b073dd98bb03d57618bdf import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; -@@ -667,14 +668,44 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -661,14 +662,44 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @Nullable private IInventory l() { @@ -93,7 +93,7 @@ index d87d3f274ba1525c13875a92eec9d4c1bd265fa5..7e5e72d06f2b073dd98bb03d57618bdf } public static List c(IHopper ihopper) { -@@ -689,14 +720,15 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -683,14 +714,15 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi } @Nullable @@ -114,7 +114,7 @@ index d87d3f274ba1525c13875a92eec9d4c1bd265fa5..7e5e72d06f2b073dd98bb03d57618bdf BlockPosition blockposition = new BlockPosition(d0, d1, d2); if ( !world.isLoaded( blockposition ) ) return null; // Spigot IBlockData iblockdata = world.getType(blockposition); -@@ -714,8 +746,9 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -708,8 +740,9 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi } } } @@ -125,7 +125,7 @@ index d87d3f274ba1525c13875a92eec9d4c1bd265fa5..7e5e72d06f2b073dd98bb03d57618bdf List list = world.getEntities((Entity) null, new AxisAlignedBB(d0 - 0.5D, d1 - 0.5D, d2 - 0.5D, d0 + 0.5D, d1 + 0.5D, d2 + 0.5D), IEntitySelector.d); if (!list.isEmpty()) { -@@ -785,4 +818,21 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi +@@ -779,4 +812,21 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi protected Container createContainer(int i, PlayerInventory playerinventory) { return new ContainerHopper(i, playerinventory, this); } diff --git a/patches/server/0022-Optimize-TileEntity-loading.patch b/patches/server/0022-Optimize-TileEntity-loading.patch index 458349b7..130b1af2 100644 --- a/patches/server/0022-Optimize-TileEntity-loading.patch +++ b/patches/server/0022-Optimize-TileEntity-loading.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: tr7zw -Date: Fri, 31 Jul 2020 22:04:17 -0500 +From: Bud Gidiere +Date: Wed, 5 Aug 2020 08:08:44 -0500 Subject: [PATCH] Optimize TileEntity loading @@ -32,7 +32,7 @@ index c2c19a6fbfa2a4aba21aa71789071c69a6246556..7dfd36e22a896ae440bbda6db0628c44 } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 542b7cb89ac6b216d02bac6563df60d53cc7e9f1..811b02d36416b41f7dfa0d3b8a94c159fe77c911 100644 +index 44af511da96b265a8441052cc87e356e630699a6..847a245606c5bb98a8821a9dcd677d7eb2e81e45 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -44,15 +44,15 @@ index 542b7cb89ac6b216d02bac6563df60d53cc7e9f1..811b02d36416b41f7dfa0d3b8a94c159 import com.destroystokyo.paper.antixray.ChunkPacketBlockController; // Paper - Anti-Xray import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray; // Paper - Anti-Xray import com.destroystokyo.paper.event.server.ServerExceptionEvent; -@@ -10,6 +12,7 @@ import com.google.common.base.MoreObjects; - import com.google.common.collect.Lists; +@@ -11,6 +13,7 @@ import com.google.common.collect.Lists; import com.mojang.serialization.Codec; + import com.proximyst.rainforest.RainforestWorldConfig; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; -@@ -42,8 +45,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -43,8 +46,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public static final ResourceKey THE_END = ResourceKey.a(IRegistry.ae, new MinecraftKey("the_end")); private static final EnumDirection[] a = EnumDirection.values(); //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list diff --git a/patches/server/0027-Redirect-Configs.patch b/patches/server/0024-Redirect-Configs.patch similarity index 62% rename from patches/server/0027-Redirect-Configs.patch rename to patches/server/0024-Redirect-Configs.patch index ee7a522f..33de6260 100644 --- a/patches/server/0027-Redirect-Configs.patch +++ b/patches/server/0024-Redirect-Configs.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: tr7zw -Date: Mon, 3 Aug 2020 17:38:07 +0200 +From: Bud Gidiere +Date: Wed, 5 Aug 2020 08:17:46 -0500 Subject: [PATCH] Redirect Configs @@ -40,42 +40,42 @@ index 1742facec843dd87897d62e4aab819835fab4a38..358ac3361c814b7cf5f9650a6a49c6ef } public static void load(final YamlConfiguration config) { -diff --git a/src/main/java/com/mrivanplays/origami/OrigamiConfig.java b/src/main/java/com/mrivanplays/origami/OrigamiConfig.java -index 111fa3cd586c31eb0ab9fd425179d1f54a40a0f4..9038b3324c50982e85c5e1992de99df6ba902a89 100644 ---- a/src/main/java/com/mrivanplays/origami/OrigamiConfig.java -+++ b/src/main/java/com/mrivanplays/origami/OrigamiConfig.java -@@ -2,6 +2,8 @@ package com.mrivanplays.origami; - - import com.destroystokyo.paper.util.SneakyThrow; +diff --git a/src/main/java/com/proximyst/rainforest/RainforestConfig.java b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +index 0d854bda9611b45d78815f9fe9cafb8901de210f..04f5751f7972ed04f97c3f911277a30f14344801 100644 +--- a/src/main/java/com/proximyst/rainforest/RainforestConfig.java ++++ b/src/main/java/com/proximyst/rainforest/RainforestConfig.java +@@ -18,6 +18,8 @@ import org.bukkit.command.Command; + import org.bukkit.configuration.InvalidConfigurationException; + import org.bukkit.configuration.file.YamlConfiguration; +import dev.tr7zw.yatopia.YatopiaConfig; + - import java.io.File; - import java.io.IOException; - import java.lang.reflect.Method; -@@ -23,7 +25,7 @@ public final class OrigamiConfig { - private static int configVersion; + // Based on PaperConfig + public final class RainforestConfig { + private static File CONFIG_FILE; +@@ -37,8 +39,7 @@ public final class RainforestConfig { + private static boolean fatalError; - public static void init(final File file) { -- OrigamiConfig.configFile = file; -+ /*OrigamiConfig.configFile = file; - final YamlConfiguration config = new YamlConfiguration(); - config.options().header(CONFIG_HEADER); - config.options().copyDefaults(true); -@@ -42,8 +44,9 @@ public final class OrigamiConfig { - SneakyThrow.sneaky(e); - throw new RuntimeException(e); // unreachable - } -- } -- load(config); -+ }*/ -+ configFile = YatopiaConfig.CONFIG_FILE; -+ load(YatopiaConfig.config); - } + public static void init(File configFile) { +- CONFIG_FILE = configFile; +- config = new YamlConfiguration(); ++ /*config = new YamlConfiguration(); + try { + config.load(CONFIG_FILE); + } catch (IOException ex) { +@@ -56,7 +57,9 @@ public final class RainforestConfig { - public static void load(final YamlConfiguration config) { + version = getInt("config-version", 1); + set("config-version", 1); +- readConfig(RainforestConfig.class, null); ++ readConfig(RainforestConfig.class, null);*/ ++ config = YatopiaConfig.config; ++ CONFIG_FILE = YatopiaConfig.CONFIG_FILE; + } + + protected static void logError(String s) { diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java -index 3b3c7053c73ac31eb00585c4e1fc19933467205a..5c904da2c49098eed9ea2b0ed133bf1322225c4d 100644 +index bd107a376eaf660ba1ad61c035f8ed2d9d04749c..157a5c1be65b6b39787e5be11d1a8d5ea4aeb2b8 100644 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java +++ b/src/main/java/de/minebench/origami/OrigamiConfig.java @@ -3,6 +3,8 @@ package de.minebench.origami; @@ -121,7 +121,7 @@ index 9f04500e167b8403c7487044a4ae03a6be61062a..fb3bf0731512b5517ca7ccb3240085b4 + "Yatopia contains many breaking changes and settings, so know what you are doing!\n" + "You have been warned!\n"; diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 9ba65a7528755f54b9a1c4b1323b6e75de867f14..d6e0d9dd98efadb46e7888af2e0cd2ff7736df83 100644 +index 0170f25a694e757798ebd4a37c90b1c1e479d3bd..73f4d52f24d042e287dab351edd4bfa4e22046b4 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -169,6 +169,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -140,12 +140,10 @@ index 9ba65a7528755f54b9a1c4b1323b6e75de867f14..d6e0d9dd98efadb46e7888af2e0cd2ff // Purpur start try { net.pl3x.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings")); -@@ -184,16 +193,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -183,14 +192,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config app.akarin.server.Config.init((java.io.File) options.valueOf("akarin-settings")); // Akarin - Server Config - us.minevict.papercut.PapercutConfig.init((java.io.File) options.valueOf("papercut-settings")); // Papercut - com.mrivanplays.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); // Origami - server config -+ de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); - + com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest - // Yatopia start - try { - dev.tr7zw.yatopia.YatopiaConfig.init(new File("yatopia.yml")); @@ -154,15 +152,15 @@ index 9ba65a7528755f54b9a1c4b1323b6e75de867f14..d6e0d9dd98efadb46e7888af2e0cd2ff - return false; - } - dev.tr7zw.yatopia.YatopiaConfig.registerCommands(); -- // Yatopia end ++ de.minebench.origami.OrigamiConfig.init((java.io.File) options.valueOf("origami-settings")); + // Yatopia end this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); - this.setResourcePack(dedicatedserverproperties.resourcePack, this.aY()); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 2c3f96e9d5e7c2cfd4a3d1aeba27f25c6e8b891b..01ad4f9881623639aa247a064c600b78952ba1be 100644 +index 1a454f74b322605b1006da5be13760b13cc5f931..6820905bf16eb4e8a97615a7ef49b6d3337ab247 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -318,7 +318,7 @@ public class Main { +@@ -304,7 +304,7 @@ public class Main { } // Paper end System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows @@ -171,42 +169,3 @@ index 2c3f96e9d5e7c2cfd4a3d1aeba27f25c6e8b891b..01ad4f9881623639aa247a064c600b78 System.out.println("Loading libraries, please wait..."); net.minecraft.server.Main.main(options); } catch (Throwable t) { -diff --git a/src/main/java/us/minevict/papercut/PapercutConfig.java b/src/main/java/us/minevict/papercut/PapercutConfig.java -index 1256b689481f9d31dc2fbbf6072293c293ed6c2e..f242810198a48e82838e67dd356da596e3288f8e 100644 ---- a/src/main/java/us/minevict/papercut/PapercutConfig.java -+++ b/src/main/java/us/minevict/papercut/PapercutConfig.java -@@ -1,6 +1,9 @@ - package us.minevict.papercut; - - import com.destroystokyo.paper.util.SneakyThrow; -+ -+import dev.tr7zw.yatopia.YatopiaConfig; -+ - import java.io.File; - import java.lang.reflect.Method; - import java.lang.reflect.Modifier; -@@ -20,7 +23,7 @@ public final class PapercutConfig { - private static int configVersion; - - public static void init(final File file) { -- final File papercutConfig = new File(file.getParent(), "papercut.yml"); -+ /*final File papercutConfig = new File(file.getParent(), "papercut.yml"); - if (!papercutConfig.exists()) { - final File oldConfig = new File(file.getParent(), "papercut.yml"); - oldConfig.renameTo(papercutConfig); -@@ -42,11 +45,12 @@ public final class PapercutConfig { - } catch (final Exception ex) { - Bukkit.getLogger().log(Level.SEVERE, "Failure to load papercut config", ex); - SneakyThrow.sneaky(ex); /* Rethrow, this is critical */ -- throw new RuntimeException(ex); // unreachable -+ /* throw new RuntimeException(ex); // unreachable - } -- } -+ }*/ - -- PapercutConfig.load(config); -+ configFile = YatopiaConfig.CONFIG_FILE; -+ PapercutConfig.load(YatopiaConfig.config); - } - - public static void load(final YamlConfiguration config) { diff --git a/patches/server/0024-Akarin-Updated-Save-json-list-async.patch b/patches/server/0025-Akarin-Updated-Save-json-list-async.patch similarity index 100% rename from patches/server/0024-Akarin-Updated-Save-json-list-async.patch rename to patches/server/0025-Akarin-Updated-Save-json-list-async.patch diff --git a/patches/server/0025-Akarin-updated-Cache-hashcode-for-BlockPosition.patch b/patches/server/0025-Akarin-updated-Cache-hashcode-for-BlockPosition.patch deleted file mode 100644 index 5b56285d..00000000 --- a/patches/server/0025-Akarin-updated-Cache-hashcode-for-BlockPosition.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sotr -Date: Fri, 31 Jul 2020 22:31:08 -0500 -Subject: [PATCH] Akarin updated Cache hashcode for BlockPosition - - -diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index dab89b0c69ddff24d37cee06107bdc464012c6bb..1e0acca45d0c8f7873176a46018b38eba02aa667 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -28,6 +28,7 @@ public class BaseBlockPosition implements Comparable { - return b < 0 || b >= 256; - } - // Paper end -+ protected int hash; // Akarin - cache hashcode - - public BaseBlockPosition(int i, int j, int k) { - this.a = i; -@@ -52,8 +53,20 @@ public class BaseBlockPosition implements Comparable { - } - - public final int hashCode() { // Paper -- return (this.getY() + this.getZ() * 31) * 31 + this.getX(); -- } -+ // Akarin start - cache hashcode -+ int result = hash; // Make the situation not too bad when it is modified by multiple threads -+ if (result == 0) { -+ result = (this.b + this.e * 31) * 31 + this.a; // Paper -+ hash = result; -+ } -+ return result; -+ // return (this.getY() + this.getZ() * 31) * 31 + this.getX(); -+ } -+ -+ public final void recalcHashCode() { -+ hash = 0; -+ } -+ // Akarin end - - public int compareTo(BaseBlockPosition baseblockposition) { - return this.getY() == baseblockposition.getY() ? (this.getZ() == baseblockposition.getZ() ? this.getX() - baseblockposition.getX() : this.getZ() - baseblockposition.getZ()) : this.getY() - baseblockposition.getY(); -diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 7ff4948a47be03c65c162ca04b2338cdcdafe7c4..14a626f98fb1faf38cf3d3e9d0bc79baf14559ac 100644 ---- a/src/main/java/net/minecraft/server/BlockPosition.java -+++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -438,7 +438,9 @@ public class BlockPosition extends BaseBlockPosition { - } - - public BlockPosition.MutableBlockPosition e(int i, int j, int k) { -- return this.d(this.getX() + i, this.getY() + j, this.getZ() + k); -+ this.d(this.getX() + i, this.getY() + j, this.getZ() + k); -+ this.recalcHashCode(); -+ return this; - } - - public BlockPosition.MutableBlockPosition a(EnumDirection.EnumAxis enumdirection_enumaxis, int i, int j) { -@@ -469,16 +471,19 @@ public class BlockPosition extends BaseBlockPosition { - // Tuinity - moved up - public final void o(int i) { // Tuinity - ((BaseBlockPosition)this).a = i; // need cast thanks to name conflict -+ this.recalcHashCode(); - } - - // Tuinity - moved up - public final void p(int i) { // Tuinity - ((BaseBlockPosition)this).b = i; // Tuinity -+ this.recalcHashCode(); - } - - // Tuinity - moved up - public final void q(int i) { // Tuinity - ((BaseBlockPosition)this).e = i; // Tuinity -+ this.recalcHashCode(); - } - - @Override diff --git a/patches/server/0026-Akarin-updated-Async-Path-Finding.patch b/patches/server/0026-Akarin-updated-Async-Path-Finding.patch deleted file mode 100644 index 31f63d2d..00000000 --- a/patches/server/0026-Akarin-updated-Async-Path-Finding.patch +++ /dev/null @@ -1,358 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: tsao chi -Date: Sun, 2 Aug 2020 12:25:52 -0500 -Subject: [PATCH] Akarin updated Async Path Finding - -Co-authored-by: Bud Gidiere - -diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index e6868e2b65e3c2bde7696272b242a47e7394e27f..c4c3ef500b9b8465644a0b7712f43ba35ad3acc1 100644 ---- a/src/main/java/net/minecraft/server/EntityBee.java -+++ b/src/main/java/net/minecraft/server/EntityBee.java -@@ -445,9 +445,9 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB - } - - @Override -- public void c() { -+ public void tickAsync() { - if (!EntityBee.this.bJ.k()) { -- super.c(); -+ super.tickAsync(); - } - } - }; -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 027a55223c660f25b0b52f99efed5b0c037ae658..09f332aa02604dd86224a6f66ec4f84d7bf99318 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -757,7 +757,7 @@ public abstract class EntityInsentient extends EntityLiving { - this.goalSelector.doTick(); - //this.world.getMethodProfiler().exit(); // Akarin - remove caller - //this.world.getMethodProfiler().enter("navigation"); // Akarin - remove caller -- this.navigation.c(); -+ this.navigation.tickAsync(); // Akarin - Async pathfinder - //this.world.getMethodProfiler().exit(); // Akarin - remove caller - //this.world.getMethodProfiler().enter("mob tick"); // Akarin - remove caller - this.mobTick(); -diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java -index 681465d8a74831461dce4615d2d19c7ed46bc299..f04411a2a295d2a982dca5851ae76a80a6a83585 100644 ---- a/src/main/java/net/minecraft/server/Navigation.java -+++ b/src/main/java/net/minecraft/server/Navigation.java -@@ -183,7 +183,7 @@ public class Navigation extends NavigationAbstract { - double d3 = (double) j2 + 0.5D - vec3d.z; - - if (d2 * d0 + d3 * d1 >= 0.0D) { -- PathType pathtype = this.o.a(this.b, i2, j - 1, j2, this.a, l, i1, j1, true, true); -+ PathType pathtype = this.o.a(this.o.a, i2, j - 1, j2, this.a, l, i1, j1, true, true); // Akarin - use chunk cache - - if (!this.a(pathtype)) { - return false; -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 2405dc5e9a6a971a565c37710b61d5fc4737bdf8..2dac507e9e0044a32ae54ea57eada0de04c1467d 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -28,6 +28,15 @@ public abstract class NavigationAbstract { - private int q; - private float r; - private final Pathfinder s; public Pathfinder getPathfinder() { return this.s; } // Paper - OBFHELPER -+ // Akarin start - Async pathfinder -+ private long lastPathfindAsync; -+ private static final java.util.concurrent.ExecutorService pathfindExecutor = -+ java.util.concurrent.Executors.newSingleThreadExecutor( -+ new com.google.common.util.concurrent.ThreadFactoryBuilder() -+ .setDaemon(true) -+ .setNameFormat("StarLink Pathfinder - %d") -+ .build()); -+ // Akarin end - - // Tuinity start - public boolean isViableForPathRecalculationChecking() { -@@ -83,7 +92,40 @@ public abstract class NavigationAbstract { - } - - } -+ // Akarin start - Async pathfinder, copied from above with modification -+ public void doPathfindAsync() { -+ if (this.b.getTime() - this.lastPathfindAsync > 20L) { -+ if (this.p != null) { -+ this.lastPathfindAsync = this.b.getTime(); -+ -+ // Bake chunk cache -+ float f = (float) this.a.b(GenericAttributes.FOLLOW_RANGE);; -+ BlockPosition blockposition = this.a.getChunkCoordinates(); -+ int k = (int) (f + (float) 8); -+ ChunkCache cache = new ChunkCache(this.b, blockposition.b(-k, -k, -k), blockposition.b(k, k, k)); -+ -+ // Execute directly if we already have a path entity, or compute one -+ if (this.c != null && !this.c.b()) { -+ doTickAsync(this.c); -+ return; -+ } - -+ pathfindExecutor.execute(() -> { -+ PathEntity result = findPathAsync(cache, java.util.Collections.singleton(this.p), this.q); -+ NavigationAbstract.this.b.getMinecraftServer().processQueue.add(() -> { -+ if (result != null && result.m() != null) -+ this.p = result.m(); -+ -+ NavigationAbstract.this.c = result; -+ }); -+ }); -+ } -+ } else { -+ // Execute directly, keep behaviour with vanilla, see the original doTick method -+ doTickAsync(this.c); -+ } -+ } -+ // Akarin end - @Nullable - public final PathEntity calculateDestination(double d0, double d1, double d2) { return a(d0, d1, d2, 0); } public final PathEntity a(double d0, double d1, double d2, int i) { // Paper - OBFHELPER - return this.a(new BlockPosition(d0, d1, d2), i); -@@ -164,7 +206,17 @@ public abstract class NavigationAbstract { - return pathentity; - } - } -- -+ // Akarin start - Async pathfinder, copied and edited from above with only pathfinding -+ protected PathEntity findPathAsync(ChunkCache cache, Set set, int j) { -+ if (this.a.locY() < 0.0D) { -+ return null; -+ } else if (!this.a()) { -+ return null; -+ } else { -+ return this.s.a(cache, this.a, set, f, j, this.r); -+ } -+ } -+ // Akarin end - public boolean a(double d0, double d1, double d2, double d3) { - return this.a(this.a(d0, d1, d2, 1), d3); - } -@@ -228,7 +280,7 @@ public abstract class NavigationAbstract { - return this.c; - } - -- public void c() { -+/* public void c() { - ++this.e; - if (this.m) { - this.j(); -@@ -238,7 +290,7 @@ public abstract class NavigationAbstract { - Vec3D vec3d; - - if (this.a()) { -- this.l(); -+ //this.l(); - } else if (this.c != null && this.c.f() < this.c.e()) { - vec3d = this.b(); - Vec3D vec3d1 = this.c.a(this.a, this.c.f()); -@@ -256,9 +308,44 @@ public abstract class NavigationAbstract { - this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a((IBlockAccess) this.b, blockposition), vec3d.z, this.d); - } - } -+ }*/ -+ //Yatopia Start -+ public void c() { -+ this.tickAsync(); -+ } -+ //Yatopia End -+ // Akarin start - Async pathfinder, copied from above -+ public void tickAsync() { -+ ++this.e; -+ this.doPathfindAsync(); - } - -- protected void l() { -+ // This was copied from above partly with param -+ public void doTickAsync(PathEntity pathEntity) { -+ if (shouldContinuePathfind(pathEntity)) -+ return; -+ -+ Vec3D vec3d; -+ if (this.a()) { -+ this.applyPath(pathEntity); -+ } else if (pathEntity.f() < pathEntity.e()) { -+ vec3d = this.b(); -+ Vec3D vec3d1 = pathEntity.a(this.a, pathEntity.f()); -+ -+ if (vec3d.y > vec3d1.y && !this.a.isOnGround() && MathHelper.floor(vec3d.x) == MathHelper.floor(vec3d1.x) && MathHelper.floor(vec3d.z) == MathHelper.floor(vec3d1.z)) { -+ pathEntity.c(pathEntity.f() + 1); -+ } -+ } -+ -+ if (shouldContinuePathfind(pathEntity)) -+ return; -+ //PacketDebug.a(this.b, this.a, pathEntity, this.l); -+ vec3d = pathEntity.a((Entity) this.a); -+ BlockPosition blockposition = new BlockPosition(vec3d); -+ -+ this.a.getControllerMove().a(vec3d.x, this.b.getType(blockposition.down()).isAir() ? vec3d.y : PathfinderNormal.a((IBlockAccess) this.b, blockposition), vec3d.z, this.d); -+ } -+/* protected void l() { - Vec3D vec3d = this.b(); - - this.l = this.a.getWidth() > 0.75F ? this.a.getWidth() / 2.0F : 0.75F - this.a.getWidth() / 2.0F; -@@ -273,8 +360,26 @@ public abstract class NavigationAbstract { - } - - this.a(vec3d); -- } -+ }*/ -+ -+ // Akarin start - Async pathfinder, copied from above with param -+ protected void applyPath(PathEntity pathEntity) { -+ Vec3D vec3d = this.b(); -+ -+ this.l = this.a.getWidth() > 0.75F ? this.a.getWidth() / 2.0F : 0.75F - this.a.getWidth() / 2.0F; -+ BaseBlockPosition baseblockposition = pathEntity.g(); -+ double d0 = Math.abs(this.a.locX() - ((double) baseblockposition.getX() + 0.5D)); -+ double d1 = Math.abs(this.a.locY() - (double) baseblockposition.getY()); -+ double d2 = Math.abs(this.a.locZ() - ((double) baseblockposition.getZ() + 0.5D)); -+ boolean flag = d0 < (double) this.l && d2 < (double) this.l && d1 < 1.0D; - -+ if (flag || this.a.b(pathEntity.h().l) && this.b(vec3d)) { -+ pathEntity.c(pathEntity.f() + 1); -+ } -+ -+ this.applyPath0(pathEntity, vec3d); -+ } -+ // Akarin end - private boolean b(Vec3D vec3d) { - if (this.c.e() <= this.c.f() + 1) { - return false; -@@ -324,7 +429,39 @@ public abstract class NavigationAbstract { - } - - } -+ // Akarin start - Async pathfinder, copied from above with param -+ protected void applyPath0(PathEntity pathEntity, Vec3D vec3d) { -+ if (this.e - this.f > 100) { -+ if (vec3d.distanceSquared(this.g) < 2.25D) { -+ this.o(); -+ } -+ -+ this.f = this.e; -+ this.g = vec3d; -+ } -+ -+ if (!pathEntity.b()) { -+ BaseBlockPosition baseblockposition = pathEntity.g(); -+ -+ if (baseblockposition.equals(this.h)) { -+ this.i += SystemUtils.getMonotonicMillis() - this.j; -+ } else { -+ this.h = baseblockposition; -+ double d0 = vec3d.f(Vec3D.c(this.h)); -+ -+ this.k = this.a.dM() > 0.0F ? d0 / (double) this.a.dM() * 1000.0D : 0.0D; -+ } -+ -+ if (this.k > 0.0D && (double) this.i > this.k * 3.0D) { -+ this.e(); -+ this.o(); -+ } -+ -+ this.j = SystemUtils.getMonotonicMillis(); -+ } - -+ } -+ // Akarin end - private void e() { - this.h = BaseBlockPosition.ZERO; - this.i = 0L; -@@ -389,7 +526,11 @@ public abstract class NavigationAbstract { - public boolean r() { - return this.o.e(); - } -- -+ // Akarin start - Async pathfinder, copied from above with param -+ public static boolean shouldContinuePathfind(PathEntity pathEntity) { -+ return pathEntity == null || pathEntity.b(); -+ } -+ // Akarin end - public void b(BlockPosition blockposition) { - if (this.c != null && !this.c.b() && this.c.e() != 0) { // Tuinity - diff on change - needed for isViableForPathRecalculationChecking() - PathPoint pathpoint = this.c.c(); -diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java -index 0c33a0c9d59d79a39826b5ee14144604717ffebe..cf3f4c1a2a89cce0345566a62faa34ef7e93c603 100644 ---- a/src/main/java/net/minecraft/server/NavigationFlying.java -+++ b/src/main/java/net/minecraft/server/NavigationFlying.java -@@ -28,7 +28,7 @@ public class NavigationFlying extends NavigationAbstract { - return this.a(entity.getChunkCoordinates(), entity, i); // Paper - Forward target entity - } - -- @Override -+/* @Override - public void c() { - ++this.e; - if (this.m) { -@@ -53,6 +53,31 @@ public class NavigationFlying extends NavigationAbstract { - this.a.getControllerMove().a(vec3d.x, vec3d.y, vec3d.z, this.d); - } - } -+ }*/ -+ -+ // This was copied from above partly with param -+ @Override -+ public void doTickAsync(PathEntity pathEntity) { -+ if (shouldContinuePathfind(pathEntity)) -+ return; -+ -+ Vec3D vec3d; -+ if (this.a()) { -+ this.applyPath(pathEntity); -+ } else if (pathEntity != null && pathEntity.f() < pathEntity.e()) { -+ vec3d = pathEntity.a(this.a, pathEntity.f()); -+ if (MathHelper.floor(this.a.locX()) == MathHelper.floor(vec3d.x) && MathHelper.floor(this.a.locY()) == MathHelper.floor(vec3d.y) && MathHelper.floor(this.a.locZ()) == MathHelper.floor(vec3d.z)) { -+ pathEntity.c(pathEntity.f() + 1); -+ } -+ } -+ -+ if (shouldContinuePathfind(pathEntity)) -+ return; -+ //PacketDebug.a(this.b, this.a, pathEntity, this.l); -+ vec3d = pathEntity.a((Entity) this.a); -+ BlockPosition blockposition = new BlockPosition(vec3d); -+ -+ this.a.getControllerMove().a(vec3d.x, vec3d.y, vec3d.z, this.d); - } - - @Override -diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java -index 1c3a8043e735ec4605635efcfc5deb08a35ea1fd..bf2ac046eebd7f88fcb1d953f37952e791e6ea83 100644 ---- a/src/main/java/net/minecraft/server/Pathfinder.java -+++ b/src/main/java/net/minecraft/server/Pathfinder.java -@@ -26,7 +26,7 @@ public class Pathfinder { - } - - @Nullable -- public PathEntity a(ChunkCache chunkcache, EntityInsentient entityinsentient, Set set, float f, int i, float f1) { -+ public synchronized PathEntity a(ChunkCache chunkcache, EntityInsentient entityinsentient, Set set, float f, int i, float f1) { // Akarin - synchronized - this.d.a(); - this.c.a(chunkcache, entityinsentient); - PathPoint pathpoint = this.c.b(); -diff --git a/src/main/java/net/minecraft/server/PathfinderTurtle.java b/src/main/java/net/minecraft/server/PathfinderTurtle.java -index cea160885783e8666b616375eac44ba6d1880e1f..9598563b4f97500fd3fba0165813d564d9c96c4f 100644 ---- a/src/main/java/net/minecraft/server/PathfinderTurtle.java -+++ b/src/main/java/net/minecraft/server/PathfinderTurtle.java -@@ -148,7 +148,7 @@ public class PathfinderTurtle extends PathfinderNormal { - if (pathtype == PathType.OPEN) { - AxisAlignedBB axisalignedbb = new AxisAlignedBB((double) i - d2 + 0.5D, (double) j + 0.001D, (double) k - d2 + 0.5D, (double) i + d2 + 0.5D, (double) ((float) j + this.b.getHeight()), (double) k + d2 + 0.5D); - -- if (!this.b.world.getCubes(this.b, axisalignedbb)) { -+ if (!this.a.getCubes(this.b, axisalignedbb)) { // Akarin - use chunk cache - return null; - } - -diff --git a/src/main/java/net/minecraft/server/PathfinderWater.java b/src/main/java/net/minecraft/server/PathfinderWater.java -index fba6692a1e537b90e20aa448567c0ad6db653332..d576edc8c30288e98aeda8f1cb561b22c6b37536 100644 ---- a/src/main/java/net/minecraft/server/PathfinderWater.java -+++ b/src/main/java/net/minecraft/server/PathfinderWater.java -@@ -63,7 +63,7 @@ public class PathfinderWater extends PathfinderAbstract { - @Override - protected PathPoint a(int i, int j, int k) { - PathPoint pathpoint = null; -- PathType pathtype = this.a(this.b.world, i, j, k); -+ PathType pathtype = this.a(this.a, i, j, k); // Akarin - use chunk cache - float f = this.b.a(pathtype); - - if (f >= 0.0F) { diff --git a/scripts/applyUpstream.sh b/scripts/applyUpstream.sh index 51c92ecb..eb1a93e2 100755 --- a/scripts/applyUpstream.sh +++ b/scripts/applyUpstream.sh @@ -14,7 +14,7 @@ git config commit.gpgsign false cd $1/patches/$2 for D in ${searchtxts[@]}; do echo "IMPORTANT:!!! $D" - if [ true ]; then + if [ -d $1/patches/$2/$dnoslashlower ]; then echo $D dnoslash=$D echo "DnoS: $dnoslash" diff --git a/scripts/getUpstream.sh b/scripts/getUpstream.sh index 690e8d5d..3068305b 100755 --- a/scripts/getUpstream.sh +++ b/scripts/getUpstream.sh @@ -12,36 +12,38 @@ for D in */; do if [[ $dnoslash != "api" ]]; then echo "Found $dnoslash directory!" for file in ${searchtxts[@]}; do - i=0 - rm -rf -f "$1/patches/$dnoslash/$file/" - echo "Looking for $file file!" - echo "$(cat $patchdir/$dnoslash/$file.txt)" - IFS='&' - read -ra ADDR <<< $(cat $patchdir/$dnoslash/$file.txt) - for patch in ${ADDR[@]}; do - echo "Found $patch in $file!" - echo $1/$dnoslash/patches/$file - for filename in $1/$dnoslash/patches/$file/*.patch; do - filenamend="${filename##*/}" - filenamens=${filenamend%/*} - #filenameedited=${filenamens%.*} # retain the part before the period - filenameedited=${filenamens::-6} - #echo $filenameedited - filenameedited=${filenameedited:5} # retain the part after the frist slash - if [[ $filenameedited == $patch ]]; then - echo "Found Matching file!" - if [[ $i == 0 ]]; then - echo "Making $file dir in $dnoslash patch dir" - mkdir $1/patches/$dnoslash/$file + if [ -f "$1/patches/$dnoslash/$file.txt" ]; then + i=0 + rm -rf -f "$1/patches/$dnoslash/$file/" + echo "Looking for $file file!" + echo "$(cat $patchdir/$dnoslash/$file.txt)" + IFS='&' + read -ra ADDR <<< $(cat $patchdir/$dnoslash/$file.txt) + for patch in ${ADDR[@]}; do + echo "Found $patch in $file!" + echo $1/$dnoslash/patches/$file + for filename in $1/$dnoslash/patches/$file/*.patch; do + filenamend="${filename##*/}" + filenamens=${filenamend%/*} + #filenameedited=${filenamens%.*} # retain the part before the period + filenameedited=${filenamens::-6} + #echo $filenameedited + filenameedited=${filenameedited:5} # retain the part after the frist slash + if [[ $filenameedited == $patch ]]; then + echo "Found Matching file!" + if [[ $i == 0 ]]; then + echo "Making $file dir in $dnoslash patch dir" + mkdir $1/patches/$dnoslash/$file + fi + ((i=i+1)) + printf -v num "%04d" $i + echo "Making ${num}-${patch}.patch file for Yatopia" + cp $1/$dnoslash/patches/$file/$filenamens $1/patches/$dnoslash/$file/"${num}-${patch}.patch" fi - ((i=i+1)) - printf -v num "%04d" $i - echo "Making ${num}-${patch}.patch file for Yatopia" - cp $1/$dnoslash/patches/$file/$filenamens $1/patches/$dnoslash/$file/"${num}-${patch}.patch" - fi + done done - done - IFS=' ' + IFS=' ' + fi done $1/scripts/applyUpstream.sh $1 $dnoslash || exit 1 fi