Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

sasetz

Members
  • Posts

    16
  • Joined

  • Last visited

sasetz's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Well, still, thank you for your help! I will continue searching for what's happening, so if I find something, I'll post it here So far I figured out that the update doesn't affect the whole chunk, several layers of grass or leaves can be different colors at the same time
  2. https://github.com/sasetz/biome_changer_block
  3. Thank you for your replies! I've done the same thing that this method does, but the problem on screenshot (https://imgur.com/a/9qNBhxS) remains. Sometimes everything changes ok but the rest of the times the result is the same as in the screenshot. Breaking/placing block inside the chunk fixes the problem public void changeBiome() { if(!level.isClientSide()){ // Now this piece of code runs only on server side final Chunk chunk = level.getChunkAt(worldPosition); Biome[] biomes = chunk.getBiomes().biomes; for (int i = 0, biomesLength = biomes.length; i < biomesLength; i++) { DynamicRegistries reg = level.registryAccess(); MutableRegistry<Biome> a = reg.registry(Registry.BIOME_REGISTRY).get(); Biome biome = a.get(Biomes.DESERT.location()); biomes[i] = biome; } // This line does basically the same that PacketDistributor#trackingChunk does ((ServerChunkProvider)level.getChunkSource()).chunkMap.getPlayers(chunk.getPos(), false) .forEach(e -> e.connection.send(new SChunkDataPacket(chunk, 65535))); } else { // Update chunk? } } I guess that the only thing remains is to update the chunk on client, how can I do that?
  4. Ok, that makes sense I understand that and still, how do I send this packet? I found info only about custom packets, not the vanilla ones
  5. Biomes.DESERT.location() returns the correct ResourceLocation (minecraft:desert) No, the client knows about the biome change, since this method fires on both sides. If it works only on server side, the client needs to revisit a chunk, F3 + A is not enough Yes, that's basically what I need. Is SChunkDataPacket going to fix this issue? If so, how can I send this vanilla packet?
  6. Instead of getting the desert biome I just typed new ResourceLocation("minecraft:desert") and it finally worked! The final code is public void changeBiome() { Biome[] biomes = level.getChunkAt(worldPosition).getBiomes().biomes; for (int i = 0, biomesLength = biomes.length; i < biomesLength; i++) { DynamicRegistries reg = level.registryAccess(); MutableRegistry<Biome> a = reg.registry(Registry.BIOME_REGISTRY).get(); Biome biome = a.get(new ResourceLocation("minecraft:desert")); biomes[i] = biome; } } But the only thing left is that the grass color doesn't change instantly, but when I click F3 + A (only if I click the combination twice) it looks how it should be (grass changes from plains green to yellow) If I hit F3 + A only 1 time, the borders between biomes become sharp between the chunks https://imgur.com/a/9qNBhxS (screenshot) Is there a way to reload a chunk like F3 + A does? And thank you for all of your replies!
  7. For some reason the code Biomes.DESERT.getRegistryName().toString() returns "minecraft:worldgen/biome"...
  8. Now it's doing a NullPointerException... I just did this level.registryAccess().registry(Registry.BIOME_REGISTRY).get().get(Biomes.DESERT.getRegistryName()).toString() The second get method returns null
  9. And then what field or method should I call? I just couldn't find anything suitable
  10. I've tried this, but how do I turn RegistryKey to Biome?
  11. It's method that returns Biome, there's a bunch of those for each biome inside BiomeMaker class
  12. if(!level.isClientSide()){ Biome[] biomes = level.getChunkAt(worldPosition).getBiomes().biomes; sendToChat(BiomeMaker.desertBiome(.125f, .05f, false, false, false).toString()); for (int i = 0, biomesLength = biomes.length; i < biomesLength; i++) { biomes[i] = BiomeMaker.desertBiome(.125f, .05f, false, false, false); sendToChat("" + i + ": " + biomes[i].getRegistryName()); } } This is a piece of code is called when I right click on a block, it's inside of a TileEntity
  13. Thanks for you reply! Ok, I've figured it out that chunk is divided to cubes with 4 blocks side and each of the cubes has it's own biome. But still, I want to change biome in the whole chunk, so I change every element of the array to another biome and it doesn't change (registry name says it's null biome), and the changes don't save (when I reload the world, biomes are back to normal)
  14. Thank you for your replies! I created an AT and checked what's inside of this array. Why is there 1024 Biome instances? Is it 4 instances for each block in a chunk or what? I inspected BiomeContainer#getNoiseBiome, but it didn't make much sense since I don't know what 3 int parameters supposed to mean (xyz? I thought biome stretches from y=0 to y=255. Maybe it's 16x16 and 4 layers vertically? idk) I've tried changing stuff inside of the array (using BiomeMaker methods) but after I did that, when I checked again the array and the registry names of biomes inside are all null. After I restart the world it turns back to normal (minecraft:plains or more) So I need to call this method on every block inside of chunk, so it gets zoomed? I don't think it's what you meant though...
  15. Thank you for your reply! The block will be placed by a player, so, the chunk is generated. So, I need to create an access transformer to change biome array's signature from "private final" to "public", right? What does it mean "unzoomed biome"? And how do I apply zoom with BiomeManager?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.