Remove Only-vanilla-biomes restriction (#1373)

Dieser Commit ist enthalten in:
MrKinau 2021-10-22 16:34:37 +02:00 committet von GitHub
Ursprung 857090bdde
Commit 7b775ca57d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 16 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -608,11 +608,22 @@ public final class PaperweightFaweAdapter extends CachedBukkitAdapter implements
@Override @Override
public int getInternalBiomeId(BiomeType biomeType) { public int getInternalBiomeId(BiomeType biomeType) {
if (biomeType.getId().startsWith("minecraft:")) {
Biome biomeBase = CraftBlock.biomeToBiomeBase( Biome biomeBase = CraftBlock.biomeToBiomeBase(
MinecraftServer.getServer().registryAccess().ownedRegistryOrThrow(Registry.BIOME_REGISTRY), MinecraftServer.getServer().registryAccess().ownedRegistryOrThrow(Registry.BIOME_REGISTRY),
BukkitAdapter.adapt(biomeType) BukkitAdapter.adapt(biomeType)
); );
return MinecraftServer.getServer().registryAccess().ownedRegistryOrThrow(Registry.BIOME_REGISTRY).getId(biomeBase); return MinecraftServer.getServer().registryAccess().ownedRegistryOrThrow(Registry.BIOME_REGISTRY).getId(biomeBase);
} else {
WritableRegistry<Biome> biomeRegistry = MinecraftServer.getServer().registryAccess()
.ownedRegistryOrThrow(Registry.BIOME_REGISTRY);
ResourceLocation resourceLocation = biomeRegistry.keySet().stream()
.filter(resource -> resource.toString().equals(biomeType.getId()))
.findAny().orElse(null);
return biomeRegistry.getId(biomeRegistry.get(resourceLocation));
}
} }
@Override @Override