Update to Minecraft 1.19.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2022-12-08 03:00:00 +11:00
parent a13136ada2
commit 8b26bb8f3e
305 changed files with 3331 additions and 2864 deletions

View File

@@ -1,13 +1,11 @@
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -56,6 +56,18 @@
@@ -53,6 +53,16 @@
import net.minecraft.world.level.storage.Convertable;
import org.slf4j.Logger;
+// CraftBukkit start
+import com.mojang.serialization.DynamicOps;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.world.level.DataPackConfiguration;
+import net.minecraft.server.WorldLoader;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.io.IoBuilder;
@@ -19,20 +17,20 @@
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
static final Logger LOGGER = LogUtils.getLogger();
@@ -73,8 +85,10 @@
@@ -70,8 +80,10 @@
@Nullable
private final TextFilter textFilterClient;
- public DedicatedServer(Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, WorldLoadListenerFactory worldloadlistenerfactory) {
- super(thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory);
+ // CraftBukkit start - Signature changed
+ public DedicatedServer(joptsimple.OptionSet options, DataPackConfiguration datapackconfiguration, DynamicOps<NBTBase> registryreadops, Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, WorldLoadListenerFactory worldloadlistenerfactory) {
+ super(options, datapackconfiguration, registryreadops, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory);
+ public DedicatedServer(joptsimple.OptionSet options, WorldLoader.a worldLoader, Thread thread, Convertable.ConversionSession convertable_conversionsession, ResourcePackRepository resourcepackrepository, WorldStem worldstem, DedicatedServerSettings dedicatedserversettings, DataFixer datafixer, Services services, WorldLoadListenerFactory worldloadlistenerfactory) {
+ super(options, worldLoader, thread, convertable_conversionsession, resourcepackrepository, worldstem, Proxy.NO_PROXY, datafixer, services, worldloadlistenerfactory);
+ // CraftBukkit end
this.settings = dedicatedserversettings;
this.rconConsoleSource = new RemoteControlCommandListener(this);
this.textFilterClient = TextFilter.createFromConfig(dedicatedserversettings.getProperties().textFilteringConfig);
@@ -84,13 +98,44 @@
@@ -81,13 +93,44 @@
public boolean initServer() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@@ -80,7 +78,7 @@
}
} catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -99,6 +144,27 @@
@@ -96,6 +139,27 @@
}
};
@@ -108,7 +106,7 @@
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
thread.start();
@@ -123,7 +189,7 @@
@@ -120,7 +184,7 @@
this.setMotd(dedicatedserverproperties.motd);
super.setPlayerIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
@@ -117,12 +115,12 @@
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
InetAddress inetaddress = null;
@@ -147,6 +213,12 @@
@@ -144,6 +208,12 @@
return false;
}
+ // CraftBukkit start
+ this.setPlayerList(new DedicatedPlayerList(this, this.registryHolder, this.playerDataStorage));
+ this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage));
+ server.loadPlugins();
+ server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP);
+ // CraftBukkit end
@@ -130,12 +128,12 @@
if (!this.usesAuthentication()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -161,13 +233,13 @@
@@ -158,13 +228,13 @@
if (!NameReferencingFileConverter.serverReadyAfterUserconversion(this)) {
return false;
} else {
- this.setPlayerList(new DedicatedPlayerList(this, this.registryAccess(), this.playerDataStorage));
+ // this.setPlayerList(new DedicatedPlayerList(this, this.registryAccess(), this.playerDataStorage)); // CraftBukkit - moved up
- this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage));
+ // this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // CraftBukkit - moved up
long i = SystemUtils.getNanos();
TileEntitySkull.setup(this.services, this);
@@ -146,7 +144,7 @@
long j = SystemUtils.getNanos() - i;
String s = String.format(Locale.ROOT, "%.3fs", (double) j / 1.0E9D);
@@ -184,6 +256,7 @@
@@ -181,6 +251,7 @@
if (dedicatedserverproperties.enableRcon) {
DedicatedServer.LOGGER.info("Starting remote control listener");
this.rconThread = RemoteControlListener.create(this);
@@ -154,7 +152,7 @@
}
if (this.getMaxTickLength() > 0L) {
@@ -300,6 +373,7 @@
@@ -296,6 +367,7 @@
this.queryThreadGs4.stop();
}
@@ -162,7 +160,7 @@
}
@Override
@@ -321,7 +395,15 @@
@@ -317,7 +389,15 @@
while (!this.consoleInput.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
@@ -179,7 +177,7 @@
}
}
@@ -546,14 +628,45 @@
@@ -537,14 +617,45 @@
@Override
public String getPluginNames() {
@@ -227,7 +225,7 @@
});
return this.rconConsoleSource.getCommandResponse();
}
@@ -606,4 +719,15 @@
@@ -597,4 +708,15 @@
public Optional<MinecraftServer.ServerResourcePackInfo> getServerResourcePack() {
return this.settings.getProperties().serverResourcePackInfo;
}

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -37,10 +37,15 @@
import net.minecraft.world.level.levelgen.structure.StructureSet;
@@ -45,11 +45,16 @@
import net.minecraft.world.level.levelgen.presets.WorldPresets;
import org.slf4j.Logger;
+// CraftBukkit start
@@ -12,13 +12,14 @@
static final Logger LOGGER = LogUtils.getLogger();
private static final Pattern SHA1 = Pattern.compile("^[a-fA-F0-9]{40}$");
private static final Splitter COMMA_SPLITTER = Splitter.on(',').trimResults();
+ public final boolean debug = this.get("debug", false); // CraftBukkit
public final boolean onlineMode = this.get("online-mode", true);
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
public final String serverIp = this.get("server-ip", "");
@@ -95,8 +100,10 @@
@Nullable
private GeneratorSettings worldGenSettings;
@@ -103,8 +108,10 @@
private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
public final WorldOptions worldOptions;
- public DedicatedServerProperties(Properties properties) {
- super(properties);
@@ -29,8 +30,8 @@
this.difficulty = (EnumDifficulty) this.get("difficulty", dispatchNumberOrString(EnumDifficulty::byId, EnumDifficulty::byName), EnumDifficulty::getKey, EnumDifficulty.EASY);
this.gamemode = (EnumGamemode) this.get("gamemode", dispatchNumberOrString(EnumGamemode::byId, EnumGamemode::byName), EnumGamemode::getName, EnumGamemode.SURVIVAL);
this.levelName = this.get("level-name", "world");
@@ -147,13 +154,15 @@
this.serverResourcePackInfo = getServerPackInfo(this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));
@@ -160,13 +167,15 @@
this.initialDataPackConfiguration = getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled())));
}
- public static DedicatedServerProperties fromFile(Path path) {
@@ -42,30 +43,30 @@
@Override
- protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties) {
- DedicatedServerProperties dedicatedserverproperties = new DedicatedServerProperties(properties);
- return new DedicatedServerProperties(properties);
+ protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties, OptionSet optionset) {
+ DedicatedServerProperties dedicatedserverproperties = new DedicatedServerProperties(properties, optionset);
+ return new DedicatedServerProperties(properties, optionset);
+ // CraftBukkit end
}
dedicatedserverproperties.getWorldGenSettings(iregistrycustom);
return dedicatedserverproperties;
@@ -222,10 +231,10 @@
@Nullable
@@ -247,10 +256,10 @@
}).orElseThrow(() -> {
return new IllegalStateException("Invalid datapack contents: can't find default preset");
});
- Optional optional = Optional.ofNullable(MinecraftKey.tryParse(this.levelType)).map((minecraftkey) -> {
+ Optional<ResourceKey<WorldPreset>> optional = Optional.ofNullable(MinecraftKey.tryParse(this.levelType)).map((minecraftkey) -> { // CraftBukkit - decompile error
return ResourceKey.create(IRegistry.WORLD_PRESET_REGISTRY, minecraftkey);
return ResourceKey.create(Registries.WORLD_PRESET, minecraftkey);
}).or(() -> {
- return Optional.ofNullable((ResourceKey) DedicatedServerProperties.a.LEGACY_PRESET_NAMES.get(this.levelType));
+ return Optional.ofNullable(DedicatedServerProperties.a.LEGACY_PRESET_NAMES.get(this.levelType)); // CraftBukkit - decompile error
- return Optional.ofNullable((ResourceKey) DedicatedServerProperties.WorldDimensionData.LEGACY_PRESET_NAMES.get(this.levelType));
+ return Optional.ofNullable(DedicatedServerProperties.WorldDimensionData.LEGACY_PRESET_NAMES.get(this.levelType)); // CraftBukkit - decompile error
});
Objects.requireNonNull(iregistry);
@@ -239,7 +248,7 @@
@@ -262,7 +271,7 @@
if (holder1.is(WorldPresets.FLAT)) {
RegistryOps<JsonElement> registryops = RegistryOps.create(JsonOps.INSTANCE, iregistrycustom);
if (holder.is(WorldPresets.FLAT)) {
RegistryOps<JsonElement> registryops = RegistryOps.create(JsonOps.INSTANCE, (HolderLookup.b) iregistrycustom);
- DataResult dataresult = GeneratorSettingsFlat.CODEC.parse(new Dynamic(registryops, this.generatorSettings()));
+ DataResult<GeneratorSettingsFlat> dataresult = GeneratorSettingsFlat.CODEC.parse(new Dynamic(registryops, this.generatorSettings())); // CraftBukkit - decompile error
Logger logger = DedicatedServerProperties.LOGGER;