added paper patches #4
209
Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch
Normale Datei
209
Paper/SteamWar-Patches/0558-Disable-legacy-data-convertion-paper.patch
Normale Datei
@ -0,0 +1,209 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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<Integer, Schema, Schema> a = Schema::new;
|
||||
private static final BiFunction<Integer, Schema, Schema> 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 <T> Dynamic<T> update(DSL.TypeReference typeReference, Dynamic<T> 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<String, Supplier<TypeTemplate>> entityTypes, Map<String, Supplier<TypeTemplate>> blockEntityTypes) {}
|
||||
+
|
||||
+ @Override
|
||||
+ public Map<String, Supplier<TypeTemplate>> registerEntities(Schema schema) {
|
||||
+ return Maps.newHashMap();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Map<String, Supplier<TypeTemplate>> registerBlockEntities(Schema schema) {
|
||||
+ return Maps.newHashMap();
|
||||
+ }
|
||||
+
|
||||
+ @Override protected Map<String, Type<?>> 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<CraftMetaItem> parent = CraftMetaItem.class;
|
||||
+ /*
|
||||
+ public static final Class<CraftMetaItem> parent = CraftMetaItem.class;
|
||||
|
||||
@Parameters(name = "[{index}]:{1}")
|
||||
public static List<Object[]> 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<StackProvider> 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());
|
24
Paper/SteamWar-Patches/0559-Dont-search-disambiguities-paper.patch
Normale Datei
24
Paper/SteamWar-Patches/0559-Dont-search-disambiguities-paper.patch
Normale Datei
@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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);
|
||||
}
|
||||
|
||||
- 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;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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<K, V extends JsonListEntry<K>> {
|
||||
}
|
||||
|
||||
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<V> collection = this.d.values();
|
||||
String s = this.b.toJson(collection);
|
@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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
|
||||
+ //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());
|
72
Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch
Normale Datei
72
Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch
Normale Datei
@ -0,0 +1,72 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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);
|
||||
- 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 @@ public class CommandDispatcher {
|
||||
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);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
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 IAsyncTaskHandlerReentrant<TickTas
|
||||
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 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
|
||||
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();
|
47
Paper/SteamWar-Patches/0563-Load-Plugins-async-paper.patch
Normale Datei
47
Paper/SteamWar-Patches/0563-Load-Plugins-async-paper.patch
Normale Datei
@ -0,0 +1,47 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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<Thread> threads = new ArrayList<>(); //Steamwar
|
||||
for (Plugin plugin : plugins) {
|
||||
- try {
|
||||
+ //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();
|
@ -0,0 +1,82 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -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
|
||||
|
||||
- for ( EntityHuman player : world.getPlayers() )
|
||||
- {
|
||||
+ //Steamwar Start
|
||||
+ List<AxisAlignedBB> 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;
|
||||
}
|
||||
}
|
||||
}
|
24
Paper/SteamWar-Patches/0565-Remove-RAM-Check-paper.patch
Normale Datei
24
Paper/SteamWar-Patches/0565-Remove-RAM-Check-paper.patch
Normale Datei
@ -0,0 +1,24 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zeanon <thezeanon@gmail.com>
|
||||
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
|
||||
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());
|
||||
- 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();
|
18
README.md
18
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
|
||||
|
||||
take the patches in the Paper/SteamWar-Patches folder and put them into Paper's Spigot-Server-Patches folder
|
||||
|
||||
Run ./paper jar in the root directory of your Paper repo
|
||||
Lixfel markierte diese Unterhaltung als gelöst
Veraltet
|
||||
|
||||
Enjoy your patched server in \[Paper directory\]/Paper-Server/target.
|
||||
|
||||
|
6
Spigot/applyPatches.sh
Normale Datei
6
Spigot/applyPatches.sh
Normale Datei
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
git apply --unsafe-paths --directory=../../Spigot/Spigot-Server SteamWar-Patches/*
|
||||
|
||||
cd ../../Spigot/Spigot-Server
|
||||
mvn package
|
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
git apply --unsafe-paths --directory=../Spigot/Spigot-Server SteamWar-Patches/*
|
||||
|
||||
cd ../Spigot/Spigot-Server
|
||||
mvn package
|
In neuem Issue referenzieren
Einen Benutzer sperren
Hast du das einmal getestet?
Das CWD passt schätzungsweise nicht.
Das ist alles angepasst, also bei mir tats jedenfalls
Und wegen dem anfordern, wollte euch praktisch nur taggen :)