From 58e66daeb4d7315b76245536b81e5c09b449454f Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Mon, 28 Dec 2020 11:34:56 +0200 Subject: [PATCH 01/10] Updated Upstream and Sidestream(s) (Tuinity/Origami/Purpur/AirplaneLite) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: a405b1b Merge branch 'master' of https://github.com/Spottedleaf/Tuinity into ver/1.16.4 f06591a Updated Upstream (Paper) 48d3556 Prevent light queue overfill when no players are online Origami Changes: 78f4af0 Require Java 11 b70595f Fix patch rebuilding for MojangAPI module 34170a7 Update Paper Purpur Changes: 3d455ff Updated Upstream (Paper & Tuinity) 7152b72 [ci-skip] Use shadowJar output as input for paperclip 822a35a [ci-skip] Publish shadowJar as server artifact f142481 Resolves #125 - Full netherite armor grants fire resistance 5e269e1 Updated Upstream (Paper) AirplaneLite Changes: 9326301 Update upstream, fix utf8 --- AirplaneLite | 2 +- Origami | 2 +- Purpur | 2 +- Tuinity | 2 +- patches/server/0001-Yatopia-Server-Fixes.patch | 6 +++--- patches/server/0007-Yatopia-configuration.patch | 2 +- .../server/0008-Per-entity-type-collision-settings.patch | 2 +- patches/server/0013-lithium-MixinBox.patch | 4 ++-- patches/server/0014-lithium-enum_values.patch | 2 +- patches/server/0025-Fix-lead-fall-dmg-config.patch | 4 ++-- patches/server/0062-Use-faster-random-implementation.patch | 2 +- ...-not-update-distance-map-when-animal-and-mob-spawn.patch | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/AirplaneLite b/AirplaneLite index 20b8c796..93263016 160000 --- a/AirplaneLite +++ b/AirplaneLite @@ -1 +1 @@ -Subproject commit 20b8c796f4b66bce7bc3be496f5c9e9edef1d226 +Subproject commit 93263016b44914c8cfced4d3b4b4635fc74ff839 diff --git a/Origami b/Origami index 36c0e05c..78f4af04 160000 --- a/Origami +++ b/Origami @@ -1 +1 @@ -Subproject commit 36c0e05ca7b28d77f18fcd698c9b57f6c35d0ece +Subproject commit 78f4af0495caff22cce5e8a05b2e2b15f85af1ba diff --git a/Purpur b/Purpur index 5758335e..3d455ff2 160000 --- a/Purpur +++ b/Purpur @@ -1 +1 @@ -Subproject commit 5758335e73176ec765e6d8c73b78c3f39f5262ee +Subproject commit 3d455ff2d59d2e08a1675ce84250e4883a19525c diff --git a/Tuinity b/Tuinity index 86b20d4e..a405b1bc 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 86b20d4ea11e52f1d5e9509351ac577e8a9cdce5 +Subproject commit a405b1bc440bd372630069e20886082f3fd52ebf diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index 9173a9fc..6191d784 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -197,7 +197,7 @@ index 86f1cfe454ea0a989775b49a6b88375c766ef647..da53af61d1171db3c167c6e007adf953 if (!(this.k instanceof EntityPlayer)) { throw CommandListenerWrapper.a.create(); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 985d0d4aea2210e908ac76fbeafc0c895372aee7..d224b1d0e224853e825486559938aed2c56c3981 100644 +index 77100ab382b33aef8b2194b611c0b1d454da91fd..1ece3e1e9e7a26f1ee07202916687f627c9e4c95 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -434,7 +434,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -394,7 +394,7 @@ index 07d47ad2362c5ebfa7993262a8faed240cc21717..107d7ac761bfb7667dfab88b31712e20 this.world = new CraftWorld((WorldServer) this, gen, env); 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 313aa8f7d47c53a6a0130994c9d61d7c073c95c6..0000000000000000000000000000000000000000 +index f4e9c5a0136d3a0ed813efec7fe8a0e7f256cf40..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/World.java.rej +++ /dev/null @@ -1,18 +0,0 @@ @@ -411,7 +411,7 @@ index 313aa8f7d47c53a6a0130994c9d61d7c073c95c6..00000000000000000000000000000000 -@@ -124,6 +126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper - this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot -- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper +- this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper -+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config - this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray - this.generator = gen; diff --git a/patches/server/0007-Yatopia-configuration.patch b/patches/server/0007-Yatopia-configuration.patch index 466bd170..46db39d4 100644 --- a/patches/server/0007-Yatopia-configuration.patch +++ b/patches/server/0007-Yatopia-configuration.patch @@ -47,7 +47,7 @@ index 3ee8d31c453105eca7b96bede39a9ebbf40e1c2c..0a9f03526abf0638ada15d9810b94988 this.setAllowFlight(dedicatedserverproperties.allowFlight); this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba()); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 36c6968ac03872004d46e70f38c5a515621b8eb1..1597eec51d69f6fc136eda5e1b6bdcdb3fceeb69 100644 +index 7034da84c5534d5e1acff645dc9e7d60ddf315fb..b1fa51050ca3deb9a7cfc732d5415010d753ada4 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/0008-Per-entity-type-collision-settings.patch b/patches/server/0008-Per-entity-type-collision-settings.patch index 67d58fd8..f5d1da9a 100644 --- a/patches/server/0008-Per-entity-type-collision-settings.patch +++ b/patches/server/0008-Per-entity-type-collision-settings.patch @@ -59,7 +59,7 @@ index 537456a7427cddd6783f5b5d8ee2d655668c4c53..004184a7c3da4f72f68a5fd9b4dd5abd } \ 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 1597eec51d69f6fc136eda5e1b6bdcdb3fceeb69..615dc8586b692138446998bd6a1dc245d3c65c70 100644 +index b1fa51050ca3deb9a7cfc732d5415010d753ada4..2f0e9e3fc184d803aa81b2d4d0b52927f575f69b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2870,7 +2870,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0013-lithium-MixinBox.patch b/patches/server/0013-lithium-MixinBox.patch index 3c15d01a..275ba37e 100644 --- a/patches/server/0013-lithium-MixinBox.patch +++ b/patches/server/0013-lithium-MixinBox.patch @@ -7,10 +7,10 @@ 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.16.x/fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 20e9e06b36cda913809b46e71144d212322619aa..ed5b153f081b8c42b92cb8b195ff54d18e900490 100644 +index acd009844099293befd28c5f1c20d947016fa19b..4fb61603ca2d7cb7df9742c72117f4d33bd2bbdf 100644 --- a/src/main/java/net/minecraft/server/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java -@@ -194,12 +194,38 @@ public class AxisAlignedBB { +@@ -202,12 +202,38 @@ public class AxisAlignedBB { return new AxisAlignedBB(vec3d.x, vec3d.y, vec3d.z, vec3d.x + 1.0D, vec3d.y + 1.0D, vec3d.z + 1.0D); } diff --git a/patches/server/0014-lithium-enum_values.patch b/patches/server/0014-lithium-enum_values.patch index e6d53bbf..93a67665 100644 --- a/patches/server/0014-lithium-enum_values.patch +++ b/patches/server/0014-lithium-enum_values.patch @@ -39,7 +39,7 @@ index 5d3bb5f393a1e0e4a2e8b9a466530a91279697a9..7f084e7f11a829c10d113c7fb39eec0b 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 615dc8586b692138446998bd6a1dc245d3c65c70..ddd9f3cca681b067515d8a8d217d03747c3352a3 100644 +index 2f0e9e3fc184d803aa81b2d4d0b52927f575f69b..230e798c03edb57fe8733887d09150f67eb2bbfa 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2591,10 +2591,12 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0025-Fix-lead-fall-dmg-config.patch b/patches/server/0025-Fix-lead-fall-dmg-config.patch index e8f5f600..f2c84219 100644 --- a/patches/server/0025-Fix-lead-fall-dmg-config.patch +++ b/patches/server/0025-Fix-lead-fall-dmg-config.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix lead fall dmg config diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index d224b1d0e224853e825486559938aed2c56c3981..0bca08dc6ffd367de7cffab0433900d6bfe555cf 100644 +index 1ece3e1e9e7a26f1ee07202916687f627c9e4c95..540bd5ccb01789d9130ea64a78dc125f94f94bb6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1290,6 +1290,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1301,6 +1301,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance = 0.0F; } else if (d0 < 0.0D) { this.fallDistance = (float) ((double) this.fallDistance - d0); diff --git a/patches/server/0062-Use-faster-random-implementation.patch b/patches/server/0062-Use-faster-random-implementation.patch index ac349ba0..80f87d56 100644 --- a/patches/server/0062-Use-faster-random-implementation.patch +++ b/patches/server/0062-Use-faster-random-implementation.patch @@ -58,7 +58,7 @@ index 38dc6086d18951e065d4048d1d8eee288c5c5fd1..4e094f0e1117cecbd39be645997eb9d3 this.f = ShapeDetectorBuilder.a().a(" ", " ", " ", " # ", " ", " ", " ").a(" ", " ", " ", " # ", " ", " ", " ").a(" ", " ", " ", " # ", " ", " ", " ").a(" ### ", " # # ", "# #", "# # #", "# #", " # # ", " ### ").a(" ", " ### ", " ##### ", " ##### ", " ##### ", " ### ", " ").a('#', ShapeDetectorBlock.a(BlockPredicate.a(Blocks.BEDROCK))).b(); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0bca08dc6ffd367de7cffab0433900d6bfe555cf..51c4ff1bd6948ab46d723c37af39c76cdf662be5 100644 +index 540bd5ccb01789d9130ea64a78dc125f94f94bb6..cbf9c61d535f1f99f08b1ee71a890a74d7f6d834 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -61,7 +61,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch b/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch index 0c65d9eb..93eaea47 100644 --- a/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch +++ b/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch @@ -9,7 +9,7 @@ Licensed under Bukkit and CraftBukkit's original license, GPLv3 The following patch should be treated as it is licensed in GPLv3 diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 84429f12d0c6e0990b7cbb1b503b7868b3a02b14..f04a5a526748f913e885b673dda793e5bb16c1b7 100644 +index 12d9b73ccc2f4406957932397746cac7902d650e..a0d4a175720a2285dca2eaee96fc614104a76bcc 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -982,7 +982,7 @@ public class ChunkProviderServer extends IChunkProvider { From 011dd344e4484e69b1acb616ba2a2c86cc586902 Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Tue, 29 Dec 2020 08:52:57 +0200 Subject: [PATCH 02/10] Add a special case for floodgate and offline uuids floodgate spoofs uuids, but plugins such as luckperms get the uuid that the server uses, causing problems if this option is configured properly, such things won't happen --- PATCHES.md | 1 + ...case-for-floodgate-and-offline-uuids.patch | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch diff --git a/PATCHES.md b/PATCHES.md index fc4904fb..b7ed1a69 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -18,6 +18,7 @@ # Patches | server | Add NBT API as a first-class lib | tr7zw | | | api | Add StructureLocateEvent | dfsek | | | server | Add StructureLocateEvent | dfsek | | +| server | Add a special case for floodgate and offline uuids | Ivan Pekov | | | server | Add component util | William Blake Galbreath | | | api | Add last tick time API | Ivan Pekov | tr7zw | | server | Add last tick time API | Ivan Pekov | tr7zw | diff --git a/patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch b/patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch new file mode 100644 index 00000000..061d1dcf --- /dev/null +++ b/patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ivan Pekov +Date: Tue, 29 Dec 2020 08:47:43 +0200 +Subject: [PATCH] Add a special case for floodgate and offline uuids + +floodgate spoofs uuids, but plugins such as luckperms get the uuid that the server uses, causing problems +if this option is configured properly, such things won't happen + +diff --git a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java +index 2d4fb0a4664578f8d5c23db854eb8f2764724940..00c600d74ba84cb564b9b22f53f279a93839d71f 100644 +--- a/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java ++++ b/src/main/java/org/yatopiamc/yatopia/server/YatopiaConfig.java +@@ -225,7 +225,16 @@ public class YatopiaConfig { + fixFallDistance = getBoolean("settings.fixFallDistance", false); + } + ++ public static boolean usingFloodgate = false; ++ private static void usingFloodgate() { ++ usingFloodgate = getBoolean("settings.using-floodgate", false); ++ } ++ + public static boolean shouldUseOfflineUUID() { ++ if (usingFloodgate) { ++ // never cuz floodgate spoofs an uuid ++ return false; ++ } + if (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode) { + return false; + } From adb131f051faebec76c9888bc6cc48e5d97db3c4 Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Sun, 3 Jan 2021 13:41:36 +0200 Subject: [PATCH 03/10] Updated Upstream and Sidestream(s) (Tuinity/EMC/Purpur/AirplaneLite) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 2325c36 Updated Upstream (Paper) EMC Changes: a841b5a5 Fix more lore/item name issues (fixes witch gem issue) 1abb3fae Ensure server conversions on ExactChoice ingredients f2f9d2b0 Forgot to commit paper ref 388620d5 Updated Paper 7a0ae67b Add a null check for UUID to prevent npe later 9de409e0 Updated Paper 0d09eb9a Add new Empire Server API for managing fake players for the tablist Purpur Changes: da95725 Updated Upstream (Tuinity) 7194a16 Updated Upstream (Paper) 77373ea Updated Upstream (Tuinity) 0bae78d Drop async advancements patch for now AirplaneLite Changes: 7b4acbe h != k a07e80c Whoops, missed paperclip change 845c191 Add license to patch files fa671b7 Allow gradle wrapper in gitignore 04fc820 Rework strip raytracing patch f48f6b2 Updated Upstream (Tuinity) ec7c6df Fix encoding 9326301 Update upstream, fix utf8 20b8c79 Allow gradle wrapper in gitignore 6cd80e9 Updated Upstream (Tuinity) --- AirplaneLite | 2 +- Empirecraft | 2 +- PATCHES.md | 2 - Purpur | 2 +- Tuinity | 2 +- patches/AirplaneLite/server.txt | 2 +- ...006-Add-NBT-API-as-a-first-class-lib.patch | 4 +- .../server/0001-Yatopia-Server-Fixes.patch | 33 +++++++++++- patches/server/0002-Modify-POM.patch | 2 +- patches/server/0004-Utilities.patch | 2 +- ...010-Add-NBT-API-as-a-first-class-lib.patch | 2 +- .../server/0011-Modify-default-configs.patch | 6 +-- ...ize-furnance-fuel-and-recipe-lookups.patch | 29 ++-------- ...0020-Optimize-TileEntity-load-unload.patch | 2 +- ...0051-PaperPR-Fix-harming-potion-dupe.patch | 53 ------------------- ...051-lithium-PerlinNoiseSamplerMixin.patch} | 0 ...lithium-VoronoiBiomeAccessTypeMixin.patch} | 0 ...53-lithium-NoiseChunkGeneratorMixin.patch} | 0 ... => 0054-lithium-reduce-allocations.patch} | 0 ... => 0055-Smarter-statistics-ticking.patch} | 0 ...056-Configurable-criterion-triggers.patch} | 0 ...0057-Configurable-BlockPhysicsEvent.patch} | 0 ...ws.patch => 0058-Infinity-No-Arrows.patch} | 0 ...patch => 0059-Custom-Locale-Support.patch} | 0 ...> 0060-Configurable-movement-checks.patch} | 0 ...61-Use-faster-random-implementation.patch} | 2 +- ...-Configurable-enchanting-table-tick.patch} | 0 ...tance-map-when-animal-and-mob-spawn.patch} | 0 ...ase-for-floodgate-and-offline-uuids.patch} | 0 29 files changed, 50 insertions(+), 97 deletions(-) delete mode 100644 patches/server/0051-PaperPR-Fix-harming-potion-dupe.patch rename patches/server/{0052-lithium-PerlinNoiseSamplerMixin.patch => 0051-lithium-PerlinNoiseSamplerMixin.patch} (100%) rename patches/server/{0053-lithium-VoronoiBiomeAccessTypeMixin.patch => 0052-lithium-VoronoiBiomeAccessTypeMixin.patch} (100%) rename patches/server/{0054-lithium-NoiseChunkGeneratorMixin.patch => 0053-lithium-NoiseChunkGeneratorMixin.patch} (100%) rename patches/server/{0055-lithium-reduce-allocations.patch => 0054-lithium-reduce-allocations.patch} (100%) rename patches/server/{0056-Smarter-statistics-ticking.patch => 0055-Smarter-statistics-ticking.patch} (100%) rename patches/server/{0057-Configurable-criterion-triggers.patch => 0056-Configurable-criterion-triggers.patch} (100%) rename patches/server/{0058-Configurable-BlockPhysicsEvent.patch => 0057-Configurable-BlockPhysicsEvent.patch} (100%) rename patches/server/{0059-Infinity-No-Arrows.patch => 0058-Infinity-No-Arrows.patch} (100%) rename patches/server/{0060-Custom-Locale-Support.patch => 0059-Custom-Locale-Support.patch} (100%) rename patches/server/{0061-Configurable-movement-checks.patch => 0060-Configurable-movement-checks.patch} (100%) rename patches/server/{0062-Use-faster-random-implementation.patch => 0061-Use-faster-random-implementation.patch} (99%) rename patches/server/{0063-Configurable-enchanting-table-tick.patch => 0062-Configurable-enchanting-table-tick.patch} (100%) rename patches/server/{0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch => 0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch} (100%) rename patches/server/{0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch => 0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch} (100%) diff --git a/AirplaneLite b/AirplaneLite index 93263016..7b4acbef 160000 --- a/AirplaneLite +++ b/AirplaneLite @@ -1 +1 @@ -Subproject commit 93263016b44914c8cfced4d3b4b4635fc74ff839 +Subproject commit 7b4acbefa5139909dcfdb32e201bf3af437b6832 diff --git a/Empirecraft b/Empirecraft index d32f7b26..a841b5a5 160000 --- a/Empirecraft +++ b/Empirecraft @@ -1 +1 @@ -Subproject commit d32f7b265f971d588a1ee69eb25e74ad372e133d +Subproject commit a841b5a54e163bd6c9e1f9ab3c1d7876b932521f diff --git a/PATCHES.md b/PATCHES.md index b7ed1a69..31bc38e0 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -51,7 +51,6 @@ # Patches | server | Configurable villager brain ticks | William Blake Galbreath | | | server | Cows eat mushrooms | William Blake Galbreath | | | server | Custom Locale Support | Bud Gidiere | | -| server | DataBits slight optimization | Paul Sauve | | | api | Default permissions | William Blake Galbreath | | | server | Despawn rate config options per projectile type | jmp | | | api | Disable reload command | Ivan Pekov | | @@ -106,7 +105,6 @@ # Patches | server | Origami Server Config | Phoenix616 | | | server | PaperPR - Add hex color code support for console logging | Esophose | | | server | PaperPR - Projectile load/save limit per chunk | jmp | | -| server | PaperPR: Fix harming potion dupe | PepperCode1 | | | server | Per entity (type) collision settings | MrIvanPlays | tr7zw | | server | Persistent TileEntity Lore and DisplayName | jmp | | | api | PlayerAttackEntityEvent | Ivan Pekov | | diff --git a/Purpur b/Purpur index 3d455ff2..da957253 160000 --- a/Purpur +++ b/Purpur @@ -1 +1 @@ -Subproject commit 3d455ff2d59d2e08a1675ce84250e4883a19525c +Subproject commit da957253a39022c68bc1a8cc2914066791f4855c diff --git a/Tuinity b/Tuinity index a405b1bc..2325c367 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit a405b1bc440bd372630069e20886082f3fd52ebf +Subproject commit 2325c367106142f0a587764d32507560b937beca diff --git a/patches/AirplaneLite/server.txt b/patches/AirplaneLite/server.txt index e667ee12..adc227aa 100644 --- a/patches/AirplaneLite/server.txt +++ b/patches/AirplaneLite/server.txt @@ -1 +1 @@ -AirplaneLite-MC-Dev-Fixes&AirplaneLite-Data-Structs&Strip-raytracing-for-EntityLiving-hasLineOfSight&Simpler-ShapelessRecipes-comparison-for-Vanilla&Use-unmodifiableMap-instead-of-making-copy&DataBits-slight-optimization&Swap-priority-of-checks-in-chunk-ticking&Reduce-projectile-chunk-loading \ No newline at end of file +AirplaneLite-MC-Dev-Fixes&AirplaneLite-Data-Structs&Strip-raytracing-for-EntityLiving-hasLineOfSight&Simpler-ShapelessRecipes-comparison-for-Vanilla&Use-unmodifiableMap-instead-of-making-copy&Swap-priority-of-checks-in-chunk-ticking&Reduce-projectile-chunk-loading \ No newline at end of file diff --git a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch b/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch index cd8d2b65..57ae0b60 100644 --- a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch @@ -108,10 +108,10 @@ index 76e857c364fe79e20cf9bde54b65e5b7108174fd..dc7e9983b89726625acce95026b45695 + // Yatopia end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index ccd81fca25233c2a9c2a8c3f4dda3053d7b2e723..5ad9dfb7856b2f86947b12b5444b2f8147f72bbf 100644 +index 4f2520f7a4ca6d57a85924ada1068a055b9a01fb..9ac89fe309e5cb393bdda3a77f8313991ab77732 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -791,4 +791,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -792,4 +792,42 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { return itemMeta.hasItemFlag(flag); } // Paper end diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index 6191d784..471e2dd5 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -4,6 +4,37 @@ Date: Sun, 25 Oct 2020 12:23:35 -0500 Subject: [PATCH] Yatopia-Server-Fixes +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 3542746c427192ef836675af1acd002b20fd0649..c863cd41de1929d61d6289b81c0943625484fb96 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -714,4 +714,9 @@ public class PaperWorldConfig { + private void disableMobSpawnerSpawnEggTransformation() { + disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation); + } ++ ++ public int projectileSaveLimit = -1; ++ private void projectileSaveLimit() { ++ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit); ++ } + } +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej +deleted file mode 100644 +index 67f63901bdbae923eb6262d522b5198f9df5a7bc..0000000000000000000000000000000000000000 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej ++++ /dev/null +@@ -1,11 +0,0 @@ +-diff a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java (rejected hunks) +-@@ -709,4 +709,9 @@ public class PaperWorldConfig { +- private void fixCuringExploit() { +- fixCuringZombieVillagerDiscountExploit = getBoolean("game-mechanics.fix-curing-zombie-villager-discount-exploit", fixCuringZombieVillagerDiscountExploit); +- } +-+ +-+ public int projectileSaveLimit = -1; +-+ private void projectileSaveLimit() { +-+ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit); +-+ } +- } diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java index fe7330fabe386966c2d203a190a00a785ea21be0..537456a7427cddd6783f5b5d8ee2d655668c4c53 100644 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java @@ -373,7 +404,7 @@ index dd52a8fe4fd46e57a5d1af49ba1965a483cf4fcc..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/World.java b/src/main/java/net/minecraft/server/World.java -index 07d47ad2362c5ebfa7993262a8faed240cc21717..107d7ac761bfb7667dfab88b31712e2061a46258 100644 +index c2b5874a77ae8a992bc668dc19f5300bebf3d239..3bbfb0117187a26354fa58ec46eeb6e62845851e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -96,6 +96,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/patches/server/0002-Modify-POM.patch b/patches/server/0002-Modify-POM.patch index 55ac6f0d..bc273799 100644 --- a/patches/server/0002-Modify-POM.patch +++ b/patches/server/0002-Modify-POM.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM diff --git a/pom.xml b/pom.xml -index 78c2a8bbcc0132f891c8aa545529d20aa0d9eb57..9f2cc8fbc0bfaefd772904076e6fd4d0c78f30ee 100644 +index 174c0b67c1c5b41d80613128ebf2d78ee27f3cee..e20489a5834e9727a8c50435768ffe0e87af2188 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ diff --git a/patches/server/0004-Utilities.patch b/patches/server/0004-Utilities.patch index 177899d8..59313874 100644 --- a/patches/server/0004-Utilities.patch +++ b/patches/server/0004-Utilities.patch @@ -9,7 +9,7 @@ Co-authored-by: Mykyta Komarnytskyy Co-authored-by: Ivan Pekov diff --git a/pom.xml b/pom.xml -index 9f2cc8fbc0bfaefd772904076e6fd4d0c78f30ee..2acc51071e968333f85959d76b86e7e6e0ee828b 100644 +index e20489a5834e9727a8c50435768ffe0e87af2188..50fa602350b757a0444d104d5efd7b947aaf6cbd 100644 --- a/pom.xml +++ b/pom.xml @@ -166,6 +166,12 @@ diff --git a/patches/server/0010-Add-NBT-API-as-a-first-class-lib.patch b/patches/server/0010-Add-NBT-API-as-a-first-class-lib.patch index 9817577c..020f7cc2 100644 --- a/patches/server/0010-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/server/0010-Add-NBT-API-as-a-first-class-lib.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add NBT API as a first-class lib diff --git a/pom.xml b/pom.xml -index 2acc51071e968333f85959d76b86e7e6e0ee828b..4918a1e92d3515825402258605bcd9b4511420a5 100644 +index 50fa602350b757a0444d104d5efd7b947aaf6cbd..a590598ca65301c96ebbd1d93037731fb75f83e0 100644 --- a/pom.xml +++ b/pom.xml @@ -348,6 +348,10 @@ diff --git a/patches/server/0011-Modify-default-configs.patch b/patches/server/0011-Modify-default-configs.patch index a4f8c8c8..dfa17c81 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 041016de85360adacf4a5d0845bb1ebcc25a14b9..0f45769b5d8b9b6c4a89550db16576c5c7221e04 100644 +index ce14283dd1a1fddbea17c2fbaf1c4ef9d7a7479f..4a21a83c448355d61fb946bd0eb5d752767d536a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -206,7 +206,7 @@ public class PaperConfig { @@ -16,9 +16,9 @@ index 041016de85360adacf4a5d0845bb1ebcc25a14b9..0f45769b5d8b9b6c4a89550db16576c5 + boolean timings = getBoolean("timings.enabled", false); // Yatopia don't profile by default boolean verboseTimings = getBoolean("timings.verbose", true); TimingsManager.privacy = getBoolean("timings.server-name-privacy", false); - TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses")); + TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret")); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2452f54d96cab2d93140c64e25d9b799cbc94caa..c3f38f3228e0104d878b3e116f203efc64279710 100644 +index c863cd41de1929d61d6289b81c0943625484fb96..c99ed7a194c0a323bc21dfd3f46b911d80f9523a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -598,7 +598,7 @@ public class PaperWorldConfig { diff --git a/patches/server/0019-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch b/patches/server/0019-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch index 19aff42e..71e1bf3c 100644 --- a/patches/server/0019-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch +++ b/patches/server/0019-Heavily-optimize-furnance-fuel-and-recipe-lookups.patch @@ -6,33 +6,10 @@ Subject: [PATCH] Heavily optimize furnance fuel and recipe lookups Co-authored-by: Mykyta Komarn diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..77ea56c5a25fe09a1721429d42965ad34d905870 100644 +index e75e676d196d9f5a3409ec50645fab611b0afdad..fa2b88b54a419f506a195130e664701766720ceb 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java -@@ -83,7 +83,14 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I - this.c = recipes; - } - -+ private static Object2IntOpenHashMap cachedFuelMap = null; // Yatopia -+ - public static Map f() { -+ // Yatopia start -+ if(cachedFuelMap != null) { -+ return cachedFuelMap; -+ } -+ // Yatopia end - Map map = Maps.newLinkedHashMap(); - - a(map, (IMaterial) Items.LAVA_BUCKET, 20000); -@@ -146,6 +153,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I - a(map, (IMaterial) Blocks.FLETCHING_TABLE, 300); - a(map, (IMaterial) Blocks.SMITHING_TABLE, 300); - a(map, (IMaterial) Blocks.COMPOSTER, 300); -+ cachedFuelMap = new Object2IntOpenHashMap<>(map); // Yatopia - return map; - } - -@@ -271,7 +279,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -283,7 +283,10 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.cookTimeTotal); } } else { @@ -44,7 +21,7 @@ index 1d3c2dd93657fb5dc71ee6b444c585b54619d1e8..77ea56c5a25fe09a1721429d42965ad3 if (!this.isBurning() && this.canBurn(irecipe)) { // CraftBukkit start -@@ -597,4 +608,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I +@@ -609,4 +612,18 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I } } diff --git a/patches/server/0020-Optimize-TileEntity-load-unload.patch b/patches/server/0020-Optimize-TileEntity-load-unload.patch index 69d53a1d..82c56802 100644 --- a/patches/server/0020-Optimize-TileEntity-load-unload.patch +++ b/patches/server/0020-Optimize-TileEntity-load-unload.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimize TileEntity load/unload diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 107d7ac761bfb7667dfab88b31712e2061a46258..95b9663e072991004904365cfc2ba11edb01de20 100644 +index 3bbfb0117187a26354fa58ec46eeb6e62845851e..ed2f75195d7a39882675af9ff0a7e8e7d208f906 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -42,8 +42,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/patches/server/0051-PaperPR-Fix-harming-potion-dupe.patch b/patches/server/0051-PaperPR-Fix-harming-potion-dupe.patch deleted file mode 100644 index 93bc4d32..00000000 --- a/patches/server/0051-PaperPR-Fix-harming-potion-dupe.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> -Date: Mon, 19 Oct 2020 15:56:47 +0300 -Subject: [PATCH] PaperPR: Fix harming potion dupe - - -diff --git a/src/main/java/net/minecraft/server/ItemPotion.java b/src/main/java/net/minecraft/server/ItemPotion.java -index 7862b63a245222d9a3d0896bdb2741b0e5e7ac40..04e48b195387410d9494ef87beba15e8d9e0419d 100644 ---- a/src/main/java/net/minecraft/server/ItemPotion.java -+++ b/src/main/java/net/minecraft/server/ItemPotion.java -@@ -22,6 +22,8 @@ public class ItemPotion extends Item { - CriterionTriggers.z.a((EntityPlayer) entityhuman, itemstack); - } - -+ List instantLater = new java.util.ArrayList<>(); // Yatopia -+ - if (!world.isClientSide) { - List list = PotionUtil.getEffects(itemstack); - Iterator iterator = list.iterator(); -@@ -30,7 +32,7 @@ public class ItemPotion extends Item { - MobEffect mobeffect = (MobEffect) iterator.next(); - - if (mobeffect.getMobEffect().isInstant()) { -- mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D); -+ instantLater.add(mobeffect); // Yatopia - } else { - entityliving.addEffect(new MobEffect(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.POTION_DRINK); // CraftBukkit - } -@@ -44,7 +46,24 @@ public class ItemPotion extends Item { - } - } - -+ // Yatopia start - fix harming potion dupe -+ if (!world.isClientSide) { -+ int len = instantLater.size(); -+ while (len > 0) { -+ MobEffect mobeffect = instantLater.remove(0); -+ mobeffect.getMobEffect().applyInstantEffect(entityhuman, entityhuman, entityliving, mobeffect.getAmplifier(), 1.0D); -+ len--; -+ } -+ } -+ // Yatopia end -+ - if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) { -+ // Yatopia start - fix harming potion dupe -+ if (entityliving.getHealth() <= 0 && !(entityhuman != null && entityliving.world.getGameRules().getBoolean(GameRules.KEEP_INVENTORY))) { -+ entityliving.dropItem(new ItemStack(Items.GLASS_BOTTLE), 0); -+ return ItemStack.NULL_ITEM; -+ } -+ // Yatopia end - if (itemstack.isEmpty()) { - return new ItemStack(Items.GLASS_BOTTLE); - } diff --git a/patches/server/0052-lithium-PerlinNoiseSamplerMixin.patch b/patches/server/0051-lithium-PerlinNoiseSamplerMixin.patch similarity index 100% rename from patches/server/0052-lithium-PerlinNoiseSamplerMixin.patch rename to patches/server/0051-lithium-PerlinNoiseSamplerMixin.patch diff --git a/patches/server/0053-lithium-VoronoiBiomeAccessTypeMixin.patch b/patches/server/0052-lithium-VoronoiBiomeAccessTypeMixin.patch similarity index 100% rename from patches/server/0053-lithium-VoronoiBiomeAccessTypeMixin.patch rename to patches/server/0052-lithium-VoronoiBiomeAccessTypeMixin.patch diff --git a/patches/server/0054-lithium-NoiseChunkGeneratorMixin.patch b/patches/server/0053-lithium-NoiseChunkGeneratorMixin.patch similarity index 100% rename from patches/server/0054-lithium-NoiseChunkGeneratorMixin.patch rename to patches/server/0053-lithium-NoiseChunkGeneratorMixin.patch diff --git a/patches/server/0055-lithium-reduce-allocations.patch b/patches/server/0054-lithium-reduce-allocations.patch similarity index 100% rename from patches/server/0055-lithium-reduce-allocations.patch rename to patches/server/0054-lithium-reduce-allocations.patch diff --git a/patches/server/0056-Smarter-statistics-ticking.patch b/patches/server/0055-Smarter-statistics-ticking.patch similarity index 100% rename from patches/server/0056-Smarter-statistics-ticking.patch rename to patches/server/0055-Smarter-statistics-ticking.patch diff --git a/patches/server/0057-Configurable-criterion-triggers.patch b/patches/server/0056-Configurable-criterion-triggers.patch similarity index 100% rename from patches/server/0057-Configurable-criterion-triggers.patch rename to patches/server/0056-Configurable-criterion-triggers.patch diff --git a/patches/server/0058-Configurable-BlockPhysicsEvent.patch b/patches/server/0057-Configurable-BlockPhysicsEvent.patch similarity index 100% rename from patches/server/0058-Configurable-BlockPhysicsEvent.patch rename to patches/server/0057-Configurable-BlockPhysicsEvent.patch diff --git a/patches/server/0059-Infinity-No-Arrows.patch b/patches/server/0058-Infinity-No-Arrows.patch similarity index 100% rename from patches/server/0059-Infinity-No-Arrows.patch rename to patches/server/0058-Infinity-No-Arrows.patch diff --git a/patches/server/0060-Custom-Locale-Support.patch b/patches/server/0059-Custom-Locale-Support.patch similarity index 100% rename from patches/server/0060-Custom-Locale-Support.patch rename to patches/server/0059-Custom-Locale-Support.patch diff --git a/patches/server/0061-Configurable-movement-checks.patch b/patches/server/0060-Configurable-movement-checks.patch similarity index 100% rename from patches/server/0061-Configurable-movement-checks.patch rename to patches/server/0060-Configurable-movement-checks.patch diff --git a/patches/server/0062-Use-faster-random-implementation.patch b/patches/server/0061-Use-faster-random-implementation.patch similarity index 99% rename from patches/server/0062-Use-faster-random-implementation.patch rename to patches/server/0061-Use-faster-random-implementation.patch index 80f87d56..7a1dda66 100644 --- a/patches/server/0062-Use-faster-random-implementation.patch +++ b/patches/server/0061-Use-faster-random-implementation.patch @@ -245,7 +245,7 @@ index f0fdfd6891e59891e7370a2d682b65c647b28e9e..8d5fe0880f4f2bffe14dc1c7163cde69 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 95b9663e072991004904365cfc2ba11edb01de20..c63d728082e28c13bc9724e74b154d02fbb2392e 100644 +index ed2f75195d7a39882675af9ff0a7e8e7d208f906..b9a4d29382f4693eb94b39cabfc46b7e952b9306 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -48,13 +48,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/patches/server/0063-Configurable-enchanting-table-tick.patch b/patches/server/0062-Configurable-enchanting-table-tick.patch similarity index 100% rename from patches/server/0063-Configurable-enchanting-table-tick.patch rename to patches/server/0062-Configurable-enchanting-table-tick.patch diff --git a/patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch b/patches/server/0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch similarity index 100% rename from patches/server/0064-Do-not-update-distance-map-when-animal-and-mob-spawn.patch rename to patches/server/0063-Do-not-update-distance-map-when-animal-and-mob-spawn.patch diff --git a/patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch b/patches/server/0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch similarity index 100% rename from patches/server/0065-Add-a-special-case-for-floodgate-and-offline-uuids.patch rename to patches/server/0064-Add-a-special-case-for-floodgate-and-offline-uuids.patch From 9cd8a35964bc24bdc26d37e7bcd98bd983555abf Mon Sep 17 00:00:00 2001 From: SoSeDiK Date: Sun, 3 Jan 2021 13:45:56 +0200 Subject: [PATCH 04/10] Update NBT-API (#329) --- ...006-Add-NBT-API-as-a-first-class-lib.patch | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch b/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch index 57ae0b60..fb5238f7 100644 --- a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add NBT API as a first-class lib diff --git a/pom.xml b/pom.xml -index 31aba885d940acf0a9df5d4e83dfec69030b2a37..afe3477c9a577a5fa1ef6c7dfd5a221fd3ca9f6b 100644 +index 31aba885d940acf0a9df5d4e83dfec69030b2a37..cb8eaf5dd3c89193960a433cdc5b6c2903076499 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,11 @@ @@ -27,7 +27,7 @@ index 31aba885d940acf0a9df5d4e83dfec69030b2a37..afe3477c9a577a5fa1ef6c7dfd5a221f + + de.tr7zw + item-nbt-api -+ 2.6.0 ++ 2.7.1 + @@ -45,6 +45,27 @@ index 31aba885d940acf0a9df5d4e83dfec69030b2a37..afe3477c9a577a5fa1ef6c7dfd5a221f +diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java +index 98263d896f316983609432c45b85401a2692432d..afaa459d2c351f99b598ec9054a6838ffb0098e8 100644 +--- a/src/main/java/org/bukkit/Chunk.java ++++ b/src/main/java/org/bukkit/Chunk.java +@@ -275,4 +275,16 @@ public interface Chunk extends PersistentDataHolder { + * @return if the block is contained within + */ + boolean contains(@NotNull BlockData block); ++ ++ // Yatopia start ++ /** ++ * Returns a custom tag container of this chunk. ++ * ++ * @return custom NBT tags container ++ */ ++ @NotNull ++ default de.tr7zw.changeme.nbtapi.NBTCompound getNBTC() { ++ return new de.tr7zw.changeme.nbtapi.NBTChunk(this).getPersistentDataContainer(); ++ } ++ // Yatopia end + } diff --git a/src/main/java/org/bukkit/block/TileState.java b/src/main/java/org/bukkit/block/TileState.java index 3b10fcc13893403b29f0260b8605144679e89b82..1e9a96d8b08cc396acf73dc42083009354e89d8a 100644 --- a/src/main/java/org/bukkit/block/TileState.java From ea14d2c947a18b488915aff1cc028d140b718e34 Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Mon, 4 Jan 2021 10:38:27 +0200 Subject: [PATCH 05/10] Updated Upstream and Sidestream(s) (Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 076174a Updated Upstream (Paper) --- Tuinity | 2 +- patches/server/0001-Yatopia-Server-Fixes.patch | 4 ++-- patches/server/0003-Brandings.patch | 4 ++-- patches/server/0006-Add-last-tick-time-API.patch | 6 +++--- patches/server/0011-Modify-default-configs.patch | 4 ++-- .../server/0037-Respect-PlayerKickEvent-leaveMessage.patch | 2 +- ...timize-whitelist-command-for-multiple-additions-re.patch | 4 ++-- patches/server/0047-Configurable-flight-checks.patch | 2 +- patches/server/0057-Configurable-BlockPhysicsEvent.patch | 4 ++-- patches/server/0060-Configurable-movement-checks.patch | 2 +- patches/server/0061-Use-faster-random-implementation.patch | 6 +++--- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Tuinity b/Tuinity index 2325c367..076174a1 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 2325c367106142f0a587764d32507560b937beca +Subproject commit 076174a1116aee549bc536af1bb08a41272415c6 diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index 471e2dd5..cef48b96 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Yatopia-Server-Fixes diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 3542746c427192ef836675af1acd002b20fd0649..c863cd41de1929d61d6289b81c0943625484fb96 100644 +index 80409c4b52a4bb7146760070dae0e04d49bdd6b3..0bca517b4948cd55bfbf3ba4d5c1b3cd895cc086 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -714,4 +714,9 @@ public class PaperWorldConfig { +@@ -731,4 +731,9 @@ public class PaperWorldConfig { private void disableMobSpawnerSpawnEggTransformation() { disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation); } diff --git a/patches/server/0003-Brandings.patch b/patches/server/0003-Brandings.patch index abf18723..67a75ccf 100644 --- a/patches/server/0003-Brandings.patch +++ b/patches/server/0003-Brandings.patch @@ -39,10 +39,10 @@ index 74ed02fa9296583977bb721014b10ff8b708b43c..a13c7b2b5bc79ecaea404779149ed02c .completer(new ConsoleCommandCompleter(this.server)) ); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a91869dde9f47e00b6c6e380e7d3b92282d9b235..fc3abab760aa90e2afa5b4bf6abd3a0aff897f25 100644 +index 97cece32f994db6ff1d88b740060996869648f3c..c929c3ecb2a8c9056cad0418b2266b47bd0bbcaf 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1524,7 +1524,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fc3abab760aa90e2afa5b4bf6abd3a0aff897f25..e990a39d97cb1427dd2ce43bdc79fb84e93e9c4b 100644 +index c929c3ecb2a8c9056cad0418b2266b47bd0bbcaf..a342a13f387b4079bfc983d500a0fde534891196 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -936,6 +936,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant methodProfiler; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a69b38f293723a58691b2777d170f9cc146d1148..b746d1efbb06173e16a5b3a7f6bf0f3303a5ae05 100644 +index 8904b39db2203118fe3589133cb7e64334c20f33..d37c1e1f05b40ea672145478aa608a4002bc09bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -334,7 +334,7 @@ public class CraftWorld implements World { From 63ce6fbe1602b96079ea344d0d9bccce4f946430 Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Mon, 4 Jan 2021 10:51:42 +0200 Subject: [PATCH 06/10] PaperPR - Fix username connecting with no texture being overwritten by usercache --- PATCHES.md | 1 + ...name-connecting-with-no-texture-bein.patch | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch diff --git a/PATCHES.md b/PATCHES.md index 31bc38e0..303f3e4c 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -104,6 +104,7 @@ # Patches | server | Option to toggle milk curing bad omen | William Blake Galbreath | | | server | Origami Server Config | Phoenix616 | | | server | PaperPR - Add hex color code support for console logging | Esophose | | +| server | PaperPR - Fix username connecting with no texture being | Camotoy | | | server | PaperPR - Projectile load/save limit per chunk | jmp | | | server | Per entity (type) collision settings | MrIvanPlays | tr7zw | | server | Persistent TileEntity Lore and DisplayName | jmp | | diff --git a/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch b/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch new file mode 100644 index 00000000..c454176e --- /dev/null +++ b/patches/server/0065-PaperPR-Fix-username-connecting-with-no-texture-bein.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Camotoy <20743703+Camotoy@users.noreply.github.com> +Date: Mon, 4 Jan 2021 10:45:49 +0200 +Subject: [PATCH] PaperPR - Fix username connecting with no texture being + overwritten by usercache + + +diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +index 8bda2180576d3c58ad592e6158621160a8c4c5cf..44132e902b653b07b21fd01d13a88870290af439 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java ++++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +@@ -166,9 +166,15 @@ public class CraftPlayerProfile implements PlayerProfile { + if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) { + GameProfile profile = userCache.getProfile(this.profile.getId()); + if (profile != null) { ++ // Yatopia start - fix username connecting with no texture being overwritten by user cache ++ if (this.profile.getName() == null) { + // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't + copyProfileProperties(this.profile, profile); + this.profile = profile; ++ } else { ++ copyProfileProperties(profile, this.profile); ++ } ++ // Yatopia end + } + } + return this.profile.isComplete(); From 548b666d62400b85d4f9c3b04da3ad81b7066bef Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Mon, 4 Jan 2021 20:45:19 +0200 Subject: [PATCH 07/10] Some entity optimisations Optimised halloween checker and some smol optimisations. --- PATCHES.md | 2 + .../0066-Optimised-hallowen-checker.patch | 144 ++++++++++++++++++ .../0067-Smol-entity-optimisations.patch | 48 ++++++ 3 files changed, 194 insertions(+) create mode 100644 patches/server/0066-Optimised-hallowen-checker.patch create mode 100644 patches/server/0067-Smol-entity-optimisations.patch diff --git a/PATCHES.md b/PATCHES.md index 303f3e4c..39b8a3b8 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -93,6 +93,7 @@ # Patches | server | Nuke streams off BlockPosition | Ivan Pekov | | | server | Nuke streams off SectionPosition | Ivan Pekov | | | server | Optimise portals | Ivan Pekov | | +| server | Optimised hallowen checker | Ivan Pekov | | | server | Optimize BehaviorController | MrIvanPlays | | | server | Optimize TileEntity load/unload | tr7zw | | | server | Optimize Villagers | Ivan Pekov | | @@ -123,6 +124,7 @@ # Patches | server | Simpler ShapelessRecipes comparison for Vanilla | Paul Sauve | | | server | Skip events if there's no listeners | William Blake Galbreath | | | server | Smarter statistics ticking | Mykyta Komarnytskyy | | +| server | Smol entity optimisations | Ivan Pekov | | | server | Snowman drop and put back pumpkin | William Blake Galbreath | | | server | Spread out and optimise player list ticks | James Lyne | | | server | Squid EAR immunity | William Blake Galbreath | | diff --git a/patches/server/0066-Optimised-hallowen-checker.patch b/patches/server/0066-Optimised-hallowen-checker.patch new file mode 100644 index 00000000..dea2715a --- /dev/null +++ b/patches/server/0066-Optimised-hallowen-checker.patch @@ -0,0 +1,144 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ivan Pekov +Date: Mon, 4 Jan 2021 20:12:36 +0200 +Subject: [PATCH] Optimised hallowen checker + + +diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java +index 0a59e02d762a096cb3de62e0f8105cc5a5fab8d4..bdcbdc21f986852277dcc41a2b0f385f8caeb9f7 100644 +--- a/src/main/java/net/minecraft/server/EntityBat.java ++++ b/src/main/java/net/minecraft/server/EntityBat.java +@@ -222,11 +222,16 @@ public class EntityBat extends EntityAmbient { + } + + private static boolean eJ() { ++ // Yatopia start - optimised halloween checker ++ /* + LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); + int j = localdate.get(ChronoField.MONTH_OF_YEAR); + + return j == 10 && i >= 20 || j == 11 && i <= 3; ++ */ ++ return org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenSeason(); ++ // Yatopia end + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +index f73304240a626f3f7d9355e6e5f2963a06c4bb7d..3ca3280d4a4d3cd8e0b4aff8431d8fe5904d23a4 100644 +--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java ++++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +@@ -109,11 +109,15 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR + this.eL(); + this.setCanPickupLoot(this.world.paperConfig.skeletonsAlwaysCanPickUpLoot || this.random.nextFloat() < 0.55F * difficultydamagescaler.d()); // Paper + if (this.getEquipment(EnumItemSlot.HEAD).isEmpty()) { ++ /* // Yatopia start - optimised halloween checker + LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); + int j = localdate.get(ChronoField.MONTH_OF_YEAR); + + if (j == 10 && i == 31 && this.random.nextFloat() < 0.25F) { ++ */ ++ if (org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenDay() && this.random.nextFloat() < 0.25F) { ++ // Yatopia end + this.setSlot(EnumItemSlot.HEAD, new ItemStack(this.random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + this.dropChanceArmor[EnumItemSlot.HEAD.b()] = 0.0F; + } +diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java +index 62d202ff871cf3f3deea69931fbee84131bdda8b..0475feb6e50c6d4a1f2813b028bbaef4ed710a7d 100644 +--- a/src/main/java/net/minecraft/server/EntityZombie.java ++++ b/src/main/java/net/minecraft/server/EntityZombie.java +@@ -471,11 +471,15 @@ public class EntityZombie extends EntityMonster { + } + + if (this.getEquipment(EnumItemSlot.HEAD).isEmpty()) { ++ /* // Yatopia start - optimised halloween checker + LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); + int j = localdate.get(ChronoField.MONTH_OF_YEAR); + + if (j == 10 && i == 31 && this.random.nextFloat() < 0.25F) { ++ */ ++ if (org.yatopiamc.yatopia.server.entity.HalloweenChecker.isHalloweenDay() && this.random.nextFloat() < 0.25F) { ++ // Yatopia end + this.setSlot(EnumItemSlot.HEAD, new ItemStack(this.random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN)); + this.dropChanceArmor[EnumItemSlot.HEAD.b()] = 0.0F; + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 0d23591fffcda1f8121e7bc7a6aa00d088b6e80b..7b326635aac5b1e7fb6e3933d133d7e181b7541c 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1335,6 +1335,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant ++ * Checks whether or not it is halloween at a specific rate rather than every time when ++ * a entity is being spawned. ++ *

