mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
SPIGOT-6237: WorldCreator#generatorSettings not working
By: Martoph <sager1018@gmail.com>
This commit is contained in:
parent
15305e6842
commit
7af71a460f
1 changed files with 36 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
--- a/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
+++ b/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
@@ -34,9 +34,14 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.resources.RegistryReadOps;
|
||||
+import net.minecraft.server.packs.resources.IResourceManager;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class GeneratorSettings {
|
||||
|
||||
- public static final Codec<GeneratorSettings> a = RecordCodecBuilder.create((instance) -> {
|
||||
+ public static final Codec<GeneratorSettings> a = RecordCodecBuilder.<GeneratorSettings>create((instance) -> { // CraftBukkit - decompile error
|
||||
return instance.group(Codec.LONG.fieldOf("seed").stable().forGetter(GeneratorSettings::getSeed), Codec.BOOL.fieldOf("generate_features").orElse(true).stable().forGetter(GeneratorSettings::shouldGenerateMapFeatures), Codec.BOOL.fieldOf("bonus_chest").orElse(false).stable().forGetter(GeneratorSettings::c), RegistryMaterials.b(IRegistry.M, Lifecycle.stable(), WorldDimension.a).xmap(WorldDimension::a, Function.identity()).fieldOf("dimensions").forGetter(GeneratorSettings::d), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((generatorsettings) -> {
|
||||
return generatorsettings.g;
|
||||
})).apply(instance, instance.stable(GeneratorSettings::new));
|
||||
@@ -120,7 +125,7 @@
|
||||
public static RegistryMaterials<WorldDimension> a(RegistryMaterials<WorldDimension> registrymaterials, Supplier<DimensionManager> supplier, ChunkGenerator chunkgenerator) {
|
||||
RegistryMaterials<WorldDimension> registrymaterials1 = new RegistryMaterials<>(IRegistry.M, Lifecycle.experimental());
|
||||
|
||||
- registrymaterials1.a(WorldDimension.OVERWORLD, (Object) (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable());
|
||||
+ registrymaterials1.a(WorldDimension.OVERWORLD, (new WorldDimension(supplier, chunkgenerator)), Lifecycle.stable()); // CraftBukkit - decompile error
|
||||
Iterator iterator = registrymaterials.d().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -229,7 +234,7 @@
|
||||
switch (b0) {
|
||||
case 0:
|
||||
JsonObject jsonobject = !s.isEmpty() ? ChatDeserializer.a(s) : new JsonObject();
|
||||
- Dynamic<JsonElement> dynamic = new Dynamic(JsonOps.INSTANCE, jsonobject);
|
||||
+ Dynamic<JsonElement> dynamic = new Dynamic(RegistryReadOps.a(JsonOps.INSTANCE, IResourceManager.Empty.INSTANCE, (IRegistryCustom.Dimension) iregistrycustom), jsonobject); // CraftBukkit - SPIGOT-6237
|
||||
DataResult dataresult = GeneratorSettingsFlat.a.parse(dynamic);
|
||||
Logger logger = GeneratorSettings.LOGGER;
|
||||
|
Loading…
Reference in a new issue