Fix #84 Parse floats and add info for chance list

This commit is contained in:
Misode
2020-06-01 01:09:42 +02:00
parent b6eba92e64
commit 073cdd2af1
5 changed files with 5 additions and 0 deletions

View File

@@ -372,6 +372,7 @@ function updateField(el) {
for (let i = 0; i < value.length; i += 1) {
value[i] = value[i].trim();
if (type === 'chance-list') {
value[i] = parseFloat(value[i]);
if (isNaN(value[i])) {
value = [];
break;

View File

@@ -393,6 +393,7 @@
"help.biome_source.type.checkerboard": "Biomes generating in a checkerboard chunk pattern",
"help.biome_source.type.vanilla_layered": "Biome distribution for the overworld",
"help.biome_source.type.the_end": "Biome distrubution for the end",
"help.condition.chances": "List of floats between 0 and 1 separated by commas",
"help.condition.time_period": "If present, time will be modulo-divided by this value. For example, if set to 24000, value will operate on a time period of days.",
"help.dimension": "The identifier used for \"/execute in\". Must be all lowercase.",
"help.dimension.type.ultrawarm": "If true, water will evaporate and sponges will dry",

View File

@@ -541,6 +541,7 @@
"id": "chances",
"type": "chance-list",
"translate": "condition.chances",
"help": true,
"require": [
"minecraft:table_bonus"
]

View File

@@ -733,6 +733,7 @@
"id": "chances",
"type": "chance-list",
"translate": "condition.chances",
"help": true,
"require": [
"minecraft:table_bonus"
]

View File

@@ -733,6 +733,7 @@
"id": "chances",
"type": "chance-list",
"translate": "condition.chances",
"help": true,
"require": [
"minecraft:table_bonus"
]