diff --git a/index.html b/index.html
index f25960e5..526382fb 100644
--- a/index.html
+++ b/index.html
@@ -25,11 +25,7 @@
-
-
+
-
diff --git a/locales/en.json b/locales/en.json
index 915f550d..373abb92 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -71,6 +71,9 @@
"condition_remove": "Remove Condition",
"copy": "Copy",
"credit": "on GitHub",
+ "criteria": "Criteria",
+ "criteria_add": "Add Criterion",
+ "criteria_remove": "Remove Criterion",
"damage_source.bypasses_armor": "Bypass Armor",
"damage_source.bypasses_invulnerability": "Void",
"damage_source.bypasses_magic": "Starvation",
@@ -83,9 +86,21 @@
"damage_source.source_entity": "Source Entity",
"description.loot-table": "Loot Table Generator for Minecraft",
"description.predicate": "Predicate Generator for Minecraft",
+ "description.advancement": "Advancement Generator for Minecraft",
"dimension.overworld": "Overworld",
"dimension.the_end": "The End",
"dimension.the_nether": "The Nether",
+ "display": "Display",
+ "display.icon": "Icon",
+ "display.icon.item": "Icon Item",
+ "display.icon.nbt": "Icon NBT",
+ "display.title": "Title",
+ "display.description": "Description",
+ "display.frame": "Frame",
+ "display.background": "Background",
+ "display.show_toast": "Show Toast",
+ "display.announce_to_chat": "Announce To Chat",
+ "display.hidden": "Hidden",
"distance.absolute": "Absolute",
"distance.horizontal": "Horizontal",
"distance.x": "X",
@@ -280,8 +295,10 @@
"nbt_operation.target": "Target",
"nbt_operation_add": "Add Operation",
"nbt_operation_remove": "Remove Operation",
+ "parent": "Parent Advancement",
"placeholder.advancement": "An advancement ID",
"placeholder.block_state": "A block state key",
+ "placeholder.criteria": "A criterion ID",
"placeholder.effect": "An status effect ID",
"placeholder.fluid_state": "A fluid state key",
"placeholder.objective": "An scoreboard objective",
@@ -303,6 +320,7 @@
"range.range": "Range",
"range.uniform": "Uniform",
"remove": "Remove",
+ "requirements": "Requirements",
"share": "Share",
"show_source": "Show Source",
"slot.chest": "Chest",
@@ -351,6 +369,7 @@
"theme.light": "Light",
"title.loot-table": "Loot Table Generator",
"title.predicate": "Predicate Generator",
+ "title.advancement": "Advancement Generator",
"true": "True",
"unset": "Unset"
}
diff --git a/schemas/1.15.json b/schemas/1.15.json
index 6496b621..75351eee 100644
--- a/schemas/1.15.json
+++ b/schemas/1.15.json
@@ -34,6 +34,99 @@
"description": "description.predicate",
"type": "object",
"value": "condition"
+ },
+ {
+ "id": "advancement",
+ "title": "title.advancement",
+ "description": "description.advancement",
+ "type": "object",
+ "color": "success",
+ "fields": [
+ {
+ "id": "display",
+ "translate": "display",
+ "type": "object",
+ "collapse": true,
+ "color": "dark",
+ "fields": [
+ {
+ "id": "icon",
+ "translate": "display.icon",
+ "type": "object",
+ "color": "dark",
+ "fields": [
+ {
+ "id": "item",
+ "translate": "display.icon.item",
+ "type": "string"
+ },
+ {
+ "id": "nbt",
+ "translate": "display.icon.nbt",
+ "type": "nbt"
+ }
+ ]
+ },
+ {
+ "id": "title",
+ "translate": "display.title",
+ "type": "json"
+ },
+ {
+ "id": "description",
+ "translate": "display.description",
+ "type": "json"
+ },
+ {
+ "id": "frame",
+ "translate": "display.frame",
+ "translateValue": "",
+ "type": "enum",
+ "unset": true,
+ "values": [
+ "task",
+ "challenge",
+ "goal"
+ ]
+ },
+ {
+ "id": "background",
+ "translate": "display.background",
+ "type": "string"
+ },
+ {
+ "id": "show_toast",
+ "translate": "display.show_toast",
+ "type": "boolean"
+ },
+ {
+ "id": "announce_to_chat",
+ "translate": "display.announce_to_chat",
+ "type": "boolean"
+ },
+ {
+ "id": "hidden",
+ "translate": "display.hidden",
+ "type": "boolean"
+ }
+ ]
+ },
+ {
+ "id": "parent",
+ "translate": "parent",
+ "type": "string"
+ },
+ {
+ "id": "criteria",
+ "translate": "criteria",
+ "translatePlaceholder": "placeholder.criteria",
+ "type": "map",
+ "values": {
+ "type": "object",
+ "value": "criterion"
+ }
+ }
+ ]
}
],
"components": [
@@ -1420,6 +1513,60 @@
"translate": "statistic.value"
}
]
+ },
+ {
+ "id": "criterion",
+ "type": "object",
+ "color": "info",
+ "fields": [
+ {
+ "id": "trigger",
+ "translate": "criteria.trigger",
+ "translateValue": "criteria.trigger",
+ "type": "enum",
+ "default": "minecraft:inventory_changed",
+ "values": [
+ "minecraft:bee_nest_destroyed",
+ "minecraft:bred_animals",
+ "minecraft:brewed_potion",
+ "minecraft:changed_dimension",
+ "minecraft:channeled_lightning",
+ "minecraft:construct_beacon",
+ "minecraft:consume_item",
+ "minecraft:cured_zombie_villager",
+ "minecraft:effects_changed",
+ "minecraft:enchanted_item",
+ "minecraft:enter_block",
+ "minecraft:entity_hurt_player",
+ "minecraft:entity_killed_player",
+ "minecraft:filled_bucket",
+ "minecraft:fishing_rod_hooked",
+ "minecraft:hero_of_the_village",
+ "minecraft:impossible",
+ "minecraft:inventory_changed",
+ "minecraft:item_durability_changed",
+ "minecraft:killed_by_crossbow",
+ "minecraft:levitation",
+ "minecraft:location",
+ "minecraft:nether_travel",
+ "minecraft:placed_block",
+ "minecraft:player_hurt_entity",
+ "minecraft:player_killed_entity",
+ "minecraft:recipe_unlocked",
+ "minecraft:safely_harvest_honey",
+ "minecraft:shot_crossbow",
+ "minecraft:slept_in_bed",
+ "minecraft:slide_down_block",
+ "minecraft:summoned_entity",
+ "minecraft:tame_animal",
+ "minecraft:tick",
+ "minecraft:used_ender_eye",
+ "minecraft:used_totem",
+ "minecraft:villager_trade",
+ "minecraft:voluntary_exile"
+ ]
+ }
+ ]
}
],
"collections": {
diff --git a/view.js b/view.js
index 07baf7ef..67a0bef8 100644
--- a/view.js
+++ b/view.js
@@ -2,15 +2,24 @@ let structure;
let components;
let collections;
+const generators = {
+ 'advancement': ['1.15'],
+ 'loot-table': ['1.13', '1.14', '1.15'],
+ 'predicate': ['1.15']
+}
+
+const generator = window.location.pathname.replace(/\/$/, '').replace(/^\//, '');
+generators[generator].forEach(v => {
+ $('#versionList').append(`${v}`)
+});
+
changeVersion('1.15');
function changeVersion(version) {
$.getJSON('schemas/' + version + '.json', json => {
- console.log(json);
if (json.root) {
structure = json.root;
} else if (json.roots) {
- let id = window.location.pathname.replace(/\/$/, '').replace(/^\//, '');
- structure = json.roots.find(e => e.id === id) || json.roots[0] ;
+ structure = json.roots.find(e => e.id === generator) || json.roots[0] ;
}
components = json.components;
collections = json.collections;
@@ -56,7 +65,7 @@ function updateView() {
}
function generateSourceAndView(data, struct) {
- if (struct.id === 'loot-table') {
+ if (generator === 'loot-table') {
$('#lootTableToolbar').removeClass('d-none');
$('#structure').attr('data-index', 'pools');
return generateTable(data, struct);