Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Adds ore toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
kNoAPP committed Oct 10, 2020
1 parent 9701c03 commit 9e998b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ max-millis-per-tick-generating: 4
enable-water: true
# Max build height (no higher than: 255), cannot go above this point.
max-build-height: 255
# Should we replace andisite, diorite, granite with useful ores?
extra-ore: true


# -=MAP SETTINGS=-
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/com/knoban/obw/map/GameMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GameMap implements Listener {
private final int length;
private final long maxMillisPerTickOnGeneration;
private int completedGenerationStages, lowestStableXRel;
private final boolean water;
private final boolean water, ore;
private Location origin, center;

private Runnable onGenerationComplete;
Expand All @@ -42,6 +42,7 @@ private GameMap(@NotNull String name, int length) {
FileConfiguration fc = OneBlockWide.getInstance().getFileConfig().getCachedYML();
this.maxMillisPerTickOnGeneration = fc.getLong("max-millis-per-tick-generating", 10);
this.water = fc.getBoolean("enable-water", true);
this.ore = fc.getBoolean("extra-ore", true);
}

public void generateWorld() {
Expand Down Expand Up @@ -257,15 +258,18 @@ public void run() {
case REDSTONE_ORE:
case EMERALD_ORE:
case GOLD_ORE:
b.setType(Material.DIAMOND_ORE);
if(ore)
b.setType(Material.DIAMOND_ORE);
break;
case DIORITE:
case COAL_ORE:
b.setType(Material.IRON_ORE);
if(ore)
b.setType(Material.IRON_ORE);
break;
case ANDESITE:
case GRANITE:
b.setType(Material.COAL_ORE);
if(ore)
b.setType(Material.COAL_ORE);
break;
case WATER:
if(!water)
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ max-millis-per-tick-generating: 4
enable-water: true
# Max build height (no higher than: 255), cannot go above this point.
max-build-height: 255
# Should we replace andisite, diorite, granite with useful ores?
extra-ore: true


# -=MAP SETTINGS=-
Expand Down

0 comments on commit 9e998b0

Please sign in to comment.