13
0
geforkt von Mirrors/Paper
Dieser Commit ist enthalten in:
Owen1212055 2022-06-08 09:03:33 -04:00
Ursprung 4d7d4e996e
Commit bf30d497ba
4 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (xx == chunkPos.x && zz == chunkPos.z) {
+ chunks.add(protoChunk);
+ } else {
+ final Holder<net.minecraft.world.level.biome.Biome> biomeHolder = serverLevel.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
+ final net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeHolder = serverLevel.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY).getHolderOrThrow(net.minecraft.world.level.biome.Biomes.PLAINS);
+ final net.minecraft.world.level.chunk.ChunkAccess chunk = new net.minecraft.world.level.chunk.EmptyLevelChunk(serverLevel, new net.minecraft.world.level.ChunkPos(xx, zz), biomeHolder);
+ chunks.add(chunk);
+ }

Datei anzeigen

@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return new BiomeProvider() {
+ @Override
+ public Biome getBiome(final org.bukkit.generator.WorldInfo worldInfo, final int x, final int y, final int z) {
+ return CraftBlock.biomeBaseToBiome(biomeRegistry, chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2));
+ return CraftBlock.biomeBaseToBiome(biomeRegistry, CraftWorld.this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2));
+ }
+
+ @Override

Datei anzeigen

@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public Location locateNearestBiome(Location origin, Biome biome, int radius, int step) {
+ BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ());
+ BlockPos nearest = getHandle().findNearestBiome( holder -> holder.is(CraftNamespacedKey.toMinecraft(biome.getKey())), originPos, radius, step).getFirst();
+ BlockPos nearest = getHandle().findClosestBiome3d( holder -> holder.is(CraftNamespacedKey.toMinecraft(biome.getKey())), originPos, radius, step, step).getFirst();
+ return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ());
+ }
+

Datei anzeigen

@ -44,9 +44,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ private net.minecraft.nbt.StringTag convert(String json) {
+ Component component = Component.Serializer.fromJson(json);
+ if (component instanceof TextComponent && component.getContents().contains("\u00A7") && component.getSiblings().isEmpty()) {
+ if (component.getContents() instanceof net.minecraft.network.chat.contents.LiteralContents literalContents && literalContents.text().contains("\u00A7") && component.getSiblings().isEmpty()) {
+ // Only convert if the root component is a single comp with legacy in it, don't convert already normal components
+ component = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(component.getContents())[0];
+ component = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(literalContents.text())[0];
+ }
+ return net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(component));
+ }