++ * The rate changes depending on how much TPS the server has. By default, the rate is every ++ * 2 hours, or every 144k ticks (if the server has _that_ much uptime) ++ * ++ * @author MrIvanPlays ++ */ ++public class HalloweenChecker { ++ ++ private static boolean halloweenSeason = false; ++ private static boolean halloweenDay = false; ++ ++ private static int delay = (20 * 60 * 60) * 2; ++ private static int lastCheckTick = -delay; ++ ++ public static void tick() { ++ if (MinecraftServer.currentTick % 100 == 0) { ++ // update the delay every 100 ticks ++ if (MinecraftServer.TPS >= 20) { ++ delay = (20 * 60 * 20) * 2; ++ } ++ if (MinecraftServer.TPS < 15) { ++ delay = delay + (20 * 60 * 15); ++ } ++ if (MinecraftServer.TPS < 10) { ++ delay = delay + (20 * 60 * 30); ++ } ++ } ++ if (MinecraftServer.currentTick - lastCheckTick > delay) { ++ LocalDate now = LocalDate.now(); ++ int day = now.getDayOfMonth(); ++ int month = now.get(ChronoField.MONTH_OF_YEAR); ++ ++ halloweenDay = (month == 10) && (day == 31); ++ halloweenSeason = ((month == 10) && (day >= 20)) || ((month == 11) && (day <= 3)); ++ ++ lastCheckTick = MinecraftServer.currentTick; ++ } ++ } ++ ++ public static boolean isHalloweenSeason() { ++ return halloweenSeason; ++ } ++ ++ public static boolean isHalloweenDay() { ++ return halloweenDay; ++ } ++ ++} diff --git a/patches/server/0067-Smol-entity-optimisations.patch b/patches/server/0067-Smol-entity-optimisations.patch new file mode 100644 index 00000000..7bc586f5 --- /dev/null +++ b/patches/server/0067-Smol-entity-optimisations.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ivan Pekov +Date: Mon, 4 Jan 2021 20:32:06 +0200 +Subject: [PATCH] Smol entity optimisations + + +diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java +index bdcbdc21f986852277dcc41a2b0f385f8caeb9f7..dff2dc82c2a6b26c6e41b3949953abcaf379b20a 100644 +--- a/src/main/java/net/minecraft/server/EntityBat.java ++++ b/src/main/java/net/minecraft/server/EntityBat.java +@@ -208,7 +208,7 @@ public class EntityBat extends EntityAmbient { + if (blockposition.getY() >= generatoraccess.getSeaLevel()) { + return false; + } else { +- int i = generatoraccess.getLightLevel(blockposition); ++ //int i = generatoraccess.getLightLevel(blockposition); // Yatopia - moved down + byte b0 = 4; + + if (eJ()) { +@@ -217,6 +217,7 @@ public class EntityBat extends EntityAmbient { + return false; + } + ++ int i = generatoraccess.getLightLevel(blockposition); // Yatopia - moved from above + return i > random.nextInt(b0) ? false : a(entitytypes, generatoraccess, enummobspawn, blockposition, random); + } + } +diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +index 228236bce14bfdf930570b453862dcfaae9e4823..e278681892d8cc6fe704f32f9d892b3186435ce4 100644 +--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +@@ -2,6 +2,7 @@ package net.minecraft.server; + + import com.google.common.collect.Lists; + import com.mojang.datafixers.util.Pair; ++import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; // Yatopia + import java.util.Collection; + import java.util.Collections; + import java.util.HashSet; +@@ -56,7 +57,7 @@ public class EntityTrackerEntry { + + public EntityTrackerEntry(WorldServer worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { + // Paper end +- this.trackedPlayers = trackedPlayers; ++ this.trackedPlayers = new ObjectOpenHashSet<>(trackedPlayers); // Yatopia - uses less memory + // CraftBukkit end + this.m = Vec3D.ORIGIN; + this.p = Collections.emptyList(); From 2b156e3c9cbc877cc35452bb192263dffee414c5 Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Tue, 5 Jan 2021 19:21:38 +0200 Subject: [PATCH 08/10] Updated Upstream and Sidestream(s) (Tuinity/Origami/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: abeafb0 Updated Upstream (Paper) Origami Changes: e204bb8 Update Paper Purpur Changes: c7b279f Updated Upstream (Paper & Tuinity) --- Origami | 2 +- PATCHES.md | 2 - Purpur | 2 +- Tuinity | 2 +- patches/Purpur/server.txt | 2 +- patches/api/0001-Yatopia-API-Bundle.patch | 12 + patches/api/0002-Modify-POM.patch | 2 +- ... => 0003-Add-GameProfileLookupEvent.patch} | 54 ++-- patches/api/0003-Kill-AnnotationTest.patch | 271 ------------------ ...atch => 0004-Add-last-tick-time-API.patch} | 9 +- ...05-Add-NBT-API-as-a-first-class-lib.patch} | 2 +- ...patch => 0006-ProxyForwardDataEvent.patch} | 33 ++- ...tch => 0007-PlayerAttackEntityEvent.patch} | 10 +- ...ch => 0008-Add-StructureLocateEvent.patch} | 0 ...atch => 0009-Disable-reload-command.patch} | 0 .../server/0001-Yatopia-Server-Fixes.patch | 31 -- patches/server/0003-Brandings.patch | 4 +- .../server/0007-Yatopia-configuration.patch | 2 +- patches/server/0022-Redirect-Configs.patch | 2 +- .../server/0035-ProxyForwardDataEvent.patch | 4 +- ...2-Ensure-pools-create-daemon-threads.patch | 2 +- ...061-Use-faster-random-implementation.patch | 2 +- .../0066-Optimised-hallowen-checker.patch | 120 ++++---- 23 files changed, 149 insertions(+), 421 deletions(-) rename patches/api/{0004-Add-GameProfileLookupEvent.patch => 0003-Add-GameProfileLookupEvent.patch} (66%) delete mode 100644 patches/api/0003-Kill-AnnotationTest.patch rename patches/api/{0005-Add-last-tick-time-API.patch => 0004-Add-last-tick-time-API.patch} (82%) rename patches/api/{0006-Add-NBT-API-as-a-first-class-lib.patch => 0005-Add-NBT-API-as-a-first-class-lib.patch} (98%) rename patches/api/{0007-ProxyForwardDataEvent.patch => 0006-ProxyForwardDataEvent.patch} (72%) rename patches/api/{0008-PlayerAttackEntityEvent.patch => 0007-PlayerAttackEntityEvent.patch} (88%) rename patches/api/{0009-Add-StructureLocateEvent.patch => 0008-Add-StructureLocateEvent.patch} (100%) rename patches/api/{0010-Disable-reload-command.patch => 0009-Disable-reload-command.patch} (100%) diff --git a/Origami b/Origami index 78f4af04..e204bb8e 160000 --- a/Origami +++ b/Origami @@ -1 +1 @@ -Subproject commit 78f4af0495caff22cce5e8a05b2e2b15f85af1ba +Subproject commit e204bb8e0fa441dd74d2df98c0444cc2f43854a3 diff --git a/PATCHES.md b/PATCHES.md index 39b8a3b8..2104da56 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -76,13 +76,11 @@ # Patches | server | Highly optimize VillagePlace filtering | Ivan Pekov | | | server | Hopper Optimizations | Phoenix616 | | | server | Implement TPSBar | BillyGalbreath | | -| server | Implement bamboo growth settings | William Blake Galbreath | | | server | Implement infinite lava | William Blake Galbreath | | | server | Improve task performance | ishland | Mykyta Komarn | | server | Infinity No Arrows | Bud Gidiere | | | server | Infinity bow settings | William Blake Galbreath | | | server | Item stuck sleep config | tr7zw | | -| api | Kill AnnotationTest | tr7zw | | | server | Lagging threshold | William Blake Galbreath | | | server | MC-147659 - Fix non black cats spawning in swamp huts | William Blake Galbreath | | | server | MC-168772 Fix - Add turtle egg block options | William Blake Galbreath | | diff --git a/Purpur b/Purpur index da957253..c7b279fe 160000 --- a/Purpur +++ b/Purpur @@ -1 +1 @@ -Subproject commit da957253a39022c68bc1a8cc2914066791f4855c +Subproject commit c7b279fe1bc55120c2902609d124f2940f74b231 diff --git a/Tuinity b/Tuinity index 076174a1..abeafb0f 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit 076174a1116aee549bc536af1bb08a41272415c6 +Subproject commit abeafb0f5ec4fb534dbf34c116970ad65260f085 diff --git a/patches/Purpur/server.txt b/patches/Purpur/server.txt index b58768de..d9c1c5bd 100644 --- a/patches/Purpur/server.txt +++ b/patches/Purpur/server.txt @@ -1 +1 @@ -Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Implement-bamboo-growth-settings&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar \ No newline at end of file +Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar \ 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 deff16a7..1f3daf7f 100644 --- a/patches/api/0001-Yatopia-API-Bundle.patch +++ b/patches/api/0001-Yatopia-API-Bundle.patch @@ -25,6 +25,18 @@ index fecd7b14d317f55eb1ce7b5c6af9913917971427..6df897ed32a94df4a06e1d5ac3d749e6 + } + // Purpur end } +diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java +index 06bdfddb7b1acb7bb7b347ad1aa13bff0c823ab1..bd2723618272068bee0fb6be8d702c34cb44762b 100644 +--- a/src/main/java/org/bukkit/ChatColor.java ++++ b/src/main/java/org/bukkit/ChatColor.java +@@ -312,6 +312,7 @@ public enum ChatColor { + * @return Associative {@link org.bukkit.ChatColor} with the given id, + * or null if it doesn't exist + */ ++ @Nullable // Yatopia + public static ChatColor getById(int id) { + return BY_ID.get(id); + } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index b45ad8df8b7a44c9e6d12326e5ea85e8d166a16c..40d342ef1a618b7d85731b238b0344402e551251 100644 --- a/src/main/java/org/bukkit/Server.java diff --git a/patches/api/0002-Modify-POM.patch b/patches/api/0002-Modify-POM.patch index 1f491362..c3c31971 100644 --- a/patches/api/0002-Modify-POM.patch +++ b/patches/api/0002-Modify-POM.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Modify POM diff --git a/pom.xml b/pom.xml -index 4516ba097e8afc3e422efc368311fa66e967c05a..f641f2b375bdb5c43880ff67195764c4d4124155 100644 +index 024be926afb1219c6443c496721f4bd0a4fec222..89542d52c14cc009d8bf50f446ab2bebb8516c94 100644 --- a/pom.xml +++ b/pom.xml @@ -3,18 +3,18 @@ diff --git a/patches/api/0004-Add-GameProfileLookupEvent.patch b/patches/api/0003-Add-GameProfileLookupEvent.patch similarity index 66% rename from patches/api/0004-Add-GameProfileLookupEvent.patch rename to patches/api/0003-Add-GameProfileLookupEvent.patch index 3809f043..3699d080 100644 --- a/patches/api/0004-Add-GameProfileLookupEvent.patch +++ b/patches/api/0003-Add-GameProfileLookupEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add GameProfileLookupEvent diff --git a/pom.xml b/pom.xml -index f641f2b375bdb5c43880ff67195764c4d4124155..31aba885d940acf0a9df5d4e83dfec69030b2a37 100644 +index 89542d52c14cc009d8bf50f446ab2bebb8516c94..3e6971d0bbc383e4639e402c076af5292ee9236a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,10 @@ @@ -35,18 +35,18 @@ index f641f2b375bdb5c43880ff67195764c4d4124155..31aba885d940acf0a9df5d4e83dfec69 fastutil diff --git a/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..ff58b8875a07b34de02b9b479ff3e6daf66d7832 +index 0000000000000000000000000000000000000000..313fe42442a93db76f91eaab50a345340f314fa8 --- /dev/null +++ b/src/main/java/dev/tr7zw/yatopia/events/GameProfileLookupEvent.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,51 @@ +package dev.tr7zw.yatopia.events; + ++import com.mojang.authlib.GameProfile; +import java.util.UUID; -+ +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; -+ -+import com.mojang.authlib.GameProfile; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class GameProfileLookupEvent extends Event { + private static final HandlerList handlers = new HandlerList(); @@ -54,32 +54,38 @@ index 0000000000000000000000000000000000000000..ff58b8875a07b34de02b9b479ff3e6da + private final UUID uuid; + private final String name; + -+ public GameProfileLookupEvent(boolean async, UUID uuid, String name) { -+ super(async); -+ this.uuid = uuid; -+ this.name = name; -+ } ++ public GameProfileLookupEvent(boolean async, @NotNull UUID uuid, @NotNull String name) { ++ super(async); ++ this.uuid = uuid; ++ this.name = name; ++ } + -+ public GameProfile getGameProfile() { -+ return gameProfile; -+ } ++ @Nullable ++ public GameProfile getGameProfile() { ++ return gameProfile; ++ } + -+ public void setGameProfile(GameProfile gameProfile) { -+ this.gameProfile = gameProfile; -+ } ++ public void setGameProfile(@Nullable GameProfile gameProfile) { ++ this.gameProfile = gameProfile; ++ } + -+ public UUID getUuid() { -+ return uuid; -+ } ++ @NotNull ++ public UUID getUuid() { ++ return uuid; ++ } + -+ public String getName() { -+ return name; -+ } ++ @NotNull ++ public String getName() { ++ return name; ++ } + -+ public HandlerList getHandlers() { ++ @NotNull ++ @Override ++ public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/patches/api/0003-Kill-AnnotationTest.patch b/patches/api/0003-Kill-AnnotationTest.patch deleted file mode 100644 index 23c50e9e..00000000 --- a/patches/api/0003-Kill-AnnotationTest.patch +++ /dev/null @@ -1,271 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: tr7zw -Date: Sat, 1 Aug 2020 15:52:19 -0500 -Subject: [PATCH] Kill AnnotationTest - - -diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java -deleted file mode 100644 -index a48be38b159bec27ec398666b28620a9ea625547..0000000000000000000000000000000000000000 ---- a/src/test/java/org/bukkit/AnnotationTest.java -+++ /dev/null -@@ -1,259 +0,0 @@ --package org.bukkit; -- --import java.io.File; --import java.io.FileInputStream; --import java.io.IOException; --import java.net.URISyntaxException; --import java.net.URL; --import java.util.ArrayList; --import java.util.Collection; --import java.util.Collections; --import java.util.HashMap; --import java.util.List; --import java.util.Map; --import org.jetbrains.annotations.NotNull; --import org.jetbrains.annotations.Nullable; --import org.junit.Assert; --import org.junit.Test; --import org.objectweb.asm.ClassReader; --import org.objectweb.asm.Opcodes; --import org.objectweb.asm.Type; --import org.objectweb.asm.tree.AnnotationNode; --import org.objectweb.asm.tree.ClassNode; --import org.objectweb.asm.tree.MethodNode; --import org.objectweb.asm.tree.ParameterNode; -- --public class AnnotationTest { -- -- private static final String[] ACCEPTED_ANNOTATIONS = { -- "Lorg/jetbrains/annotations/Nullable;", -- "Lorg/jetbrains/annotations/NotNull;", -- "Lorg/jetbrains/annotations/Contract;", -- "Lorg/bukkit/UndefinedNullability;" -- }; -- -- private static final String[] EXCLUDED_CLASSES = { -- // Internal technical classes -- "org/bukkit/plugin/java/JavaPluginLoader", -- "org/bukkit/util/io/BukkitObjectInputStream", -- "org/bukkit/util/io/BukkitObjectOutputStream", -- "org/bukkit/util/io/Wrapper", -- "org/bukkit/plugin/java/PluginClassLoader", -- // Generic functional interface -- "org/bukkit/util/Consumer", -- // Paper start -- // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull -- "co/aikar/timings/TimingHistory$2", -- "co/aikar/timings/TimingHistory$2$1", -- "co/aikar/timings/TimingHistory$2$1$1", -- "co/aikar/timings/TimingHistory$2$1$2", -- "co/aikar/timings/TimingHistory$3", -- "co/aikar/timings/TimingHistory$4", -- "co/aikar/timings/TimingHistoryEntry$1" -- // Paper end -- }; -- -- @Test -- public void testAll() throws IOException, URISyntaxException { -- URL loc = Bukkit.class.getProtectionDomain().getCodeSource().getLocation(); -- File file = new File(loc.toURI()); -- -- // Running from jar is not supported yet -- Assert.assertTrue("code must be in a directory", file.isDirectory()); -- -- final HashMap foundClasses = new HashMap<>(); -- collectClasses(file, foundClasses); -- -- final ArrayList errors = new ArrayList<>(); -- -- for (ClassNode clazz : foundClasses.values()) { -- if (!isClassIncluded(clazz, foundClasses)) { -- continue; -- } -- -- for (MethodNode method : clazz.methods) { -- if (!isMethodIncluded(clazz, method, foundClasses)) { -- continue; -- } -- -- if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) { -- warn(errors, clazz, method, "return value"); -- } -- -- Type[] paramTypes = Type.getArgumentTypes(method.desc); -- List parameters = method.parameters; -- -- for (int i = 0; i < paramTypes.length; i++) { -- if (mustBeAnnotated(paramTypes[i]) && !isWellAnnotated(method.invisibleParameterAnnotations == null ? null : method.invisibleParameterAnnotations[i])) { -- ParameterNode paramNode = parameters == null ? null : parameters.get(i); -- String paramName = paramNode == null ? null : paramNode.name; -- -- warn(errors, clazz, method, "parameter " + i + (paramName == null ? "" : ": " + paramName)); -- } -- } -- } -- } -- -- if (errors.isEmpty()) { -- // Success -- return; -- } -- -- Collections.sort(errors); -- -- System.out.println(errors.size() + " missing annotation(s):"); -- for (String message : errors) { -- System.out.print("\t"); -- System.out.println(message); -- } -- -- Assert.fail("There " + errors.size() + " are missing annotation(s)"); -- } -- -- private static void collectClasses(@NotNull File from, @NotNull Map to) throws IOException { -- if (from.isDirectory()) { -- final File[] files = from.listFiles(); -- assert files != null; -- -- for (File file : files) { -- collectClasses(file, to); -- } -- return; -- } -- -- if (!from.getName().endsWith(".class")) { -- return; -- } -- -- try (FileInputStream in = new FileInputStream(from)) { -- final ClassReader cr = new ClassReader(in); -- -- final ClassNode node = new ClassNode(); -- cr.accept(node, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); -- -- to.put(node.name, node); -- } -- } -- -- private static boolean isClassIncluded(@NotNull ClassNode clazz, @NotNull Map allClasses) { -- // Exclude private, synthetic or deprecated classes and annotations, since their members can't be null -- if ((clazz.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_DEPRECATED | Opcodes.ACC_ANNOTATION)) != 0) { -- return false; -- } -- -- if (isSubclassOf(clazz, "org/bukkit/material/MaterialData", allClasses)) { -- throw new AssertionError("Subclass of MaterialData must be deprecated: " + clazz.name); -- } -- -- if (isSubclassOf(clazz, "java/lang/Exception", allClasses) -- || isSubclassOf(clazz, "java/lang/RuntimeException", allClasses)) { -- // Exceptions are excluded -- return false; -- } -- -- for (String excludedClass : EXCLUDED_CLASSES) { -- if (excludedClass.equals(clazz.name)) { -- return false; -- } -- } -- -- return true; -- } -- -- private static boolean isMethodIncluded(@NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull Map allClasses) { -- // Exclude private, synthetic and deprecated methods -- if ((method.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_DEPRECATED)) != 0 || (method.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_PUBLIC)) == 0) { // Paper - ignore package-private -- return false; -- } -- -- // Exclude Java methods -- if (is(method, "toString", 0) || is(method, "clone", 0) || is(method, "equals", 1)) { -- return false; -- } -- -- // Exclude generated Enum methods -- if (isSubclassOf(clazz, "java/lang/Enum", allClasses) && (is(method, "values", 0) || is(method, "valueOf", 1))) { -- return false; -- } -- -- // Anonymous classes have generated constructors, which can't be annotated nor invoked -- if ("".equals(method.name) && isAnonymous(clazz)) { -- return false; -- } -- -- return true; -- } -- -- private static boolean isWellAnnotated(@Nullable List annotations) { -- if (annotations == null) { -- return false; -- } -- -- for (AnnotationNode node : annotations) { -- for (String acceptedAnnotation : ACCEPTED_ANNOTATIONS) { -- if (acceptedAnnotation.equals(node.desc)) { -- return true; -- } -- } -- } -- -- return false; -- } -- -- private static boolean mustBeAnnotated(@NotNull Type type) { -- return type.getSort() == Type.ARRAY || type.getSort() == Type.OBJECT; -- } -- -- private static boolean is(@NotNull MethodNode method, @NotNull String name, int parameters) { -- final List params = method.parameters; -- return method.name.equals(name) && (params == null || params.size() == parameters); -- } -- -- /** -- * Checks if the class is anonymous. -- * -- * @param clazz the class to check -- * @return true if given class is anonymous -- */ -- private static boolean isAnonymous(@NotNull ClassNode clazz) { -- final String name = clazz.name; -- if (name == null) { -- return false; -- } -- final int nestedSeparator = name.lastIndexOf('$'); -- if (nestedSeparator == -1 || nestedSeparator + 1 == name.length()) { -- return false; -- } -- -- // Nested classes have purely numeric names. Java classes can't begin with a number, -- // so if first character is a number, the class must be anonymous -- final char c = name.charAt(nestedSeparator + 1); -- return c >= '0' && c <= '9'; -- } -- -- private static boolean isSubclassOf(@NotNull ClassNode what, @NotNull String ofWhat, @NotNull Map allClasses) { -- if (ofWhat.equals(what.name) -- // Not only optimization: Super class may not be present in allClasses, so it is checked here -- || ofWhat.equals(what.superName)) { -- return true; -- } -- -- final ClassNode parent = allClasses.get(what.superName); -- if (parent != null && isSubclassOf(parent, ofWhat, allClasses)) { -- return true; -- } -- -- for (String superInterface : what.interfaces) { -- final ClassNode interfaceParent = allClasses.get(superInterface); -- if (interfaceParent != null && isSubclassOf(interfaceParent, ofWhat, allClasses)) { -- return true; -- } -- } -- -- return false; -- } -- -- private static void warn(@NotNull Collection out, @NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull String description) { -- out.add(clazz.name + " \t" + method.name + " \t" + description); -- } --} diff --git a/patches/api/0005-Add-last-tick-time-API.patch b/patches/api/0004-Add-last-tick-time-API.patch similarity index 82% rename from patches/api/0005-Add-last-tick-time-API.patch rename to patches/api/0004-Add-last-tick-time-API.patch index 01701db7..cecb10c0 100644 --- a/patches/api/0005-Add-last-tick-time-API.patch +++ b/patches/api/0004-Add-last-tick-time-API.patch @@ -7,7 +7,7 @@ Original patch by: Co-authored-by: tr7zw diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..7b704b5841aa2f212b70719cf9bd79b4fb21fcf0 100644 +index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..b08a5a91315f3cd80c4c4ef47f5fc6755cbf73d8 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -1828,4 +1828,14 @@ public final class Bukkit { @@ -20,16 +20,16 @@ index 6df897ed32a94df4a06e1d5ac3d749e6a360ab2f..7b704b5841aa2f212b70719cf9bd79b4 + public static long getLastTickMs() { + return server.getLastTickMs(); + } -+ public static java.time.Duration getLastTickTime() { ++ @NotNull public static java.time.Duration getLastTickTime() { + return server.getLastTickTime(); + } + // Yatopia end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 40d342ef1a618b7d85731b238b0344402e551251..2f86ada4a487a6d59fa8b173c8339dcdda65cb30 100644 +index 40d342ef1a618b7d85731b238b0344402e551251..d6ba0895f259c15de9fb974a5c74da709158fc28 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1651,4 +1651,23 @@ public interface Server extends PluginMessageRecipient { +@@ -1651,4 +1651,24 @@ public interface Server extends PluginMessageRecipient { */ boolean isLagging(); // Purpur end @@ -50,6 +50,7 @@ index 40d342ef1a618b7d85731b238b0344402e551251..2f86ada4a487a6d59fa8b173c8339dcd + * + * @return duration + */ ++ @NotNull + java.time.Duration getLastTickTime(); + // Yatopia end } diff --git a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch b/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch similarity index 98% rename from patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch rename to patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch index fb5238f7..7354d49b 100644 --- a/patches/api/0006-Add-NBT-API-as-a-first-class-lib.patch +++ b/patches/api/0005-Add-NBT-API-as-a-first-class-lib.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add NBT API as a first-class lib diff --git a/pom.xml b/pom.xml -index 31aba885d940acf0a9df5d4e83dfec69030b2a37..cb8eaf5dd3c89193960a433cdc5b6c2903076499 100644 +index 3e6971d0bbc383e4639e402c076af5292ee9236a..0e762240836299630743f29d00db03ffa193d4ab 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,11 @@ diff --git a/patches/api/0007-ProxyForwardDataEvent.patch b/patches/api/0006-ProxyForwardDataEvent.patch similarity index 72% rename from patches/api/0007-ProxyForwardDataEvent.patch rename to patches/api/0006-ProxyForwardDataEvent.patch index 56d730b3..835aa36b 100644 --- a/patches/api/0007-ProxyForwardDataEvent.patch +++ b/patches/api/0006-ProxyForwardDataEvent.patch @@ -6,12 +6,13 @@ Subject: [PATCH] ProxyForwardDataEvent diff --git a/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java b/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453efd44d865b +index 0000000000000000000000000000000000000000..d3780d965bdd491425a92bf5e554f7def6e0ecf0 --- /dev/null +++ b/src/main/java/net/yatopia/api/event/ProxyForwardDataEvent.java -@@ -0,0 +1,114 @@ +@@ -0,0 +1,125 @@ +package net.yatopia.api.event; + ++import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.mojang.authlib.properties.Property; +import java.util.List; @@ -19,6 +20,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Called when a proxy such as BungeeCord or Velocity forwards player data to the server. @@ -29,7 +31,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + private final String name; + private List properties; + -+ public ProxyForwardDataEvent(boolean async, UUID uuid, String name, List properties) { ++ public ProxyForwardDataEvent(boolean async, @NotNull UUID uuid, @NotNull String name, @NotNull List properties) { + super(async); + this.uuid = uuid; + this.name = name; @@ -41,6 +43,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * + * @return unique id + */ ++ @NotNull + public UUID getUuid() { + return uuid; + } @@ -50,15 +53,19 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * + * @return name + */ ++ @NotNull + public String getName() { + return name; + } + + /** + * Returns an immutable copy of the forwarded properties. ++ *

++ * If there were no properties, it would return an empty list. + * + * @return properties + */ ++ @NotNull + public List getProperties() { + return ImmutableList.copyOf(properties); + } @@ -68,7 +75,8 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * + * @param property property + */ -+ public void addProperty(Property property) { ++ public void addProperty(@NotNull Property property) { ++ Preconditions.checkNotNull(property, "property"); + if (hasProperty(property.getName())) { + removeProperty(property.getName()); + } @@ -81,9 +89,11 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * @param property the property's name you want to get + * @return property if present + */ -+ public Property getProperty(String property) { ++ @Nullable ++ public Property getProperty(@NotNull String property) { ++ Preconditions.checkNotNull(property, "property"); + for (Property prop : properties) { -+ if (prop.getName().toLowerCase().equalsIgnoreCase(property.toLowerCase())) { ++ if (prop.getName().equalsIgnoreCase(property)) { + return prop; + } + } @@ -96,7 +106,7 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * @param property the name of the property you want to check if exists + * @return boolean value + */ -+ public boolean hasProperty(String property) { ++ public boolean hasProperty(@NotNull String property) { + return getProperty(property) != null; + } + @@ -105,8 +115,8 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * + * @param property the property's name you want to remove + */ -+ public void removeProperty(String property) { -+ properties.removeIf(prop -> prop.getName().toLowerCase().equalsIgnoreCase(property.toLowerCase())); ++ public void removeProperty(@NotNull String property) { ++ properties.removeIf(prop -> prop.getName().equalsIgnoreCase(property)); + } + + /** @@ -114,13 +124,14 @@ index 0000000000000000000000000000000000000000..22775d2d03ccd4c7decebc3e26b453ef + * + * @param property the property you want to remove + */ -+ public void removeProperty(Property property) { ++ public void removeProperty(@NotNull Property property) { ++ Preconditions.checkNotNull(property, "property"); + properties.remove(property); + } + + // + private static final HandlerList handlers = new HandlerList(); + @NotNull @Override public HandlerList getHandlers() { return handlers; } -+ public static HandlerList getHandlerList() { return handlers; } ++ @NotNull public static HandlerList getHandlerList() { return handlers; } + // +} diff --git a/patches/api/0008-PlayerAttackEntityEvent.patch b/patches/api/0007-PlayerAttackEntityEvent.patch similarity index 88% rename from patches/api/0008-PlayerAttackEntityEvent.patch rename to patches/api/0007-PlayerAttackEntityEvent.patch index 5a545802..93d75bfb 100644 --- a/patches/api/0008-PlayerAttackEntityEvent.patch +++ b/patches/api/0007-PlayerAttackEntityEvent.patch @@ -7,10 +7,10 @@ Added per request diff --git a/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java b/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe5aa64e98 +index 0000000000000000000000000000000000000000..7a4bd2d6518409972651373c3e6ea0fd17f8fcf7 --- /dev/null +++ b/src/main/java/net/yatopia/api/event/PlayerAttackEntityEvent.java -@@ -0,0 +1,121 @@ +@@ -0,0 +1,123 @@ +package net.yatopia.api.event; + +import org.bukkit.entity.Entity; @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe + private boolean criticalHit; + private float damage; + -+ public PlayerAttackEntityEvent(HumanEntity attacker, Entity attacked, ItemStack attackItem, boolean criticalHit, float damage) { ++ public PlayerAttackEntityEvent(@NotNull HumanEntity attacker, @NotNull Entity attacked, @NotNull ItemStack attackItem, boolean criticalHit, float damage) { + this.attacker = attacker; + this.attacked = attacked; + this.attackItem = attackItem; @@ -67,6 +67,8 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe + + /** + * Returns the attack item used to damage the {@link #getAttackedEntity()} ++ *

++ * If there wasn't any item, it would return ItemStack(Material.AIR) + * + * @return attack item + */ @@ -129,6 +131,6 @@ index 0000000000000000000000000000000000000000..72e2cfd4c62f02154d8dddaa964249fe + // + private static final HandlerList handlers = new HandlerList(); + @NotNull @Override public HandlerList getHandlers() { return handlers; } -+ public static HandlerList getHandlerList() { return handlers; } ++ @NotNull public static HandlerList getHandlerList() { return handlers; } + // +} diff --git a/patches/api/0009-Add-StructureLocateEvent.patch b/patches/api/0008-Add-StructureLocateEvent.patch similarity index 100% rename from patches/api/0009-Add-StructureLocateEvent.patch rename to patches/api/0008-Add-StructureLocateEvent.patch diff --git a/patches/api/0010-Disable-reload-command.patch b/patches/api/0009-Disable-reload-command.patch similarity index 100% rename from patches/api/0010-Disable-reload-command.patch rename to patches/api/0009-Disable-reload-command.patch diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index cef48b96..12d33bb7 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -4,37 +4,6 @@ Date: Sun, 25 Oct 2020 12:23:35 -0500 Subject: [PATCH] Yatopia-Server-Fixes -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 80409c4b52a4bb7146760070dae0e04d49bdd6b3..0bca517b4948cd55bfbf3ba4d5c1b3cd895cc086 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -731,4 +731,9 @@ public class PaperWorldConfig { - private void disableMobSpawnerSpawnEggTransformation() { - disableMobSpawnerSpawnEggTransformation = getBoolean("game-mechanics.disable-mob-spawner-spawn-egg-transformation", disableMobSpawnerSpawnEggTransformation); - } -+ -+ public int projectileSaveLimit = -1; -+ private void projectileSaveLimit() { -+ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit); -+ } - } -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej -deleted file mode 100644 -index 67f63901bdbae923eb6262d522b5198f9df5a7bc..0000000000000000000000000000000000000000 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java.rej -+++ /dev/null -@@ -1,11 +0,0 @@ --diff a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java (rejected hunks) --@@ -709,4 +709,9 @@ public class PaperWorldConfig { -- private void fixCuringExploit() { -- fixCuringZombieVillagerDiscountExploit = getBoolean("game-mechanics.fix-curing-zombie-villager-discount-exploit", fixCuringZombieVillagerDiscountExploit); -- } --+ --+ public int projectileSaveLimit = -1; --+ private void projectileSaveLimit() { --+ projectileSaveLimit = getInt("projectile-load-save-per-chunk-limit", projectileSaveLimit); --+ } -- } diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java index fe7330fabe386966c2d203a190a00a785ea21be0..537456a7427cddd6783f5b5d8ee2d655668c4c53 100644 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java diff --git a/patches/server/0003-Brandings.patch b/patches/server/0003-Brandings.patch index 67a75ccf..2abd54d9 100644 --- a/patches/server/0003-Brandings.patch +++ b/patches/server/0003-Brandings.patch @@ -65,7 +65,7 @@ index fcf2bf8962cf6bc33d4213c1101debae4afa7114..ea882b3ff0608e23852e48e7aa10f364 private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index dbc934b374ff1b9eb4b66d2365e89c39c951763b..3c603e2358de71f534e88551b72f202d190f58fe 100644 +index dbc934b374ff1b9eb4b66d2365e89c39c951763b..00e7eb476f21a7ee711d6c5847a57154e79d9f1e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -275,7 +275,7 @@ public class Main { @@ -73,7 +73,7 @@ index dbc934b374ff1b9eb4b66d2365e89c39c951763b..3c603e2358de71f534e88551b72f202d // Paper start - This is some stupid bullshit System.err.println("*** Warning, you've not updated in a while! ***"); - System.err.println("*** Please download a new build ***"); // Paper // Tuinity -+ System.err.println("*** Please download a new build as per instructions from https://yatopia.net/download ***"); // Paper // Tuinity // Yatopia ++ System.err.println("*** Please download a new build as per instructions from https://yatopiamc.org/download ***"); // Paper // Tuinity // Yatopia //System.err.println("*** Server will start in 20 seconds ***"); //Thread.sleep(TimeUnit.SECONDS.toMillis(20)); // Paper End diff --git a/patches/server/0007-Yatopia-configuration.patch b/patches/server/0007-Yatopia-configuration.patch index 46db39d4..563ef9c3 100644 --- a/patches/server/0007-Yatopia-configuration.patch +++ b/patches/server/0007-Yatopia-configuration.patch @@ -106,7 +106,7 @@ index 248605cc533e4cad4b75b92b1d88ef6aa03f4c5c..40aaa7c1fe0bf0a5031d5e1e15035a40 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 3c603e2358de71f534e88551b72f202d190f58fe..ce08abf2eabfdb606b806f4d6d374055f5e10168 100644 +index 00e7eb476f21a7ee711d6c5847a57154e79d9f1e..e7818d40d9cac682eb28fadf319d08f8ca88e89d 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -162,6 +162,14 @@ public class Main { diff --git a/patches/server/0022-Redirect-Configs.patch b/patches/server/0022-Redirect-Configs.patch index ae7f011e..f6eff443 100644 --- a/patches/server/0022-Redirect-Configs.patch +++ b/patches/server/0022-Redirect-Configs.patch @@ -52,7 +52,7 @@ index 0a9f03526abf0638ada15d9810b949887fca9f9a..64b662dc9146d0d414a9668d9b93e07a this.setAllowFlight(dedicatedserverproperties.allowFlight); this.setResourcePack(dedicatedserverproperties.resourcePack, this.ba()); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ce08abf2eabfdb606b806f4d6d374055f5e10168..b9d11f4ba9a49d955b487ccf5a6dac4e1c9ba19b 100644 +index e7818d40d9cac682eb28fadf319d08f8ca88e89d..605b7477dfce17c5d9752fd48a71098739e3f4c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -303,7 +303,7 @@ public class Main { diff --git a/patches/server/0035-ProxyForwardDataEvent.patch b/patches/server/0035-ProxyForwardDataEvent.patch index 5bc6fa91..2cbaed4c 100644 --- a/patches/server/0035-ProxyForwardDataEvent.patch +++ b/patches/server/0035-ProxyForwardDataEvent.patch @@ -25,7 +25,7 @@ index 79f726ef43e70b8882890007146df199824d14e3..edb7a9de55718d9c860c82580aca78c3 { ChatMessage chatmessage = new ChatMessage("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"); diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index d987483255195c0bde713a92676baced1eaff2b3..2fa0f21cfa81670f6c3f18f76e7fa8d0bb541f11 100644 +index d987483255195c0bde713a92676baced1eaff2b3..bb45fc83d81948c84bc721961474e5e806ab404a 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -125,6 +125,23 @@ public class LoginListener implements PacketLoginInListener { @@ -38,7 +38,7 @@ index d987483255195c0bde713a92676baced1eaff2b3..2fa0f21cfa81670f6c3f18f76e7fa8d0 + if (networkManager.spoofedProfile != null) { + properties = new java.util.ArrayList<>(Arrays.asList(networkManager.spoofedProfile)); + } else { -+ properties = new java.util.ArrayList<>(); ++ properties = java.util.Collections.emptyList(); + } + net.yatopia.api.event.ProxyForwardDataEvent event = new net.yatopia.api.event.ProxyForwardDataEvent( + !org.bukkit.Bukkit.isPrimaryThread(), uuid, i.getName(), properties diff --git a/patches/server/0042-Ensure-pools-create-daemon-threads.patch b/patches/server/0042-Ensure-pools-create-daemon-threads.patch index 98a0311f..11acc75f 100644 --- a/patches/server/0042-Ensure-pools-create-daemon-threads.patch +++ b/patches/server/0042-Ensure-pools-create-daemon-threads.patch @@ -7,7 +7,7 @@ If only 1 non-daemon thread is left to run when the server is shutting down, the This patche ensures that executors make daemon threads. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 2fa0f21cfa81670f6c3f18f76e7fa8d0bb541f11..9190caed195b9987e3af545f4de63b8d956788a6 100644 +index bb45fc83d81948c84bc721961474e5e806ab404a..847122f76f6d951b24b22c86276140e02aaf37d6 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -108,7 +108,11 @@ public class LoginListener implements PacketLoginInListener { diff --git a/patches/server/0061-Use-faster-random-implementation.patch b/patches/server/0061-Use-faster-random-implementation.patch index 178b5fd7..6a377bad 100644 --- a/patches/server/0061-Use-faster-random-implementation.patch +++ b/patches/server/0061-Use-faster-random-implementation.patch @@ -132,7 +132,7 @@ index c3b57e8d572d13ec74d6df5544072cdc55756690..99e5e2c6fe12e0deda1f5aeb3f8922ef private final EnumItemRarity a; private final int maxStackSize; diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 9190caed195b9987e3af545f4de63b8d956788a6..178386cfb44152b50757234a624afef0d61e00d8 100644 +index 847122f76f6d951b24b22c86276140e02aaf37d6..0500d49b51ed9bba27f351ff4bff93bb6e315846 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -32,7 +32,7 @@ public class LoginListener implements PacketLoginInListener { diff --git a/patches/server/0066-Optimised-hallowen-checker.patch b/patches/server/0066-Optimised-hallowen-checker.patch index dea2715a..ea2009ec 100644 --- a/patches/server/0066-Optimised-hallowen-checker.patch +++ b/patches/server/0066-Optimised-hallowen-checker.patch @@ -79,66 +79,66 @@ index 0d23591fffcda1f8121e7bc7a6aa00d088b6e80b..7b326635aac5b1e7fb6e3933d133d7e1 long endTime = System.nanoTime(); diff --git a/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java b/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java new file mode 100644 -index 0000000000000000000000000000000000000000..71622619f325738d97a64fce5bfb7792934ce1d5 +index 0000000000000000000000000000000000000000..b9e8c25fa4c4cc088a12c2b865887751c8cdbcd8 --- /dev/null +++ b/src/main/java/org/yatopiamc/yatopia/server/entity/HalloweenChecker.java @@ -0,0 +1,59 @@ -+package org.yatopiamc.yatopia.server.entity; -+ -+import java.time.LocalDate; -+import java.time.temporal.ChronoField; -+import net.minecraft.server.MinecraftServer; -+ -+/** -+ * Entity halloween checker -+ *

-+ * Checks whether or not it is halloween at a specific rate rather than every time when -+ * a entity is being spawned. -+ *

-+ * The rate changes depending on how much TPS the server has. By default, the rate is every -+ * 2 hours, or every 144k ticks (if the server has _that_ much uptime) -+ * -+ * @author MrIvanPlays -+ */ -+public class HalloweenChecker { -+ -+ private static boolean halloweenSeason = false; -+ private static boolean halloweenDay = false; -+ -+ private static int delay = (20 * 60 * 60) * 2; -+ private static int lastCheckTick = -delay; -+ -+ public static void tick() { -+ if (MinecraftServer.currentTick % 100 == 0) { -+ // update the delay every 100 ticks -+ if (MinecraftServer.TPS >= 20) { -+ delay = (20 * 60 * 20) * 2; -+ } -+ if (MinecraftServer.TPS < 15) { -+ delay = delay + (20 * 60 * 15); -+ } -+ if (MinecraftServer.TPS < 10) { -+ delay = delay + (20 * 60 * 30); -+ } -+ } -+ if (MinecraftServer.currentTick - lastCheckTick > delay) { -+ LocalDate now = LocalDate.now(); -+ int day = now.getDayOfMonth(); -+ int month = now.get(ChronoField.MONTH_OF_YEAR); -+ -+ halloweenDay = (month == 10) && (day == 31); -+ halloweenSeason = ((month == 10) && (day >= 20)) || ((month == 11) && (day <= 3)); -+ -+ lastCheckTick = MinecraftServer.currentTick; -+ } -+ } -+ -+ public static boolean isHalloweenSeason() { -+ return halloweenSeason; -+ } -+ -+ public static boolean isHalloweenDay() { -+ return halloweenDay; -+ } -+ -+} ++package org.yatopiamc.yatopia.server.entity; ++ ++import java.time.LocalDate; ++import java.time.temporal.ChronoField; ++import net.minecraft.server.MinecraftServer; ++ ++/** ++ * Entity halloween checker ++ *

++ * Checks whether or not it is halloween at a specific rate rather than every time when ++ * a entity is being spawned. ++ *

++ * The rate changes depending on how much TPS the server has. By default, the rate is every ++ * 2 hours, or every 144k ticks (if the server has _that_ much uptime) ++ * ++ * @author MrIvanPlays ++ */ ++public class HalloweenChecker { ++ ++ private static boolean halloweenSeason = false; ++ private static boolean halloweenDay = false; ++ ++ private static int delay = (20 * 60 * 60) * 2; ++ private static int lastCheckTick = -delay; ++ ++ public static void tick() { ++ if (MinecraftServer.currentTick % 100 == 0) { ++ // update the delay every 100 ticks ++ if (MinecraftServer.TPS >= 20) { ++ delay = (20 * 60 * 60) * 2; ++ } ++ if (MinecraftServer.TPS < 15) { ++ delay = delay + (20 * 60 * 15); ++ } ++ if (MinecraftServer.TPS < 10) { ++ delay = delay + (20 * 60 * 30); ++ } ++ } ++ if (MinecraftServer.currentTick - lastCheckTick > delay) { ++ LocalDate now = LocalDate.now(); ++ int day = now.getDayOfMonth(); ++ int month = now.get(ChronoField.MONTH_OF_YEAR); ++ ++ halloweenDay = (month == 10) && (day == 31); ++ halloweenSeason = ((month == 10) && (day >= 20)) || ((month == 11) && (day <= 3)); ++ ++ lastCheckTick = MinecraftServer.currentTick; ++ } ++ } ++ ++ public static boolean isHalloweenSeason() { ++ return halloweenSeason; ++ } ++ ++ public static boolean isHalloweenDay() { ++ return halloweenDay; ++ } ++ ++} From 074471c3de2953368b36794eb7d1968c16fcfe5e Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Wed, 6 Jan 2021 20:03:47 +0200 Subject: [PATCH 09/10] Do not initiate trackedPlayers with ObjectOpenHashSet Potential fix of #331 Whether or not cursors are present on a map - the game forces the server to track players if the map is rendered. This change wasn't liked by the maps, so - revert it for now. I'll probably find a way to optimise this later... --- .../0067-Smol-entity-optimisations.patch | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/patches/server/0067-Smol-entity-optimisations.patch b/patches/server/0067-Smol-entity-optimisations.patch index 7bc586f5..895ba55a 100644 --- a/patches/server/0067-Smol-entity-optimisations.patch +++ b/patches/server/0067-Smol-entity-optimisations.patch @@ -25,24 +25,3 @@ index bdcbdc21f986852277dcc41a2b0f385f8caeb9f7..dff2dc82c2a6b26c6e41b3949953abca return i > random.nextInt(b0) ? false : a(entitytypes, generatoraccess, enummobspawn, blockposition, random); } } -diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 228236bce14bfdf930570b453862dcfaae9e4823..e278681892d8cc6fe704f32f9d892b3186435ce4 100644 ---- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java -+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -2,6 +2,7 @@ package net.minecraft.server; - - import com.google.common.collect.Lists; - import com.mojang.datafixers.util.Pair; -+import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; // Yatopia - import java.util.Collection; - import java.util.Collections; - import java.util.HashSet; -@@ -56,7 +57,7 @@ public class EntityTrackerEntry { - - public EntityTrackerEntry(WorldServer worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { - // Paper end -- this.trackedPlayers = trackedPlayers; -+ this.trackedPlayers = new ObjectOpenHashSet<>(trackedPlayers); // Yatopia - uses less memory - // CraftBukkit end - this.m = Vec3D.ORIGIN; - this.p = Collections.emptyList(); From 3770a434722cd81011e6045fc7becd50122b03cf Mon Sep 17 00:00:00 2001 From: Ivan Pekov Date: Thu, 7 Jan 2021 17:09:35 +0200 Subject: [PATCH 10/10] Updated Upstream and Sidestream(s) (Tuinity/Purpur/AirplaneLite) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 33b3f86 Updated Upstream (Paper) 4743c34 Updated Upstream (Paper) Purpur Changes: 5c0dbf1 [ci-skip] Easier way to remove tuinity's revert of MC-4 424fcf1 Updated Upstream (Paper & Tuinity) b3644cc Fix rotating UP/DOWN CW and CCW fbb74cd Updated Upstream (Paper) AirplaneLite Changes: 5e8ebc0 Updated Upstream (Tuinity) --- AirplaneLite | 2 +- PATCHES.md | 1 + Purpur | 2 +- Tuinity | 2 +- patches/Purpur/server.txt | 2 +- patches/server/0001-Yatopia-Server-Fixes.patch | 6 +++--- patches/server/0011-Modify-default-configs.patch | 4 ++-- patches/server/0012-lithium-MixinDirection.patch | 4 ++-- patches/server/0066-Optimised-hallowen-checker.patch | 4 ++-- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/AirplaneLite b/AirplaneLite index 7b4acbef..5e8ebc09 160000 --- a/AirplaneLite +++ b/AirplaneLite @@ -1 +1 @@ -Subproject commit 7b4acbefa5139909dcfdb32e201bf3af437b6832 +Subproject commit 5e8ebc09f1c090843d154e8db1160c9075be7649 diff --git a/PATCHES.md b/PATCHES.md index 2104da56..2be58136 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -68,6 +68,7 @@ # Patches | server | Fix LightEngineThreaded memory leak | Ivan Pekov | | | server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | | | server | Fix lead fall dmg config | tr7zw | | +| server | Fix rotating UP/DOWN CW and CCW | BillyGalbreath | | | server | Fix the dead lagging the server | William Blake Galbreath | | | server | Fix vanilla command permission handler | William Blake Galbreath | | | server | Global Eula file | tr7zw | | diff --git a/Purpur b/Purpur index c7b279fe..5c0dbf17 160000 --- a/Purpur +++ b/Purpur @@ -1 +1 @@ -Subproject commit c7b279fe1bc55120c2902609d124f2940f74b231 +Subproject commit 5c0dbf179b9bad231e894fe1e47169a66404004a diff --git a/Tuinity b/Tuinity index abeafb0f..33b3f860 160000 --- a/Tuinity +++ b/Tuinity @@ -1 +1 @@ -Subproject commit abeafb0f5ec4fb534dbf34c116970ad65260f085 +Subproject commit 33b3f860c233cf20cd2be93e474ee687116e180b diff --git a/patches/Purpur/server.txt b/patches/Purpur/server.txt index d9c1c5bd..4a1f098c 100644 --- a/patches/Purpur/server.txt +++ b/patches/Purpur/server.txt @@ -1 +1 @@ -Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar \ No newline at end of file +Purpur-config-files&Timings-stuff&Add-component-util&Barrels-and-enderchests-6-rows&Lagging-threshold&Configurable-villager-brain-ticks&Alternative-Keepalive-Handling&MC-168772-Fix-Add-turtle-egg-block-options&Fix-vanilla-command-permission-handler&Fix-outdated-server-showing-in-ping-before-server-fu&Dont-send-useless-entity-packets&MC-147659-Fix-non-black-cats-spawning-in-swamp-huts&Cows-eat-mushrooms&Snowman-drop-and-put-back-pumpkin&Signs-editable-on-right-click&Signs-allow-color-codes&Allow-soil-to-moisten-from-water-directly-under-it&Option-to-toggle-milk-curing-bad-omen&Fix-the-dead-lagging-the-server&Skip-events-if-there-s-no-listeners&Add-permission-for-F3-N-debug&Allow-leashing-villagers&Implement-infinite-lava&Make-lava-flow-speed-configurable&PaperPR-Projectile-load-save-limit-per-chunk&Add-5-second-tps-average-in-tps&Entity-lifespan&Squid-EAR-immunity&Allow-anvil-colors&Add-no-tick-block-list&Add-option-to-disable-dolphin-treasure-searching&Stop-squids-floating-on-top-of-water&Despawn-rate-config-options-per-projectile-type&PaperPR-Add-hex-color-code-support-for-console-loggi&Persistent-TileEntity-Lore-and-DisplayName&Infinity-bow-settings&Allow-infinite-and-mending-enchantments-together&Add-twisting-and-weeping-vines-growth-rates&Config-migration-disable-saving-projectiles-to-disk-&Spread-out-and-optimise-player-list-ticks&Implement-TPSBar&Fix-rotating-UP-DOWN-CW-and-CCW \ No newline at end of file diff --git a/patches/server/0001-Yatopia-Server-Fixes.patch b/patches/server/0001-Yatopia-Server-Fixes.patch index 12d33bb7..471592aa 100644 --- a/patches/server/0001-Yatopia-Server-Fixes.patch +++ b/patches/server/0001-Yatopia-Server-Fixes.patch @@ -142,7 +142,7 @@ index 2291135eaef64c403183724cb6e413cd7e472672..6fcc7ed7c129e6a33386d65b37cbba4a public static long a(long i, EnumDirection enumdirection) { return a(i, enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ()); diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf0df583dd 100644 +index 17753c8a997aa286460be5d8eb6508e2eaed18ce..56d5cebd155f2b5ee24c1d8b75903316e59688d1 100644 --- a/src/main/java/net/minecraft/server/CommandDispatcher.java +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java @@ -107,6 +107,7 @@ public class CommandDispatcher { @@ -153,7 +153,7 @@ index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf } if (commanddispatcher_servertype.d) { -@@ -337,6 +338,7 @@ public class CommandDispatcher { +@@ -338,6 +339,7 @@ public class CommandDispatcher { } @@ -161,7 +161,7 @@ index cabce1a8ba5db56495628edd9bc796aee7a53356..9754a9eac48c50efdefdceefbb4386bf public static LiteralArgumentBuilder a(String s) { return LiteralArgumentBuilder.literal(s); } -@@ -356,6 +358,7 @@ public class CommandDispatcher { +@@ -357,6 +359,7 @@ public class CommandDispatcher { }; } diff --git a/patches/server/0011-Modify-default-configs.patch b/patches/server/0011-Modify-default-configs.patch index 3bced699..a2e0f278 100644 --- a/patches/server/0011-Modify-default-configs.patch +++ b/patches/server/0011-Modify-default-configs.patch @@ -18,10 +18,10 @@ index ce14283dd1a1fddbea17c2fbaf1c4ef9d7a7479f..4a21a83c448355d61fb946bd0eb5d752 TimingsManager.privacy = getBoolean("timings.server-name-privacy", false); TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret")); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0bca517b4948cd55bfbf3ba4d5c1b3cd895cc086..ef129bbf7573af014876e323b0449a92181fe691 100644 +index 5b2077c90e2a3010a6a596d7e3551e791e670d16..fd0f3d6ddea9d0a6f3fd3bba041d5ed60bddb13c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -615,7 +615,7 @@ public class PaperWorldConfig { +@@ -624,7 +624,7 @@ public class PaperWorldConfig { } public boolean cooldownHopperWhenFull = true; diff --git a/patches/server/0012-lithium-MixinDirection.patch b/patches/server/0012-lithium-MixinDirection.patch index da277823..acf69e8d 100644 --- a/patches/server/0012-lithium-MixinDirection.patch +++ b/patches/server/0012-lithium-MixinDirection.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.16.x/fabric (Yarn mappings) diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 36aafc3b71013bcec0f4d956761fc2710848b3fd..259af9622e91b784a0a5de254304a9eab9a09d15 100644 +index 343eb3e9ab37730b55baeea839db6e882c3e50ae..9edc9f8eb820ba17559e796c6b42d78f038ba1db 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -20,13 +20,13 @@ public enum EnumDirection implements INamable { @@ -40,7 +40,7 @@ index 36aafc3b71013bcec0f4d956761fc2710848b3fd..259af9622e91b784a0a5de254304a9ea } public EnumDirection g() { -@@ -185,8 +189,12 @@ public enum EnumDirection implements INamable { +@@ -197,8 +201,12 @@ public enum EnumDirection implements INamable { return (float) ((this.i & 3) * 90); } diff --git a/patches/server/0066-Optimised-hallowen-checker.patch b/patches/server/0066-Optimised-hallowen-checker.patch index ea2009ec..f5505bb5 100644 --- a/patches/server/0066-Optimised-hallowen-checker.patch +++ b/patches/server/0066-Optimised-hallowen-checker.patch @@ -46,10 +46,10 @@ index f73304240a626f3f7d9355e6e5f2963a06c4bb7d..3ca3280d4a4d3cd8e0b4aff8431d8fe5 this.dropChanceArmor[EnumItemSlot.HEAD.b()] = 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 62d202ff871cf3f3deea69931fbee84131bdda8b..0475feb6e50c6d4a1f2813b028bbaef4ed710a7d 100644 +index 752e39ad94ea9e8254853a3fda846be2bd436918..f470650838ab0e349a7ffc79fcb4b84460d32832 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -471,11 +471,15 @@ public class EntityZombie extends EntityMonster { +@@ -472,11 +472,15 @@ public class EntityZombie extends EntityMonster { } if (this.getEquipment(EnumItemSlot.HEAD).isEmpty()) {