Archiviert
13
0

added paper patches #4

Zusammengeführt
Lixfel hat 3 Commits von PaperPatches nach master 2021-04-14 20:22:38 +02:00 zusammengeführt
21 geänderte Dateien mit 399 neuen und 7 gelöschten Zeilen
Nur Änderungen aus Commit 34925cd808 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -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<Integer, Schema, Schema> a = Schema::new;
private static final BiFunction<Integer, Schema, Schema> b = DataConverterSchemaNamed::new;
- private static final DataFixer c = b();
+ //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();
+ }
- private static DataFixer b() {
- DataFixerBuilder datafixerbuilder = new DataFixerBuilder(SharedConstants.getGameVersion().getWorldVersion());
+ @Override protected Map<String, Type<?>> 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() {

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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<V> collection = this.d.values();
String s = this.b.toJson(collection);

Datei anzeigen

@ -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());

Datei anzeigen

@ -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();

Datei anzeigen

@ -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<Thread> 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();

Datei anzeigen

@ -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<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;
}
}
}

Datei anzeigen

@ -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();

6
Paper/applyPatches.sh Normale Datei
Datei anzeigen

@ -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

Datei anzeigen

@ -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.

6
Spigot/applyPatches.sh Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
#!/bin/sh
git apply --unsafe-paths --directory=../../Spigot/Spigot-Server SteamWar-Patches/*
cd ../../Spigot/Spigot-Server
mvn package

Datei anzeigen

@ -1,6 +0,0 @@
#!/bin/sh
git apply --unsafe-paths --directory=../Spigot/Spigot-Server SteamWar-Patches/*
cd ../Spigot/Spigot-Server
mvn package