Update to Minecraft 1.20.5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-04-24 01:15:00 +10:00
parent 4deda9501f
commit 65bc2541a3
524 changed files with 7788 additions and 6181 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -53,6 +53,18 @@
@@ -58,6 +58,18 @@
import net.minecraft.world.level.storage.Convertable;
import org.slf4j.Logger;
@@ -19,7 +19,7 @@
public class DedicatedServer extends MinecraftServer implements IMinecraftServer {
static final Logger LOGGER = LogUtils.getLogger();
@@ -61,7 +73,7 @@
@@ -66,7 +78,7 @@
private final List<ServerCommand> consoleInput = Collections.synchronizedList(Lists.newArrayList());
@Nullable
private RemoteStatusListener queryThreadGs4;
@@ -28,9 +28,9 @@
@Nullable
private RemoteControlListener rconThread;
public DedicatedServerSettings settings;
@@ -70,10 +82,12 @@
@@ -79,10 +91,12 @@
@Nullable
private final TextFilter textFilterClient;
private DebugSampleSubscriptionTracker debugSampleSubscriptionTracker;
- 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);
@@ -44,7 +44,7 @@
this.textFilterClient = TextFilter.createFromConfig(dedicatedserversettings.getProperties().textFilteringConfig);
}
@@ -81,13 +95,44 @@
@@ -90,13 +104,44 @@
public boolean initServer() throws IOException {
Thread thread = new Thread("Server console handler") {
public void run() {
@@ -92,7 +92,7 @@
}
} catch (IOException ioexception) {
DedicatedServer.LOGGER.error("Exception handling console input", ioexception);
@@ -96,6 +141,29 @@
@@ -105,6 +150,29 @@
}
};
@@ -122,7 +122,7 @@
thread.setDaemon(true);
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(DedicatedServer.LOGGER));
thread.start();
@@ -120,7 +188,7 @@
@@ -129,7 +197,7 @@
this.setMotd(dedicatedserverproperties.motd);
super.setPlayerIdleTimeout((Integer) dedicatedserverproperties.playerIdleTimeout.get());
this.setEnforceWhitelist(dedicatedserverproperties.enforceWhitelist);
@@ -131,7 +131,7 @@
DedicatedServer.LOGGER.info("Default game type: {}", dedicatedserverproperties.gamemode);
InetAddress inetaddress = null;
@@ -144,6 +212,12 @@
@@ -153,6 +221,12 @@
return false;
}
@@ -144,14 +144,16 @@
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.");
@@ -158,19 +232,19 @@
@@ -167,7 +241,7 @@
if (!NameReferencingFileConverter.serverReadyAfterUserconversion(this)) {
return false;
} else {
- this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage));
+ // this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // CraftBukkit - moved up
this.debugSampleSubscriptionTracker = new DebugSampleSubscriptionTracker(this.getPlayerList());
this.tickTimeLogger = new RemoteSampleLogger(TpsDebugDimensions.values().length, this.debugSampleSubscriptionTracker, RemoteDebugSampleType.TICK_TIME);
long i = SystemUtils.getNanos();
@@ -175,13 +249,13 @@
TileEntitySkull.setup(this.services, this);
UserCache.setUsesAuthentication(this.usesAuthentication());
DedicatedServer.LOGGER.info("Preparing level \"{}\"", this.getLevelIdName());
@@ -167,7 +169,7 @@
}
if (dedicatedserverproperties.enableQuery) {
@@ -296,6 +370,7 @@
@@ -307,6 +381,7 @@
this.queryThreadGs4.stop();
}
@@ -175,7 +177,7 @@
}
@Override
@@ -317,7 +392,15 @@
@@ -328,7 +403,15 @@
while (!this.consoleInput.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.consoleInput.remove(0);
@@ -192,7 +194,7 @@
}
}
@@ -544,16 +627,52 @@
@@ -555,16 +638,52 @@
@Override
public String getPluginNames() {
@@ -249,9 +251,9 @@
}
public void storeUsingWhiteList(boolean flag) {
@@ -604,4 +723,15 @@
public Optional<MinecraftServer.ServerResourcePackInfo> getServerResourcePack() {
return this.settings.getProperties().serverResourcePackInfo;
@@ -641,4 +760,15 @@
public boolean acceptsTransfers() {
return this.settings.getProperties().acceptsTransfers;
}
+
+ // CraftBukkit start

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -44,11 +44,16 @@
@@ -43,11 +43,16 @@
import net.minecraft.world.level.levelgen.presets.WorldPresets;
import org.slf4j.Logger;
@@ -17,9 +17,9 @@
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", "");
@@ -103,8 +108,10 @@
private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
@@ -104,8 +109,10 @@
public final WorldOptions worldOptions;
public boolean acceptsTransfers;
- public DedicatedServerProperties(Properties properties) {
- super(properties);
@@ -30,7 +30,7 @@
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");
@@ -161,13 +168,15 @@
@@ -164,13 +171,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())));
}
@@ -50,7 +50,7 @@
}
@Nullable
@@ -248,10 +257,10 @@
@@ -251,10 +260,10 @@
}).orElseThrow(() -> {
return new IllegalStateException("Invalid datapack contents: can't find default preset");
});
@@ -63,10 +63,10 @@
});
Objects.requireNonNull(iregistry);
@@ -263,7 +272,7 @@
@@ -266,7 +275,7 @@
if (holder.is(WorldPresets.FLAT)) {
RegistryOps<JsonElement> registryops = RegistryOps.create(JsonOps.INSTANCE, (HolderLookup.b) iregistrycustom);
RegistryOps<JsonElement> registryops = iregistrycustom.createSerializationContext(JsonOps.INSTANCE);
- 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;

View File

@@ -108,8 +108,8 @@
private final V value;
private final Function<V, String> serializer;
- EditableProperty(String s, Object object, Function function) {
+ EditableProperty(String s, V object, Function function) { // CraftBukkit - decompile error
- EditableProperty(final String s, final Object object, final Function function) {
+ EditableProperty(final String s, final V object, final Function function) { // CraftBukkit - decompile error
this.key = s;
this.value = object;
this.serializer = function;