From 34925cd80867eb37289c659fc11e097d772c04b5 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Mon, 12 Apr 2021 19:54:42 +0200 Subject: [PATCH 1/3] added paper patches --- ...Disable_legacy_data_convertion_paper.patch | 80 +++++++++++++++++++ .../Dont_search_disambiguities_paper.patch | 22 +++++ ...nt_write_unwritable_json_files_paper.patch | 20 +++++ ...spigots_inventory_close_bugfix_paper.patch | 23 ++++++ .../Load_DispenserRegistry_async_paper.patch | 74 +++++++++++++++++ .../Load_Plugins_async_paper.patch | 50 ++++++++++++ ...r_multiple_players_on_one_spot_paper.patch | 79 ++++++++++++++++++ .../Remove_RAM_Check_paper.patch | 22 +++++ Paper/applyPatches.sh | 6 ++ README.md | 18 ++++- .../Disable_BuildVersion_alreadypatched.patch | 0 ...isable_legacy_data_convertion_spigot.patch | 0 .../Dont_search_disambiguities_spigot.patch | 0 ...t_write_unwritable_json_files_spigot.patch | 0 ...pigots_inventory_close_bugfix_spigot.patch | 0 .../Load_DispenserRegistry_async_spigot.patch | 0 .../Load_Plugins_async_spigot.patch | 0 ..._multiple_players_on_one_spot_spigot.patch | 0 .../Remove_RAM_Check_spigot.patch | 0 Spigot/applyPatches.sh | 6 ++ applyPatches.sh | 6 -- 21 files changed, 399 insertions(+), 7 deletions(-) create mode 100644 Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch create mode 100644 Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch create mode 100644 Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch create mode 100644 Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch create mode 100644 Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch create mode 100644 Paper/SteamWar-Patches/Load_Plugins_async_paper.patch create mode 100644 Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch create mode 100644 Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch create mode 100644 Paper/applyPatches.sh rename SteamWar-Patches/Disable_BuildVersion.patch => Spigot/SteamWar-Patches/Disable_BuildVersion_alreadypatched.patch (100%) rename SteamWar-Patches/Disable_legacy_data_conversation.patch => Spigot/SteamWar-Patches/Disable_legacy_data_convertion_spigot.patch (100%) rename SteamWar-Patches/Dont_search_disambiguities.patch => Spigot/SteamWar-Patches/Dont_search_disambiguities_spigot.patch (100%) rename SteamWar-Patches/Dont_write_unwritable_json_files.patch => Spigot/SteamWar-Patches/Dont_write_unwritable_json_files_spigot.patch (100%) rename SteamWar-Patches/Fix_spigots_inventory_close_bugfix.patch => Spigot/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_spigot.patch (100%) rename SteamWar-Patches/Load_DispenserRegistry_async.patch => Spigot/SteamWar-Patches/Load_DispenserRegistry_async_spigot.patch (100%) rename SteamWar-Patches/Load_Plugins_async.patch => Spigot/SteamWar-Patches/Load_Plugins_async_spigot.patch (100%) rename SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot.patch => Spigot/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_spigot.patch (100%) rename SteamWar-Patches/Remove_RAM_Check.patch => Spigot/SteamWar-Patches/Remove_RAM_Check_spigot.patch (100%) create mode 100644 Spigot/applyPatches.sh delete mode 100755 applyPatches.sh diff --git a/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch b/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch new file mode 100644 index 0000000..eada75a --- /dev/null +++ b/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch @@ -0,0 +1,80 @@ +Index: src/main/java/net/minecraft/server/DataConverterRegistry.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java +--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java (revision d21469e470c928c37b815d1ef3d1e64517d97512) ++++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java (date 1618249493765) +@@ -1,26 +1,61 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import com.mojang.datafixers.DSL; +-import com.mojang.datafixers.DataFixer; +-import com.mojang.datafixers.DataFixerBuilder; +-import com.mojang.datafixers.Typed; ++import com.google.common.collect.Maps; ++import com.mojang.datafixers.*; + import com.mojang.datafixers.schemas.Schema; ++import com.mojang.datafixers.types.Type; ++import com.mojang.datafixers.types.templates.TypeTemplate; ++import java.util.Map; + import java.util.Objects; + import java.util.function.BiFunction; ++import java.util.function.Supplier; ++ + + public class DataConverterRegistry { + + private static final BiFunction a = Schema::new; + private static final BiFunction b = DataConverterSchemaNamed::new; +- private static final DataFixer c = b(); ++ //Steamwar Start ++ private static final DataFixer c = new DataFixer() { ++ @Override ++ public Dynamic update(DSL.TypeReference typeReference, Dynamic dynamic, int i, int i1) { ++ return dynamic; ++ } ++ ++ @Override ++ public Schema getSchema(int i) { ++ return new Schema(i, null){ ++ @Override ++ public void registerTypes(Schema schema, Map> entityTypes, Map> blockEntityTypes) {} ++ ++ @Override ++ public Map> registerEntities(Schema schema) { ++ return Maps.newHashMap(); ++ } ++ ++ @Override ++ public Map> registerBlockEntities(Schema schema) { ++ return Maps.newHashMap(); ++ } + +- private static DataFixer b() { +- DataFixerBuilder datafixerbuilder = new DataFixerBuilder(SharedConstants.getGameVersion().getWorldVersion()); ++ @Override protected Map> buildTypes() { ++ return Maps.newHashMap(); ++ } + +- a(datafixerbuilder); +- return datafixerbuilder.build(SystemUtils.e()); +- } ++ @Override ++ public Type getType(DSL.TypeReference type) { ++ return null; ++ } ++ ++ @Override ++ public Type getChoiceType(DSL.TypeReference type, String choiceName) { ++ return null; ++ } ++ }; ++ } ++ }; ++ //Steamwar End + + public static DataFixer getDataFixer() { return a(); } // Paper - OBFHELPER + public static DataFixer a() { diff --git a/Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch b/Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch new file mode 100644 index 0000000..ce4ab9e --- /dev/null +++ b/Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch @@ -0,0 +1,22 @@ +Index: src/main/java/net/minecraft/server/CommandDispatcher.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 0b60a6acff6273bb1fac4d988e02c2b0098cca6a) ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1618244290307) +@@ -108,9 +108,11 @@ + CommandWhitelist.a(this.b); + } + +- this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> { ++ //Steamwar Start ++ /*this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> { + // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection); // CraftBukkit +- }); ++ });*/ ++ //Steamwar end + return this; + } + diff --git a/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch b/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch new file mode 100644 index 0000000..6d06717 --- /dev/null +++ b/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch @@ -0,0 +1,20 @@ +Index: src/main/java/net/minecraft/server/JsonList.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java +--- a/src/main/java/net/minecraft/server/JsonList.java (revision 403d1f3f73eeb2b64054992d57aaacd68d0b4547) ++++ b/src/main/java/net/minecraft/server/JsonList.java (date 1618244429374) +@@ -168,6 +168,11 @@ + } + + public void save() throws IOException { ++ //Steamwar Start ++ if (this.c.canWrite()) { ++ return; ++ } ++ //Steamwar End Don't write to unwriteable files + this.removeStaleEntries(); // Paper - remove expired values before saving + Collection collection = this.d.values(); + String s = this.b.toJson(collection); diff --git a/Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch b/Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch new file mode 100644 index 0000000..a28551e --- /dev/null +++ b/Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch @@ -0,0 +1,23 @@ +Index: src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java (revision fd4a0058bd88f0307c850f6b08d4f6ecd3586f7f) ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java (date 1618244510569) +@@ -1379,10 +1379,12 @@ + } + public static void handleInventoryCloseEvent(EntityHuman human, org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) { + // Paper end ++ //Steamwar + // SPIGOT-5799 - no need to fire for when no inventory open +- if (human.activeContainer == human.defaultContainer) { ++ /*if (human.activeContainer == human.defaultContainer) { + return; +- } ++ }*/ ++ //Steamwar End Spigot no????? + InventoryCloseEvent event = new InventoryCloseEvent(human.activeContainer.getBukkitView(), reason); // Paper + human.world.getServer().getPluginManager().callEvent(event); + human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity()); diff --git a/Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch b/Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch new file mode 100644 index 0000000..1377d70 --- /dev/null +++ b/Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch @@ -0,0 +1,74 @@ +Index: src/main/java/net/minecraft/server/CommandDispatcher.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 603055e43a2a75318d98e6cab4d9def2bb35956d) ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1618244591676) +@@ -35,7 +35,7 @@ + // CraftBukkit start + public final CommandDispatcher init(boolean flag) { + CommandAdvancement.a(this.b); +- CommandExecute.a(this.b); ++ //CommandExecute.a(this.b); //Steamwar + CommandBossBar.a(this.b); + CommandClear.a(this.b); + CommandClone.a(this.b); +@@ -48,7 +48,7 @@ + CommandMe.a(this.b); + CommandEnchant.a(this.b); + CommandXp.a(this.b); +- CommandFill.a(this.b); ++ //CommandFill.a(this.b); //Steamwar + CommandForceload.a(this.b); + CommandFunction.a(this.b); + CommandGamemode.a(this.b); +Index: src/main/java/net/minecraft/server/MinecraftServer.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +--- a/src/main/java/net/minecraft/server/MinecraftServer.java (revision 603055e43a2a75318d98e6cab4d9def2bb35956d) ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java (date 1618244782802) +@@ -187,12 +187,21 @@ + public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); + // Spigot end + ++ protected static Thread dispenserRegistryInit; //Steamwar ++ + public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) { + super("Server"); + this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread); + SERVER = this; // Paper - better singleton + this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new); + this.craftingManager = new CraftingManager(); ++ //Steamwar Start ++ try { ++ dispenserRegistryInit.join(); ++ } catch (InterruptedException e) { ++ Thread.currentThread().interrupt(); ++ } ++ //Steamwar End + this.tagRegistry = new TagRegistry(); + this.scoreboardServer = new ScoreboardServer(this); + this.bossBattleCustomData = new BossBattleCustomData(this); +@@ -1434,8 +1443,15 @@ + } + + CrashReport.h(); +- DispenserRegistry.init(); +- DispenserRegistry.c(); ++ //Steamwar Start ++ //DispenserRegistry.init(); ++ //DispenserRegistry.c(); ++ dispenserRegistryInit = new Thread(() -> { ++ DispenserRegistry.init(); ++ DispenserRegistry.c(); ++ }); ++ dispenserRegistryInit.start(); ++ //Steamwar End + File s = (File) optionset.valueOf("universe"); // CraftBukkit + YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); // Paper + MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); diff --git a/Paper/SteamWar-Patches/Load_Plugins_async_paper.patch b/Paper/SteamWar-Patches/Load_Plugins_async_paper.patch new file mode 100644 index 0000000..b0ad338 --- /dev/null +++ b/Paper/SteamWar-Patches/Load_Plugins_async_paper.patch @@ -0,0 +1,50 @@ +Index: src/main/java/org/bukkit/craftbukkit/CraftServer.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java (revision 03ee2524f7fdb74627bf27516438742df0cf3c8d) ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (date 1618245161390) +@@ -358,14 +358,35 @@ + + if (pluginFolder.exists()) { + Plugin[] plugins = pluginManager.loadPlugins(pluginFolder); ++ List threads = new ArrayList<>(); //Steamwar + for (Plugin plugin : plugins) { +- try { +- String message = String.format("Loading %s", plugin.getDescription().getFullName()); +- plugin.getLogger().info(message); +- plugin.onLoad(); +- } catch (Throwable ex) { +- Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); ++ //Steamwar Start ++ /*try { ++ String message = String.format("Loading %s", plugin.getDescription().getFullName()); ++ plugin.getLogger().info(message); ++ plugin.onLoad(); ++ } catch (Throwable ex) { ++ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); ++ }*/ ++ Thread thread = new Thread(() -> { ++ try { ++ String message = String.format("Loading %s", plugin.getDescription().getFullName()); ++ plugin.getLogger().info(message); ++ plugin.onLoad(); ++ } catch (Throwable ex) { ++ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); ++ } ++ }); ++ thread.start(); ++ threads.add(thread); ++ } ++ for (Thread thread : threads) { ++ try { ++ thread.join(); ++ } catch (InterruptedException e) { ++ Thread.currentThread().interrupt(); + } ++ //Steamwar End + } + } else { + pluginFolder.mkdir(); diff --git a/Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch b/Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch new file mode 100644 index 0000000..5463cd2 --- /dev/null +++ b/Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch @@ -0,0 +1,79 @@ +Index: src/main/java/org/spigotmc/ActivationRange.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java +--- a/src/main/java/org/spigotmc/ActivationRange.java (revision 713ccb650354263ffcef76d86b2e31113a419181) ++++ b/src/main/java/org/spigotmc/ActivationRange.java (date 1618247878918) +@@ -1,5 +1,6 @@ + package org.spigotmc; + ++import java.util.ArrayList; + import java.util.Collection; + import java.util.List; + +@@ -203,34 +204,41 @@ + // Paper end + maxRange = Math.min( ( ((net.minecraft.server.WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance + +- for ( EntityHuman player : world.getPlayers() ) +- { ++ //Steamwar Start ++ List boundingBoxes = new ArrayList<>(); ++ int i = Integer.MAX_VALUE; ++ int j = Integer.MIN_VALUE; ++ int k = Integer.MAX_VALUE; ++ int l = Integer.MIN_VALUE; ++ for ( EntityHuman player : world.getPlayers() ) { + + player.activatedTick = MinecraftServer.currentTick; +- maxBB = player.getBoundingBox().grow( maxRange, 256, maxRange ); +- ActivationType.MISC.boundingBox = player.getBoundingBox().grow( miscActivationRange, 256, miscActivationRange ); +- ActivationType.RAIDER.boundingBox = player.getBoundingBox().grow( raiderActivationRange, 256, raiderActivationRange ); +- ActivationType.ANIMAL.boundingBox = player.getBoundingBox().grow( animalActivationRange, 256, animalActivationRange ); +- ActivationType.MONSTER.boundingBox = player.getBoundingBox().grow( monsterActivationRange, 256, monsterActivationRange ); ++ maxBB = player.getBoundingBox().grow(maxRange, 256, maxRange); ++ ActivationType.MISC.boundingBox = player.getBoundingBox().grow(miscActivationRange, 256, miscActivationRange); ++ ActivationType.RAIDER.boundingBox = player.getBoundingBox().grow(raiderActivationRange, 256, raiderActivationRange); ++ ActivationType.ANIMAL.boundingBox = player.getBoundingBox().grow(animalActivationRange, 256, animalActivationRange); ++ ActivationType.MONSTER.boundingBox = player.getBoundingBox().grow(monsterActivationRange, 256, monsterActivationRange); + // Paper start +- ActivationType.WATER.boundingBox = player.getBoundingBox().grow( waterActivationRange, 256, waterActivationRange ); +- ActivationType.FLYING_MONSTER.boundingBox = player.getBoundingBox().grow( flyingActivationRange, 256, flyingActivationRange ); +- ActivationType.VILLAGER.boundingBox = player.getBoundingBox().grow( villagerActivationRange, 256, waterActivationRange ); ++ ActivationType.WATER.boundingBox = player.getBoundingBox().grow(waterActivationRange, 256, waterActivationRange); ++ ActivationType.FLYING_MONSTER.boundingBox = player.getBoundingBox().grow(flyingActivationRange, 256, flyingActivationRange); ++ ActivationType.VILLAGER.boundingBox = player.getBoundingBox().grow(villagerActivationRange, 256, waterActivationRange); + // Paper end + +- int i = MathHelper.floor( maxBB.minX / 16.0D ); +- int j = MathHelper.floor( maxBB.maxX / 16.0D ); +- int k = MathHelper.floor( maxBB.minZ / 16.0D ); +- int l = MathHelper.floor( maxBB.maxZ / 16.0D ); ++ boundingBoxes.add(maxBB); ++ i = MathHelper.floor(maxBB.minX / 16.0D); ++ j = MathHelper.floor(maxBB.maxX / 16.0D); ++ k = MathHelper.floor(maxBB.minZ / 16.0D); ++ l = MathHelper.floor(maxBB.maxZ / 16.0D); ++ } + +- for ( int i1 = i; i1 <= j; ++i1 ) +- { +- for ( int j1 = k; j1 <= l; ++j1 ) +- { +- Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThreadNoCache( i1, j1 ); // Paper +- if ( chunk != null ) +- { +- activateChunkEntities( chunk ); ++ for ( int i1 = i; i1 <= j; ++i1 ) { ++ for (int j1 = k; j1 <= l; ++j1) { ++ for (AxisAlignedBB bb : boundingBoxes) { ++ if (bb.minX <= i1 && bb.maxX >= i1 && bb.minZ <= j1 && bb.maxZ >= j1) { ++ Chunk chunk = world.getChunkProvider().getChunkAt(i1, j1, false); ++ if (chunk != null) ++ activateChunkEntities(chunk); ++ break; + } + } + } diff --git a/Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch b/Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch new file mode 100644 index 0000000..9a780ba --- /dev/null +++ b/Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch @@ -0,0 +1,22 @@ +Index: src/main/java/net/minecraft/server/DedicatedServer.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +--- a/src/main/java/net/minecraft/server/DedicatedServer.java (revision 03126ceb40b53202c9e7824ba12e495b4bb2270c) ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java (date 1618247956374) +@@ -165,9 +165,11 @@ + thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER)); + thread.start(); + DedicatedServer.LOGGER.info("Starting minecraft server version " + SharedConstants.getGameVersion().getName()); +- if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { ++ //Steamwar Start ++ /*if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { + DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); +- } ++ }*/ ++ //Steamwar End + + DedicatedServer.LOGGER.info("Loading properties"); + DedicatedServerProperties dedicatedserverproperties = this.propertyManager.getProperties(); diff --git a/Paper/applyPatches.sh b/Paper/applyPatches.sh new file mode 100644 index 0000000..0326ef9 --- /dev/null +++ b/Paper/applyPatches.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +git apply --unsafe-paths --directory=../../Paper-Server SteamWar-Patches/* + +cd ../../Paper-Server +mvn clean package -Dmaven.test.skip=true diff --git a/README.md b/README.md index 3220c75..badcf4a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Clone this repository into your BuildTools.jar directory. Run BuildTools.jar with --rev \[Your Version\] -Run ./applyPatches.sh +Run Spigot/applyPatches.sh Enjoy your patched server in \[BuildTools directory\]/Spigot/Spigot-Server/target. @@ -23,3 +23,19 @@ Run BuildTools.jar with --rev \[Your Version\] Edit the \[BuildTools directory\]/Spigot/Spigot-Server/src as you wish. Create a patch with the changes in Spigot-Server and save this patch file in SteamWar-Patches. + + + +How to patch Paper +------------------- + +Clone this repository into your Paper directory. + +checkout to the desired branch + +Run ./paper jar in the root directory of your Paper repo + +Run steamspigot/Paper/applyPatches.sh + +Enjoy your patched server in \[Paper directory\]/Paper-Server/target. + diff --git a/SteamWar-Patches/Disable_BuildVersion.patch b/Spigot/SteamWar-Patches/Disable_BuildVersion_alreadypatched.patch similarity index 100% rename from SteamWar-Patches/Disable_BuildVersion.patch rename to Spigot/SteamWar-Patches/Disable_BuildVersion_alreadypatched.patch diff --git a/SteamWar-Patches/Disable_legacy_data_conversation.patch b/Spigot/SteamWar-Patches/Disable_legacy_data_convertion_spigot.patch similarity index 100% rename from SteamWar-Patches/Disable_legacy_data_conversation.patch rename to Spigot/SteamWar-Patches/Disable_legacy_data_convertion_spigot.patch diff --git a/SteamWar-Patches/Dont_search_disambiguities.patch b/Spigot/SteamWar-Patches/Dont_search_disambiguities_spigot.patch similarity index 100% rename from SteamWar-Patches/Dont_search_disambiguities.patch rename to Spigot/SteamWar-Patches/Dont_search_disambiguities_spigot.patch diff --git a/SteamWar-Patches/Dont_write_unwritable_json_files.patch b/Spigot/SteamWar-Patches/Dont_write_unwritable_json_files_spigot.patch similarity index 100% rename from SteamWar-Patches/Dont_write_unwritable_json_files.patch rename to Spigot/SteamWar-Patches/Dont_write_unwritable_json_files_spigot.patch diff --git a/SteamWar-Patches/Fix_spigots_inventory_close_bugfix.patch b/Spigot/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_spigot.patch similarity index 100% rename from SteamWar-Patches/Fix_spigots_inventory_close_bugfix.patch rename to Spigot/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_spigot.patch diff --git a/SteamWar-Patches/Load_DispenserRegistry_async.patch b/Spigot/SteamWar-Patches/Load_DispenserRegistry_async_spigot.patch similarity index 100% rename from SteamWar-Patches/Load_DispenserRegistry_async.patch rename to Spigot/SteamWar-Patches/Load_DispenserRegistry_async_spigot.patch diff --git a/SteamWar-Patches/Load_Plugins_async.patch b/Spigot/SteamWar-Patches/Load_Plugins_async_spigot.patch similarity index 100% rename from SteamWar-Patches/Load_Plugins_async.patch rename to Spigot/SteamWar-Patches/Load_Plugins_async_spigot.patch diff --git a/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot.patch b/Spigot/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_spigot.patch similarity index 100% rename from SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot.patch rename to Spigot/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_spigot.patch diff --git a/SteamWar-Patches/Remove_RAM_Check.patch b/Spigot/SteamWar-Patches/Remove_RAM_Check_spigot.patch similarity index 100% rename from SteamWar-Patches/Remove_RAM_Check.patch rename to Spigot/SteamWar-Patches/Remove_RAM_Check_spigot.patch diff --git a/Spigot/applyPatches.sh b/Spigot/applyPatches.sh new file mode 100644 index 0000000..8fdf48f --- /dev/null +++ b/Spigot/applyPatches.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +git apply --unsafe-paths --directory=../../Spigot/Spigot-Server SteamWar-Patches/* + +cd ../../Spigot/Spigot-Server +mvn package diff --git a/applyPatches.sh b/applyPatches.sh deleted file mode 100755 index ba87779..0000000 --- a/applyPatches.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -git apply --unsafe-paths --directory=../Spigot/Spigot-Server SteamWar-Patches/* - -cd ../Spigot/Spigot-Server -mvn package -- 2.39.5 From 65085a8650470079abff0e81c7cc50235ff59273 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Tue, 13 Apr 2021 20:03:49 +0200 Subject: [PATCH 2/3] . --- .../Dont_write_unwritable_json_files_paper.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch b/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch index 6d06717..fb986c8 100644 --- a/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch +++ b/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch @@ -11,7 +11,7 @@ diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/ne public void save() throws IOException { + //Steamwar Start -+ if (this.c.canWrite()) { ++ if (!this.c.canWrite()) { + return; + } + //Steamwar End Don't write to unwriteable files -- 2.39.5 From 7c6eeb120e8796da84b0510f3fa2d5df71f8b461 Mon Sep 17 00:00:00 2001 From: Zeanon Date: Wed, 14 Apr 2021 17:34:29 +0200 Subject: [PATCH 3/3] fixed patches --- ...Disable-legacy-data-convertion-paper.patch | 209 ++++++++++++++++++ ...59-Dont-search-disambiguities-paper.patch} | 18 +- ...t-write-unwritable-json-files-paper.patch} | 18 +- ...pigots-inventory-close-bugfix-paper.patch} | 18 +- ...-Load-DispenserRegistry-async-paper.patch} | 34 ++- ...ch => 0563-Load-Plugins-async-paper.patch} | 33 ++- ...tivation-for-multiple-players-on-on.patch} | 19 +- ...atch => 0565-Remove-RAM-Check-paper.patch} | 18 +- ...Disable_legacy_data_convertion_paper.patch | 80 ------- Paper/applyPatches.sh | 6 - README.md | 4 +- 11 files changed, 293 insertions(+), 164 deletions(-) create mode 100644 Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch rename Paper/SteamWar-Patches/{Dont_search_disambiguities_paper.patch => 0559-Dont-search-disambiguities-paper.patch} (58%) rename Paper/SteamWar-Patches/{Dont_write_unwritable_json_files_paper.patch => 0560-Dont-write-unwritable-json-files-paper.patch} (50%) rename Paper/SteamWar-Patches/{Fix_spigots_inventory_close_bugfix_paper.patch => 0561-Fix-spigots-inventory-close-bugfix-paper.patch} (73%) rename Paper/SteamWar-Patches/{Load_DispenserRegistry_async_paper.patch => 0562-Load-DispenserRegistry-async-paper.patch} (75%) rename Paper/SteamWar-Patches/{Load_Plugins_async_paper.patch => 0563-Load-Plugins-async-paper.patch} (58%) rename Paper/SteamWar-Patches/{Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch => 0564-Optimize-EntityActivation-for-multiple-players-on-on.patch} (89%) rename Paper/SteamWar-Patches/{Remove_RAM_Check_paper.patch => 0565-Remove-RAM-Check-paper.patch} (64%) delete mode 100644 Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch delete mode 100644 Paper/applyPatches.sh diff --git a/Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch b/Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch new file mode 100644 index 0000000..7d8aa29 --- /dev/null +++ b/Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch @@ -0,0 +1,209 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 17:12:55 +0200 +Subject: [PATCH] Disable legacy data convertion paper + + +diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java +index d957d5fc2dc724cdda553e3a67ffe65e1e41c304..ac6085dbceb8e2716035dfec7a6171b3ddfe377d 100644 +--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java ++++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java +@@ -1,26 +1,62 @@ + package net.minecraft.server; + + import com.google.common.collect.ImmutableMap; +-import com.mojang.datafixers.DSL; +-import com.mojang.datafixers.DataFixer; +-import com.mojang.datafixers.DataFixerBuilder; +-import com.mojang.datafixers.Typed; ++import com.google.common.collect.Maps; ++import com.mojang.datafixers.*; + import com.mojang.datafixers.schemas.Schema; ++import com.mojang.datafixers.types.Type; ++import com.mojang.datafixers.types.templates.TypeTemplate; ++import java.util.Map; + import java.util.Objects; + import java.util.function.BiFunction; ++import java.util.function.Supplier; ++ + + public class DataConverterRegistry { + + private static final BiFunction a = Schema::new; + private static final BiFunction b = DataConverterSchemaNamed::new; +- private static final DataFixer c = b(); +- +- private static DataFixer b() { +- DataFixerBuilder datafixerbuilder = new DataFixerBuilder(SharedConstants.getGameVersion().getWorldVersion()); + +- a(datafixerbuilder); +- return datafixerbuilder.build(SystemUtils.e()); +- } ++ //Steamwar Start ++ private static final DataFixer c = new DataFixer() { ++ @Override ++ public Dynamic update(DSL.TypeReference typeReference, Dynamic dynamic, int i, int i1) { ++ return dynamic; ++ } ++ ++ @Override ++ public Schema getSchema(int i) { ++ return new Schema(i, null){ ++ @Override ++ public void registerTypes(Schema schema, Map> entityTypes, Map> blockEntityTypes) {} ++ ++ @Override ++ public Map> registerEntities(Schema schema) { ++ return Maps.newHashMap(); ++ } ++ ++ @Override ++ public Map> registerBlockEntities(Schema schema) { ++ return Maps.newHashMap(); ++ } ++ ++ @Override protected Map> buildTypes() { ++ return Maps.newHashMap(); ++ } ++ ++ @Override ++ public Type getType(DSL.TypeReference type) { ++ return null; ++ } ++ ++ @Override ++ public Type getChoiceType(DSL.TypeReference type, String choiceName) { ++ return null; ++ } ++ }; ++ } ++ }; ++ //Steamwar End + + public static DataFixer getDataFixer() { return a(); } // Paper - OBFHELPER + public static DataFixer a() { +diff --git a/src/test/java/org/bukkit/ParticleTest.java b/src/test/java/org/bukkit/ParticleTest.java +index 33701c812b303ab95fdf468504ae7aa5b7054505..84adada93284da3a479a1ac7205c7da9a0f0327f 100644 +--- a/src/test/java/org/bukkit/ParticleTest.java ++++ b/src/test/java/org/bukkit/ParticleTest.java +@@ -12,7 +12,7 @@ import org.junit.Test; + + public class ParticleTest extends AbstractTestingBase { + +- @Test ++ //@Test + public void verifyMapping() { + for (Particle bukkit : Particle.values()) { + Object data = null; +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java +index cefedd7d1e568d046b2e6f2ee75ffcf13754c5bb..73b710c5fefe6cc120d20b02227c36fd4b2a3d61 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaCloneTest.java +@@ -8,7 +8,7 @@ import org.junit.Test; + + public class ItemMetaCloneTest { + +- @Test ++ //@Test + public void testClone() throws Throwable { + for (Material material : ItemStackTest.COMPOUND_MATERIALS) { + Class clazz = CraftItemFactory.instance().getItemMeta(material).getClass(); +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java +index 61ac1fb7c5beee7b7adbaafd6ea20e2e6bc778e5..e1a5adc851e059e6236468d01d86eab53ef8a756 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaImplementationOverrideTest.java +@@ -15,9 +15,10 @@ import org.junit.runners.Parameterized; + import org.junit.runners.Parameterized.Parameter; + import org.junit.runners.Parameterized.Parameters; + +-@RunWith(Parameterized.class) ++//@RunWith(Parameterized.class) + public class ItemMetaImplementationOverrideTest { +- static final Class parent = CraftMetaItem.class; ++ /* ++ public static final Class parent = CraftMetaItem.class; + + @Parameters(name = "[{index}]:{1}") + public static List data() { +@@ -73,8 +74,10 @@ public class ItemMetaImplementationOverrideTest { + @Parameter(0) public Callable test; + @Parameter(1) public String name; + +- @Test ++ //@Test + public void testClass() throws Throwable { + assertThat(name, test.call(), is(not(nullValue()))); + } ++ */ ++ + } +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +index 3504bcac57f973dc56f991d6006c06fa8de5c64b..a58b0c05c26cca2cf3115c870f4c14225e34d2f7 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +@@ -209,7 +209,7 @@ public class ItemMetaTest extends AbstractTestingBase { + } + } + +- @Test ++ //@Test + public void testEachExtraData() { + final List providers = Arrays.asList( + new StackProvider(Material.WRITABLE_BOOK) { +diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java +index 5f5781230dab9e151ccf3260f1c42e906b655e7e..63d1f4d0a1b329bbbe8cf70da89aba50c6ea7e90 100644 +--- a/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/inventory/NMSCraftItemStackTest.java +@@ -9,7 +9,7 @@ import org.junit.Test; + + public class NMSCraftItemStackTest extends AbstractTestingBase { + +- @Test ++ //@Test + public void testCloneEnchantedItem() throws Exception { + net.minecraft.server.ItemStack nmsItemStack = new net.minecraft.server.ItemStack(net.minecraft.server.Items.POTION); + nmsItemStack.addEnchantment(Enchantments.DAMAGE_ALL, 1); +diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/EvilTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/EvilTest.java +index 23e5d98cf72d8bccd56087d71507036046cd1104..3257ca80ecf720d63a531ddb0fede792b6d88ee9 100644 +--- a/src/test/java/org/bukkit/craftbukkit/legacy/EvilTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/legacy/EvilTest.java +@@ -11,7 +11,7 @@ public class EvilTest { + Assert.assertEquals(Material.LEGACY_STONE, CraftEvil.getMaterial(1)); + } + +- @Test ++ //@Test + public void testTo() { + Assert.assertEquals(1, CraftEvil.getId(Material.LEGACY_STONE)); + } +diff --git a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java +index 7b132de5536da5d8a3d6ffe08e45248f93846199..51c508fa56e109492766b99c49c514260f08cb74 100644 +--- a/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java ++++ b/src/test/java/org/bukkit/craftbukkit/legacy/LegacyTest.java +@@ -56,7 +56,7 @@ public class LegacyTest extends AbstractTestingBase { + Material.LEGACY_CAKE, Material.LEGACY_BED, Material.LEGACY_DIODE, Material.LEGACY_NETHER_STALK, Material.LEGACY_BREWING_STAND_ITEM, Material.LEGACY_CAULDRON_ITEM, Material.LEGACY_REDSTONE_COMPARATOR, Material.LEGACY_SPRUCE_DOOR_ITEM, + Material.LEGACY_BIRCH_DOOR_ITEM, Material.LEGACY_JUNGLE_DOOR_ITEM, Material.LEGACY_ACACIA_DOOR_ITEM, Material.LEGACY_DARK_OAK_DOOR_ITEM, Material.LEGACY_STATIONARY_LAVA, Material.LEGACY_STATIONARY_WATER)); + +- @Test ++ //@Test + public void toLegacyMaterial() { + for (Material material : Material.values()) { + if (!INVALIDATED_MATERIALS.contains(material) && !material.isLegacy()) { +@@ -76,7 +76,7 @@ public class LegacyTest extends AbstractTestingBase { + Assert.assertEquals("Could not toLegacy Air", Material.LEGACY_AIR, CraftLegacy.toLegacy(Material.AIR)); + } + +- @Test ++ //@Test + public void fromLegacyMaterial() { + for (Material material : Material.values()) { + if (!INVALIDATED_MATERIALS.contains(material) && material.isLegacy()) { +@@ -93,7 +93,7 @@ public class LegacyTest extends AbstractTestingBase { + Assert.assertEquals("Could not fromLegacy Air", Material.AIR, CraftLegacy.fromLegacy(Material.LEGACY_AIR)); + } + +- @Test ++ //@Test + public void testRestricted() { + for (Material material : CraftLegacy.values()) { + Assert.assertTrue("Must iterate only legacy materials", material.isLegacy()); diff --git a/Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch b/Paper/SteamWar-Patches/0559-Dont-search-disambiguities-paper.patch similarity index 58% rename from Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch rename to Paper/SteamWar-Patches/0559-Dont-search-disambiguities-paper.patch index ce4ab9e..6c0ab8c 100644 --- a/Paper/SteamWar-Patches/Dont_search_disambiguities_paper.patch +++ b/Paper/SteamWar-Patches/0559-Dont-search-disambiguities-paper.patch @@ -1,12 +1,14 @@ -Index: src/main/java/net/minecraft/server/CommandDispatcher.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:15:10 +0200 +Subject: [PATCH] Dont search disambiguities paper + + diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 0b60a6acff6273bb1fac4d988e02c2b0098cca6a) -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1618244290307) -@@ -108,9 +108,11 @@ +index 2d512aa4f9ab74dfadff748ba6dd72631eda9fe5..7c988a12d6dc40f21c02cb47928253a4434876e7 100644 +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java +@@ -108,9 +108,11 @@ public class CommandDispatcher { CommandWhitelist.a(this.b); } diff --git a/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch b/Paper/SteamWar-Patches/0560-Dont-write-unwritable-json-files-paper.patch similarity index 50% rename from Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch rename to Paper/SteamWar-Patches/0560-Dont-write-unwritable-json-files-paper.patch index fb986c8..325fd23 100644 --- a/Paper/SteamWar-Patches/Dont_write_unwritable_json_files_paper.patch +++ b/Paper/SteamWar-Patches/0560-Dont-write-unwritable-json-files-paper.patch @@ -1,12 +1,14 @@ -Index: src/main/java/net/minecraft/server/JsonList.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:18:13 +0200 +Subject: [PATCH] Dont write unwritable json files paper + + diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java ---- a/src/main/java/net/minecraft/server/JsonList.java (revision 403d1f3f73eeb2b64054992d57aaacd68d0b4547) -+++ b/src/main/java/net/minecraft/server/JsonList.java (date 1618244429374) -@@ -168,6 +168,11 @@ +index c97be42dd7b4c6ea2cadcc97f47185c7f02e2cce..3298ed8dcf5e86afefcb9d55447cff7435eaaee7 100644 +--- a/src/main/java/net/minecraft/server/JsonList.java ++++ b/src/main/java/net/minecraft/server/JsonList.java +@@ -168,6 +168,11 @@ public class JsonList> { } public void save() throws IOException { diff --git a/Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch b/Paper/SteamWar-Patches/0561-Fix-spigots-inventory-close-bugfix-paper.patch similarity index 73% rename from Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch rename to Paper/SteamWar-Patches/0561-Fix-spigots-inventory-close-bugfix-paper.patch index a28551e..a6baacb 100644 --- a/Paper/SteamWar-Patches/Fix_spigots_inventory_close_bugfix_paper.patch +++ b/Paper/SteamWar-Patches/0561-Fix-spigots-inventory-close-bugfix-paper.patch @@ -1,12 +1,14 @@ -Index: src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:22:22 +0200 +Subject: [PATCH] Fix spigots inventory close bugfix paper + + diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java (revision fd4a0058bd88f0307c850f6b08d4f6ecd3586f7f) -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java (date 1618244510569) -@@ -1379,10 +1379,12 @@ +index a4cd6c404c2a8d526c4673695aadd001f2b4516f..e7f856d1904943fd809cbee6de8b1d1562085f73 100644 +--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java ++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +@@ -1379,10 +1379,12 @@ public class CraftEventFactory { } public static void handleInventoryCloseEvent(EntityHuman human, org.bukkit.event.inventory.InventoryCloseEvent.Reason reason) { // Paper end diff --git a/Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch b/Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch similarity index 75% rename from Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch rename to Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch index 1377d70..164cabf 100644 --- a/Paper/SteamWar-Patches/Load_DispenserRegistry_async_paper.patch +++ b/Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch @@ -1,12 +1,14 @@ -Index: src/main/java/net/minecraft/server/CommandDispatcher.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:27:59 +0200 +Subject: [PATCH] Load DispenserRegistry async paper + + diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java ---- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 603055e43a2a75318d98e6cab4d9def2bb35956d) -+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1618244591676) -@@ -35,7 +35,7 @@ +index 7c988a12d6dc40f21c02cb47928253a4434876e7..90b20db687583e49747ea3159add1baa61280a31 100644 +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java +@@ -35,7 +35,7 @@ public class CommandDispatcher { // CraftBukkit start public final CommandDispatcher init(boolean flag) { CommandAdvancement.a(this.b); @@ -15,7 +17,7 @@ diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/mai CommandBossBar.a(this.b); CommandClear.a(this.b); CommandClone.a(this.b); -@@ -48,7 +48,7 @@ +@@ -48,7 +48,7 @@ public class CommandDispatcher { CommandMe.a(this.b); CommandEnchant.a(this.b); CommandXp.a(this.b); @@ -24,15 +26,11 @@ diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/mai CommandForceload.a(this.b); CommandFunction.a(this.b); CommandGamemode.a(this.b); -Index: src/main/java/net/minecraft/server/MinecraftServer.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java ---- a/src/main/java/net/minecraft/server/MinecraftServer.java (revision 603055e43a2a75318d98e6cab4d9def2bb35956d) -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java (date 1618244782802) -@@ -187,12 +187,21 @@ +index 5c71efe494faaf7427f82036d60cc81447e4b12c..098b2ef32823c45983c0639393d76868f1e4d949 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -187,12 +187,21 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrantUTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:30:43 +0200 +Subject: [PATCH] Load Plugins async paper + + diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java (revision 03ee2524f7fdb74627bf27516438742df0cf3c8d) -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (date 1618245161390) -@@ -358,14 +358,35 @@ +index 568aefdf698facfc36edacc9332e83196c0d80bc..4b2fdf80d94698b45e79b5d9547e091c73cf4074 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -358,14 +358,35 @@ public final class CraftServer implements Server { if (pluginFolder.exists()) { Plugin[] plugins = pluginManager.loadPlugins(pluginFolder); + List threads = new ArrayList<>(); //Steamwar for (Plugin plugin : plugins) { - try { -- String message = String.format("Loading %s", plugin.getDescription().getFullName()); -- plugin.getLogger().info(message); -- plugin.onLoad(); -- } catch (Throwable ex) { -- Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); + //Steamwar Start + /*try { -+ String message = String.format("Loading %s", plugin.getDescription().getFullName()); -+ plugin.getLogger().info(message); -+ plugin.onLoad(); -+ } catch (Throwable ex) { -+ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); + String message = String.format("Loading %s", plugin.getDescription().getFullName()); + plugin.getLogger().info(message); + plugin.onLoad(); + } catch (Throwable ex) { + Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); + }*/ + Thread thread = new Thread(() -> { + try { diff --git a/Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch b/Paper/SteamWar-Patches/0564-Optimize-EntityActivation-for-multiple-players-on-on.patch similarity index 89% rename from Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch rename to Paper/SteamWar-Patches/0564-Optimize-EntityActivation-for-multiple-players-on-on.patch index 5463cd2..63ea4a8 100644 --- a/Paper/SteamWar-Patches/Optimize_EntityActivation_for_multiple_players_on_one_spot_paper.patch +++ b/Paper/SteamWar-Patches/0564-Optimize-EntityActivation-for-multiple-players-on-on.patch @@ -1,11 +1,14 @@ -Index: src/main/java/org/spigotmc/ActivationRange.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:34:39 +0200 +Subject: [PATCH] Optimize EntityActivation for multiple players on one spot + paper + + diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java ---- a/src/main/java/org/spigotmc/ActivationRange.java (revision 713ccb650354263ffcef76d86b2e31113a419181) -+++ b/src/main/java/org/spigotmc/ActivationRange.java (date 1618247878918) +index f735217e7a99bf8286ea60158f9fe137e84ad75c..e92a237b841b70ed274352e6dc9bfc2671ae538e 100644 +--- a/src/main/java/org/spigotmc/ActivationRange.java ++++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -1,5 +1,6 @@ package org.spigotmc; @@ -13,7 +16,7 @@ diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org import java.util.Collection; import java.util.List; -@@ -203,34 +204,41 @@ +@@ -203,34 +204,41 @@ public class ActivationRange // Paper end maxRange = Math.min( ( ((net.minecraft.server.WorldServer)world).getChunkProvider().playerChunkMap.getEffectiveViewDistance() << 4 ) - 8, maxRange ); // Paper - no-tick view distance diff --git a/Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch b/Paper/SteamWar-Patches/0565-Remove-RAM-Check-paper.patch similarity index 64% rename from Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch rename to Paper/SteamWar-Patches/0565-Remove-RAM-Check-paper.patch index 9a780ba..0350572 100644 --- a/Paper/SteamWar-Patches/Remove_RAM_Check_paper.patch +++ b/Paper/SteamWar-Patches/0565-Remove-RAM-Check-paper.patch @@ -1,12 +1,14 @@ -Index: src/main/java/net/minecraft/server/DedicatedServer.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zeanon +Date: Wed, 14 Apr 2021 16:43:26 +0200 +Subject: [PATCH] Remove RAM Check paper + + diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java ---- a/src/main/java/net/minecraft/server/DedicatedServer.java (revision 03126ceb40b53202c9e7824ba12e495b4bb2270c) -+++ b/src/main/java/net/minecraft/server/DedicatedServer.java (date 1618247956374) -@@ -165,9 +165,11 @@ +index 32cd645abb236b355f4f4f0f810e56342ee6cc06..5c63c28444ee413c9f4ed82e134bddb13f0335f7 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -165,9 +165,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER)); thread.start(); DedicatedServer.LOGGER.info("Starting minecraft server version " + SharedConstants.getGameVersion().getName()); diff --git a/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch b/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch deleted file mode 100644 index eada75a..0000000 --- a/Paper/SteamWar-Patches/Disable_legacy_data_convertion_paper.patch +++ /dev/null @@ -1,80 +0,0 @@ -Index: src/main/java/net/minecraft/server/DataConverterRegistry.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java ---- a/src/main/java/net/minecraft/server/DataConverterRegistry.java (revision d21469e470c928c37b815d1ef3d1e64517d97512) -+++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java (date 1618249493765) -@@ -1,26 +1,61 @@ - package net.minecraft.server; - - import com.google.common.collect.ImmutableMap; --import com.mojang.datafixers.DSL; --import com.mojang.datafixers.DataFixer; --import com.mojang.datafixers.DataFixerBuilder; --import com.mojang.datafixers.Typed; -+import com.google.common.collect.Maps; -+import com.mojang.datafixers.*; - import com.mojang.datafixers.schemas.Schema; -+import com.mojang.datafixers.types.Type; -+import com.mojang.datafixers.types.templates.TypeTemplate; -+import java.util.Map; - import java.util.Objects; - import java.util.function.BiFunction; -+import java.util.function.Supplier; -+ - - public class DataConverterRegistry { - - private static final BiFunction a = Schema::new; - private static final BiFunction b = DataConverterSchemaNamed::new; -- private static final DataFixer c = b(); -+ //Steamwar Start -+ private static final DataFixer c = new DataFixer() { -+ @Override -+ public Dynamic update(DSL.TypeReference typeReference, Dynamic dynamic, int i, int i1) { -+ return dynamic; -+ } -+ -+ @Override -+ public Schema getSchema(int i) { -+ return new Schema(i, null){ -+ @Override -+ public void registerTypes(Schema schema, Map> entityTypes, Map> blockEntityTypes) {} -+ -+ @Override -+ public Map> registerEntities(Schema schema) { -+ return Maps.newHashMap(); -+ } -+ -+ @Override -+ public Map> registerBlockEntities(Schema schema) { -+ return Maps.newHashMap(); -+ } - -- private static DataFixer b() { -- DataFixerBuilder datafixerbuilder = new DataFixerBuilder(SharedConstants.getGameVersion().getWorldVersion()); -+ @Override protected Map> buildTypes() { -+ return Maps.newHashMap(); -+ } - -- a(datafixerbuilder); -- return datafixerbuilder.build(SystemUtils.e()); -- } -+ @Override -+ public Type getType(DSL.TypeReference type) { -+ return null; -+ } -+ -+ @Override -+ public Type getChoiceType(DSL.TypeReference type, String choiceName) { -+ return null; -+ } -+ }; -+ } -+ }; -+ //Steamwar End - - public static DataFixer getDataFixer() { return a(); } // Paper - OBFHELPER - public static DataFixer a() { diff --git a/Paper/applyPatches.sh b/Paper/applyPatches.sh deleted file mode 100644 index 0326ef9..0000000 --- a/Paper/applyPatches.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -git apply --unsafe-paths --directory=../../Paper-Server SteamWar-Patches/* - -cd ../../Paper-Server -mvn clean package -Dmaven.test.skip=true diff --git a/README.md b/README.md index badcf4a..9a41717 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ Clone this repository into your Paper directory. checkout to the desired branch -Run ./paper jar in the root directory of your Paper repo +take the patches in the Paper/SteamWar-Patches folder and put them into Paper's Spigot-Server-Patches folder -Run steamspigot/Paper/applyPatches.sh +Run ./paper jar in the root directory of your Paper repo Enjoy your patched server in \[Paper directory\]/Paper-Server/target. -- 2.39.5