CrystalCraftMC / CrystalSpace

Bringing the unexplored frontier of space to Minecraft

Home Page:https://crystalcraftmc.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diamond ore planets should have an option to only be cores

jwflory opened this issue · comments

Diamond ore planets are very powerful and have the potential to completely inflate the economy of a space server. As a result, there should be a way to either limit them or "hide" them a little better from players.

This could be done with a configurable boolean in the config.yml giving the administrator the discretion to decide whether he or she wishes for diamond ore to only be cores or if it can also be planet shells.

Based on what I saw in planets.yml diamond ore isn't not a part of the shell generation possibilities, do you think it should be added (if we add the boolean value system like you said)?

https://github.com/CrystalCraftMC/CrystalSpace/blob/master/src/main/resources/planets.yml

If adding boolean values here is an idea.
The existing planet config file uses this to config the shells and cores:

  • PUMPKIN-0.8
  • STATIONARY_LAVA-0.8
  • COAL_ORE-1.0
    -DIAMOND_ORE-0.1
    ETC.

The only thing we have to do is add the boolean value after:

  • PUMPKIN-0.8-TRUE
  • STATIONARY_LAVA-0.8-TRUE
  • COAL_ORE-1.0-TRUE
    -DIAMOND_ORE-0.1-FALSE

Then all we have to do is change how it is parsed in Line 326 in the method "loadAllowedBlocks()"
Link: https://github.com/CrystalCraftMC/CrystalSpace/blob/master/src/main/java/com/crystalcraftmc/crystalspace/wgen/planets/PlanetsChunkGenerator.java

Doing this means we would need to alter
allowedCoreIds = new HashMap.Set.MaterialData>, Float>();
allowedShellIds = new HashMap.Set.MaterialData>, Float>();
(Note, I replaced < with . because github text hides stuff in the sideways carrots.
So that the Set contained in the the HashMap is actually another Map type that maps the block types to booleans.

After that we must then find where allowedCoreIds, and allowedShellIds are accessed and change the readin process so it takes advantage of the boolean check for config. Also because it would break since we changed the data storage type.