Jump to content

ttocskcaj

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by ttocskcaj

  1. Is there a way to add a custom variant to a vanilla block? I want to change gold ore to have a custom stone colour (to place among my custom stone block), whilst still keeping the original gold ore as well. If not, is the best way just to create a whole new block and ore dictionary it?
  2. Looks ok. But why not just extend MapGenCaves and override the one method you need to?
  3. Just been working on the cave generation. @jabelar it automatically picks the biome blocks to repace as well (topBlock and fillerBlock).
  4. Do you wanna try building mine and running it? See if the lag is any less for you.
  5. MapGenCaves uses this method to check if it can replace a block with a cave: protected boolean canReplaceBlock(IBlockState p_175793_1_, IBlockState p_175793_2_) { if (p_175793_1_.getBlock() == Blocks.STONE) { return true; } else if (p_175793_1_.getBlock() == Blocks.DIRT) { return true; } else if (p_175793_1_.getBlock() == Blocks.GRASS) { return true; } else if (p_175793_1_.getBlock() == Blocks.HARDENED_CLAY) { return true; } else if (p_175793_1_.getBlock() == Blocks.STAINED_HARDENED_CLAY) { return true; } else if (p_175793_1_.getBlock() == Blocks.SANDSTONE) { return true; } else if (p_175793_1_.getBlock() == Blocks.RED_SANDSTONE) { return true; } else if (p_175793_1_.getBlock() == Blocks.MYCELIUM) { return true; } else if (p_175793_1_.getBlock() == Blocks.SNOW_LAYER) { return true; } else { return (p_175793_1_.getBlock() == Blocks.SAND || p_175793_1_.getBlock() == Blocks.GRAVEL) && p_175793_2_.getMaterial() != Material.WATER; } } @Dragonisser If it ends up to be your mapgen, you could try override that method?
  6. That doesn't look too much worse than my performance, maybe I just have a better cpu? What is your render distance set to? Anything above 10 and my dimension starts creating issues for me.
  7. Just paste your code in if you don't figure it out. Someone will help. Probably start a new thread though
  8. Maybe the issue lies somewhere else. Blocks, Items or Entities? From my understanding, your dimension, ChunkProvider, Biomes etc should only cause lag when chunks are being generated.
  9. Try profiling the code and see what's running slow? Or step through in debugger, maybe you're getting stuck in a loop somewhere?
  10. https://github.com/ttocskcaj/ElementalCraft/tree/b4931beb400823e81610d2d3854271204be8de57 After getting the dimension working with 2 biomes, we made the decision to split out "Elemental Plane" into 4 dimensions anyway (one for each element). There's link to an older commit, but it was working with 2 biomes at that point.
  11. Mine is in 1.12. Not sure if there's any difference in world generation between the versions. My chunk loading times are definitely longer that vanilla overworld, but I haven't spent any time optimizing it yet. Other than that, I don't get any lag playing, even running out of intellij.
  12. Cheers, good to know. It is cool that there's work arounds for this though. Really Helpful for modding.
  13. What exactly is an AT? Google doesn't seem to turn up anything.
  14. Not really sure what's going on. From what I can see, they just set and forget. The don't create their own copy or anything. Maybe it's only changed to private recently? Maybe I'm missing something small and obvious again haha. https://github.com/TeamTwilight/twilightforest/blob/1.12.x/src/main/java/twilightforest/world/TFBiomeProvider.java I totally wouldn't do something silly like forget to make it static... Cheers, it's working now Last question: The getModdedBiomeGenerators method that I'm overriding fires an event on the TERRAIN_GEN_BUS. public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) { net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens event = new net.minecraftforge.event.terraingen.WorldTypeEvent.InitBiomeGens(worldType, seed, original); net.minecraftforge.common.MinecraftForge.TERRAIN_GEN_BUS.post(event); return event.getNewBiomeGens(); } Would the preferred method be to use that event to override the genLayers instead? Or am I fine overriding the whole method?
  15. Finally got my dimension generating with 2 out of four biomes. Took a good few hours of messing around and trying to make sense of other code on github, and stepping through the debugger (yawn). Firstly, I was using the wrong constructor in my BiomeProvider, it needs to use the one that takes a WorldInfo object. Both twilightforest and biomes-o-plenty simply assign the genLayers and biomeIndexLayer fields directly, but they're both private variables, so I'm not sure how that works. Maybe it's my limited Java experience? Secondly, I had to override the getModdedBiomeGenerators method and create my own GenLayers (These are what picks what biomes go where). This is what assigns the genLayers and biomIndexLayer fields in BiomeProvider. Thirdly, the event listener for registering biomes wasn't working (Still don't know why this is. Maybe it's a bug?) I had to use ForgeRegistries.BIOMES.register(Biome) instead. Here's my finished BiomeProvider. public class BiomeProviderEP extends BiomeProvider { public BiomeProviderEP(World world) { super(world.getWorldInfo()); allowedBiomes.clear(); allowedBiomes.add(ModBiomes.BIOME_EARTH); allowedBiomes.add(ModBiomes.BIOME_FIRE); getBiomesToSpawnIn().clear(); getBiomesToSpawnIn().add(ModBiomes.BIOME_EARTH); } @Override public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original) { GenLayer biomes = new GenLayerEP(1); biomes = new GenLayerEPBiomes(1000, biomes); biomes = new GenLayerZoom(1000, biomes); biomes = new GenLayerZoom(1001, biomes); biomes = new GenLayerZoom(1002, biomes); biomes = new GenLayerZoom(1003, biomes); biomes = new GenLayerZoom(1004, biomes); GenLayer biomeIndexLayer = new GenLayerVoronoiZoom(10L, biomes); biomeIndexLayer.initWorldGenSeed(seed); return new GenLayer[]{ biomes, biomeIndexLayer }; } }
  16. Cheers, I got that It seems weird that the constructor to create that field in BiomeProvider is private. There seems to be no easy way except override every method. I'll investigate further later .
  17. Cheers @jabelar that was really helpful. I've got the hang (mostly) of WorldProvider, IChunkGenerator and Biomes with BiomeProviderSingle. I can't seem to get a custom BiomeProvider working though. Following your tutorial for Multi-Biome Provider (Semi-Custom) I get a NullPointerException. Log: https://pastebin.com/xYkbkTpH public class BiomeProviderEP extends BiomeProvider { public BiomeProviderEP(World world) { super(); allowedBiomes.clear(); allowedBiomes.add(ModBiomes.BIOME_FIRE); allowedBiomes.add(ModBiomes.BIOME_EARTH); } }
  18. Hi modders, I'm trying to create a custom dimension for a mod, but am struggling to find much information on how to do so. I've already checked out mcjty's tutorials, but that doesn't explain much about using custom biomes, and glosses over the topic quite a bit: https://wiki.mcjty.eu/modding/index.php?title=Dimensions-1.12 The official docs for 1.12 don't seem to cover it, and I can't find older versions of the docs to see if there's anything covered in there. I've tried going through the source of other mods, namely RFTools Dimensions and Plenty O' Biomes, but they're quite complicated (and don't have many comments :P) The outcome I want, is four custom biomes, and a dimension similar to the vanilla overworld but only using those four biomes. Cheers for any help, or links you can offer.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.