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,7 +1,7 @@
--- a/net/minecraft/world/level/storage/Convertable.java
+++ b/net/minecraft/world/level/storage/Convertable.java
@@ -61,6 +61,10 @@
import net.minecraft.world.level.levelgen.presets.WorldPresets;
@@ -69,6 +69,10 @@
import net.minecraft.world.level.levelgen.WorldDimensions;
import org.slf4j.Logger;
+// CraftBukkit start
@@ -11,29 +11,24 @@
public class Convertable {
static final Logger LOGGER = LogUtils.getLogger();
@@ -114,7 +118,7 @@
@@ -115,7 +119,7 @@
}
private static DataPackConfiguration readDataPackConfig(Dynamic<?> dynamic) {
- DataResult dataresult = DataPackConfiguration.CODEC.parse(dynamic);
+ DataResult<DataPackConfiguration> dataresult = DataPackConfiguration.CODEC.parse(dynamic); // CraftBukkit - decompile error
private static WorldDataConfiguration readDataConfig(Dynamic<?> dynamic) {
- DataResult dataresult = WorldDataConfiguration.CODEC.parse(dynamic);
+ DataResult<WorldDataConfiguration> dataresult = WorldDataConfiguration.CODEC.parse(dynamic); // CraftBukkit - decompile error
Logger logger = Convertable.LOGGER;
Objects.requireNonNull(logger);
@@ -241,7 +245,11 @@
WorldSettings worldsettings = WorldSettings.parse(dynamic, datapackconfiguration);
Lifecycle lifecycle1 = ((Lifecycle) pair.getSecond()).add(lifecycle);
@@ -253,6 +257,7 @@
WorldDimensions.b worlddimensions_b = generatorsettings.dimensions().bake(iregistry);
Lifecycle lifecycle1 = worlddimensions_b.lifecycle().add(lifecycle);
WorldDataServer worlddataserver = WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, worlddimensions_b.specialWorldProperty(), generatorsettings.options(), lifecycle1);
+ worlddataserver.pdc = nbttagcompound1.get("BukkitValues"); // CraftBukkit - Add PDC to world
- return WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), lifecycle1);
+ // CraftBukkit start - Add PDC to world
+ WorldDataServer worldDataServer = WorldDataServer.parse(dynamic, datafixer, i, nbttagcompound2, worldsettings, levelversion, (GeneratorSettings) pair.getFirst(), lifecycle1);
+ worldDataServer.pdc = nbttagcompound1.get("BukkitValues");
+ return worldDataServer;
+ // CraftBukkit end
} catch (Exception exception) {
Convertable.LOGGER.error("Exception reading {}", path, exception);
return null;
@@ -314,9 +322,23 @@
return Pair.of(worlddataserver, worlddimensions_b);
};
@@ -334,9 +339,23 @@
return this.backupDir;
}
@@ -59,7 +54,7 @@
public static record a(List<Convertable.b> levels) implements Iterable<Convertable.b> {
@@ -369,8 +391,12 @@
@@ -389,8 +408,12 @@
public final Convertable.b levelDirectory;
private final String levelId;
private final Map<SavedFile, Path> resources = Maps.newHashMap();
@@ -73,7 +68,7 @@
this.levelId = s;
this.levelDirectory = new Convertable.b(Convertable.this.baseDir.resolve(s));
this.lock = SessionLock.create(this.levelDirectory.path());
@@ -381,7 +407,7 @@
@@ -401,7 +424,7 @@
}
public Path getLevelPath(SavedFile savedfile) {
@@ -82,7 +77,7 @@
Convertable.b convertable_b = this.levelDirectory;
Objects.requireNonNull(this.levelDirectory);
@@ -389,7 +415,7 @@
@@ -409,7 +432,7 @@
}
public Path getDimensionPath(ResourceKey<World> resourcekey) {

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/storage/WorldDataServer.java
+++ b/net/minecraft/world/level/storage/WorldDataServer.java
@@ -42,6 +42,15 @@
@@ -43,6 +43,15 @@
import net.minecraft.world.level.timers.CustomFunctionCallbackTimers;
import org.slf4j.Logger;
@@ -16,7 +16,7 @@
public class WorldDataServer implements IWorldDataServer, SaveData {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -81,6 +90,19 @@
@@ -83,6 +92,19 @@
private final Set<String> knownServerBrands;
private boolean wasModded;
private final CustomFunctionCallbackTimerQueue<MinecraftServer> scheduledEvents;
@@ -34,9 +34,9 @@
+ }
+ // CraftBukkit end
private WorldDataServer(@Nullable DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, boolean flag, int j, int k, int l, float f, long i1, long j1, int k1, int l1, int i2, boolean flag1, int j2, boolean flag2, boolean flag3, boolean flag4, WorldBorder.c worldborder_c, int k2, int l2, @Nullable UUID uuid, Set<String> set, CustomFunctionCallbackTimerQueue<MinecraftServer> customfunctioncallbacktimerqueue, @Nullable NBTTagCompound nbttagcompound1, NBTTagCompound nbttagcompound2, WorldSettings worldsettings, GeneratorSettings generatorsettings, Lifecycle lifecycle) {
if (!generatorsettings.dimensions().containsKey(WorldDimension.OVERWORLD)) {
@@ -128,7 +150,8 @@
private WorldDataServer(@Nullable DataFixer datafixer, int i, @Nullable NBTTagCompound nbttagcompound, boolean flag, int j, int k, int l, float f, long i1, long j1, int k1, int l1, int i2, boolean flag1, int j2, boolean flag2, boolean flag3, boolean flag4, WorldBorder.c worldborder_c, int k2, int l2, @Nullable UUID uuid, Set<String> set, CustomFunctionCallbackTimerQueue<MinecraftServer> customfunctioncallbacktimerqueue, @Nullable NBTTagCompound nbttagcompound1, NBTTagCompound nbttagcompound2, WorldSettings worldsettings, WorldOptions worldoptions, WorldDataServer.a worlddataserver_a, Lifecycle lifecycle) {
this.fixerUpper = datafixer;
@@ -127,7 +149,8 @@
return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue();
});
@@ -44,9 +44,9 @@
+ // CraftBukkit - decompile error
+ return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(UUIDUtil.CODEC).result().orElse(null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
return dynamic1.asString().result().stream();
}).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle);
}).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, worldoptions, worlddataserver_a, lifecycle);
}
@@ -148,7 +171,7 @@
@@ -147,7 +170,7 @@
private void setTagData(IRegistryCustom iregistrycustom, NBTTagCompound nbttagcompound, @Nullable NBTTagCompound nbttagcompound1) {
NBTTagList nbttaglist = new NBTTagList();
@@ -55,16 +55,16 @@
Objects.requireNonNull(nbttaglist);
stream.forEach(nbttaglist::add);
@@ -163,7 +186,7 @@
@@ -162,7 +185,7 @@
nbttagcompound.put("Version", nbttagcompound2);
nbttagcompound.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion());
DynamicOps<NBTBase> dynamicops = RegistryOps.create(DynamicOpsNBT.INSTANCE, iregistrycustom);
- DataResult dataresult = GeneratorSettings.CODEC.encodeStart(dynamicops, this.worldGenSettings);
+ DataResult<NBTBase> dataresult = GeneratorSettings.CODEC.encodeStart(dynamicops, this.worldGenSettings); // CraftBukkit - decompile error
DynamicOps<NBTBase> dynamicops = RegistryOps.create(DynamicOpsNBT.INSTANCE, (HolderLookup.b) iregistrycustom);
- DataResult dataresult = GeneratorSettings.encode(dynamicops, this.worldOptions, iregistrycustom);
+ DataResult<NBTBase> dataresult = GeneratorSettings.encode(dynamicops, this.worldOptions, iregistrycustom); // CraftBukkit - decompile error
Logger logger = WorldDataServer.LOGGER;
Objects.requireNonNull(logger);
@@ -211,6 +234,8 @@
@@ -214,6 +237,8 @@
nbttagcompound.putUUID("WanderingTraderId", this.wanderingTraderId);
}
@@ -73,7 +73,7 @@
}
@Override
@@ -328,6 +353,20 @@
@@ -331,6 +356,20 @@
@Override
public void setThundering(boolean flag) {
@@ -94,7 +94,7 @@
this.thundering = flag;
}
@@ -348,6 +387,20 @@
@@ -351,6 +390,20 @@
@Override
public void setRaining(boolean flag) {
@@ -115,7 +115,7 @@
this.raining = flag;
}
@@ -414,6 +467,12 @@
@@ -417,6 +470,12 @@
@Override
public void setDifficulty(EnumDifficulty enumdifficulty) {
this.settings = this.settings.withDifficulty(enumdifficulty);
@@ -128,11 +128,10 @@
}
@Override
@@ -534,4 +593,12 @@
public WorldSettings getLevelSettings() {
@@ -548,6 +607,14 @@
return this.settings.copy();
}
+
+ // CraftBukkit start - Check if the name stored in NBT is the correct one
+ public void checkName(String name) {
+ if (!this.settings.levelName.equals(name)) {
@@ -140,4 +139,7 @@
+ }
+ }
+ // CraftBukkit end
}
+
/** @deprecated */
@Deprecated
public static enum a {

View File

@@ -14,7 +14,7 @@
public class LootTable {
static final Logger LOGGER = LogUtils.getLogger();
@@ -117,8 +124,21 @@
@@ -119,8 +126,21 @@
}
public void fill(IInventory iinventory, LootTableInfo loottableinfo) {