Compare commits

11 Commits

Author SHA1 Message Date
c420ed5c55 Remove Pre-Load of CrashReport and ObfHelper
Some checks failed
Build Paper / build (21) (push) Has been cancelled
Build Paper / Event File (push) Has been cancelled
2025-01-02 21:52:15 +01:00
Lixfel
d764c3ff8c Merge pull request 'Merge Latest Changes' (#2) from update into main
Some checks failed
Build Paper / build (21) (push) Has been cancelled
Build Paper / Event File (push) Has been cancelled
Reviewed-on: https://steamwar.de/devlabs/SteamWar/Paper/pulls/2
2025-01-01 12:39:18 +01:00
53747c723b Merge remote-tracking branch 'upstream/main' into update 2024-12-31 17:12:20 +01:00
a6bd638bab Compile pls? 2024-12-26 18:50:36 +01:00
04924c1385 Revert "Fix Compile?"
This reverts commit 44cf7ff229.
2024-12-26 11:00:01 +01:00
44cf7ff229 Fix Compile? 2024-12-26 10:58:07 +01:00
Lixfel
c06d6c6ae2 Merge pull request 'Paper 1.21.4 & Hardfork' (#1) from init into main
Reviewed-on: https://steamwar.de/devlabs/SteamWar/Paper/pulls/1
2024-12-26 10:49:10 +01:00
Lixfel
eb48d457d9 Change maven name to prevent automatic compilation failures 2024-12-26 10:48:44 +01:00
1f3cbc08da SW Remove Debug Message 2024-12-25 12:37:36 +01:00
94b0d30c7f SW Disable Commands 2024-12-25 12:37:24 +01:00
2833e4c0a5 SW Remove Worldlock and Symlink Check 2024-12-25 12:37:14 +01:00
10 changed files with 300 additions and 9 deletions

View File

@@ -0,0 +1,72 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chaoscaot <chaos@chaoscaot.de>
Date: Wed, 25 Dec 2024 12:18:00 +0100
Subject: [PATCH] SW Remove Worldlock and Symlink Check
diff --git a/net/minecraft/world/level/storage/LevelStorageSource.java b/net/minecraft/world/level/storage/LevelStorageSource.java
index de43e54698125ce9f319d4889dd49f7029fe95e0..e21d744040bcf58b391f002f2dd1129e532ff1b6 100644
--- a/net/minecraft/world/level/storage/LevelStorageSource.java
+++ b/net/minecraft/world/level/storage/LevelStorageSource.java
@@ -343,7 +343,7 @@ public class LevelStorageSource {
public LevelStorageSource.LevelStorageAccess validateAndCreateAccess(String saveName, ResourceKey<LevelStem> dimensionType) throws IOException, ContentValidationException { // CraftBukkit
Path levelPath = this.getLevelPath(saveName);
- List<ForbiddenSymlinkInfo> list = Boolean.getBoolean("paper.disableWorldSymlinkValidation") ? List.of() : this.worldDirValidator.validateDirectory(levelPath, true); // Paper - add skipping of symlinks scan
+ List<ForbiddenSymlinkInfo> list = List.of(); // Paper - add skipping of symlinks scan
if (!list.isEmpty()) {
throw new ContentValidationException(levelPath, list);
} else {
@@ -420,7 +420,6 @@ public class LevelStorageSource {
}
public class LevelStorageAccess implements AutoCloseable {
- final DirectoryLock lock;
public final LevelStorageSource.LevelDirectory levelDirectory;
private final String levelId;
private final Map<LevelResource, Path> resources = Maps.newHashMap();
@@ -432,7 +431,6 @@ public class LevelStorageSource {
// CraftBukkit end
this.levelId = levelId;
this.levelDirectory = new LevelStorageSource.LevelDirectory(levelDir);
- this.lock = DirectoryLock.create(levelDir);
}
public long estimateDiskSpace() {
@@ -476,9 +474,7 @@ public class LevelStorageSource {
}
private void checkLock() {
- if (!this.lock.isValid()) {
- throw new IllegalStateException("Lock is no longer valid");
- }
+ //nope
}
public PlayerDataStorage createPlayerStorage() {
@@ -532,7 +528,7 @@ public class LevelStorageSource {
}
public Optional<Path> getIconFile() {
- return !this.lock.isValid() ? Optional.empty() : Optional.of(this.levelDirectory.iconFile());
+ return Optional.of(this.levelDirectory.iconFile());
}
public void deleteLevel() throws IOException {
@@ -561,7 +557,6 @@ public class LevelStorageSource {
throw exception;
} else {
if (dir.equals(LevelStorageAccess.this.levelDirectory.path())) {
- LevelStorageAccess.this.lock.close();
Files.deleteIfExists(path);
}
@@ -645,7 +640,7 @@ public class LevelStorageSource {
@Override
public void close() throws IOException {
- this.lock.close();
+ //ignored
}
public boolean restoreLevelDataFromOld() {

View File

@@ -0,0 +1,152 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chaoscaot <chaos@chaoscaot.de>
Date: Wed, 25 Dec 2024 12:31:02 +0100
Subject: [PATCH] SW Disable Commands
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
index 19ccf3abf14c67f72a1ca065e4a304f50e645ef4..86d2a9b1cbe6e03066ea4a2034e2dd611bff67cb 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
@@ -150,66 +150,66 @@ public class Commands {
private final CommandDispatcher<CommandSourceStack> dispatcher = new CommandDispatcher<>();
public Commands(Commands.CommandSelection selection, CommandBuildContext context) {
- AdvancementCommands.register(this.dispatcher);
- AttributeCommand.register(this.dispatcher, context);
- ExecuteCommand.register(this.dispatcher, context);
- BossBarCommands.register(this.dispatcher, context);
+ //AdvancementCommands.register(this.dispatcher);
+ //AttributeCommand.register(this.dispatcher, context);
+ //ExecuteCommand.register(this.dispatcher, context);
+ //BossBarCommands.register(this.dispatcher, context);
ClearInventoryCommands.register(this.dispatcher, context);
- CloneCommands.register(this.dispatcher, context);
- DamageCommand.register(this.dispatcher, context);
- DataCommands.register(this.dispatcher);
- DataPackCommand.register(this.dispatcher);
- DebugCommand.register(this.dispatcher);
- DefaultGameModeCommands.register(this.dispatcher);
- DifficultyCommand.register(this.dispatcher);
+ //CloneCommands.register(this.dispatcher, context);
+ //DamageCommand.register(this.dispatcher, context);
+ //DataCommands.register(this.dispatcher);
+ //DataPackCommand.register(this.dispatcher);
+ //DebugCommand.register(this.dispatcher);
+ //DefaultGameModeCommands.register(this.dispatcher);
+ //DifficultyCommand.register(this.dispatcher);
EffectCommands.register(this.dispatcher, context);
- EmoteCommands.register(this.dispatcher);
+ //EmoteCommands.register(this.dispatcher);
EnchantCommand.register(this.dispatcher, context);
- ExperienceCommand.register(this.dispatcher);
- FillCommand.register(this.dispatcher, context);
+ //ExperienceCommand.register(this.dispatcher);
+ //FillCommand.register(this.dispatcher, context);
FillBiomeCommand.register(this.dispatcher, context);
- ForceLoadCommand.register(this.dispatcher);
- FunctionCommand.register(this.dispatcher);
+ //ForceLoadCommand.register(this.dispatcher);
+ //FunctionCommand.register(this.dispatcher);
GameModeCommand.register(this.dispatcher);
GameRuleCommand.register(this.dispatcher, context);
GiveCommand.register(this.dispatcher, context);
- HelpCommand.register(this.dispatcher);
- ItemCommands.register(this.dispatcher, context);
+ //HelpCommand.register(this.dispatcher);
+ //ItemCommands.register(this.dispatcher, context);
KickCommand.register(this.dispatcher);
KillCommand.register(this.dispatcher);
- ListPlayersCommand.register(this.dispatcher);
- LocateCommand.register(this.dispatcher, context);
- LootCommand.register(this.dispatcher, context);
- MsgCommand.register(this.dispatcher);
- ParticleCommand.register(this.dispatcher, context);
- PlaceCommand.register(this.dispatcher);
- PlaySoundCommand.register(this.dispatcher);
- RandomCommand.register(this.dispatcher);
- ReloadCommand.register(this.dispatcher);
- RecipeCommand.register(this.dispatcher);
- ReturnCommand.register(this.dispatcher);
- RideCommand.register(this.dispatcher);
+ //ListPlayersCommand.register(this.dispatcher);
+ //LocateCommand.register(this.dispatcher, context);
+ //LootCommand.register(this.dispatcher, context);
+ //MsgCommand.register(this.dispatcher);
+ //ParticleCommand.register(this.dispatcher, context);
+ //PlaceCommand.register(this.dispatcher);
+ //PlaySoundCommand.register(this.dispatcher);
+ //RandomCommand.register(this.dispatcher);
+ //ReloadCommand.register(this.dispatcher);
+ //RecipeCommand.register(this.dispatcher);
+ //ReturnCommand.register(this.dispatcher);
+ //RideCommand.register(this.dispatcher);
RotateCommand.register(this.dispatcher);
- SayCommand.register(this.dispatcher);
- ScheduleCommand.register(this.dispatcher);
- ScoreboardCommand.register(this.dispatcher, context);
- SeedCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED);
- SetBlockCommand.register(this.dispatcher, context);
- SetSpawnCommand.register(this.dispatcher);
+ //SayCommand.register(this.dispatcher);
+ //ScheduleCommand.register(this.dispatcher);
+ //ScoreboardCommand.register(this.dispatcher, context);
+ //SeedCommand.register(this.dispatcher, selection != Commands.CommandSelection.INTEGRATED);
+ //SetBlockCommand.register(this.dispatcher, context);
+ //SetSpawnCommand.register(this.dispatcher);
SetWorldSpawnCommand.register(this.dispatcher);
SpectateCommand.register(this.dispatcher);
- SpreadPlayersCommand.register(this.dispatcher);
- StopSoundCommand.register(this.dispatcher);
+ //SpreadPlayersCommand.register(this.dispatcher);
+ //StopSoundCommand.register(this.dispatcher);
SummonCommand.register(this.dispatcher, context);
- TagCommand.register(this.dispatcher);
- TeamCommand.register(this.dispatcher, context);
- TeamMsgCommand.register(this.dispatcher);
+ //TagCommand.register(this.dispatcher);
+ //TeamCommand.register(this.dispatcher, context);
+ //TeamMsgCommand.register(this.dispatcher);
TeleportCommand.register(this.dispatcher);
- TellRawCommand.register(this.dispatcher, context);
+ //TellRawCommand.register(this.dispatcher, context);
TickCommand.register(this.dispatcher);
TimeCommand.register(this.dispatcher);
- TitleCommand.register(this.dispatcher, context);
- TriggerCommand.register(this.dispatcher);
+ //TitleCommand.register(this.dispatcher, context);
+ //TriggerCommand.register(this.dispatcher);
WeatherCommand.register(this.dispatcher);
WorldBorderCommand.register(this.dispatcher);
if (JvmProfiler.INSTANCE.isAvailable()) {
@@ -230,20 +230,20 @@ public class Commands {
}
if (selection.includeDedicated) {
- BanIpCommands.register(this.dispatcher);
- BanListCommands.register(this.dispatcher);
- BanPlayerCommands.register(this.dispatcher);
- DeOpCommands.register(this.dispatcher);
- OpCommand.register(this.dispatcher);
- PardonCommand.register(this.dispatcher);
- PardonIpCommand.register(this.dispatcher);
- PerfCommand.register(this.dispatcher);
+ //BanIpCommands.register(this.dispatcher);
+ //BanListCommands.register(this.dispatcher);
+ //BanPlayerCommands.register(this.dispatcher);
+ //DeOpCommands.register(this.dispatcher);
+ //OpCommand.register(this.dispatcher);
+ //PardonCommand.register(this.dispatcher);
+ //PardonIpCommand.register(this.dispatcher);
+ //PerfCommand.register(this.dispatcher);
SaveAllCommand.register(this.dispatcher);
SaveOffCommand.register(this.dispatcher);
SaveOnCommand.register(this.dispatcher);
- SetPlayerIdleTimeoutCommand.register(this.dispatcher);
+ //SetPlayerIdleTimeoutCommand.register(this.dispatcher);
StopCommand.register(this.dispatcher);
- TransferCommand.register(this.dispatcher);
+ //TransferCommand.register(this.dispatcher);
WhitelistCommand.register(this.dispatcher);
}

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chaoscaot <chaos@chaoscaot.de>
Date: Wed, 25 Dec 2024 12:36:40 +0100
Subject: [PATCH] SW Remove Debug Message
diff --git a/net/minecraft/server/players/StoredUserList.java b/net/minecraft/server/players/StoredUserList.java
index d445e8f126f077d8419c52fa5436ea963a1a42a4..dfb0d766b5244646d18ddec5d8b91eddb69d9e97 100644
--- a/net/minecraft/server/players/StoredUserList.java
+++ b/net/minecraft/server/players/StoredUserList.java
@@ -12,6 +12,7 @@ import com.mojang.logging.LogUtils;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
@@ -103,6 +104,8 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
try (BufferedWriter writer = Files.newWriter(this.file, StandardCharsets.UTF_8)) {
GSON.toJson(jsonArray, GSON.newJsonWriter(writer));
+ } catch (FileNotFoundException e) {
+ return;
}
}

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chaoscaot <chaos@chaoscaot.de>
Date: Thu, 2 Jan 2025 21:49:47 +0100
Subject: [PATCH] SW Removed for Performance
diff --git a/net/minecraft/CrashReport.java b/net/minecraft/CrashReport.java
index 3e0e88afcf010d9a3d46e48bca5cbdf98fe97544..c4dbb94fef4240f25186015c637556ea3b9988e6 100644
--- a/net/minecraft/CrashReport.java
+++ b/net/minecraft/CrashReport.java
@@ -221,6 +221,6 @@ public class CrashReport {
public static void preload() {
//MemoryReserve.allocate(); // Paper - Disable memory reserve allocating
- new CrashReport("Don't panic!", new Throwable()).getFriendlyReport(ReportType.CRASH);
+ //new CrashReport("Don't panic!", new Throwable()).getFriendlyReport(ReportType.CRASH);
}
}
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
index 97a294d2f5c1ddf0af7ffec3e1425eb329c5751b..897e22353b577baa8165f23e2ff21af95c47c1c4 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -207,7 +207,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.SpigotConfig.init((java.io.File) this.options.valueOf("spigot-settings"));
org.spigotmc.SpigotConfig.registerCommands();
// Spigot end
- io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
+ //io.papermc.paper.util.ObfHelper.INSTANCE.getClass(); // Paper - load mappings for stacktrace deobf and etc.
// Paper start - initialize global and world-defaults configuration
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());

View File

@@ -92,7 +92,7 @@ public enum VersionHistoryManager {
)) {
gson.toJson(currentData, writer);
} catch (final IOException e) {
logger.log(Level.SEVERE, "Failed to write to version history file", e);
// logger.log(Level.SEVERE, "Failed to write to version history file", e);
}
}

View File

@@ -112,7 +112,7 @@ public abstract class Configurations<G, W> {
loader.save(node);
} catch (ConfigurateException ex) {
if (ex.getCause() instanceof AccessDeniedException) {
LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex);
//LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex);
} else throw ex;
}
}

View File

@@ -463,8 +463,6 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
// Symlinks are not correctly checked in createDirectories
static void createDirectoriesSymlinkAware(Path path) throws IOException {
if (!Files.isDirectory(path)) {
Files.createDirectories(path);
}
// do nothing
}
}

View File

@@ -517,7 +517,7 @@ public final class CraftServer implements Server {
try {
this.configuration.save(this.getConfigFile());
} catch (IOException ex) {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "Could not save " + this.getConfigFile(), ex);
//Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "Could not save " + this.getConfigFile(), ex);
}
}
@@ -525,7 +525,7 @@ public final class CraftServer implements Server {
try {
this.commandsConfiguration.save(this.getCommandsConfigFile());
} catch (IOException ex) {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "Could not save " + this.getCommandsConfigFile(), ex);
//Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, "Could not save " + this.getCommandsConfigFile(), ex);
}
}
@@ -615,7 +615,7 @@ public final class CraftServer implements Server {
DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions();
if (!io.papermc.paper.configuration.GlobalConfiguration.get().misc.loadPermissionsYmlBeforePlugins) this.loadCustomPermissions(); // Paper
this.helpMap.initializeCommands();
//this.helpMap.initializeCommands();
this.syncCommands();
}
}

View File

@@ -97,7 +97,7 @@ public class SpigotConfig {
try {
SpigotConfig.config.save(SpigotConfig.CONFIG_FILE);
} catch (IOException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Could not save " + SpigotConfig.CONFIG_FILE, ex);
//Bukkit.getLogger().log(Level.SEVERE, "Could not save " + SpigotConfig.CONFIG_FILE, ex);
}
}

11
steamwarci.yml Normal file
View File

@@ -0,0 +1,11 @@
build:
- "JAVA_HOME=/usr/lib/jvm/java-21.0.5-openjdk-amd64 ./gradlew applyPatches"
- "JAVA_HOME=/usr/lib/jvm/java-21.0.5-openjdk-amd64 ./gradlew createMojmapBundlerJar"
- "JAVA_HOME=/usr/lib/jvm/java-21.0.5-openjdk-amd64 ./gradlew --stop"
artifacts:
"/binarys/paper-1.21.4.jar": "paper-server/build/libs/paper-bundler-1.21.4-R0.1-SNAPSHOT-mojmap.jar"
"/binarys/spigot-1.21.4-inner.jar": "paper-server/build/libs/paper-server-1.21.4-R0.1-SNAPSHOT.jar"
release:
- "mvn deploy:deploy-file -DgroupId=de.steamwar -DartifactId=spigot -Dversion=1.21.4 -Dpackaging=jar -Dfile=paper-server/build/libs/paper-server-1.21.4-R0.1-SNAPSHOT.jar -Durl=file:///var/www/html/maven/"