@@ -1,32 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
|
||||
+++ b/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java
|
||||
@@ -58,7 +58,7 @@
|
||||
return chunkgeneratorabstract.h;
|
||||
})).apply(instance, instance.stable(ChunkGeneratorAbstract::new));
|
||||
});
|
||||
- private static final float[] i = (float[]) SystemUtils.a((Object) (new float[13824]), (afloat) -> {
|
||||
+ private static final float[] i = (float[]) SystemUtils.a((new float[13824]), (afloat) -> { // CraftBukkit - decompile error
|
||||
for (int i = 0; i < 24; ++i) {
|
||||
for (int j = 0; j < 24; ++j) {
|
||||
for (int k = 0; k < 24; ++k) {
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
|
||||
});
|
||||
- private static final float[] j = (float[]) SystemUtils.a((Object) (new float[25]), (afloat) -> {
|
||||
+ private static final float[] j = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
for (int j = -2; j <= 2; ++j) {
|
||||
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
|
||||
@@ -227,6 +227,11 @@
|
||||
f6 = f4;
|
||||
f7 = f5;
|
||||
}
|
||||
+ // CraftBukkit start - fix MC-54738
|
||||
+ if (f6 < -1.8F) {
|
||||
+ f6 = -1.8F;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
float f8 = f4 > f3 ? 0.5F : 1.0F;
|
||||
float f9 = f8 * ChunkGeneratorAbstract.j[l + 2 + (i1 + 2) * 5] / (f6 + 2.0F);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
+++ b/net/minecraft/world/level/levelgen/GeneratorSettings.java
|
||||
@@ -34,9 +34,14 @@
|
||||
@@ -35,9 +35,14 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -11,26 +11,44 @@
|
||||
+
|
||||
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;
|
||||
- public static final Codec<GeneratorSettings> CODEC = RecordCodecBuilder.create((instance) -> {
|
||||
+ public static final Codec<GeneratorSettings> CODEC = 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.LEVEL_STEM_REGISTRY, Lifecycle.stable(), WorldDimension.CODEC).xmap(WorldDimension::a, Function.identity()).fieldOf("dimensions").forGetter(GeneratorSettings::d), Codec.STRING.optionalFieldOf("legacy_custom_options").stable().forGetter((generatorsettings) -> {
|
||||
return generatorsettings.legacyCustomOptions;
|
||||
})).apply(instance, instance.stable(GeneratorSettings::new));
|
||||
@@ -120,7 +125,7 @@
|
||||
@@ -121,7 +126,7 @@
|
||||
public static RegistryMaterials<WorldDimension> a(RegistryMaterials<WorldDimension> registrymaterials, Supplier<DimensionManager> supplier, ChunkGenerator chunkgenerator) {
|
||||
RegistryMaterials<WorldDimension> registrymaterials1 = new RegistryMaterials<>(IRegistry.M, Lifecycle.experimental());
|
||||
RegistryMaterials<WorldDimension> registrymaterials1 = new RegistryMaterials<>(IRegistry.LEVEL_STEM_REGISTRY, 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 @@
|
||||
@@ -129,7 +134,7 @@
|
||||
ResourceKey<WorldDimension> resourcekey = (ResourceKey) entry.getKey();
|
||||
|
||||
if (resourcekey != WorldDimension.OVERWORLD) {
|
||||
- registrymaterials1.a(resourcekey, (Object) ((WorldDimension) entry.getValue()), registrymaterials.d((Object) ((WorldDimension) entry.getValue())));
|
||||
+ registrymaterials1.a(resourcekey, ((WorldDimension) entry.getValue()), registrymaterials.d(((WorldDimension) entry.getValue()))); // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +247,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);
|
||||
DataResult dataresult = GeneratorSettingsFlat.CODEC.parse(dynamic);
|
||||
Logger logger = GeneratorSettings.LOGGER;
|
||||
|
||||
@@ -278,7 +283,7 @@
|
||||
Entry<ResourceKey<WorldDimension>, WorldDimension> entry = (Entry) iterator.next();
|
||||
ResourceKey<WorldDimension> resourcekey = (ResourceKey) entry.getKey();
|
||||
|
||||
- registrymaterials.a(resourcekey, (Object) (new WorldDimension(((WorldDimension) entry.getValue()).a(), ((WorldDimension) entry.getValue()).c().withSeed(j))), this.dimensions.d((Object) ((WorldDimension) entry.getValue())));
|
||||
+ registrymaterials.a(resourcekey, (Object) (new WorldDimension(((WorldDimension) entry.getValue()).a(), ((WorldDimension) entry.getValue()).c().withSeed(j))), this.dimensions.d(((WorldDimension) entry.getValue()))); // CraftBukkit - decompile error
|
||||
}
|
||||
} else {
|
||||
registrymaterials = this.dimensions;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
|
||||
+++ b/net/minecraft/world/level/levelgen/MobSpawnerPatrol.java
|
||||
@@ -118,7 +118,7 @@
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
entitymonsterpatrolling.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
entitymonsterpatrolling.prepare(worldserver, worldserver.getDamageScaler(blockposition), EnumMobSpawn.PATROL, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
--- a/net/minecraft/world/level/levelgen/NoiseSampler.java
|
||||
+++ b/net/minecraft/world/level/levelgen/NoiseSampler.java
|
||||
@@ -13,7 +13,7 @@
|
||||
public class NoiseSampler {
|
||||
|
||||
private static final int OLD_CELL_COUNT_Y = 32;
|
||||
- private static final float[] BIOME_WEIGHTS = (float[]) SystemUtils.a((Object) (new float[25]), (afloat) -> {
|
||||
+ private static final float[] BIOME_WEIGHTS = (float[]) SystemUtils.a((new float[25]), (afloat) -> { // CraftBukkit - decompile error
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
for (int j = -2; j <= 2; ++j) {
|
||||
float f = 10.0F / MathHelper.c((float) (i * i + j * j) + 0.2F);
|
||||
@@ -97,6 +97,11 @@
|
||||
f6 = f4;
|
||||
f7 = f5;
|
||||
}
|
||||
+ // CraftBukkit start - fix MC-54738
|
||||
+ if (f6 < -1.8F) {
|
||||
+ f6 = -1.8F;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
float f8 = f4 > f3 ? 0.5F : 1.0F;
|
||||
float f9 = f8 * NoiseSampler.BIOME_WEIGHTS[k1 + 2 + (l1 + 2) * 5] / (f6 + 2.0F);
|
||||
@@ -6,21 +6,21 @@
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -22,14 +23,15 @@
|
||||
return structuresettings.d;
|
||||
return structuresettings.structureConfig;
|
||||
})).apply(instance, StructureSettings::new);
|
||||
});
|
||||
- public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> b = ImmutableMap.builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_PYRAMID, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.ENDCITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.FORTRESS, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
- public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> DEFAULTS = ImmutableMap.builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_TEMPLE, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.OCEAN_MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.END_CITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.WOODLAND_MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_BRIDGE, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
+ // CraftBukkit - decompile error
|
||||
+ public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> b = ImmutableMap.<StructureGenerator<?>, StructureSettingsFeature>builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_PYRAMID, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.ENDCITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.FORTRESS, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
public static final StructureSettingsStronghold c;
|
||||
private final Map<StructureGenerator<?>, StructureSettingsFeature> d;
|
||||
+ public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> DEFAULTS = ImmutableMap.<StructureGenerator<?>, StructureSettingsFeature>builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_TEMPLE, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.OCEAN_MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.END_CITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.WOODLAND_MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_BRIDGE, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
public static final StructureSettingsStronghold DEFAULT_STRONGHOLD;
|
||||
private final Map<StructureGenerator<?>, StructureSettingsFeature> structureConfig;
|
||||
@Nullable
|
||||
private final StructureSettingsStronghold e;
|
||||
private final StructureSettingsStronghold stronghold;
|
||||
|
||||
public StructureSettings(Optional<StructureSettingsStronghold> optional, Map<StructureGenerator<?>, StructureSettingsFeature> map) {
|
||||
- this.e = (StructureSettingsStronghold) optional.orElse((Object) null);
|
||||
+ this.e = (StructureSettingsStronghold) optional.orElse(null); // CraftBukkit - decompile error
|
||||
this.d = map;
|
||||
- this.stronghold = (StructureSettingsStronghold) optional.orElse((Object) null);
|
||||
+ this.stronghold = (StructureSettingsStronghold) optional.orElse(null); // CraftBukkit - decompile error
|
||||
this.structureConfig = map;
|
||||
}
|
||||
|
||||
@@ -53,6 +55,15 @@
|
||||
@@ -28,10 +28,10 @@
|
||||
|
||||
static {
|
||||
+ // CraftBukkit - decompile error start
|
||||
+ c = new StructureSettingsStronghold(32, 3, 128);
|
||||
+ DEFAULT_STRONGHOLD = new StructureSettingsStronghold(32, 3, 128);
|
||||
+
|
||||
+ for (StructureGenerator<?> structuregenerator : IRegistry.STRUCTURE_FEATURE) {
|
||||
+ if (!StructureSettings.b.containsKey(structuregenerator)) {
|
||||
+ if (!StructureSettings.DEFAULTS.containsKey(structuregenerator)) {
|
||||
+ throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ }
|
||||
+ }
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
StructureGenerator structuregenerator;
|
||||
@@ -67,5 +78,7 @@
|
||||
} while (StructureSettings.b.containsKey(structuregenerator));
|
||||
} while (StructureSettings.DEFAULTS.containsKey(structuregenerator));
|
||||
|
||||
throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ */
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
+
|
||||
public class PersistentStructureLegacy {
|
||||
|
||||
- private static final Map<String, String> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> a = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
- private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> CURRENT_TO_LEGACY_MAP = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
hashmap.put("Village", "Village");
|
||||
hashmap.put("Mineshaft", "Mineshaft");
|
||||
hashmap.put("Mansion", "Mansion");
|
||||
@@ -19,29 +19,29 @@
|
||||
hashmap.put("Fortress", "Fortress");
|
||||
hashmap.put("EndCity", "EndCity");
|
||||
});
|
||||
- private static final Map<String, String> b = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> b = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
- private static final Map<String, String> LEGACY_TO_CURRENT_MAP = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
|
||||
+ private static final Map<String, String> LEGACY_TO_CURRENT_MAP = (Map) SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // CraftBukkit - decompile error
|
||||
hashmap.put("Iglu", "Igloo");
|
||||
hashmap.put("TeDP", "Desert_Pyramid");
|
||||
hashmap.put("TeJP", "Jungle_Pyramid");
|
||||
@@ -236,16 +240,16 @@
|
||||
@@ -234,16 +238,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
- public static PersistentStructureLegacy a(ResourceKey<World> resourcekey, @Nullable WorldPersistentData worldpersistentdata) {
|
||||
- if (resourcekey == World.OVERWORLD) {
|
||||
+ public static PersistentStructureLegacy a(ResourceKey<DimensionManager> resourcekey, @Nullable WorldPersistentData worldpersistentdata) { // CraftBukkit
|
||||
+ if (resourcekey == DimensionManager.OVERWORLD) { // CraftBukkit
|
||||
+ if (resourcekey == DimensionManager.OVERWORLD_LOCATION) { // CraftBukkit
|
||||
return new PersistentStructureLegacy(worldpersistentdata, ImmutableList.of("Monument", "Stronghold", "Village", "Mineshaft", "Temple", "Mansion"), ImmutableList.of("Village", "Mineshaft", "Mansion", "Igloo", "Desert_Pyramid", "Jungle_Pyramid", "Swamp_Hut", "Stronghold", "Monument"));
|
||||
} else {
|
||||
ImmutableList immutablelist;
|
||||
|
||||
- if (resourcekey == World.THE_NETHER) {
|
||||
+ if (resourcekey == DimensionManager.THE_NETHER) { // CraftBukkit
|
||||
- if (resourcekey == World.NETHER) {
|
||||
+ if (resourcekey == DimensionManager.NETHER_LOCATION) { // CraftBukkit
|
||||
immutablelist = ImmutableList.of("Fortress");
|
||||
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
|
||||
- } else if (resourcekey == World.THE_END) {
|
||||
+ } else if (resourcekey == DimensionManager.THE_END) { // CraftBukkit
|
||||
- } else if (resourcekey == World.END) {
|
||||
+ } else if (resourcekey == DimensionManager.END_LOCATION) { // CraftBukkit
|
||||
immutablelist = ImmutableList.of("EndCity");
|
||||
return new PersistentStructureLegacy(worldpersistentdata, immutablelist, immutablelist);
|
||||
} else {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/WorldGenWitchHut.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/WorldGenWitchHut.java
|
||||
@@ -106,7 +106,7 @@
|
||||
@@ -101,7 +101,7 @@
|
||||
entitywitch.setPersistent();
|
||||
entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(new BlockPosition(j, i, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
entitywitch.setPositionRotation((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
entitywitch.prepare(generatoraccessseed, generatoraccessseed.getDamageScaler(blockposition_mutableblockposition), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- generatoraccessseed.addAllEntities(entitywitch);
|
||||
+ generatoraccessseed.addAllEntities(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
@@ -121,7 +121,7 @@
|
||||
entitycat.setPersistent();
|
||||
entitycat.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
entitycat.prepare(worldaccess, worldaccess.getDamageScaler(new BlockPosition(i, j, k)), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
entitycat.setPositionRotation((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
entitycat.prepare(worldaccess, worldaccess.getDamageScaler(blockposition_mutableblockposition), EnumMobSpawn.STRUCTURE, (GroupDataEntity) null, (NBTTagCompound) null);
|
||||
- worldaccess.addAllEntities(entitycat);
|
||||
+ worldaccess.addAllEntities(entitycat, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure.java
|
||||
@@ -134,7 +134,7 @@
|
||||
@@ -147,7 +147,7 @@
|
||||
}
|
||||
|
||||
private static List<DefinedStructure.BlockInfo> a(List<DefinedStructure.BlockInfo> list, List<DefinedStructure.BlockInfo> list1, List<DefinedStructure.BlockInfo> list2) {
|
||||
- Comparator<DefinedStructure.BlockInfo> comparator = Comparator.comparingInt((definedstructure_blockinfo) -> {
|
||||
+ Comparator<DefinedStructure.BlockInfo> comparator = Comparator.<DefinedStructure.BlockInfo>comparingInt((definedstructure_blockinfo) -> { // CraftBukkit - decompile error
|
||||
return definedstructure_blockinfo.a.getY();
|
||||
return definedstructure_blockinfo.pos.getY();
|
||||
}).thenComparingInt((definedstructure_blockinfo) -> {
|
||||
return definedstructure_blockinfo.a.getX();
|
||||
@@ -154,7 +154,7 @@
|
||||
return definedstructure_blockinfo.pos.getX();
|
||||
@@ -167,7 +167,7 @@
|
||||
}
|
||||
|
||||
private void a(World world, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
@@ -18,14 +18,14 @@
|
||||
return !(entity instanceof EntityHuman);
|
||||
});
|
||||
|
||||
@@ -466,11 +466,13 @@
|
||||
@@ -471,11 +471,13 @@
|
||||
}
|
||||
|
||||
private static Optional<Entity> a(WorldAccess worldaccess, NBTTagCompound nbttagcompound) {
|
||||
- try {
|
||||
+ // CraftBukkit start
|
||||
+ // try {
|
||||
return EntityTypes.a(nbttagcompound, (World) worldaccess.getMinecraftWorld());
|
||||
return EntityTypes.a(nbttagcompound, (World) worldaccess.getLevel());
|
||||
- } catch (Exception exception) {
|
||||
- return Optional.empty();
|
||||
- }
|
||||
@@ -35,13 +35,13 @@
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public BlockPosition a(EnumBlockRotation enumblockrotation) {
|
||||
@@ -905,7 +907,7 @@
|
||||
public BaseBlockPosition a(EnumBlockRotation enumblockrotation) {
|
||||
@@ -868,7 +870,7 @@
|
||||
public IBlockData a(int i) {
|
||||
IBlockData iblockdata = (IBlockData) this.b.fromId(i);
|
||||
IBlockData iblockdata = (IBlockData) this.ids.fromId(i);
|
||||
|
||||
- return iblockdata == null ? DefinedStructure.b.a : iblockdata;
|
||||
+ return iblockdata == null ? a : iblockdata; // CraftBukkit - decompile error
|
||||
- return iblockdata == null ? DefinedStructure.b.DEFAULT_BLOCK_STATE : iblockdata;
|
||||
+ return iblockdata == null ? DEFAULT_BLOCK_STATE : iblockdata; // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public Iterator<IBlockData> iterator() {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureManager.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureManager.java
|
||||
@@ -31,7 +31,7 @@
|
||||
public class DefinedStructureManager {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
- private final Map<MinecraftKey, DefinedStructure> b = Maps.newHashMap();
|
||||
+ private final Map<MinecraftKey, DefinedStructure> b = Maps.newConcurrentMap(); // SPIGOT-5287
|
||||
private final DataFixer c;
|
||||
private IResourceManager d;
|
||||
private final Path e;
|
||||
Reference in New Issue
Block a user