Merge remote-tracking branch 'upstream/main'
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-04-29 19:41:25 +02:00
18 changed files with 269 additions and 38 deletions

View File

@ -40,6 +40,7 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import javax.imageio.ImageIO;
import net.minecraft.Optionull;
import net.minecraft.advancements.AdvancementHolder;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
@ -1943,12 +1944,13 @@ public final class CraftServer implements Server {
}
@Override
@Deprecated
public CraftMapView getMap(int id) {
MapItemSavedData mapData = this.console.getLevel(net.minecraft.world.level.Level.OVERWORLD).getMapData(new MapId(id));
if (mapData == null) {
return null;
}
final net.minecraft.world.level.Level overworld = this.console.overworld();
if (overworld == null) return null;
final MapItemSavedData mapData = overworld.getMapData(new MapId(id));
if (mapData == null) return null;
return mapData.mapView;
}
@ -2261,7 +2263,11 @@ public final class CraftServer implements Server {
@Override
public GameMode getDefaultGameMode() {
return GameMode.getByValue(this.console.getLevel(net.minecraft.world.level.Level.OVERWORLD).serverLevelData.getGameType().getId());
return GameMode.getByValue(Optionull.mapOrDefault(
this.console.getLevel(net.minecraft.world.level.Level.OVERWORLD),
l -> l.serverLevelData.getGameType(),
this.console.getProperties().gamemode
).getId());
}
@Override