diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 761ff3bb..18bace52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,12 @@ jobs: - name: Build YAPFA run: | git submodule init - git submodule update + git submodule update --init --recursive git config --global user.email "ci@github.com" git config --global user.name "Github CI" - ./yapfa up + yapfaDir=`pwd` + cd Tuinity + ./tuinity jar + cd $yapfaDir ./yapfa patch ./yapfa build diff --git a/.gitmodules b/.gitmodules index fa984b51..73179f45 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "Paper"] - path = Paper - url = https://github.com/PaperMC/Paper +[submodule "Tuinity"] + path = Tuinity + url = https://github.com/Spottedleaf/Tuinity diff --git a/Paper b/Paper deleted file mode 160000 index 7bd0b6ab..00000000 --- a/Paper +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7bd0b6ab1ab2d7a17b20048dfc06daa1319c3506 diff --git a/README.md b/README.md index 00d2d4d5..68f3258f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # YAPFA -## (Yet another Paper fork attempt) +## (Yet another ~~Paper~~ Tuinity fork attempt) ## What ## -This Fork tries to import universal patches from [EMC](https://github.com/starlis/empirecraft) and [Purpur](https://github.com/pl3xgaming/Purpur), while adding a few more "extrem" patches that modify the basic minecraft server for more performance. +This Fork tries to import universal patches from [EMC](https://github.com/starlis/empirecraft) and [Purpur](https://github.com/pl3xgaming/Purpur), while adding a few more "extrem" patches that modify the basic minecraft server for more performance. This fork was based on Paper, but is now based on [Tuinity](https://github.com/Spottedleaf/Tuinity). ## Building and setting up Run the following commands in the root directory: diff --git a/Tuinity b/Tuinity new file mode 160000 index 00000000..d16b7882 --- /dev/null +++ b/Tuinity @@ -0,0 +1 @@ +Subproject commit d16b7882fc663ed975daf74091449c1927d0242a diff --git a/current-paper b/current-tuinity similarity index 100% rename from current-paper rename to current-tuinity diff --git a/patches/api/0001-Modify-POM.patch b/patches/api/0001-Modify-POM.patch index 1fde4617..382a11eb 100644 --- a/patches/api/0001-Modify-POM.patch +++ b/patches/api/0001-Modify-POM.patch @@ -1,36 +1,36 @@ -From e56e7c35b802814b62608f98517d2368cca70e47 Mon Sep 17 00:00:00 2001 +From 3f7f02d0d9e68b60c6c92144fc458afd99a64eb2 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 17:03:06 +0100 Subject: [PATCH] Modify POM --- - pom.xml | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) + pom.xml | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml -index 2cb97140..8103f6dd 100644 +index bab0b017..4bb7efe9 100644 --- a/pom.xml +++ b/pom.xml -@@ -3,18 +3,18 @@ +@@ -3,18 +3,19 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 -- com.destroystokyo.paper -- paper-parent +- com.tuinity +- tuinity-parent + de.tr7zw.yapfa + yapfa-parent dev-SNAPSHOT + ../pom.xml -- com.destroystokyo.paper -- paper-api +- tuinity-api + de.tr7zw.yapfa + yapfa-api 1.15.2-R0.1-SNAPSHOT jar -- Paper-API -- https://github.com/PaperMC/Paper +- Tuinity-API +- https://github.com/Spottedleaf/Tuinity + YAPFA-API + https://github.com/tr7zw/YAPFA An enhanced plugin API for Minecraft servers. diff --git a/patches/api/0031-Add-GameProfileLookupEvent.patch b/patches/api/0031-Add-GameProfileLookupEvent.patch index 15ce3ad0..8a08970c 100644 --- a/patches/api/0031-Add-GameProfileLookupEvent.patch +++ b/patches/api/0031-Add-GameProfileLookupEvent.patch @@ -1,4 +1,4 @@ -From d9c138fbfa962b5aafcc8b5387882523bab251dc Mon Sep 17 00:00:00 2001 +From 1c8f1bf377624c066e0d6300a3f684193eb1d0e9 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 22:21:14 +0100 Subject: [PATCH] Add GameProfileLookupEvent @@ -10,10 +10,10 @@ Subject: [PATCH] Add GameProfileLookupEvent create mode 100644 src/main/java/de/tr7zw/yapfa/events/GameProfileLookupEvent.java diff --git a/pom.xml b/pom.xml -index ca897873..3f97b2be 100644 +index 4bb7efe9..d9fb880f 100644 --- a/pom.xml +++ b/pom.xml -@@ -39,6 +39,10 @@ +@@ -40,6 +40,10 @@ sonatype https://oss.sonatype.org/content/groups/public/ @@ -24,7 +24,7 @@ index ca897873..3f97b2be 100644 -@@ -49,6 +53,13 @@ +@@ -50,6 +54,13 @@ diff --git a/patches/api/0032-Add-getLastTickMs-api.patch b/patches/api/0032-Add-getLastTickMs-api.patch index f2cd8c03..31f183f3 100644 --- a/patches/api/0032-Add-getLastTickMs-api.patch +++ b/patches/api/0032-Add-getLastTickMs-api.patch @@ -1,4 +1,4 @@ -From 8ad98f5fbf4542b3cb48d754448ff847bd45bab0 Mon Sep 17 00:00:00 2001 +From f729f3eb13144eb45278d3f0671f44339dd55552 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Thu, 5 Mar 2020 21:13:14 +0100 Subject: [PATCH] Add getLastTickMs() api @@ -9,10 +9,10 @@ Subject: [PATCH] Add getLastTickMs() api 2 files changed, 19 insertions(+) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 355bd2e2..f603f99f 100644 +index b9973406..610bd5b1 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1618,6 +1618,14 @@ public final class Bukkit { +@@ -1662,6 +1662,14 @@ public final class Bukkit { return server.getCurrentTick(); } // Paper end @@ -28,10 +28,10 @@ index 355bd2e2..f603f99f 100644 @NotNull public static Server.Spigot spigot() { diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 98e7ba90..7cebe608 100644 +index 80f9abdc..7b6cbe71 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1416,4 +1416,15 @@ public interface Server extends PluginMessageRecipient { +@@ -1456,4 +1456,15 @@ public interface Server extends PluginMessageRecipient { */ int getCurrentTick(); // Paper end diff --git a/patches/server/0001-Modify-POM.patch b/patches/server/0001-Modify-POM.patch index fd72d328..7f9823b1 100644 --- a/patches/server/0001-Modify-POM.patch +++ b/patches/server/0001-Modify-POM.patch @@ -1,37 +1,38 @@ -From 332de8cfc43e110aaf9c46ca3b9eef4ccf94c22d Mon Sep 17 00:00:00 2001 +From ddf4f73e653d81b5273acc1ad7cfc1ac00fd42e9 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 17:08:07 +0100 Subject: [PATCH] Modify POM --- - pom.xml | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) + pom.xml | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml -index 55679af9..7e166ce9 100644 +index 332a8a45..742e423c 100644 --- a/pom.xml +++ b/pom.xml -@@ -1,11 +1,11 @@ - 4.0.0 -- paper +- tuinity + yapfa jar 1.15.2-R0.1-SNAPSHOT -- Paper -- https://papermc.io +- Tuinity-Server +- https://github.com/Spottedleaf/Tuinity + YAPFA + https://github.com/tr7zw/YAPFA - ++ -@@ -21,16 +21,16 @@ + UTF-8 +@@ -20,16 +21,16 @@ -- com.destroystokyo.paper -- paper-parent +- com.tuinity +- tuinity-parent + de.tr7zw.yapfa + yapfa-parent dev-SNAPSHOT @@ -40,27 +41,28 @@ index 55679af9..7e166ce9 100644 -- com.destroystokyo.paper -- paper-api +- com.tuinity +- tuinity-api + de.tr7zw.yapfa + yapfa-api ${project.version} compile -@@ -143,7 +143,7 @@ +@@ -148,15 +149,15 @@ -- paper-${minecraft.version} +- tuinity-${minecraft.version} +- install + yapfa-${minecraft.version} - clean install ++ clean install -@@ -151,7 +151,7 @@ + com.lukegb.mojo gitdescribe-maven-plugin 1.3 -- git-Paper- +- git-Tuinity- + git-YAPFA- .. diff --git a/patches/server/0002-Brandings.patch b/patches/server/0002-Brandings.patch index fa596e3a..1636ae4b 100644 --- a/patches/server/0002-Brandings.patch +++ b/patches/server/0002-Brandings.patch @@ -1,47 +1,33 @@ -From 657c46021b893e6184415b1182fda23d7d9974d9 Mon Sep 17 00:00:00 2001 +From d1dfd7255c30123ed4d636bb4a6c2b1f03bac049 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 18:37:34 +0100 Subject: [PATCH] Brandings --- - .../paper/console/PaperConsole.java | 2 +- - .../paper/util/misc/AreaMap.java | 1 + + .../paper/console/PaperConsole.java | 1 + .../de/tr7zw/yapfa/YapfaVersionFetcher.java | 20 +++++++++++++++++++ .../net/minecraft/server/MinecraftServer.java | 2 +- .../org/bukkit/craftbukkit/CraftServer.java | 2 +- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- .../bukkit/craftbukkit/util/Versioning.java | 2 +- - 7 files changed, 26 insertions(+), 5 deletions(-) + 6 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -index cd6e25923..24e852ebd 100644 +index cd6e2592..e3599d11 100644 --- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java -@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { - @Override +@@ -18,6 +18,7 @@ public final class PaperConsole extends SimpleTerminalConsole { protected LineReader buildReader(LineReaderBuilder builder) { return super.buildReader(builder -- .appName("Paper") -+ .appName("YAPFA") + .appName("Paper") ++ .appName("YAPFA") // YAPFA .completer(new ConsoleCommandCompleter(this.server)) ); } -diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java -index 5a44bc644..4bd88e5b3 100644 ---- a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java -+++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java -@@ -1,6 +1,7 @@ - package com.destroystokyo.paper.util.misc; - - import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; -+import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; - import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; - import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; - import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap; diff --git a/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java b/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java new file mode 100644 -index 000000000..4ca5fd338 +index 00000000..b7a73408 --- /dev/null +++ b/src/main/java/de/tr7zw/yapfa/YapfaVersionFetcher.java @@ -0,0 +1,20 @@ @@ -65,28 +51,28 @@ index 000000000..4ca5fd338 + } + +} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c9deaffc4..b5bed4705 100644 +index 2acd6bf2..eec9a5b2 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1484,7 +1484,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return "YAPFA"; //YAPFA - YAPFA > //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! +- return "Tuinity"; // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "YAPFA"; // YAPFA // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! } public CrashReport b(CrashReport crashreport) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b7dfda265..d6b06c06e 100644 +index 0b65cbb2..4b27af23 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -203,7 +203,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { -- private final String serverName = "Paper"; // Paper + private final String serverName = "YAPFA"; // YAPFA private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); diff --git a/patches/server/0004-EMC-PlayerUseItem-Event.patch b/patches/server/0004-EMC-PlayerUseItem-Event.patch index 1bca3e5c..5b677619 100644 --- a/patches/server/0004-EMC-PlayerUseItem-Event.patch +++ b/patches/server/0004-EMC-PlayerUseItem-Event.patch @@ -1,4 +1,4 @@ -From 1d76a3b9382672fb6f13dd9efb6b5e77e7962bcb Mon Sep 17 00:00:00 2001 +From 4421584fbbc1dfb981327ea61e8621616b60c3f1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 22 Dec 2012 00:35:15 -0500 Subject: [PATCH] EMC PlayerUseItem Event @@ -23,10 +23,10 @@ index ad474500..671fa069 100644 this.setSlot(EnumItemSlot.MAINHAND, itemstack); } else { diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index ce4340a4..51e10cfc 100644 +index 1b60310b..3f358ec5 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java -@@ -391,6 +391,15 @@ public class PlayerInteractManager { +@@ -412,6 +412,15 @@ public class PlayerInteractManager { } public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand) { @@ -42,7 +42,7 @@ index ce4340a4..51e10cfc 100644 if (this.gamemode == EnumGamemode.SPECTATOR) { return EnumInteractionResult.PASS; } else if (entityhuman.getCooldownTracker().hasCooldown(itemstack.getItem())) { -@@ -398,27 +407,53 @@ public class PlayerInteractManager { +@@ -419,27 +428,53 @@ public class PlayerInteractManager { } else { int i = itemstack.getCount(); int j = itemstack.getDamage(); @@ -102,7 +102,7 @@ index ce4340a4..51e10cfc 100644 ((EntityPlayer) entityhuman).updateInventory(entityhuman.defaultContainer); } -@@ -432,6 +467,7 @@ public class PlayerInteractManager { +@@ -453,6 +488,7 @@ public class PlayerInteractManager { public boolean firedInteract = false; public EnumInteractionResult a(EntityHuman entityhuman, World world, ItemStack itemstack, EnumHand enumhand, MovingObjectPositionBlock movingobjectpositionblock) { BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); @@ -110,7 +110,7 @@ index ce4340a4..51e10cfc 100644 IBlockData iblockdata = world.getType(blockposition); EnumInteractionResult enuminteractionresult = EnumInteractionResult.PASS; boolean cancelledBlock = false; -@@ -499,17 +535,45 @@ public class PlayerInteractManager { +@@ -520,17 +556,45 @@ public class PlayerInteractManager { } if (!itemstack.isEmpty() && enuminteractionresult != EnumInteractionResult.SUCCESS && !interactResult) { // add !interactResult SPIGOT-764 diff --git a/patches/server/0013-EMC-Disable-UUID-conversion-Already-done.patch b/patches/server/0013-EMC-Disable-UUID-conversion-Already-done.patch index 5aaf4e05..525045d1 100644 --- a/patches/server/0013-EMC-Disable-UUID-conversion-Already-done.patch +++ b/patches/server/0013-EMC-Disable-UUID-conversion-Already-done.patch @@ -1,4 +1,4 @@ -From 89df9d7ca41b413ae9c3ac8193d8cedc89d68541 Mon Sep 17 00:00:00 2001 +From e1b72d3c45a36d430d4ef3b1bde43fbb6784bb5e Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 14 Apr 2014 20:44:38 -0400 Subject: [PATCH] EMC Disable UUID conversion - Already done @@ -9,10 +9,10 @@ Subject: [PATCH] EMC Disable UUID conversion - Already done 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 349a0ea2..8a241c28 100644 +index ede43693..610826c9 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -249,7 +249,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -250,7 +250,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); } diff --git a/patches/server/0015-EMC-EntityKnockbackEvent.patch b/patches/server/0015-EMC-EntityKnockbackEvent.patch index c7a5902b..ff9dc7c8 100644 --- a/patches/server/0015-EMC-EntityKnockbackEvent.patch +++ b/patches/server/0015-EMC-EntityKnockbackEvent.patch @@ -1,4 +1,4 @@ -From 38cac2cc8d88fa416f879fa39ad554f2cde7c2a4 Mon Sep 17 00:00:00 2001 +From 360d20b06b9e2b1b8e68275a3ba054e1de3e7a65 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 16 Mar 2014 20:44:46 -0400 Subject: [PATCH] EMC EntityKnockbackEvent @@ -44,10 +44,10 @@ index 584166f2..9346fbf0 100644 if (this.isSprinting() && flag) { sendSoundEffect(this, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_PLAYER_ATTACK_KNOCKBACK, this.getSoundCategory(), 1.0F, 1.0F); // Paper - send while respecting visibility diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 1991cee4..329f3685 100644 +index 27ef4760..0592e095 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1308,7 +1308,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1315,7 +1315,7 @@ public abstract class EntityInsentient extends EntityLiving { if (entity instanceof EntityLiving) { f += EnchantmentManager.a(this.getItemInMainHand(), ((EntityLiving) entity).getMonsterType()); diff --git a/patches/server/0017-EMC-Accept-the-EULA.patch b/patches/server/0017-EMC-Accept-the-EULA.patch index 9be3a70a..57f53889 100644 --- a/patches/server/0017-EMC-Accept-the-EULA.patch +++ b/patches/server/0017-EMC-Accept-the-EULA.patch @@ -1,4 +1,4 @@ -From f4e88ce690719daef8a3baac865262a070c43ea2 Mon Sep 17 00:00:00 2001 +From ec8804120c0877c9ed090ed7ed0e429eaffcab59 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 5 Sep 2014 23:04:54 -0400 Subject: [PATCH] EMC Accept the EULA @@ -9,10 +9,10 @@ Starlis LLC, the owner of Empire Minecraft, accepts the Minecraft EULA with this 1 file changed, 1 insertion(+) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 32f1099a..b5bd0e38 100644 +index 15ceb83f..fa8a5f53 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1343,6 +1343,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Thu, 25 Jun 2015 21:00:09 -0400 Subject: [PATCH] EMC ServerReloadEvent @@ -8,10 +8,10 @@ Subject: [PATCH] EMC ServerReloadEvent 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d6b06c06..9384c929 100644 +index 4b27af23..d3a0a917 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -761,6 +761,7 @@ public final class CraftServer implements Server { +@@ -771,6 +771,7 @@ public final class CraftServer implements Server { @Override public void reload() { org.spigotmc.WatchdogThread.hasStarted = false; // Paper - Disable watchdog early timeout on reload diff --git a/patches/server/0036-EMC-Do-not-save-entities-with-player-passengers.patch b/patches/server/0036-EMC-Do-not-save-entities-with-player-passengers.patch index b1025935..38a14913 100644 --- a/patches/server/0036-EMC-Do-not-save-entities-with-player-passengers.patch +++ b/patches/server/0036-EMC-Do-not-save-entities-with-player-passengers.patch @@ -1,4 +1,4 @@ -From b04e7fb704af33ef186743d10d773b5826e850ba Mon Sep 17 00:00:00 2001 +From 979580a2ffb58f7903fbddf2ef26203797535c79 Mon Sep 17 00:00:00 2001 From: chickeneer Date: Wed, 22 Jan 2020 01:22:34 -0600 Subject: [PATCH] EMC Do not save entities with player passengers @@ -8,10 +8,10 @@ Subject: [PATCH] EMC Do not save entities with player passengers 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 4349d22c..669eb9eb 100644 +index d529b795..1b2b73b8 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -444,7 +444,7 @@ public class ChunkRegionLoader { +@@ -452,7 +452,7 @@ public class ChunkRegionLoader { if (asyncsavedata == null) toUpdate.add(entity); // todo fix this broken code, entityJoinedWorld wont work in this case! continue; } @@ -20,7 +20,7 @@ index 4349d22c..669eb9eb 100644 continue; } // Paper end -@@ -525,6 +525,20 @@ public class ChunkRegionLoader { +@@ -533,6 +533,20 @@ public class ChunkRegionLoader { return nbttagcompound; } diff --git a/patches/server/0037-Purpur-Disable-outdated-build-check.patch b/patches/server/0037-Purpur-Disable-outdated-build-check.patch index d756d886..d2cebead 100644 --- a/patches/server/0037-Purpur-Disable-outdated-build-check.patch +++ b/patches/server/0037-Purpur-Disable-outdated-build-check.patch @@ -1,4 +1,4 @@ -From 87a4ad5661fa6d92f8ead7f64e3c1548054d08ac Mon Sep 17 00:00:00 2001 +From 9339c992bd089a91513ff682736b5c44da787cd8 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Sun, 15 Dec 2019 12:53:59 -0600 Subject: [PATCH] Purpur Disable outdated build check @@ -8,10 +8,10 @@ Subject: [PATCH] Purpur Disable outdated build check 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 374e0450..d6aa0306 100644 +index 2666940e..a9f2229c 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -212,7 +212,7 @@ public class Main { +@@ -219,7 +219,7 @@ public class Main { System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } diff --git a/patches/server/0039-Don-t-save-Fireworks-and-Arrows.patch b/patches/server/0039-Don-t-save-Fireworks-and-Arrows.patch index 274daf94..2dd58af4 100644 --- a/patches/server/0039-Don-t-save-Fireworks-and-Arrows.patch +++ b/patches/server/0039-Don-t-save-Fireworks-and-Arrows.patch @@ -1,4 +1,4 @@ -From cc74d3456f0ffbd9abdbc0c6b740c6d17644a3fd Mon Sep 17 00:00:00 2001 +From 42b73c07d1ef71fd082f14c8eb6682817d33ea68 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 21:39:58 +0100 Subject: [PATCH] Don't save Fireworks and Arrows @@ -8,10 +8,10 @@ Subject: [PATCH] Don't save Fireworks and Arrows 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 8974c16b..bfcf4a9b 100644 +index 181f1742..d2a224a8 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1516,7 +1516,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1616,7 +1616,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean c(NBTTagCompound nbttagcompound) { diff --git a/patches/server/0041-Add-GameProfileLookupEvent.patch b/patches/server/0040-Add-GameProfileLookupEvent.patch similarity index 91% rename from patches/server/0041-Add-GameProfileLookupEvent.patch rename to patches/server/0040-Add-GameProfileLookupEvent.patch index 3f742ab8..aa234ac2 100644 --- a/patches/server/0041-Add-GameProfileLookupEvent.patch +++ b/patches/server/0040-Add-GameProfileLookupEvent.patch @@ -1,4 +1,4 @@ -From 08c19476a6b5359ebc6fe21668c9a9dbb38e01c6 Mon Sep 17 00:00:00 2001 +From f3d5def9a1faac55232b4c258ec5f3c36ae81ede Mon Sep 17 00:00:00 2001 From: tr7zw Date: Wed, 26 Feb 2020 22:22:02 +0100 Subject: [PATCH] Add GameProfileLookupEvent @@ -9,7 +9,7 @@ Subject: [PATCH] Add GameProfileLookupEvent 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java -index b151a13c1..9eacb3c43 100644 +index b151a13c..a37db9a5 100644 --- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -5,8 +5,12 @@ import com.google.common.base.Charsets; @@ -34,7 +34,7 @@ index b151a13c1..9eacb3c43 100644 - this.profile = result; - } + // YAPFA start -+ GameProfileLookupEvent event = new GameProfileLookupEvent(!de.tr7zw.yapfa.MainThreadHandler.isMainThread(Thread.currentThread()), profile.getId(), profile.getName()); ++ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName()); + Bukkit.getServer().getPluginManager().callEvent(event); + if (event.getGameProfile() != null) { + this.profile = event.getGameProfile(); @@ -49,7 +49,7 @@ index b151a13c1..9eacb3c43 100644 return profile.isComplete() && (!isOnlineMode || !textures || hasTextures()); } diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 0882d82ce..8ed2c09ad 100644 +index 0882d82c..62607f49 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java @@ -4,9 +4,14 @@ import com.google.common.collect.Iterables; @@ -73,7 +73,7 @@ index 0882d82ce..8ed2c09ad 100644 { - profile = TileEntitySkull.sessionService.fillProfileProperties( profile, true ); + // YAPFA start -+ GameProfileLookupEvent event = new GameProfileLookupEvent(!de.tr7zw.yapfa.MainThreadHandler.isMainThread(Thread.currentThread()), profile.getId(), profile.getName()); ++ GameProfileLookupEvent event = new GameProfileLookupEvent(!Bukkit.isPrimaryThread(), profile.getId(), profile.getName()); + Bukkit.getServer().getPluginManager().callEvent(event); + if (event.getGameProfile() != null) { + profile = event.getGameProfile(); diff --git a/patches/server/0040-Add-MainThreadHandler-to-allow-custom-MainThreads.patch b/patches/server/0040-Add-MainThreadHandler-to-allow-custom-MainThreads.patch deleted file mode 100644 index a88cb3e0..00000000 --- a/patches/server/0040-Add-MainThreadHandler-to-allow-custom-MainThreads.patch +++ /dev/null @@ -1,166 +0,0 @@ -From 8005dcac9b78f662be51bc0734b9d334a15d5a5a Mon Sep 17 00:00:00 2001 -From: tr7zw -Date: Thu, 5 Mar 2020 20:47:06 +0100 -Subject: [PATCH] Add MainThreadHandler to allow custom "MainThreads" - ---- - .../de/tr7zw/yapfa/MainThreadHandler.java | 24 +++++++++++++++++++ - .../minecraft/server/IAsyncTaskHandler.java | 5 +++- - .../java/net/minecraft/server/MCUtil.java | 6 +++-- - .../net/minecraft/server/MinecraftServer.java | 3 +++ - .../org/bukkit/craftbukkit/CraftServer.java | 4 +++- - src/main/java/org/spigotmc/AsyncCatcher.java | 4 ++-- - 6 files changed, 40 insertions(+), 6 deletions(-) - create mode 100644 src/main/java/de/tr7zw/yapfa/MainThreadHandler.java - -diff --git a/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java b/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java -new file mode 100644 -index 000000000..f66e15e76 ---- /dev/null -+++ b/src/main/java/de/tr7zw/yapfa/MainThreadHandler.java -@@ -0,0 +1,24 @@ -+package de.tr7zw.yapfa; -+ -+import org.bukkit.craftbukkit.util.WeakCollection; -+ -+/** -+ * All Threads that are stored in this Collection are considered "MainThread" -+ * for all intents and purposes. -+ * -+ * @author tr7zw -+ * -+ */ -+public class MainThreadHandler { -+ -+ private static WeakCollection weakMainThreads = new WeakCollection(); -+ -+ public static void registerThread(Thread thread) { -+ weakMainThreads.add(thread); -+ } -+ -+ public static boolean isMainThread(Thread thread) { -+ return weakMainThreads.contains(thread); -+ } -+ -+} -diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index cfe43e882..9009705ee 100644 ---- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -+++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -@@ -1,6 +1,9 @@ - package net.minecraft.server; - - import com.google.common.collect.Queues; -+ -+import de.tr7zw.yapfa.MainThreadHandler; -+ - import java.util.Queue; - import java.util.concurrent.CompletableFuture; - import java.util.concurrent.Executor; -@@ -25,7 +28,7 @@ public abstract class IAsyncTaskHandler implements Mailbox T ensureMain(String reason, Supplier run) { -- if (AsyncCatcher.enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread) { -+ if (AsyncCatcher.enabled && !MainThreadHandler.isMainThread(Thread.currentThread())) { // YAPFA - if (reason != null) { - new IllegalStateException("Asynchronous " + reason + "! Blocking thread until it returns ").printStackTrace(); - } -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 816f4ff14..6ea3833fc 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2,6 +2,8 @@ package net.minecraft.server; - - import com.google.common.base.Splitter; - import co.aikar.timings.Timings; -+import de.tr7zw.yapfa.MainThreadHandler; -+ - import com.destroystokyo.paper.event.server.PaperServerListPingEvent; - import com.google.common.base.Stopwatch; - import com.google.common.collect.Lists; -@@ -132,6 +134,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { - MinecraftServer.LOGGER.error(throwable); - }); -+ MainThreadHandler.registerThread(thread); // YAPFA - }); - private long nextTick = SystemUtils.getMonotonicMillis(); - private long ab; final long getTickOversleepMaxTime() { return this.ab; } // Paper - OBFHELPER -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9384c9292..19b74f3ca 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -14,6 +14,8 @@ import com.mojang.brigadier.StringReader; - import com.mojang.brigadier.exceptions.CommandSyntaxException; - import com.mojang.brigadier.tree.CommandNode; - import com.mojang.brigadier.tree.LiteralCommandNode; -+ -+import de.tr7zw.yapfa.MainThreadHandler; - import io.netty.buffer.ByteBuf; - import io.netty.buffer.ByteBufOutputStream; - import io.netty.buffer.Unpooled; -@@ -1684,7 +1686,7 @@ public final class CraftServer implements Server { - - @Override - public boolean isPrimaryThread() { -- return Thread.currentThread().equals(console.serverThread); // Paper - Fix issues with detecting main thread properly -+ return MainThreadHandler.isMainThread(Thread.currentThread()); // YAPFA // Paper - Fix issues with detecting main thread properly - } - - @Override -diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java -index 9f7d2ef93..f9fd9f603 100644 ---- a/src/main/java/org/spigotmc/AsyncCatcher.java -+++ b/src/main/java/org/spigotmc/AsyncCatcher.java -@@ -1,6 +1,6 @@ - package org.spigotmc; - --import net.minecraft.server.MinecraftServer; -+import de.tr7zw.yapfa.MainThreadHandler; - - public class AsyncCatcher - { -@@ -10,7 +10,7 @@ public class AsyncCatcher - - public static void catchOp(String reason) - { -- if ( enabled && Thread.currentThread() != MinecraftServer.getServer().serverThread ) -+ if ( enabled && !MainThreadHandler.isMainThread(Thread.currentThread()) ) // YAPFA - { - throw new IllegalStateException( "Asynchronous " + reason + "!" ); - } --- -2.25.1.windows.1 - diff --git a/patches/server/0042-Add-getLastTickMs-api.patch b/patches/server/0041-Add-getLastTickMs-api.patch similarity index 88% rename from patches/server/0042-Add-getLastTickMs-api.patch rename to patches/server/0041-Add-getLastTickMs-api.patch index 20fa2abf..bed061da 100644 --- a/patches/server/0042-Add-getLastTickMs-api.patch +++ b/patches/server/0041-Add-getLastTickMs-api.patch @@ -1,4 +1,4 @@ -From 90e8bcd5384daf77b5d94744e1f40fbaf71526e5 Mon Sep 17 00:00:00 2001 +From 03a99f384fef93ce99164346e625053155eb7438 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Thu, 5 Mar 2020 21:13:33 +0100 Subject: [PATCH] Add getLastTickMs() api @@ -10,10 +10,10 @@ Subject: [PATCH] Add getLastTickMs() api 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6ea3833fc..d5efea027 100644 +index 376cf955..0276abe1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -886,6 +886,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant Date: Thu, 5 Mar 2020 22:31:50 +0100 Subject: [PATCH] Add config, yapfa command and basic settings @@ -8,14 +8,14 @@ Subject: [PATCH] Add config, yapfa command and basic settings src/main/java/de/tr7zw/yapfa/YapfaConfig.java | 219 ++++++++++++++++++ .../net/minecraft/server/DedicatedServer.java | 9 + .../java/net/minecraft/server/Entity.java | 3 +- - .../net/minecraft/server/EntityLiving.java | 9 +- - 5 files changed, 366 insertions(+), 3 deletions(-) + .../net/minecraft/server/EntityLiving.java | 6 +- + 5 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaCommand.java create mode 100644 src/main/java/de/tr7zw/yapfa/YapfaConfig.java diff --git a/src/main/java/de/tr7zw/yapfa/YapfaCommand.java b/src/main/java/de/tr7zw/yapfa/YapfaCommand.java new file mode 100644 -index 000000000..58ce1f826 +index 00000000..76d83f3d --- /dev/null +++ b/src/main/java/de/tr7zw/yapfa/YapfaCommand.java @@ -0,0 +1,129 @@ @@ -148,9 +148,10 @@ index 000000000..58ce1f826 + Command.broadcastCommandMessage(sender, ChatColor.GREEN + "YAPFA config reload complete."); + } +} +\ No newline at end of file diff --git a/src/main/java/de/tr7zw/yapfa/YapfaConfig.java b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java new file mode 100644 -index 000000000..71c04cf49 +index 00000000..9711cbc5 --- /dev/null +++ b/src/main/java/de/tr7zw/yapfa/YapfaConfig.java @@ -0,0 +1,219 @@ @@ -373,8 +374,9 @@ index 000000000..71c04cf49 + } + +} +\ No newline at end of file diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8a241c28a..c4006ff01 100644 +index 610826c9..2ed69f56 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -194,6 +194,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -390,14 +392,14 @@ index 8a241c28a..c4006ff01 100644 + } + de.tr7zw.yapfa.YapfaConfig.registerCommands(); + // YAPFA end + com.tuinity.tuinity.config.TuinityConfig.init((File) options.valueOf("tuinity-settings")); // Tuinity - Server Config this.setSpawnAnimals(dedicatedserverproperties.spawnAnimals); - this.setSpawnNPCs(dedicatedserverproperties.spawnNpcs); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index bfcf4a9b0..c27c1d5c2 100644 +index d2a224a8..45fdcee0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -662,6 +662,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -761,6 +761,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke try { this.inLava = false; @@ -405,7 +407,7 @@ index bfcf4a9b0..c27c1d5c2 100644 this.checkBlockCollisions(); } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Checking entity block collision"); -@@ -786,7 +787,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -885,7 +886,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this); VoxelShape voxelshape = this.world.getWorldBorder().a(); Stream stream = VoxelShapes.c(voxelshape, VoxelShapes.a(axisalignedbb.shrink(1.0E-7D)), OperatorBoolean.AND) ? Stream.empty() : Stream.of(voxelshape); @@ -415,10 +417,10 @@ index bfcf4a9b0..c27c1d5c2 100644 Vec3D vec3d1 = vec3d.g() == 0.0D ? vec3d : a(this, vec3d, axisalignedbb, this.world, voxelshapecollision, streamaccumulator); boolean flag = vec3d.x != vec3d1.x; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5b402690d..fa3affb54 100644 +index 5b402690..839b0f51 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -246,10 +246,11 @@ public abstract class EntityLiving extends Entity { +@@ -246,6 +246,7 @@ public abstract class EntityLiving extends Entity { this.world.getMethodProfiler().enter("livingEntityBaseTick"); boolean flag = this instanceof EntityHuman; @@ -426,11 +428,6 @@ index 5b402690d..fa3affb54 100644 if (this.isAlive()) { if (this.inBlock()) { this.damageEntity(DamageSource.STUCK, 1.0F); -- } else if (flag && !this.world.getWorldBorder().a(this.getBoundingBox())) { -+ } else if (flag && !de.tr7zw.yapfa.YapfaConfig.disablePlayerOutOfWorldBorderCheck && !this.world.getWorldBorder().a(this.getBoundingBox())) { // YAPFA - double d0 = this.world.getWorldBorder().a((Entity) this) + this.world.getWorldBorder().getDamageBuffer(); - - if (d0 < 0.0D) { @@ -261,6 +262,7 @@ public abstract class EntityLiving extends Entity { } } @@ -455,7 +452,7 @@ index 5b402690d..fa3affb54 100644 if (!this.world.isClientSide) { BlockPosition blockposition = new BlockPosition(this); -@@ -2640,11 +2644,12 @@ public abstract class EntityLiving extends Entity { +@@ -2640,7 +2644,7 @@ public abstract class EntityLiving extends Entity { this.e(new Vec3D((double) this.aZ, (double) this.ba, (double) this.bb)); this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("push"); @@ -464,11 +461,6 @@ index 5b402690d..fa3affb54 100644 --this.bn; this.a(axisalignedbb, this.getBoundingBox()); } - -+ if(!de.tr7zw.yapfa.YapfaConfig.disableEntityCollisions) // YAPFA - this.collideNearby(); - this.world.getMethodProfiler().exit(); - } -- 2.25.1.windows.1 diff --git a/patches/server/0044-Kill-the-vanilla-GameProfiler.patch b/patches/server/0043-Kill-the-vanilla-GameProfiler.patch similarity index 91% rename from patches/server/0044-Kill-the-vanilla-GameProfiler.patch rename to patches/server/0043-Kill-the-vanilla-GameProfiler.patch index e19580db..44600c22 100644 --- a/patches/server/0044-Kill-the-vanilla-GameProfiler.patch +++ b/patches/server/0043-Kill-the-vanilla-GameProfiler.patch @@ -1,4 +1,4 @@ -From ead0f031e6ffc43a68ed0842ef4896bde0fd13ec Mon Sep 17 00:00:00 2001 +From 9ae232d05c7db4372c14cd33c9ef11e29770c731 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Thu, 5 Mar 2020 23:08:01 +0100 Subject: [PATCH] Kill the vanilla "GameProfiler" @@ -11,7 +11,7 @@ Subject: [PATCH] Kill the vanilla "GameProfiler" diff --git a/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java new file mode 100644 -index 000000000..96a2270a8 +index 00000000..96a2270a --- /dev/null +++ b/src/main/java/de/tr7zw/yapfa/GameProfilerDisabled.java @@ -0,0 +1,51 @@ @@ -67,10 +67,10 @@ index 000000000..96a2270a8 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d5efea027..692c0cac9 100644 +index 0276abe1..e803c968 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -82,7 +82,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant tickables = Lists.newArrayList(); @@ -79,7 +79,7 @@ index d5efea027..692c0cac9 100644 private ServerConnection serverConnection; public final WorldLoadListenerFactory worldLoadListenerFactory; private final ServerPing serverPing = new ServerPing(); -@@ -935,7 +935,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -Date: Fri, 6 Mar 2020 20:28:47 +0100 -Subject: [PATCH] Rewrite the PathfinderGoalSelector class - ---- - .../server/PathfinderGoalSelector.java | 79 +++++++++++++++++-- - 1 file changed, 72 insertions(+), 7 deletions(-) - -diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -index 935136771..8e5b944b2 100644 ---- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -+++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java -@@ -1,9 +1,14 @@ - package net.minecraft.server; - - import com.google.common.collect.Sets; -+ -+import net.minecraft.server.PathfinderGoal.Type; -+ - import java.util.EnumMap; - import java.util.EnumSet; -+import java.util.Iterator; - import java.util.Map; -+import java.util.Map.Entry; - import java.util.Set; - import java.util.stream.Stream; - import org.apache.logging.log4j.LogManager; -@@ -58,9 +63,16 @@ public class PathfinderGoalSelector { - // Paper end - - public void a(PathfinderGoal pathfindergoal) { -- this.d.stream().filter((pathfindergoalwrapped) -> { -+ // YAPFA start -+ for(PathfinderGoalWrapped goal : this.d) { -+ if(goal.j() == pathfindergoal && goal.g()) { -+ goal.d(); -+ } -+ } -+ /*this.d.stream().filter((pathfindergoalwrapped) -> { - return pathfindergoalwrapped.j() == pathfindergoal; -- }).filter(PathfinderGoalWrapped::g).forEach(PathfinderGoalWrapped::d); -+ }).filter(PathfinderGoalWrapped::g).forEach(PathfinderGoalWrapped::d);*/ -+ // YAPFA end - this.d.removeIf((pathfindergoalwrapped) -> { - return pathfindergoalwrapped.j() == pathfindergoal; - }); -@@ -68,7 +80,24 @@ public class PathfinderGoalSelector { - - public void doTick() { - this.e.enter("goalCleanup"); -- this.c().filter((pathfindergoalwrapped) -> { -+ // YAPFA start -+ for (PathfinderGoalWrapped goal : this.d) { -+ if (goal.g() && !goal.b()) { -+ boolean flag = true; -+ -+ for(Type t : goal.i()) { -+ if(this.f.contains(t)) { -+ flag = false; -+ } -+ } -+ -+ if (flag) { -+ goal.d(); -+ } -+ } -+ } -+ this.c.entrySet().removeIf(ent -> !ent.getValue().g()); -+ /*this.c().filter((pathfindergoalwrapped) -> { - boolean flag; - - if (pathfindergoalwrapped.g()) { -@@ -90,10 +119,38 @@ public class PathfinderGoalSelector { - this.c.remove(pathfindergoal_type); - } - -- }); -+ });*/ -+ // YAPFA end - this.e.exit(); - this.e.enter("goalUpdate"); -- this.d.stream().filter((pathfindergoalwrapped) -> { -+ // YAPFA start -+ for(PathfinderGoalWrapped goal : this.d) { -+ if(!goal.g() && goal.a()) { -+ boolean noneMatch = true; -+ for(Type t : goal.i()) { -+ if(this.f.contains(t)) { -+ noneMatch = false; -+ } -+ } -+ if(noneMatch) { -+ boolean allMatch = true; -+ for(Type t : goal.i()) { -+ if(!this.c.getOrDefault(t, PathfinderGoalSelector.b).a(goal)){ -+ allMatch = false; -+ } -+ } -+ if(allMatch) { -+ for(Type t : goal.i()) { -+ PathfinderGoalWrapped pathfindergoalwrapped1 = (PathfinderGoalWrapped) this.c.getOrDefault(t, PathfinderGoalSelector.b); -+ pathfindergoalwrapped1.d(); -+ this.c.put(t, goal); -+ } -+ goal.c(); -+ } -+ } -+ } -+ } -+ /*this.d.stream().filter((pathfindergoalwrapped) -> { - return !pathfindergoalwrapped.g(); - }).filter((pathfindergoalwrapped) -> { - Stream stream = pathfindergoalwrapped.i().stream(); -@@ -113,10 +170,18 @@ public class PathfinderGoalSelector { - this.c.put(pathfindergoal_type, pathfindergoalwrapped); - }); - pathfindergoalwrapped.c(); -- }); -+ });*/ -+ // YAPFA end - this.e.exit(); - this.e.enter("goalTick"); -- this.c().forEach(PathfinderGoalWrapped::e); -+ // YAPFA start -+ for(PathfinderGoalWrapped goal : this.d) { -+ if(goal.g()) { -+ goal.e(); -+ } -+ } -+ //this.c().forEach(PathfinderGoalWrapped::e); -+ // YAPFA end - this.e.exit(); - } - --- -2.25.1.windows.1 - diff --git a/patches/server/0046-PAPER-Reduce-entity-tracker-updates-on-move.patch b/patches/server/0046-PAPER-Reduce-entity-tracker-updates-on-move.patch deleted file mode 100644 index bafe08a7..00000000 --- a/patches/server/0046-PAPER-Reduce-entity-tracker-updates-on-move.patch +++ /dev/null @@ -1,218 +0,0 @@ -From b8b3b931ccfa1f390db02deb97a830c537284652 Mon Sep 17 00:00:00 2001 -From: froobynooby -Date: Thu, 20 Feb 2020 15:50:49 +0930 -Subject: [PATCH] PAPER Reduce entity tracker updates on move - -With this patch, for each player we keep track of a set of -entities that the player is tracking. This is used to split -the entity tracker update logic in the movePlayer method in -PlayerChunkMap in to two parts: -* Full update: Run through all entity trackers and update them -* Partial update: Run through all entity trackers for entities -the player is already tracking and update them - -Partial updates will always take less time than full updates, -usually by a considerable amount if players and entities are -spread out over the map. Assuming they are evenly spread, -and given there are x many players, it would be expected to -take 1/x the time of a full update. - -Full updates are only run if the following conditions are met: -* It has been 20 ticks since the last full update -* The player has moved over set distance since the last full -update (distance is configurable) - -The motivation for the first condition is that the client -sends the server its position once a second, which calls -movePlayer, so at a minimum we want to be sending the player -an updated set of entities it can see every second. - -The motivation for the second condition is that looping -through every entity in world to check if it is now within -the tracking range after the player has moved 0.1 blocks is -largely unnecessary. Checking only after the player has moved -1 or 2 blocks is far better for performance, and very unlikely -to give any noticeable side effects. - -In testing, this has reduced the time taken for movement -packet processing by up to 4x. Packet processing for movement -packets often show up as a major contributor to TPS loss in -servers with large player counts ---- - .../destroystokyo/paper/PaperWorldConfig.java | 5 ++ - .../net/minecraft/server/EntityPlayer.java | 4 ++ - .../net/minecraft/server/PlayerChunkMap.java | 63 ++++++++++++++++++- - 3 files changed, 70 insertions(+), 2 deletions(-) - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7d408542e..2ae44b230 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -658,4 +658,9 @@ public class PaperWorldConfig { - private void nerfNetherPortalPigmen() { - nerfNetherPortalPigmen = getBoolean("game-mechanics.nerf-pigmen-from-nether-portals", nerfNetherPortalPigmen); - } -+ -+ public double trackerUpdateDistance = 1; -+ private void trackeruUpdateDistance() { -+ trackerUpdateDistance = getDouble("tracker-update-distance", trackerUpdateDistance); -+ } - } -diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e7bfbc330..43774bc9a 100644 ---- a/src/main/java/net/minecraft/server/EntityPlayer.java -+++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -86,6 +86,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - public final int[] mobCounts = new int[ENUMCREATURETYPE_TOTAL_ENUMS]; // Paper - public final com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet cachedSingleMobDistanceMap; - // Paper end -+ // Paper start - Reduce entity tracker updates on move -+ public Vec3D lastTrackedPosition = new Vec3D(0, 0, 0); -+ public long lastTrackedTick; -+ // Paper end - - // CraftBukkit start - public String displayName; -diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 57bea926a..d971a4426 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunkMap.java -+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -133,6 +133,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - } - - -+ // Paper end -+ -+ // Paper start - Reduce entity tracker updates on move -+ private double trackerUpdateDistanceSquared; -+ private final Int2ObjectMap> playerTrackedEntities = new Int2ObjectOpenHashMap(); -+ private final Int2ObjectMap> playerTrackedEntitiesRemoveQueue = new Int2ObjectOpenHashMap(); -+ -+ void flushRemoveQueue(EntityPlayer entityplayer) { -+ Queue removeQueue = getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId()); -+ Int2ObjectMap entityMap = getPlayerTrackedEntityMap(entityplayer.getId()); -+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) { -+ entityMap.remove(id); -+ } -+ } -+ -+ void flushRemoveQueues() { -+ for (Int2ObjectMap.Entry> entry : playerTrackedEntitiesRemoveQueue.int2ObjectEntrySet()) { -+ Int2ObjectMap entityMap = getPlayerTrackedEntityMap(entry.getKey()); -+ Queue removeQueue = entry.getValue(); -+ for (Integer id = removeQueue.poll(); id != null; id = removeQueue.poll()) { -+ entityMap.remove(id); -+ } -+ } -+ } -+ -+ Int2ObjectMap getPlayerTrackedEntityMap(int id) { -+ return playerTrackedEntities.computeIfAbsent(id, i -> new Int2ObjectOpenHashMap()); -+ } -+ -+ Queue getPlayerTrackedEntityMapRemoveQueue(int id) { -+ return playerTrackedEntitiesRemoveQueue.computeIfAbsent(id, i -> new java.util.ArrayDeque<>()); -+ } -+ - // Paper end - - public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i) { -@@ -167,6 +200,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - this.m = new VillagePlace(new File(this.w, "poi"), datafixer, this.world); // Paper - this.setViewDistance(i); - this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper -+ this.trackerUpdateDistanceSquared = Math.pow(this.world.paperConfig.trackerUpdateDistance, 2); // Paper - } - - public void updatePlayerMobTypeMap(Entity entity) { -@@ -1334,8 +1368,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - } - - public void movePlayer(EntityPlayer entityplayer) { -- ObjectIterator objectiterator = this.trackedEntities.values().iterator(); -+ // Paper start -+ // ObjectIterator objectiterator = this.trackedEntities.values().iterator(); -+ ObjectIterator objectiterator; - -+ if (MinecraftServer.currentTick - entityplayer.lastTrackedTick >= 20 -+ || entityplayer.lastTrackedPosition.distanceSquared(entityplayer.getPositionVector()) >= trackerUpdateDistanceSquared) { -+ entityplayer.lastTrackedPosition = entityplayer.getPositionVector(); -+ entityplayer.lastTrackedTick = MinecraftServer.currentTick; -+ objectiterator = this.trackedEntities.values().iterator(); // Update all entity trackers -+ } else { -+ objectiterator = getPlayerTrackedEntityMap(entityplayer.getId()).values().iterator(); // Only update entity trackers for already tracked entities -+ } -+ // Paper end - while (objectiterator.hasNext()) { - PlayerChunkMap.EntityTracker playerchunkmap_entitytracker = (PlayerChunkMap.EntityTracker) objectiterator.next(); - -@@ -1345,6 +1390,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - playerchunkmap_entitytracker.updatePlayer(entityplayer); - } - } -+ flushRemoveQueues(); // Paper - - int i = MathHelper.floor(entityplayer.locX()) >> 4; - int j = MathHelper.floor(entityplayer.locZ()) >> 4; -@@ -1486,12 +1532,21 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - - playerchunkmap_entitytracker.clear(entityplayer); - } -+ // Paper start -+ playerTrackedEntities.remove(entityplayer.getId()); -+ playerTrackedEntitiesRemoveQueue.remove(entityplayer.getId()); -+ // Paper end - } - - PlayerChunkMap.EntityTracker playerchunkmap_entitytracker1 = (PlayerChunkMap.EntityTracker) this.trackedEntities.remove(entity.getId()); - - if (playerchunkmap_entitytracker1 != null) { - playerchunkmap_entitytracker1.a(); -+ // Paper start -+ for (EntityPlayer player : playerchunkmap_entitytracker1.trackedPlayers) { -+ getPlayerTrackedEntityMap(player.getId()).remove(playerchunkmap_entitytracker1.tracker.getId()); -+ } -+ // Paper end - } - entity.tracker = null; // Paper - We're no longer tracked - } -@@ -1532,7 +1587,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - } - world.timings.tracker2.stopTiming(); // Paper - } -- -+ flushRemoveQueues(); // Paper - - } - -@@ -1581,6 +1636,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - } - } - } -+ flushRemoveQueue(entityplayer); // Paper - - Iterator iterator; - Entity entity1; -@@ -1677,6 +1733,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - org.spigotmc.AsyncCatcher.catchOp("player tracker clear"); // Spigot - if (this.trackedPlayers.remove(entityplayer)) { - this.trackerEntry.a(entityplayer); -+ getPlayerTrackedEntityMap(entityplayer.getId()).remove(this.tracker.getId()); // Paper - } - - } -@@ -1713,9 +1770,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - - if (flag1 && this.trackedPlayerMap.putIfAbsent(entityplayer, true) == null) { // Paper - this.trackerEntry.b(entityplayer); -+ getPlayerTrackedEntityMap(entityplayer.getId()).put(this.tracker.getId(), this); // Paper - } - } else if (this.trackedPlayers.remove(entityplayer)) { - this.trackerEntry.a(entityplayer); -+ getPlayerTrackedEntityMapRemoveQueue(entityplayer.getId()).add(this.tracker.getId()); // Paper - } - - } --- -2.25.1.windows.1 - diff --git a/scripts/apply.sh b/scripts/apply.sh index 2a6a693c..0682a3a7 100755 --- a/scripts/apply.sh +++ b/scripts/apply.sh @@ -9,7 +9,7 @@ done . $(dirname $SOURCE)/init.sh PS1="$" -paperVer=$(cat current-paper) +tuinityVer=$(cat current-tuinity) gpgsign="$(git config commit.gpgsign || echo "false")" echo "Rebuilding Forked projects.... " @@ -69,8 +69,8 @@ function enableCommitSigningIfNeeded { } ( - (applyPatch Paper/Paper-API ${FORK_NAME}-API HEAD api $API_REPO && - applyPatch Paper/Paper-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1 + (applyPatch Tuinity/Tuinity-API ${FORK_NAME}-API HEAD api $API_REPO && + applyPatch Tuinity/Tuinity-Server ${FORK_NAME}-Server HEAD server $SERVER_REPO) || exit 1 enableCommitSigningIfNeeded ) || ( echo "Failed to apply patches" diff --git a/scripts/commitup.sh b/scripts/commitup.sh index 222dc8ab..8919502c 100755 --- a/scripts/commitup.sh +++ b/scripts/commitup.sh @@ -7,9 +7,9 @@ function changelog() { base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1) cd $1 && git log --oneline ${base}...HEAD } -paper=$(changelog Paper) +tuinity=$(changelog Tuinity) -log="Updated Paper \n\nUpdating our baseline Paper reference\n\nPaper changes since last:\n$paper" +log="Updated Tuinity \n\nUpdating our baseline Tuinity reference\n\nTuinity changes since last:\n$tuinity" echo -e "$log" | git commit -F - diff --git a/scripts/generatesources.sh b/scripts/generatesources.sh index cb07c522..2eae5c94 100755 --- a/scripts/generatesources.sh +++ b/scripts/generatesources.sh @@ -10,10 +10,10 @@ done cd $basedir -paperVer=$(cat current-paper) +tuinityVer=$(cat current-tuinity) -minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) -decompile="Paper/work/Minecraft/$minecraftversion/spigot" +minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +decompile="Tuinity/work/Minecraft/$minecraftversion/spigot" mkdir -p mc-dev/src/net/minecraft/server @@ -29,7 +29,7 @@ do done -base="$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server" +base="$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server" cd $basedir/mc-dev/src/net/minecraft/server/ for file in $(/bin/ls $base) do @@ -40,4 +40,4 @@ done cd $basedir/mc-dev git add . -A git commit . -m "mc-dev" -git tag -a "$paperVer" -m "$paperVer" 2>/dev/null +git tag -a "$tuinityVer" -m "$tuinityVer" 2>/dev/null diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index dc16dcf0..7b897312 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -8,8 +8,8 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done . $(dirname $SOURCE)/init.sh -workdir=$basedir/Paper/work -minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +workdir=$basedir/Tuinity/work +minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) decompiledir=$workdir/Minecraft/$minecraftversion/spigot nms="net/minecraft/server" @@ -18,13 +18,13 @@ cd $basedir export importedmcdev="" function import { - if [ -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$1.java" ]; then + if [ -f "$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server/$1.java" ]; then echo "ALREADY IMPORTED $1" return 0 fi export importedmcdev="$importedmcdev $1" file="${1}.java" - target="$basedir/Paper/Paper-Server/src/main/java/$nms/$file" + target="$basedir/Tuinity/Tuinity-Server/src/main/java/$nms/$file" base="$decompiledir/$nms/$file" if [[ ! -f "$target" ]]; then @@ -43,7 +43,7 @@ function importLibrary { shift 3 for file in "$@"; do file="$prefix/$file" - target="$basedir/Paper/Paper-Server/src/main/java/${file}" + target="$basedir/Tuinity/Tuinity-Server/src/main/java/${file}" targetdir=$(dirname "$target") mkdir -p "${targetdir}" base="$workdir/Minecraft/$minecraftversion/libraries/${group}/${lib}/$file" @@ -57,7 +57,7 @@ function importLibrary { } ( - cd Paper/Paper-Server/ + cd Tuinity/Tuinity-Server/ lastlog=$(git log -1 --oneline) if [[ "$lastlog" = *"EMC-Extra mc-dev Imports"* ]]; then git reset --hard HEAD^ @@ -78,7 +78,7 @@ function containsElement { for f in $files; do containsElement "$f" ${nonnms[@]} if [ "$?" == "1" ]; then - if [ ! -f "$basedir/Paper/Paper-Server/src/main/java/net/minecraft/server/$f.java" ]; then + if [ ! -f "$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server/$f.java" ]; then if [ ! -f "$decompiledir/$nms/$f.java" ]; then echo "$(bashColor 1 31) ERROR!!! Missing NMS$(bashColor 1 34) $f $(bashColorReset)"; else @@ -111,7 +111,7 @@ done ######################################################## ######################################################## ( - cd Paper/Paper-Server/ + cd Tuinity/Tuinity-Server/ rm -rf nms-patches git add src -A echo -e "EMC-Extra mc-dev Imports\n\n$MODLOG" | git commit src -F - diff --git a/scripts/push.sh b/scripts/push.sh index 651cb776..92d3646b 100755 --- a/scripts/push.sh +++ b/scripts/push.sh @@ -8,6 +8,6 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done . $(dirname $SOURCE)/init.sh -minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) basedir diff --git a/scripts/rebuildpatches.sh b/scripts/rebuildpatches.sh index ffc587e5..27ba16a4 100755 --- a/scripts/rebuildpatches.sh +++ b/scripts/rebuildpatches.sh @@ -40,9 +40,9 @@ function savePatches { savePatches ${FORK_NAME}-API api if [ -f "$basedir/${FORK_NAME}-API/.git/patch-apply-failed" ]; then - echo "$(bashColor 1 31)[[[ WARNING ]]] $(bashColor 1 33)- Not saving Paper-Server as it appears ${FORK_NAME}-API did not apply clean.$(bashColorReset)" + echo "$(bashColor 1 31)[[[ WARNING ]]] $(bashColor 1 33)- Not saving Tuinity-Server as it appears ${FORK_NAME}-API did not apply clean.$(bashColorReset)" echo "$(bashColor 1 33)If this is a mistake, delete $(bashColor 1 34)${FORK_NAME}-API/.git/patch-apply-failed$(bashColor 1 33) and run rebuild again.$(bashColorReset)" - echo "$(bashColor 1 33)Otherwise, rerun ./paper patch to have a clean Paper-API apply so the latest Paper-Server can build.$(bashColorReset)" + echo "$(bashColor 1 33)Otherwise, rerun ./tuinity patch to have a clean Tuinity-API apply so the latest Tuinity-Server can build.$(bashColorReset)" else savePatches ${FORK_NAME}-Server server ${basedir}/scripts/push.sh diff --git a/scripts/upstream.sh b/scripts/upstream.sh index 76049522..ef1c716b 100755 --- a/scripts/upstream.sh +++ b/scripts/upstream.sh @@ -10,33 +10,33 @@ done if [[ "$1" == up* ]]; then ( - cd "$basedir/Paper/" + cd "$basedir/Tuinity/" git fetch && git reset --hard origin/ver/1.14 cd ../ - git add Paper + git add Tuinity ) fi -paperVer=$(gethead Paper) -cd "$basedir/Paper/" +tuinityVer=$(gethead Tuinity) +cd "$basedir/Tuinity/" -./paper patch +./tuinity patch -cd "Paper-Server" +cd "Tuinity-Server" mcVer=$(mvn -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }') basedir . $basedir/scripts/importmcdev.sh -minecraftversion=$(cat $basedir/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) -version=$(echo -e "Paper: $paperVer\nmc-dev:$importedmcdev") +minecraftversion=$(cat $basedir/Tuinity/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) +version=$(echo -e "Tuinity: $tuinityVer\nmc-dev:$importedmcdev") tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $1}')" -echo "$tag" > $basedir/current-paper -git add "$basedir/current-paper" +echo "$tag" > $basedir/current-tuinity +git add "$basedir/current-tuinity" $basedir/scripts/generatesources.sh -cd Paper/ +cd Tuinity/ function tag { ( @@ -51,10 +51,10 @@ echo "Tagging as $tag" echo -e "$version" forcetag=0 -if [ "$(cat $basedir/current-paper)" != "$tag" ]; then +if [ "$(cat $basedir/current-tuinity)" != "$tag" ]; then forcetag=1 fi -tag Paper-API $forcetag -tag Paper-Server $forcetag +tag Tuinity-API $forcetag +tag Tuinity-Server $forcetag