From 69cee261dbea67487615b91ca56a93c79d726581 Mon Sep 17 00:00:00 2001 From: Misode Date: Sun, 29 Dec 2019 03:52:36 +0100 Subject: [PATCH] Fix filters for previous versions --- schemas/1.13.json | 3 +++ schemas/1.14.json | 24 ++++-------------------- schemas/1.15.json | 23 ++--------------------- view.js | 2 ++ 4 files changed, 11 insertions(+), 41 deletions(-) diff --git a/schemas/1.13.json b/schemas/1.13.json index 329dfa6a..481f41aa 100644 --- a/schemas/1.13.json +++ b/schemas/1.13.json @@ -55,6 +55,7 @@ "translate": "entry.type", "translateValue": "entry.type", "help": true, + "filter": true, "default": "minecraft:item", "values": [ "minecraft:empty", @@ -106,6 +107,7 @@ { "id": "function", "type": "enum", + "filter": true, "translate": "function.type", "translateValue": "function.type", "default": "minecraft:set_count", @@ -216,6 +218,7 @@ { "id": "condition", "type": "enum", + "filter": true, "translate": "condition.type", "translateValue": "condition.type", "default": "minecraft:random_chance", diff --git a/schemas/1.14.json b/schemas/1.14.json index 4a4e353c..f656d922 100644 --- a/schemas/1.14.json +++ b/schemas/1.14.json @@ -77,6 +77,7 @@ "translate": "entry.type", "translateValue": "entry.type", "help": true, + "filter": true, "default": "minecraft:item", "values": [ "minecraft:empty", @@ -414,32 +415,14 @@ "color": "secondary", "card": false, "require": [ - { - "function": "minecraft:apply_bonus", - "formula": "minecraft:uniform_bonus_count" - } + "minecraft:apply_bonus" ], "fields": [ { "id": "bonusMultiplier", "type": "float", "translate": "function.bonusMultiplier" - } - ] - }, - { - "id": "parameters", - "type": "object", - "translate": "function.parameters", - "color": "secondary", - "card": false, - "require": [ - { - "function": "minecraft:apply_bonus", - "formula": "minecraft:binomial_with_bonus_count" - } - ], - "fields": [ + }, { "id": "extra", "type": "int", @@ -479,6 +462,7 @@ { "id": "condition", "type": "enum", + "filter": true, "translate": "condition.type", "translateValue": "condition.type", "default": "minecraft:random_chance", diff --git a/schemas/1.15.json b/schemas/1.15.json index b352f30c..21b5c974 100644 --- a/schemas/1.15.json +++ b/schemas/1.15.json @@ -549,7 +549,6 @@ "type": "enum", "translate": "function.formula", "translateValue": "function.formula", - "filter": true, "default": "minecraft:uniform_bonus_count", "values": [ "minecraft:uniform_bonus_count", @@ -567,32 +566,14 @@ "color": "secondary", "card": false, "require": [ - { - "function": "minecraft:apply_bonus", - "formula": "minecraft:uniform_bonus_count" - } + "minecraft:apply_bonus" ], "fields": [ { "id": "bonusMultiplier", "type": "float", "translate": "function.bonusMultiplier" - } - ] - }, - { - "id": "parameters", - "type": "object", - "translate": "function.parameters", - "color": "secondary", - "card": false, - "require": [ - { - "function": "minecraft:apply_bonus", - "formula": "minecraft:binomial_with_bonus_count" - } - ], - "fields": [ + }, { "id": "extra", "type": "int", diff --git a/view.js b/view.js index e6cf5542..d610f066 100644 --- a/view.js +++ b/view.js @@ -407,12 +407,14 @@ function generateObject(data, struct, options) { let child = components.find(e => e.id === struct.value); return generateObject(data, child, options); } + console.warn(struct.id); let filter; for (let field of struct.fields) { if (filter === undefined) { filterField = struct.fields.find(e => e.type === 'enum' && e.filter === true); if (filterField) { filter = data[filterField.id]; + console.log(filter); } } if (!luckBased && field.luckBased) {