Skip to content

Commit

Permalink
New values for levelconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rlf committed Dec 20, 2014
1 parent 2544d98 commit 3558f3e
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class LevelLogic {
private static final int DATA_MASK = 0xf;
private final FileConfiguration config;

private final int blockValue[] = new int[MAX_BLOCK<<DATA_BITS];
private final float blockValue[] = new float[MAX_BLOCK<<DATA_BITS];
private final int blockLimit[] = new int[MAX_BLOCK<<DATA_BITS];
private final int blockDR[] = new int[MAX_BLOCK<<DATA_BITS];

Expand All @@ -37,15 +37,15 @@ public LevelLogic(FileConfiguration config) {
}

public void load() {
int defaultValue = config.getInt("general.default", 10);
float defaultValue = (float) config.getDouble("general.default", 10);
int defaultLimit = config.getInt("general.limit", Integer.MAX_VALUE);
int defaultDR = config.getInt("general.defaultScale", 10000);
Arrays.fill(blockValue, defaultValue);
Arrays.fill(blockLimit, defaultLimit);
ConfigurationSection blockValueSection = config.getConfigurationSection("blockValues");
for (String blockKey : blockValueSection.getKeys(false)) {
int[] blockIds = getBlockIds(blockKey);
int value = blockValueSection.getInt(blockKey, defaultValue);
float value = (float) blockValueSection.getDouble(blockKey, defaultValue);
for (int blockId : blockIds) {
blockValue[blockId] = value;
}
Expand Down
60 changes: 50 additions & 10 deletions src/main/resources/levelConfig.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
general:
#pointsPerLevel - number of points needed to advance 1 island level.
# pointsPerLevel - number of points needed to advance 1 island level.
pointsPerLevel: 1000
#default - the default value for blocks not listed in blockValues here.
# default - the default value for blocks not listed in blockValues here.
default: 10
#useDiminishingReturns - If true, diminishing returns will be used for all blocks using the default scale (custom scales can be defined in the section below)
#If useDiminishingReturns is false, the blocks listed in the dimishingReturns section will still be affected.
# useDiminishingReturns - If true, diminishing returns will be used for all blocks using the default scale (custom scales can be defined in the section below)
# If useDiminishingReturns is false, the blocks listed in the dimishingReturns section will still be affected.
useDiminishingReturns: false
#defaultScale - the default value to use for diminishing returns. This is the number of blocks before DR starts to lower value.
# defaultScale - the default value to use for diminishing returns. This is the number of blocks before DR starts to lower value.
defaultScale: 10000
# blockValues [ID: VALUE] - the blocks listed below will have custom values instead of the default.
# Syntax: ID : VALUE
Expand All @@ -16,24 +16,40 @@ general:
# '1:1': 20 # Will give 20 points per GRANITE
# '1:2-6': 25 # Will give 25 points for Polished Granite, Andesite and Diorite
blockValues:
'1:0': 10
'1:1': 12.5
'1:2:' 15
'1:3': 12.5
'1:4': 15
'1:5': 12.5
'1:6': 15
'2': 20
'3': 20
'3:1': 25
'3:2': 25
'7': 0
'8': 0
'9': 0
'10': 0
'11': 0
'12': 20
'12':1: 20
'13': 20
'14': 500
'15': 200
'16': 200
'18': 0
'18:1': 0
'18:2': 0
'18:3': 0
'19': 50
'19:1': 50
'20': 50
'21': 300
'22': 500
'24': 20
'24:0': 20
'24:1': 22.5
'24:2': 22.5
'25': 20
'26': 1000
'27': 20
Expand All @@ -42,7 +58,8 @@ blockValues:
'30': 20
'33': 40
'34': 0
'35': 50
'35:0': 50
'35:1-15': 55
'36': 0
'41': 1500
'42': 300
Expand Down Expand Up @@ -101,41 +118,52 @@ blockValues:
'152': 150
'153': 50
'155': 100
'155':1: 100
'155':2: 100
'156': 100
'157': 20
'159': 50
'161': 0
'161':1: 0
'165': 250
'167': 20
'168': 50
'168:1': 50
'168:2': 50
'169': 50
'171': 20
'172': 20
'173': 500
'176': 20
'177': 20
'179': 20
'179:1': 20
'179:2': 20
'180': 20
'181': 20

#blockLimits - blocks listed here will stop adding to island levels after the given number of blocks.
# blockLimits - blocks listed here will stop adding to island levels after the given number of blocks.
blockLimits:
'4': 10000
'19': 20
'87': 10000
'88': 10000
'106': 100
'121': 10000
'122': 1
'130': 3
'138': 10
#diminishingReturns [ID: SCALE] - The listed blocks will add more to island level before SCALE number of blocks are counted towards the island level, and less to island level after SCALE.
# diminishingReturns [ID: SCALE] - The listed blocks will add more to island level before SCALE number of blocks are counted towards the island level, and less to island level after SCALE.
diminishingReturns:
'1': 10000
'2': 10000
'3': 10000
'5': 10000
'12': 10000
'12:1': 10000
'17': 100
'26': 1
'31': 100
'35': 64
'37': 100
'38': 100
'39': 100
Expand Down Expand Up @@ -163,4 +191,16 @@ diminishingReturns:
'173': 100
'176': 20
'177': 20
'181': 20000
'182': 20000
'183': 100
'184': 100
'185': 100
'186': 100
'187': 100
'188': 5000
'189': 5000
'190': 5000
'191': 5000
'192': 5000
version: 2

0 comments on commit 3558f3e

Please sign in to comment.