Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/27/18 in all areas

  1. You should stick with HashMap<Key,Value>. It allows for .contains() queries in O(1) time as opposed to ArrayList, which is O(n). At the very least, use HashSet<Key>, that also allows for O(1) time. If I were you, I'd look into A* search. You want the shortest distance, it's optimal. That all said, it sounds like what you need is something similar to the way I'm doing multiblocks. This may prove somewhat useful to you, particularly the checkNeighbors() method, which is called whenever a block is placed. It basically checks each neighbor to see if they are an instance of the network type, and if they are, it joins the network; otherwise, it forms a new network. Ought to have a lot of cross-over application with your aims. I'm gonna warn you right now, the code for this is still fairly buggy on edge-cases. When a network is split in half and the blocks on one half have to re-resolve the master node, that just gets ugly. You can make yours simpler by implementing a true master/slave architecture in your blocks, rather than the virtual master/slave architecture I decided to implement for the challenge of it.
    1 point
  2. You don't need TEs or TESRs for this, is possible with blockstates. Take a look at GreyGhosts's Minecraft By Example mod: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe04_block_dynamic_block_model1
    1 point
  3. I cannot believe someone finally used COMMENTS in their code to explain what the heck is going on! Thank you!!!
    1 point
  4. Cascading chunk gen happens when you attempt to place blocks into a neighboring chunk that hasn't been created yet. Vanilla avoids this by offsetting the generation by +8 and +8 (as the neighboring positive X and Z chunks are guaranteed to already exist, and won't cause them to get generated)
    1 point
×
×
  • Create New...

Important Information

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