diff --git a/custom.css b/custom.css index bb6c5143..1d873ce5 100644 --- a/custom.css +++ b/custom.css @@ -64,3 +64,9 @@ textarea.invalid:focus { max-height: 300px; overflow-x: hidden; } + +#source { + white-space: pre; + overflow-wrap: normal; + overflow-x: scroll; +} diff --git a/index.html b/index.html index 2c5a1ffe..c5dfc7a9 100644 --- a/index.html +++ b/index.html @@ -18,32 +18,34 @@
-
+
- -
+ +
- +
@@ -52,7 +54,7 @@
-
+
@@ -82,931 +84,116 @@
-
-
- - - -
-
-
-
- - - -
- - - - - - - - - +
+
+
+
-
-
- - - + +
+
+
+ +
+ +
+
+
+ + + - - - - - - - - - +
+ + + + + + + + + +
+
+
+ + + +
+ + + + + +
+
+
+ +
+ + + + +
+
+
+ +
+
+ +
-
-
-
- - - +
+
+ +
+
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
- -
-
- -
+
+
-
-
-
- - +
+
+ +
+
-
-
-
- -
- -
-
-
- Count - - -
- - - - - - - - - -
-
-
- - - -
- - - - - - - - - -
-
-
- -
- -
-
-
-
- -
-
- - -
-
-
-
-
-
-
- - - -
- - - - - - - - - -
-
-
- - -
-
-
-
- -
- -
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - - - -
-
- -
-
- -
-
-
- - -
-
-
-
- -
- -
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+
+
+
-
-
-
- -
+
+
- +
- -
-
-
- -
- -
-
-
- - - -
- - - - - - - - - -
-
-
- -
- -
-
-
-
- -
-
- - -
-
-
-
-
-
-
-
-
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- - -
-
-
-
- -
- -
-
-
- -
-
- -
-
-
-
-
- -
-
-
- -
- -
-
-
- -
- -
- -
-
-
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- - - -
- - - - - -
- -
-
-
-
- -
- -
- -
-
-
-
- -
-
- -
- - - - -
-
-
- Y -
- - - - -
-
-
- Z -
- - - - -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
- -
- -
-
-
- -
- -
- -
-
-
-
-
-
- - - - - - - -
-
-
- - - -
- - - - - -
-
-
- - - -
- - - - - -
-
-
- -
- -
-
-
- -
-
+
+
- -
-
-
-
-
- -
- +
-
- - + +
+
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- -
-
- - -
-
-
-
- - - -
- - - - - -
-
-
- - - -
- - - - - -
-
-
- -
-
- - -
-
- -
-
- -
-
-
-
-
-
- -
-
- -
- -
-
-
- - - -
- - - - - -
diff --git a/locales/en.json b/locales/en.json index f71afb5b..8895e6bd 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1,33 +1,53 @@ { "$condition": { - "alternative": "Alternative", - "inverted": "Inverted", - "entity_properties": "Entity Properties", - "block_state_propery": "Block Properties", - "match_tool": "Tool Properties", - "damage_source_properties": "Damage Source", - "location_check": "Location", - "weather_check": "Weather", - "entity_scores": "Entity Scores", - "random_chance": "Random Chance", - "random_chance_with_looting": "Random Chance with Looting", - "table_bonus": "Table Bonus", - "killed_by_player": "Killed by Player", - "survives_explosion": "Survives Explosion" + "$type": { + "alternative": "Alternative", + "inverted": "Inverted", + "entity_properties": "Entity Properties", + "block_state_propery": "Block Properties", + "match_tool": "Tool Properties", + "damage_source_properties": "Damage Source", + "location_check": "Location", + "weather_check": "Weather", + "entity_scores": "Entity Scores", + "random_chance": "Random Chance", + "random_chance_with_looting": "Random Chance with Looting", + "table_bonus": "Table Bonus", + "killed_by_player": "Killed by Player", + "survives_explosion": "Survives Explosion" + }, + "type": "Condition", + "chance": "Chance", + "looting_multiplier": "Looting Multiplier", + "inverse": "Inverted", + "entity": "Entity", + "enchantment": "Enchantment", + "chances": "Chances", + "raining": "Raining", + "thundering": "Thundering", + "block": "Block", + "block_state": "Block State", + "block_state_add": "Add Block State", + "block_state_remove": "Remove Block State", + "score": "Objective", + "score_add": "Add Score", + "score_remove": "Remove Score", + "location": "Location", + "item": "Item", + "damage_source": "Damage Source", + "term": "Term" }, - "$damage": { - "damage_type": "Damage Type", - "projectile": "Projectile", - "explosion": "Explosion", - "fire": "Fire", - "magic": "Magic", - "lightning": "Lightning", - "starvation": "Starvation", - "void": "Void", - "bypass_armor": "Bypass Armor", - "dealt": "Dealt", - "taken": "Taken", - "blocked": "Blocked" + "$damage_source": { + "is_projectile": "Projectile", + "is_explosion": "Explosion", + "is_fire": "Fire", + "is_magic": "Magic", + "is_lightning": "Lightning", + "bypasses_magic": "Starvation", + "bypasses_invulnerability": "Void", + "bypasses_armor": "Bypass Armor", + "direct_entity": "Direct Entity", + "source_entity": "Source Entity" }, "$dimension": { "overworld": "Overworld", @@ -74,8 +94,6 @@ "unbreaking": "Unbreaking" }, "$entry": { - "name": "Name", - "type": "Type", "$type": { "empty": "Empty", "item": "Item", @@ -86,67 +104,86 @@ "group": "Group", "dynamic": "Dynamic" }, + "type": "Type", + "name": "Name", "expand": "Expand", "weight": "Weight", "quality": "Quality" }, "$function": { - "set_count": "Set Count", - "set_damage": "Set Damage", - "set_name": "Set Name", - "set_lore": "Set Lore", - "set_nbt": "Set NBT", - "set_attributes": "Set Attributes", - "set_contents": "Set Contents", - "enchant_randomly": "Enchant Randomly", - "enchant_with_levels": "Enchant With Levels", - "looting_enchant": "Looting Enchant", - "limit_count": "Limit Count", - "furnace_smelt": "Furnace Smelt", - "explosion_decay": "Explosion Decay", - "fill_player_head": "Fill Player Head", - "copy_name": "Copy Name", - "copy_nbt": "Copy NBT", - "apply_bonus": "Apply Bonus", - "$damage": { - "damage": "Damage" - }, - "$ench_rand": { - "ench": "Optional Enchantments" - }, - "$limit": { - "limit": "Limit" - }, - "$name": { - "name": "Name" - }, - "$lore_replace": { - "replace": "Replace" - }, - "$entity": { - "entity": "Entity" - }, - "$operations": { - "add_op": "Add Operation" + "$type": { + "set_count": "Set Count", + "set_data": "Set Data", + "set_damage": "Set Damage", + "set_name": "Set Name", + "set_lore": "Set Lore", + "set_nbt": "Set NBT", + "set_attributes": "Set Attributes", + "set_contents": "Set Contents", + "enchant_randomly": "Enchant Randomly", + "enchant_with_levels": "Enchant With Levels", + "looting_enchant": "Looting Enchant", + "limit_count": "Limit Count", + "furnace_smelt": "Furnace Smelt", + "explosion_decay": "Explosion Decay", + "fill_player_head": "Fill Player Head", + "copy_name": "Copy Name", + "copy_nbt": "Copy NBT", + "apply_bonus": "Apply Bonus", + "exploration_map": "Exploration Map Properties", + "set_stew_effect": "Set Stew Effect" }, + "type": "Function", + "count": "Count", + "data": "Data", + "damage": "Damage", + "name": "Name", + "lore": "Lore", + "nbt": "NBT", + "levels": "Levels", + "treasure": "Treasure", + "limit": "Limit", + "entity": "Entity", + "source": "Source", + "replace": "Replace", + "enchantments": "Optional Enchantments", + "enchantment": "Enchantment", + "formula": "Formula", "$formula": { - "formula": "Formula", "uniform_bonus_count": "Uniform Bonus Count", "binomial_with_bonus_count": "Binomial with Bonus Count", "ore_drops": "Ore Drops" }, - "$bonus_multiplier": { - "multiplier": "Multiplier" - }, - "$bonus_extra": { - "extra": "Extra" - }, - "$bonus_probability": { - "probability": "Propability" - } + "bonusMultiplier": "Multiplier", + "extra": "Extra", + "probability": "Propability", + "destination": "Destination", + "decoration": "Decoration", + "zoom": "Zoom", + "searchRadius": "Search Radius (Chunks)", + "skipExistingChunks": "Skip Existing Chunks" }, - "$modifier": { + "$attribute_modifier": { "attribute": "Attribute", + "name": "Name", + "amount": "Amount", + "operation": "Operation", + "$operation": { + "addition": "Addition", + "multiply_base": "Multiply Base", + "multiply_total": "Multiply Total" + }, + "slots": "Slots" + }, + "$slot": { + "mainhand": "Mainhand", + "offhand": "Offhand", + "head": "Head", + "chest": "Chest", + "legs": "Legs", + "feet": "Feet" + }, + "$attribute": { "generic_maxHealth": "Max Health", "generic_followRange": "Follow Range", "generic_knockbackResistance": "Knockback Resistance", @@ -159,18 +196,9 @@ "horse_jumpStrength": "Jump Strength", "generic_attackKnockback": "Attack Knockback", "generic_flyingSpeed": "Flying Speed", - "zombie_spawnReinforcements": "Spawn Reinforcements", - "name": "Name", - "amount": "Amount", - "operation": "Operation", - "$operation": { - "addition": "Addition", - "multiply_base": "Multiply Base", - "multiply_total": "Multiply Total" - }, - "slots": "Slots" + "zombie_spawnReinforcements": "Spawn Reinforcements" }, - "$operation": { + "$nbt_operation": { "source": "Source", "target": "Target", "operation": "Operation", @@ -187,23 +215,11 @@ "$range": { "exact": "Exact", "range": "Range", - "$range": { - "min": "Min", - "max": "Max" - }, + "min": "Min", + "max": "Max", "binomial": "Binomial", - "$binomial": { - "n": "n", - "p": "p" - } - }, - "$slot": { - "mainhand": "Mainhand", - "offhand": "Offhand", - "head": "Head", - "chest": "Chest", - "legs": "Legs", - "feet": "Feet" + "n": "n", + "p": "p" }, "$source": { "block_entity": "Block Entity", @@ -212,7 +228,6 @@ "killer_player": "Killer Player" }, "$table": { - "type": "Type", "$type": { "empty": "Empty", "entity": "Entity", @@ -220,84 +235,95 @@ "chest": "Chest", "fishing": "Fishing", "generic": "Generic" - } + }, + "type": "Type" + }, + "$entity": { + "type": "Entity", + "nbt": "NBT", + "location": "Location", + "distance": "Distance", + "flags": "Flags", + "isOnFire": "On Fire", + "isSneaking": "Sneaking", + "isSprinting": "Sprinting", + "isSwimming": "Swimming", + "isBaby": "Baby", + "equipment": "Equipment", + "status_effect": "Effects", + "status_effect_add": "Add Effect", + "status_effect_remove": "Remove Effect" + }, + "$location": { + "position": "Position", + "$position": { + "x": "X", + "y": "Y", + "z": "Z" + }, + "biome": "Biome", + "feature": "Feature", + "dimension": "Dimension" + }, + "$distance": { + "x": "X", + "y": "Y", + "z": "Z", + "absolute": "Absolute", + "horizontal": "Horizontal" + }, + "$status_effect": { + "amplifier": "Amplifier", + "duration": "Duration", + "ambient": "Ambient", + "visible": "Visible" + }, + "$potion_effect": { + "type": "Effect", + "duration": "Duration" + }, + "$item": { + "name": "Item ID", + "tag": "Item Tag", + "count": "Count", + "durability": "Durability", + "potion": "Potion", + "nbt": "NBT" }, "2_spaces": "2 Spaces", "4_spaces": "4 Spaces", - "add_block_state": "Add Block State", - "add_child": "Add Child", - "add_condition": "Add Condition", - "add_enchantment": "Add Enchantment", - "add_entry": "Add Entry", - "add_function": "Add Function", - "add_modifier": "Add Modifier", - "add_operation": "Add Operation", - "add_pool": "Add Pool", - "add_score": "Add Score", - "add_term": "Add Term", + "child_add": "Add Child", + "condition_add": "Add Condition", + "enchantment_add": "Add Enchantment", + "entry_add": "Add Entry", + "function_add": "Add Function", + "attribute_modifier_add": "Add Modifier", + "nbt_operation_add": "Add Operation", + "pool_add": "Add Pool", + "potion_effect_add": "Add Effect", + "term_add": "Add Term", "author": "by Misode", - "biome": "Biome", - "block": "Block", - "block_state": "Block State", - "chance": "Chance", - "chance_plural": "Chances", - "child": "Child", - "condition": "Condition", "copy": "Copy", - "count": "Count", - "description": "Loot Table Generator for Minecraft 1.14", - "dimension": "Dimension", - "direct_entity": "Direct Entity", - "durability": "Durability", - "enchantment": "Enchantment", - "entity": "Entity", - "entry": "Entry", + "description": "Loot Table Generator for Minecraft", "false": "False", - "feature": "Feature", - "function": "Function", "hide_source": "Hide Source", - "inverted": "Inverted", - "item": "Item", - "level_plural": "Levels", - "location": "Location", - "looting_multiplier": "Looting Multiplier", "luck_based": "Luck-based", - "modifier": "Modifier", "more": "More", - "name": "Name", - "nbt": "NBT", - "objective": "Objective", - "operation": "Operation", - "pool": "Pool", - "position": "Position", - "potion": "Potion", - "raining": "Raining", "remove": "Remove", - "remove_block_state": "Remove Block State", - "remove_condition": "Remove Condition", - "remove_enchantment": "Remove Enchantment", - "remove_entry": "Remove Entry", - "remove_function": "Remove Function", - "remove_modifier": "Remove Modifier", - "remove_operation": "Remove Operation", - "remove_pool": "Remove Pool", - "remove_score": "Remove Score", - "remove_term": "Remove Term", - "score": "Score", + "condition_remove": "Remove Condition", + "enchantment_remove": "Remove Enchantment", + "entry_remove": "Remove Entry", + "error": "Error", + "function_remove": "Remove Function", + "attribute_modifier_remove": "Remove Modifier", + "nbt_operation_remove": "Remove Operation", + "pool_remove": "Remove Pool", + "potion_effect_remove": "Remove Effect", + "term_remove": "Remove Term", "share": "Share", "show_source": "Show Source", - "source": "Source", - "source_entity": "Source Entity", "tabs": "Tabs", - "tag": "Tag", - "term": "Term", - "thundering": "Thundering", "title": "Loot Table Generator", - "treasure": "Treasure", "true": "True", - "type": "Type", - "unset": "Unset", - "x": "X", - "y": "Y", - "z": "Z" + "unset": "Unset" } diff --git a/locales/ru.json b/locales/ru.json index 14df3899..8999af85 100644 --- a/locales/ru.json +++ b/locales/ru.json @@ -1,33 +1,54 @@ { "$condition": { - "alternative": "Выбор", - "inverted": "Инвертирование", - "entity_properties": "Свойства сущности", - "block_state_propery": "Свойства блока", - "match_tool": "Свойства инструмента", - "damage_source_properties": "Источник урона", - "location_check": "Местоположение", - "weather_check": "Погода", - "entity_scores": "Счёты сущности", - "random_chance": "Случайность", - "random_chance_with_looting": "Случайность с «Добычей»", - "table_bonus": "Бонус таблицы", - "killed_by_player": "Убит игроком", - "survives_explosion": "Переживает взрыв" + "$type": { + "alternative": "Выбор", + "inverted": "Инвертирование", + "entity_properties": "Свойства сущности", + "block_state_propery": "Свойства блока", + "match_tool": "Свойства инструмента", + "damage_source_properties": "Источник урона", + "location_check": "Местоположение", + "weather_check": "Погода", + "entity_scores": "Счёты сущности", + "random_chance": "Случайность", + "random_chance_with_looting": "Случайность с «Добычей»", + "table_bonus": "Бонус таблицы", + "killed_by_player": "Убит игроком", + "survives_explosion": "Переживает взрыв" + }, + "type": "Условие", + "chance": "Шанс", + "looting_multiplier": "Множитель «Добычи»", + "inverse": "Инвертировать", + "entity": "Сущность", + "enchantment": "Чары", + "chances": "Шансы", + "raining": "Дождь", + "thundering": "Гроза", + "block": "Блок", + "block_state": "состояние блока", + "block_state_add": "Добавить состояние блока", + "block_state_remove": "Удалить состояние блока", + "objective": "Задача", + "score": "Счёт", + "score_add": "Добавить счёт", + "score_remove": "Удалить счёт", + "location": "Местоположение", + "item": "Предмет", + "damage_source": "Повреждение", + "term": "Выражение" }, - "$damage": { - "damage_type": "Тип урона", - "projectile": "Снаряд", - "explosion": "Взрыв", - "fire": "Огонь", - "magic": "Магия", - "lightning": "Молния", - "starvation": "Голод", - "void": "Бездна", - "bypass_armor": "Обход брони", - "dealt": "Нанесено", - "taken": "Получено", - "blocked": "Заблокирован" + "$damage_source": { + "is_projectile": "Снаряд", + "is_explosion": "Взрыв", + "is_fire": "Огонь", + "is_magic": "Магия", + "is_lightning": "Молния", + "bypasses_magic": "Голод", + "bypasses_invulnerability": "Бездна", + "bypasses_armor": "Обход брони", + "direct_entity": "Сущность-причина урона", + "source_entity": "Сущность-источник урона" }, "$dimension": { "overworld": "Обычный мир", @@ -74,8 +95,6 @@ "unbreaking": "Прочность" }, "$entry": { - "name": "ID", - "type": "Тип", "$type": { "empty": "Ничего", "item": "Предмет", @@ -86,67 +105,77 @@ "group": "Группа", "dynamic": "Динамический" }, + "type": "Тип", + "name": "ID", "expand": "Отдельно", "weight": "Вес", "quality": "Качество" }, "$function": { - "set_count": "Задать количество", - "set_damage": "Задать повреждение", - "set_name": "Задать имя", - "set_lore": "Задать описание", - "set_nbt": "Задать NBT", - "set_attributes": "Задать атрибуты", - "set_contents": "Задать содержимое", - "enchant_randomly": "Наложить случайные чары", - "enchant_with_levels": "Наложить чары с уровнем", - "looting_enchant": "Чары «Добыча»", - "limit_count": "Ограничить количество", - "furnace_smelt": "Расплавить в печи", - "explosion_decay": "Разрушить взрывом", - "fill_player_head": "Задать скин голове игрока", - "copy_name": "Скопировать имя", - "copy_nbt": "Скопировать NBT", - "apply_bonus": "Применить бонус", - "$damage": { - "damage": "Повреждение" - }, - "$ench_rand": { - "ench": "Чары" - }, - "$limit": { - "limit": "Ограничение" - }, - "$name": { - "name": "Имя" - }, - "$lore_replace": { - "replace": "Заменить старое" - }, - "$entity": { - "entity": "Сущность" - }, - "$operations": { - "add_op": "Добавить действие" + "$type": { + "set_count": "Задать количество", + "set_damage": "Задать повреждение", + "set_name": "Задать имя", + "set_lore": "Задать описание", + "set_nbt": "Задать NBT", + "set_attributes": "Задать атрибуты", + "set_contents": "Задать содержимое", + "enchant_randomly": "Наложить случайные чары", + "enchant_with_levels": "Наложить чары с уровнем", + "looting_enchant": "Чары «Добыча»", + "limit_count": "Ограничить количество", + "furnace_smelt": "Расплавить в печи", + "explosion_decay": "Разрушить взрывом", + "fill_player_head": "Задать скин голове игрока", + "copy_name": "Скопировать имя", + "copy_nbt": "Скопировать NBT", + "apply_bonus": "Применить бонус" }, + "type": "Функция", + "count": "Количество", + "damage": "Повреждение", + "name": "Имя", + "lore": "Описание", + "nbt": "NBT", + "levels": "Уровень", + "treasure": "Чары-сокровища", + "limit": "Ограничение", + "entity": "Сущность", + "source": "Источник", + "replace": "Заменить старое", + "enchantments": "Чары", + "enchantment": "Чары", + "formula": "Формула", "$formula": { - "formula": "Формула", "uniform_bonus_count": "Равномерное распределение", "binomial_with_bonus_count": "Биноминальное распределение", "ore_drops": "Добыча руд" }, - "$bonus_multiplier": { - "multiplier": "Множитель" + "bonus_multiplier": "Множитель", + "extra": "Дополнительное значение", + "probability": "Вероятность" + }, + "$attribute_modifier": { + "attribute": "Атрибут", + "name": "Имя", + "amount": "Количество", + "operation": "Действие", + "$operation": { + "addition": "Прибавление", + "multiply_base": "Умножение базового", + "multiply_total": "Умножение общего" }, - "$bonus_extra": { - "extra": "Дополнительное значение" - }, - "$bonus_probability": { - "probability": "Вероятность" + "slots": "Ячейки", + "$slot": { + "mainhand": "Ведущая рука", + "offhand": "Вторая рука", + "head": "Голова", + "chest": "Тело", + "legs": "Ноги", + "feet": "Стопы" } }, - "$modifier": { - "attribute": "Атрибут", + "$attribute": { "generic_maxHealth": "Максимальное здоровье", "generic_followRange": "Диапазон преследования моба", "generic_knockbackResistance": "Сопротивление отбрасыванию", @@ -159,18 +188,9 @@ "horse_jumpStrength": "Сила прыжка лошади", "generic_attackKnockback": "Отбрасывание", "generic_flyingSpeed": "Скорость полёта", - "zombie_spawnReinforcements": "Подкрепление зомби", - "name": "Имя", - "amount": "Количество", - "operation": "Действие", - "$operation": { - "addition": "Прибавление", - "multiply_base": "Умножение базового", - "multiply_total": "Умножение общего" - }, - "slots": "Ячейки" + "zombie_spawnReinforcements": "Подкрепление зомби" }, - "$operation": { + "$nbt_operation": { "source": "Источник", "target": "Цель", "operation": "Действие", @@ -187,23 +207,11 @@ "$range": { "exact": "Число", "range": "Диапазон", - "$range": { - "min": "Мин.", - "max": "Макс." - }, + "min": "Мин.", + "max": "Макс.", "binomial": "Биномиальное распределение", - "$binomial": { - "n": "n", - "p": "p" - } - }, - "$slot": { - "mainhand": "Ведущая рука", - "offhand": "Вторая рука", - "head": "Голова", - "chest": "Тело", - "legs": "Ноги", - "feet": "Стопы" + "n": "n", + "p": "p" }, "$source": { "block_entity": "Блок-сущность", @@ -212,7 +220,6 @@ "killer_player": "Игрок-убийца" }, "$table": { - "type": "Тип", "$type": { "empty": "Ничего", "entity": "Сущность", @@ -220,84 +227,64 @@ "chest": "Сундук", "fishing": "Рыбалка", "generic": "Общий" - } + }, + "type": "Тип" + }, + "$entity": { + "type": "Сущность", + "nbt": "NBT", + "location": "Местоположение" + }, + "$location": { + "position": "Позиция", + "$position": { + "x": "X", + "y": "Y", + "z": "Z" + }, + "biome": "Биом", + "feature": "Строение", + "dimension": "Измерение" + }, + "$item": { + "name": "ID", + "tag": "Тег", + "count": "Количество", + "durability": "Прочность", + "potion": "Зелье", + "nbt": "NBT" }, "2_spaces": "2 пробела", "4_spaces": "4 пробела", - "add_block_state": "Добавить состояние блока", - "add_child": "Добавить потомка", - "add_condition": "Добавить условие", - "add_enchantment": "Добавить чары", - "add_entry": "Добавить запись", - "add_function": "Добавить функцию", - "add_modifier": "Добавить модификатор", - "add_operation": "Добавить действие", - "add_pool": "Добавить пул", - "add_score": "Добавить счёт", - "add_term": "Добавить выражение", + "child_add": "Добавить потомка", + "condition_add": "Добавить условие", + "enchantment_add": "Добавить чары", + "entry_add": "Добавить запись", + "function_add": "Добавить функцию", + "attribute_modifier_add": "Добавить модификатор", + "nbt_operation_add": "Добавить действие", + "pool_add": "Добавить пул", + "term_add": "Добавить выражение", "author": "Автор: Misode", - "biome": "Биом", - "block": "Блок", - "block_state": "состояние блока", - "chance": "Шанс", - "chance_plural": "Шансы", - "child": "Потомок", - "condition": "Условие", "copy": "Скопировать", - "count": "Количество", - "description": "Генератор таблицы добычи для Minecraft 1.14", - "dimension": "Измерение", - "direct_entity": "Сущность-причина урона", - "durability": "Прочность", - "enchantment": "Чары", - "entity": "Сущность", - "entry": "Запись", + "description": "Генератор таблицы добычи для Minecraft", "false": "Нет", - "feature": "Строение", - "function": "Функция", "hide_source": "Скрыть источник", - "inverted": "Инвертировать", - "item": "Предмет", - "level_plural": "Уровень", - "location": "Местоположение", - "looting_multiplier": "Множитель «Добычи»", "luck_based": "Основано на удаче", - "modifier": "Модификатор", "more": "Больше", - "name": "ID", - "nbt": "NBT", - "objective": "Задача", - "operation": "Действие", - "pool": "Пул", - "position": "Позиция", - "potion": "Зелье", - "raining": "Дождь", "remove": "Удалить", - "remove_block_state": "Удалить состояние блока", - "remove_condition": "Удалить условие", - "remove_enchantment": "Удалить чары", - "remove_entry": "Удалить запись", - "remove_function": "Удалить функцию", - "remove_modifier": "Удалить модификатор", - "remove_operation": "Удалить действие", - "remove_pool": "Удалить пул", - "remove_score": "Удалить счёт", - "remove_term": "Удалить выражение", - "score": "Счёт", + "condition_remove": "Удалить условие", + "enchantment_remove": "Удалить чары", + "entry_remove": "Удалить запись", + "function_remove": "Удалить функцию", + "attribute_modifier_remove": "Удалить модификатор", + "nbt_operation_remove": "Удалить действие", + "pool_remove": "Удалить пул", + "term_remove": "Удалить выражение", "share": "Поделиться", "show_source": "Показать источник", - "source": "Источник", - "source_entity": "Сущность-источник урона", "tabs": "Табуляция", - "tag": "Тег", - "term": "Выражение", - "thundering": "Гроза", "title": "Генератор таблицы добычи", - "treasure": "Чары-сокровища", "true": "Да", - "type": "Тип", - "unset": "Не задано", - "x": "X", - "y": "Y", - "z": "Z" + "unset": "Не задано" } diff --git a/locales/zh-CN.json b/locales/zh-CN.json index c653b55b..9699652f 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -1,33 +1,54 @@ { "$condition": { - "alternative": "析取范式", - "inverted": "取反", - "entity_properties": "实体属性", - "block_state_propery": "方块属性", - "match_tool": "工具属性", - "damage_source_properties": "伤害源", - "location_check": "位置", - "weather_check": "天气", - "entity_scores": "实体分数", - "random_chance": "随机概率", - "random_chance_with_looting": "受抢夺附魔影响的随机概率", - "table_bonus": "附魔奖励", - "killed_by_player": "被玩家击杀", - "survives_explosion": "未被爆炸破坏" + "$type": { + "alternative": "析取范式", + "inverted": "取反", + "entity_properties": "实体属性", + "block_state_propery": "方块属性", + "match_tool": "工具属性", + "damage_source_properties": "伤害源", + "location_check": "位置", + "weather_check": "天气", + "entity_scores": "实体分数", + "random_chance": "随机概率", + "random_chance_with_looting": "受抢夺附魔影响的随机概率", + "table_bonus": "附魔奖励", + "killed_by_player": "被玩家击杀", + "survives_explosion": "未被爆炸破坏" + }, + "type": "条件", + "chance": "机率", + "looting_multiplier": "每级抢夺附魔增加的数", + "inverse": "取反", + "entity": "实体", + "enchantment": "附魔", + "chances": "机率", + "raining": "下雨", + "thundering": "雷雨", + "block": "方块", + "block_state": "方块状态", + "block_state_add": "添加方块状态", + "block_state_remove": "移除方块状态", + "objective": "计分项", + "score": "分数", + "score_add": "添加分数", + "score_remove": "移除分数", + "location": "位置", + "item": "物品", + "damage_source": "损伤值", + "term": "条件" }, - "$damage": { - "damage_type": "伤害类型", - "projectile": "弹射物", - "explosion": "爆炸", - "fire": "燃烧", - "magic": "魔法", - "lightning": "雷击", - "starvation": "饥饿", - "void": "虚空", - "bypass_armor": "破甲", - "dealt": "被防御前的伤害", - "taken": "实际造成的伤害", - "blocked": "被盾牌阻挡" + "$damage_source": { + "is_projectile": "弹射物", + "is_explosion": "爆炸", + "is_fire": "燃烧", + "is_magic": "魔法", + "is_lightning": "雷击", + "bypasses_magic": "饥饿", + "bypasses_invulnerability": "虚空", + "bypasses_armor": "破甲", + "direct_entity": "直接来源实体", + "source_entity": "根本来源实体" }, "$dimension": { "overworld": "主世界", @@ -74,8 +95,6 @@ "unbreaking": "耐久" }, "$entry": { - "name": "名称", - "type": "类型", "$type": { "empty": "空", "item": "物品", @@ -86,67 +105,82 @@ "group": "组", "dynamic": "动态" }, + "type": "类型", + "name": "名称", "expand": "展开", "weight": "权重", "quality": "每级幸运对权重的影响" }, "$function": { - "set_count": "设置物品数量", - "set_damage": "设置损伤值", - "set_name": "设置物品名", - "set_lore": "设置下标", - "set_nbt": "设置 NBT", - "set_attributes": "设置属性", - "set_contents": "设置内容物", - "enchant_randomly": "随机附魔", - "enchant_with_levels": "给予等价于经验等级的随机附魔", - "looting_enchant": "根据抢夺附魔调整物品数量", - "limit_count": "限制堆叠数量", - "furnace_smelt": "熔炉熔炼", - "explosion_decay": "爆炸损耗", - "fill_player_head": "填充玩家头颅", - "copy_name": "复制方块实体显示名", - "copy_nbt": "复制 NBT", - "apply_bonus": "应用奖励公式", - "$damage": { - "damage": "损伤值" - }, - "$ench_rand": { - "ench": "可选附魔" - }, - "$limit": { - "limit": "限制" - }, - "$name": { - "name": "名称" - }, - "$lore_replace": { - "replace": "覆盖" - }, - "$entity": { - "entity": "实体" - }, - "$operations": { - "add_op": "添加操作" + "$type": { + "set_count": "设置物品数量", + "set_damage": "设置损伤值", + "set_name": "设置物品名", + "set_lore": "设置下标", + "set_nbt": "设置 NBT", + "set_attributes": "设置属性", + "set_contents": "设置内容物", + "enchant_randomly": "随机附魔", + "enchant_with_levels": "给予等价于经验等级的随机附魔", + "looting_enchant": "根据抢夺附魔调整物品数量", + "limit_count": "限制堆叠数量", + "furnace_smelt": "熔炉熔炼", + "explosion_decay": "爆炸损耗", + "fill_player_head": "填充玩家头颅", + "copy_name": "复制方块实体显示名", + "copy_nbt": "复制 NBT", + "apply_bonus": "应用奖励公式" }, + "type": "函数", + "count": "数量", + "damage": "损伤值", + "name": "名称", + "lore": "下标", + "nbt": "NBT", + "levels": "等级", + "treasure": "宝藏型附魔", + "limit": "限制", + "entity": "实体", + "source": "源", + "replace": "覆盖", + "enchantments": "可选附魔", + "enchantment": "附魔", + "formula": "公式", "$formula": { - "formula": "公式", "uniform_bonus_count": "带奖励数量的均匀分布", "binomial_with_bonus_count": "带奖励数量的二项分布", "ore_drops": "矿物掉落" }, - "$bonus_multiplier": { - "multiplier": "乘数" + "bonusMultiplier": "乘数", + "extra": "额外值", + "probability": "概率", + "destination": "目标", + "decoration": "图标", + "zoom": "缩放等级", + "searchRadius": "搜寻半径", + "skipExistingChunks": "跳过已生成区块" + }, + "$attribute_modifier": { + "attribute": "属性", + "name": "名称", + "amount": "数额", + "operation": "运算模式", + "$operation": { + "addition": "加减数额", + "multiply_base": "乘以数额", + "multiply_total": "乘以(数额 + 1)" }, - "$bonus_extra": { - "extra": "额外值" - }, - "$bonus_probability": { - "probability": "概率" + "slots": "栏位", + "$slot": { + "mainhand": "主手", + "offhand": "副手", + "head": "头", + "chest": "胸", + "legs": "腿", + "feet": "脚" } }, - "$modifier": { - "attribute": "属性", + "$attribute": { "generic_maxHealth": "最大生命值", "generic_followRange": "追踪范围", "generic_knockbackResistance": "抗击退效果", @@ -159,18 +193,9 @@ "horse_jumpStrength": "弹跳力", "generic_attackKnockback": "击退距离", "generic_flyingSpeed": "飞行速度", - "zombie_spawnReinforcements": "连带生成新僵尸的可能性", - "name": "名称", - "amount": "数额", - "operation": "运算模式", - "$operation": { - "addition": "加减数额", - "multiply_base": "乘以数额", - "multiply_total": "乘以(数额 + 1)" - }, - "slots": "栏位" + "zombie_spawnReinforcements": "连带生成新僵尸的可能性" }, - "$operation": { + "$nbt_operation": { "source": "复制源", "target": "复制目标", "operation": "操作类型", @@ -187,23 +212,11 @@ "$range": { "exact": "精确值", "range": "范围", - "$range": { - "min": "最小值", - "max": "最大值" - }, + "min": "最小值", + "max": "最大值", "binomial": "二项分布", - "$binomial": { - "n": "n", - "p": "p" - } - }, - "$slot": { - "mainhand": "主手", - "offhand": "副手", - "head": "头", - "chest": "胸", - "legs": "腿", - "feet": "脚" + "n": "n", + "p": "p" }, "$source": { "block_entity": "方块实体", @@ -212,7 +225,6 @@ "killer_player": "击杀者玩家" }, "$table": { - "type": "战利品表类型", "$type": { "empty": "空", "entity": "实体", @@ -220,84 +232,64 @@ "chest": "箱子", "fishing": "钓鱼", "generic": "通用" - } + }, + "type": "战利品表类型" + }, + "$entity": { + "type": "实体", + "nbt": "NBT", + "location": "位置" + }, + "$location": { + "position": "位置", + "$position": { + "x": "X 坐标", + "y": "Y 坐标", + "z": "Z 坐标" + }, + "biome": "生物群系", + "feature": "结构", + "dimension": "维度" + }, + "$item": { + "name": "名称", + "tag": "标签", + "count": "数量", + "durability": "耐久度", + "potion": "药水", + "nbt": "NBT" }, "2_spaces": "2 空格缩进", "4_spaces": "4 空格缩进", - "add_block_state": "添加方块状态", - "add_child": "添加子项目", - "add_condition": "添加条件", - "add_enchantment": "添加附魔", - "add_entry": "添加项目", - "add_function": "添加函数", - "add_modifier": "添加属性修饰器", - "add_operation": "添加操作", - "add_pool": "添加随机池", - "add_score": "添加分数", - "add_term": "添加条件", + "child_add": "添加子项目", + "condition_add": "添加条件", + "enchantment_add": "添加附魔", + "entry_add": "添加项目", + "function_add": "添加函数", + "modifier_add": "添加属性修饰器", + "nbt_operation_add": "添加操作", + "pool_add": "添加随机池", + "term_add": "添加条件", "author": "作者 @Misode", - "biome": "生物群系", - "block": "方块", - "block_state": "方块状态", - "chance": "机率", - "chance_plural": "机率", - "child": "子项目", - "condition": "条件", "copy": "复制", - "count": "数量", - "description": "适用于 Minecraft 1.14 的战利品表生成器", - "dimension": "维度", - "direct_entity": "直接来源实体", - "durability": "耐久度", - "enchantment": "附魔", - "entity": "实体", - "entry": "项目", + "description": "Minecraft 战利品表生成器", "false": "否", - "feature": "结构", - "function": "函数", "hide_source": "隐藏源代码", - "inverted": "取反", - "item": "物品", - "level_plural": "等级", - "location": "位置", - "looting_multiplier": "每级抢夺附魔增加的数", "luck_based": "受幸运等级影响", - "modifier": "属性修饰器", "more": "更多选项", - "name": "名称", - "nbt": "NBT", - "objective": "计分项", - "operation": "操作", - "pool": "随机池", - "position": "位置", - "potion": "药水", - "raining": "下雨", "remove": "移除", - "remove_block_state": "移除方块状态", - "remove_condition": "移除条件", - "remove_enchantment": "移除附魔", - "remove_entry": "移除项目", - "remove_function": "移除函数", - "remove_modifier": "移除属性修饰器", - "remove_operation": "移除操作", - "remove_pool": "移除随机池", - "remove_score": "移除分数", - "remove_term": "移除条件", - "score": "分数", + "condition_remove": "移除条件", + "enchantment_remove": "移除附魔", + "entry_remove": "移除项目", + "function_remove": "移除函数", + "modifier_remove": "移除属性修饰器", + "nbt_operation_remove": "移除操作", + "pool_remove": "移除随机池", + "term_remove": "移除条件", "share": "分享", "show_source": "显示源代码", - "source": "源", - "source_entity": "根本来源实体", "tabs": "Tab 缩进", - "tag": "标签", - "term": "条件", - "thundering": "雷雨", "title": "战利品表生成器", - "treasure": "宝藏型附魔", "true": "是", - "type": "类型", - "unset": "未指定", - "x": "X 坐标", - "y": "Y 坐标", - "z": "Z 坐标" + "unset": "未指定" } diff --git a/model.js b/model.js index 10148024..3b27161a 100644 --- a/model.js +++ b/model.js @@ -5,13 +5,25 @@ $('#tableType').val("minecraft:generic"); $('#indentationSelect').val("2"); let indentation = 2; -let luck_based = false; +let luckBased = false; let table = { type: "minecraft:generic", - pools: [] + pools: [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] }; -addPool(); -addEntry($('#structure .pool').get()); +let historyBuffer = 100; +let history = ['{}']; +let historyIndex = 0; +invalidated(); const params = new URLSearchParams(window.location.search); if (params.has('q')) { @@ -25,13 +37,52 @@ if (params.has('q')) { $('.container').removeClass('d-none'); } +$(document).keydown(function(e){ + if (e.which === 89 && e.ctrlKey ){ + redo(); + } else if (e.which === 90 && e.ctrlKey ){ + undo(); + } +}); + +function undo() { + if (historyIndex > 0) { + historyIndex -= 1; + table = JSON.parse(history[historyIndex]); + updateView(); + } +} + +function redo() { + if (historyIndex < history.length - 1) { + historyIndex += 1; + table = JSON.parse(history[historyIndex]); + updateView(); + } +} + +function invalidated() { + if (historyIndex === history.length - 1) { + history.push(JSON.stringify(table)); + if (history.length > historyBuffer) { + history = history.slice(-historyBuffer); + } + historyIndex = history.length - 1; + } else { + historyIndex += 1; + history = history.slice(0, historyIndex); + history.push(JSON.stringify(table)); + } + updateView(); +} + function updateTableType() { table.type = $('#tableType').val(); invalidated(); } function updateLuckBased() { - luck_based = $('#luckBased').prop('checked'); + luckBased = $('#luckBased').prop('checked'); invalidated(); } @@ -94,134 +145,145 @@ function copySource(el) { document.execCommand('copy'); } -function getParent(el) { - let $node = $(el).closest('[data-field]'); - let fields = $node.attr('data-field').split('.'); - if (fields.length === 1 && fields[0] === 'table') { - return table; - } - if ($node.attr('data-type')) { - fields = fields.slice(0, -1); - } - let node = getParent($node.parent()); - for (let f of fields) { - if (f.endsWith('[]')) { - f = f.slice(0, -2); - let index = $node.attr('data-index'); - node = node[f][index]; - } else { - if (node[f] === undefined) { - node[f] = {}; - } - node = node[f]; +function getPath(el) { + let $node = $(el).closest('[data-index]'); + let index = $node.attr('data-index'); + if (index === 'table') return []; + let parent = getPath($node.parent()); + parent = parent.concat(index.split('.')); + return parent; +} + +function getNode(path) { + let node = table; + for (let index of path) { + if (!isNaN(index)) { + index = +index; + } else if (node[index] === undefined) { + node[index] = {}; } + node = node[index]; } return node; } +function getType(el) { + let $field = $(el).closest('[data-index]'); + if ($field) { + return $field.attr('data-type'); + } +} + +function getParent(el) { + let path = getPath(el); + path.pop(); + return getNode(path); +} + function getSuperParent(el) { - let $parent = $(el).closest('[data-field]'); - return getParent($parent.parent()); + let path = getPath(el); + path.pop(); + path.pop(); + return getNode(path); } -function setField(node, field, value) { - let fields = field.split('.'); - let last = fields.splice(-1)[0]; - for (let f of fields) { - node = node[f]; +function addComponent(el, array) { + let node = getNode(getPath(el)); + if (!node[array]) { + node[array] = []; } - node[last] = value; -} - -function deleteField(node, field) { - let fields = field.split('.'); - let last = fields.splice(-1)[0]; - for (let f of fields) { - node = node[f]; - } - delete node[last]; -} - -function getField(node, field) { - let fields = field.split('.'); - let last = fields.splice(-1)[0]; - for (let f of fields) { - node = node[f]; - } - return node[last]; -} - -function getIndex(el) { - let $parent = $(el).closest('[data-field]'); - return parseInt($parent.attr('data-index')); -} - -function addPool(el) { - if (!table.pools) { - table.pools = []; - } - table.pools.push({ - rolls: 1 - }); + node[array].push({}); invalidated(); } -function addEntry(el) { - let pool = getParent(el); - if (!pool.entries) { - pool.entries = []; +function removeComponent(el) { + let path = getPath(el); + let index = path.pop(); + let array = path.pop(); + let node = getNode(path); + node[array].splice(index, 1); + if (node[array].length === 0) { + delete node[array]; } - pool.entries.push({ - type: "minecraft:item", - name: "minecraft:stone" - }); invalidated(); } -function addChild(el) { - let entry = getParent(el); - if (!entry.children) { - entry.children = []; - } - entry.children.push({ - type: "minecraft:item", - name: "minecraft:stone" - }); - invalidated(); -} - -function addFunction(el) { - let entry = getParent(el); - if (!entry.functions) { - entry.functions = []; - } - entry.functions.push({ - function: "minecraft:set_count" - }); - invalidated(); -} - -function addCondition(el) { +function addToSet(el, array) { let parent = getParent(el); - if (!parent.conditions) { - parent.conditions = []; + if (!parent[array]) { + parent[array] = []; + } + parent[array].push($(el).attr('value')); + invalidated(); +} + +function removeFromSet(el, array) { + let parent = getParent(el); + let index = parent[array].indexOf($(el).attr('value')); + if (index > -1) { + parent[array].splice(index, 1); + invalidated(); + } +} + +function addToMap(el) { + let node = getParent(el); + let $field = $(el).closest('[data-index]'); + let key = $field.find('input').val(); + let map = $field.attr('data-index'); + let type = $field.attr('data-item-type'); + if (key.length === 0) { + return; + } + if (!node[map]) { + node[map] = {}; + } + if (type === 'int' || type === 'float' || type === 'random' || type === 'range' || type === 'boundary') { + node[map][key] = 0; + } else if (type === 'boolean') { + node[map][key] = false; + } else if (type === 'object') { + node[map][key] = {}; + } else { + node[map][key] = ""; + } + invalidated(); +} + +function removeFromMap(el) { + let path = getPath(el); + let key = path.pop(); + let node = getNode(path); + delete node[key]; + if (Object.keys(node).length === 0) { + let field = path.pop(); + let parent = getNode(path); + delete parent[field]; + } + invalidated(); +} + +function toggleCollapseObject(el) { + let path = getPath(el); + let index = path.pop(); + let node = getNode(path); + if (!node[index]) { + node[index] = {}; + } else { + delete node[index]; } - parent.conditions.push({ - condition: "minecraft:random_chance", - chance: 0.5 - }); invalidated(); } function updateField(el) { - let $field = $(el).closest('[data-field]'); - let fields = $field.attr('data-field'); - let field = fields.split('.').slice(-1)[0]; - let type = $field.attr('data-type'); - let node = getParent(el); + let path = getPath(el); + let $field = $(el).closest('[data-index]'); + let field = path.pop(); + let node = getNode(path); + let type = getType(el); let value = undefined; - if (type === 'string' || type === 'int' || type === 'float' || type === 'enum' || type === 'json' || type === 'nbt') { + if (type === 'string' || type === 'int' || type === 'float' || type === 'enum' || type === 'json' || type === 'nbt' || type === 'chance-list') { value = $(el).val(); } if (type === 'int') { @@ -234,6 +296,24 @@ function updateField(el) { if (isNaN(value)) { value = ''; } + } else if (type === 'chance-list') { + value = '[' + value + ']'; + try { + value = JSON.parse(value); + for (let i = 0; i < value.length; i += 1) { + if (value[i] > 1) { + value[i] = 1; + } else if (value[i] < 0) { + value[i] = 0; + } + } + } catch(e) { + value = []; + } + } else if (type === 'enum') { + if (value === 'unset') { + value = ''; + } } else if (type === 'nbt') { if (!value.startsWith('{')) { @@ -244,7 +324,18 @@ function updateField(el) { } } else if (type === 'json') { value = parseJSONValue(value) - } else if (type === 'range') { + } else if (type === 'json-list') { + let value = []; + for (let line of $(el).val().split('\n')) { + value.push(parseJSONValue(line)); + } + if (value.length === 0) { + value = ''; + } + } else if (type === 'range' || type === 'random' || type === 'boundary') { + if (type === 'boundary' && node[field] === undefined) { + node[field] = {}; + } value = getRangeValue($field, node[field]); } else if (type === 'checkbox') { value = $(el).prop('checked'); @@ -252,43 +343,30 @@ function updateField(el) { value = getBooleanValue(node[field], ($(el).val() === 'true')); } if (value === '') { - deleteField(node, field); + delete node[field]; } else { - setField(node, field, value); - } - invalidated(); -} - -function removeField(el) { - let node = getSuperParent(el); - let $field = $(el).closest('[data-field]'); - let index = $field.attr('data-index'); - let last = $field.attr('data-field').slice(0, -2); - node[last].splice(index, 1); - if (node[last].length === 0) { - delete node[last]; + node[field] = value; } invalidated(); } function updateRangeType(el) { - let $field = $(el).closest('[data-field]'); - let field = $field.attr('data-field'); + let path = getPath(el); + let field = path.pop(); + let node = getNode(path); let type = $(el).attr('value'); if (type === 'range') { - setField(getParent(el), field, {}); + node[field] = {}; } else if (type === 'binomial') { - setField(getParent(el), field, {type: "minecraft:binomial"}); + node[field] = {type: "minecraft:binomial"}; } else { - setField(getParent(el), field, 0); + node[field] = 0; } updateField(el); } function getRangeValue($field, data) { - console.log(data); if (typeof data === 'object') { - console.log('object'); if (data.type && data.type.match(/(minecraft:)?binomial/)) { let n = $field.find('.binomial.n').val(); let p = $field.find('.binomial.p').val(); @@ -305,7 +383,6 @@ function getRangeValue($field, data) { else delete data.max; } } else { - console.log('else'); data = parseFloat($field.find('.exact').val()); if (isNaN(data)) { data = ''; @@ -324,119 +401,6 @@ function getBooleanValue(oldvalue, newvalue) { } } -function addEnchantment(el) { - let func = getParent(el); - let enchantment = $(el).attr('data-ench'); - if (!func.enchantments) { - func.enchantments = []; - } - func.enchantments.push(enchantment); - invalidated(); -} - -function removeEnchantment(el) { - let func = getParent(el); - let ench = $(el).attr('data-ench'); - let index = func.enchantments.indexOf(ench); - if (index > -1) { - func.enchantments.splice(index, 1); - if (func.enchantments.length === 0) { - delete func.enchantments; - } - invalidated(); - } -} - -function addModifier(el) { - let func = getParent(el); - if (!func.modifiers) { - func.modifiers = []; - } - func.modifiers.push({ - attribute: 'generic.attackDamage', - name: 'Attack Damage', - amount: 1, - operation: 'addition', - slot: [] - }); - invalidated(); -} - -function addModifierSlot(el) { - let modifier = getParent(el); - if (!modifier.slot) { - modifier.slot = []; - } - modifier.slot.push($(el).attr('data-slot')); - invalidated(); -} - -function removeModifierSlot(el) { - let modifier = getParent(el); - let slot = $(el).attr('data-slot'); - let index = modifier.slot.indexOf(slot); - if (index > -1) { - modifier.slot.splice(index, 1); - invalidated(); - } -} - -function addScore(el) { - let condition = getParent(el); - let objective = $(el).closest('.condition-entity-scores').find('input').val(); - if (!objective.length) { - return; - } - if (!condition.scores) { - condition.scores = {}; - } - condition.scores[objective] = 1; - invalidated(); -} - -function removeScore(el) { - let objective = $(el).closest('.score').attr('data-objective'); - delete getParent(el).scores[objective]; - invalidated(); -} - -function updateScoreType(el, type) { - let objective = $(el).closest('.score').attr('data-objective'); - if (type === 'range') { - getParent(el).scores[objective] = {}; - } else if (type === 'binomial') { - getParent(el).scores[objective] = {type: "minecraft:binomial"}; - } else { - getParent(el).scores[objective] = 0; - } - updateScoreField(el); -} - -function updateScoreField(el) { - let parent = getParent(el); - let objective = $(el).closest('.score').attr('data-objective'); - let data = parent.scores[objective]; - let $range = $(el).closest('[data-type="range"]'); - if (typeof data === 'object') { - let min = $range.find('.range.min').val(); - let max = $range.find('.range.max').val(); - if (min) { - data.min = parseInt(min); - } else { - delete data.min; - } - if (max) { - data.max = parseInt(max); - } else { - delete data.max; - } - } else { - data = parseInt($range.find('.exact').val()); - } - parent.scores[objective] = data; - invalidated(); -} - function parseJSONValue(value) { if (value.startsWith('"') || value.startsWith('{') || value.startsWith('[')) { try { @@ -447,167 +411,3 @@ function parseJSONValue(value) { } return value; } - -function updateLoreField(el) { - let lines = $(el).val().split('\n'); - let parent = getParent(el); - parent.lore = []; - for (let line of lines) { - parent.lore.push(parseJSONValue(line)); - } - invalidated(); -} - -function addOperation(el) { - let func = getParent(el); - if (!func.ops) { - func.ops = []; - } - func.ops.push({ - source: '', - target: '', - op: 'replace' - }); - invalidated(); -} - -function removeOperation(el) { - let index = parseInt($(el).closest('.operation').attr('data-index')); - getSuperParent(el).ops.splice(index, 1); - invalidated(); -} - -function addBlockProperty(el) { - let func = getParent(el); - let blockstate = $(el).closest('.condition-block-properties').find('input').val(); - if (!func.properties) { - func.properties = {}; - } - func.properties[blockstate] = ''; - invalidated(); -} - -function removeBlockProperty(el) { - let blockstate = $(el).closest('.block-property').attr('data-blockstate'); - delete getParent(el).properties[blockstate]; - invalidated(); -} - -function updateBlockPropertyField(el) { - let blockstate = $(el).closest('.block-property').attr('data-blockstate'); - getParent(el).properties[blockstate] = $(el).val(); - invalidated(); -} - -function addTerm(el) { - let condition = getParent(el); - if (!condition.terms) { - condition.terms = []; - } - condition.terms.push({ - condition: "minecraft:random_chance", - chance: 0.5 - }); - invalidated(); -} - -function togglePosition(el) { - let parent = getParent(el); - if (parent.position) { - delete parent.position; - } else { - parent.position = {}; - } - invalidated(); -} - -function toggleEntityLocation(el) { - let parent = getParent(el); - if (parent.location) { - delete parent.location; - } else { - parent.location = {}; - } - invalidated(); -} - -function updateItemType(el, type) { - let $predicate = $(el).closest('.predicate'); - if (type === 'item') { - $predicate.find('.item').removeClass('d-none'); - $predicate.find('.tag').addClass('d-none'); - } else { - $predicate.find('.tag').removeClass('d-none'); - $predicate.find('.item').addClass('d-none'); - } -} - -function updateItemField(el, type) { - let parent = getParent(el); - if (type === 'item') { - parent.item = $(el).closest('.predicate').find('input.item').val(); - delete parent.tag; - } else { - parent.tag = $(el).closest('.predicate').find('input.tag').val(); - delete parent.item; - } - invalidated(); -} - -function toggleDamageFlags(el) { - let parent = getParent(el); - if (parent.type) { - delete parent.type; - } else { - parent.type = {}; - } - invalidated(); -} - -function toggleSourceEntity(el) { - let parent = getParent(el); - if (parent.source_entity) { - delete parent.source_entity; - } else { - parent.source_entity = {}; - } - invalidated(); -} - -function toggleDirectEntity(el) { - let parent = getParent(el); - if (parent.direct_entity) { - delete parent.direct_entity; - } else { - parent.direct_entity = {}; - } - invalidated(); -} - -function updateChancesField(el) { - let parent = getParent(el); - let chances = '[' + $(el).val() + ']'; - try { - parent.chances = JSON.parse(chances); - for (let i = 0; i < parent.chances.length; i += 1) { - if (parent.chances[i] > 1) { - parent.chances[i] = 1; - } - } - } catch(e) { - parent.chances = []; - } - invalidated(); -} - -function addConditionEnchantment(el) { - let condition = getParent(el); - if (!condition.enchantments) { - condition.enchantments = []; - } - condition.enchantments.push({ - enchantment: 'minecraft:silk_touch', - level: 1 - }); - invalidated(); -} diff --git a/schemas/1.13.json b/schemas/1.13.json new file mode 100644 index 00000000..e5aaf88c --- /dev/null +++ b/schemas/1.13.json @@ -0,0 +1,788 @@ +{ + "root": { + "fields": [ + { + "id": "pools", + "type": "array", + "translate": "pool", + "values": "pool" + } + ] + }, + "components": [ + { + "id": "pool", + "type": "object", + "color": "success", + "fields": [ + { + "id": "rolls", + "type": "range", + "translate": "$pool.rolls" + }, + { + "id": "bonus_rolls", + "type": "range", + "translate": "$pool.bonus_rolls", + "luckBased": true + }, + { + "id": "entries", + "type": "array", + "translate": "entry", + "values": "entry", + "button": "header" + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "entry", + "type": "object", + "color": "light", + "fields": [ + { + "id": "type", + "type": "enum", + "translate": "$entry.type", + "translateValue": "$entry.$type", + "default": "minecraft:item", + "values": [ + "minecraft:empty", + "minecraft:item", + "minecraft:loot_table" + ] + }, + { + "id": "name", + "type": "string", + "translate": "$entry.name", + "require": [ + "minecraft:item", + "minecraft:loot_table" + ] + }, + { + "id": "weight", + "type": "range", + "translate": "$entry.weight" + }, + { + "id": "quality", + "type": "range", + "translate": "$entry.quality", + "luckBased": true + }, + { + "id": "functions", + "type": "array", + "translate": "function", + "values": "function", + "button": "header" + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "function", + "type": "object", + "color": "secondary", + "fields": [ + { + "id": "function", + "type": "enum", + "translate": "$function.type", + "translateValue": "$function.$type", + "default": "minecraft:set_count", + "values": [ + "minecraft:set_count", + "minecraft:set_data", + "minecraft:set_damage", + "minecraft:set_nbt", + "minecraft:set_attributes", + "minecraft:enchant_randomly", + "minecraft:enchant_with_levels", + "minecraft:looting_enchant", + "minecraft:furnace_smelt" + ] + }, + { + "id": "count", + "type": "range", + "translate": "$function.count", + "require": [ + "minecraft:set_count", + "minecraft:looting_enchant" + ] + }, + { + "id": "data", + "type": "range", + "translate": "$function.data", + "require": [ + "minecraft:set_data" + ] + }, + { + "id": "damage", + "type": "range", + "translate": "$function.damage", + "require": [ + "minecraft:set_damage" + ] + }, + { + "id": "tag", + "type": "nbt", + "translate": "$function.nbt", + "require": [ + "minecraft:set_nbt" + ] + }, + { + "id": "levels", + "type": "range", + "translate": "$function.levels", + "require": [ + "minecraft:enchant_with_levels" + ] + }, + { + "id": "treasure", + "type": "boolean", + "translate": "$function.treasure", + "default": false, + "require": [ + "minecraft:enchant_with_levels" + ] + }, + { + "id": "limit", + "type": "int", + "translate": "$function.limit", + "require": [ + "minecraft:looting_enchant" + ] + }, + { + "id": "enchantments", + "type": "set", + "translate": "$function.enchantments", + "translateValue": "$enchantment", + "values": "enchantments", + "require": [ + "minecraft:enchant_randomly" + ] + }, + { + "id": "modifiers", + "type": "array", + "translate": "attribute_modifier", + "button": "field", + "values": "attribute_modifier", + "require": [ + "minecraft:set_attributes" + ] + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "condition", + "type": "object", + "color": "info", + "fields": [ + { + "id": "condition", + "type": "enum", + "translate": "$condition.type", + "translateValue": "$condition.$type", + "default": "minecraft:random_chance", + "values": [ + "minecraft:random_chance", + "minecraft:random_chance_with_looting", + "minecraft:killed_by_player", + "minecraft:entity_properties", + "minecraft:entity_scores" + ] + }, + { + "id": "chance", + "type": "float", + "translate": "$condition.chance", + "require": [ + "minecraft:random_chance", + "minecraft:random_chance_with_looting" + ] + }, + { + "id": "looting_multiplier", + "type": "float", + "translate": "$condition.looting_multiplier", + "require": [ + "minecraft:random_chance_with_looting" + ] + }, + { + "id": "inverse", + "type": "boolean", + "translate": "$condition.inverse", + "default": false, + "require": [ + "minecraft:killed_by_player" + ] + }, + { + "id": "entity", + "type": "enum", + "translate": "$condition.entity", + "translateValue": "$source", + "default": "this", + "values": [ + "this", + "killer", + "killer_player" + ], + "require": [ + "minecraft:entity_properties", + "minecraft:entity_scores" + ] + }, + { + "id": "scores", + "type": "map", + "translate": "$condition.score", + "values": { + "type": "range" + }, + "require": [ + "minecraft:entity_scores" + ] + }, + { + "id": "predicate", + "type": "object", + "translate": "entity", + "value": "entity", + "require": [ + "minecraft:entity_properties" + ] + } + ] + }, + { + "id": "attribute_modifier", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "attribute", + "type": "enum", + "translate": "$attribute_modifier.attribute", + "translateValue": "$attribute", + "default": "generic.attackDamage", + "values": [ + "generic.maxHealth", + "generic.followRange", + "generic.knockbackResistance", + "generic.movementSpeed", + "generic.attackDamage", + "generic.armor", + "generic.armorToughness", + "generic.attackSpeed", + "generic.luck", + "horse.jumpStrength", + "generic.attackKnockback", + "generic.flyingSpeed", + "zombie.spawnReinforcements" + ] + }, + { + "id": "name", + "type": "string", + "translate": "$attribute_modifier.name" + }, + { + "id": "amount", + "type": "float", + "translate": "$attribute_modifier.amount" + }, + { + "id": "operation", + "type": "enum", + "translate": "$attribute_modifier.operation", + "translateValue": "$attribute_modifier.$operation", + "default": "addition", + "values": [ + "addition", + "multiply_base", + "multiply_total" + ] + }, + { + "id": "slots", + "type": "set", + "translate": "$attribute_modifier.slots", + "translateValue": "$attribute_modifier.$slot", + "values": [ + "mainhand", + "offhand", + "head", + "chest", + "legs", + "feet" + ] + } + ] + }, + { + "id": "entity", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "type", + "type": "enum", + "translate": "$entity.type", + "translateValue": "", + "unset": true, + "values": "entity_types" + }, + { + "id": "nbt", + "type": "nbt", + "translate": "$entity.nbt" + }, + { + "id": "location", + "type": "object", + "translate": "$entity.location", + "value": "location", + "collapse": true + }, + { + "id": "distance", + "type": "object", + "translate": "$entity.distance", + "value": "distance", + "collapse": true + }, + { + "id": "effects", + "type": "map", + "translate": "$entity.status_effect", + "values": { + "type": "object", + "value": "status_effect" + } + } + ] + }, + { + "id": "location", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "position", + "type": "object", + "translate": "$location.position", + "color": "dark", + "collapse": true, + "fields": [ + { + "id": "x", + "type": "boundary", + "translate": "$location.$position.x" + }, + { + "id": "y", + "type": "boundary", + "translate": "$location.$position.y" + }, + { + "id": "z", + "type": "boundary", + "translate": "$location.$position.z" + } + ] + }, + { + "id": "biome", + "type": "enum", + "translate": "$location.biome", + "translateValue": "", + "unset": true, + "values": "biomes" + }, + { + "id": "feature", + "type": "enum", + "translate": "$location.feature", + "translateValue": "", + "unset": true, + "values": "structures" + }, + { + "id": "dimension", + "type": "enum", + "translate": "$location.dimension", + "translateValue": "$dimension", + "unset": true, + "values": "dimensions" + } + ] + }, + { + "id": "distance", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "x", + "type": "boundary", + "translate": "$distance.x" + }, + { + "id": "y", + "type": "boundary", + "translate": "$distance.y" + }, + { + "id": "z", + "type": "boundary", + "translate": "$distance.z" + }, + { + "id": "absolute", + "type": "boundary", + "translate": "$distance.absolute" + }, + { + "id": "horizontal", + "type": "boundary", + "translate": "$distance.horizontal" + } + ] + }, + { + "id": "status_effect", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "amplifier", + "type": "range", + "translate": "$status_effect.amplifier" + }, + { + "id": "duration", + "type": "range", + "translate": "$status_effect.duration" + }, + { + "id": "ambient", + "type": "boolean", + "translate": "$status_effect.ambient" + }, + { + "id": "visible", + "type": "boolean", + "translate": "$status_effect.visible" + } + ] + } + ], + "collections": { + "entity_types": [ + "minecraft:area_effect_cloud", + "minecraft:armor_stand", + "minecraft:arrow", + "minecraft:bat", + "minecraft:blaze", + "minecraft:boat", + "minecraft:cat", + "minecraft:cave_spider", + "minecraft:chest_minecart", + "minecraft:chicken", + "minecraft:cod", + "minecraft:command_block_minecart", + "minecraft:cow", + "minecraft:creeper", + "minecraft:dolphin", + "minecraft:donkey", + "minecraft:dragon_fireball", + "minecraft:drowned", + "minecraft:egg", + "minecraft:elder_guardian", + "minecraft:end_crystal", + "minecraft:ender_dragon", + "minecraft:ender_pearl", + "minecraft:enderman", + "minecraft:endermite", + "minecraft:evoker", + "minecraft:evoker_fangs", + "minecraft:experience_bottle", + "minecraft:experience_orb", + "minecraft:eye_of_ender", + "minecraft:falling_block", + "minecraft:fireball", + "minecraft:firework_rocket", + "minecraft:fishing_bobber", + "minecraft:furnace_minecart", + "minecraft:ghast", + "minecraft:giant", + "minecraft:guardian", + "minecraft:hopper_minecart", + "minecraft:horse", + "minecraft:husk", + "minecraft:illusioner", + "minecraft:iron_golem", + "minecraft:item", + "minecraft:item_frame", + "minecraft:leash_knot", + "minecraft:lightning_bolt", + "minecraft:llama", + "minecraft:llama_spit", + "minecraft:magma_cube", + "minecraft:minecart", + "minecraft:mooshroom", + "minecraft:mule", + "minecraft:ocelot", + "minecraft:painting", + "minecraft:parrot", + "minecraft:phantom", + "minecraft:pig", + "minecraft:player", + "minecraft:polar_bear", + "minecraft:potion", + "minecraft:pufferfish", + "minecraft:rabbit", + "minecraft:salmon", + "minecraft:sheep", + "minecraft:shulker", + "minecraft:shulker_bullet", + "minecraft:silverfish", + "minecraft:skeleton", + "minecraft:skeleton_horse", + "minecraft:slime", + "minecraft:small_fireball", + "minecraft:snow_golem", + "minecraft:snowball", + "minecraft:spawner_minecart", + "minecraft:spectral_arrow", + "minecraft:spider", + "minecraft:squid", + "minecraft:stray", + "minecraft:tnt", + "minecraft:tnt_minecart", + "minecraft:trader_llama", + "minecraft:trident", + "minecraft:tropical_fish", + "minecraft:turtle", + "minecraft:vex", + "minecraft:villager", + "minecraft:vindicator", + "minecraft:wandering_trader", + "minecraft:witch", + "minecraft:wither", + "minecraft:wither_skeleton", + "minecraft:wither_skull", + "minecraft:wolf", + "minecraft:zombie", + "minecraft:zombie_horse", + "minecraft:zombie_pigman", + "minecraft:zombie_villager" + ], + "enchantments": [ + "minecraft:aqua_affinity", + "minecraft:bane_of_arthropods", + "minecraft:blast_protection", + "minecraft:channeling", + "minecraft:binding_curse", + "minecraft:vanishing_curse", + "minecraft:depth_strider", + "minecraft:efficiency", + "minecraft:feather_falling", + "minecraft:fire_aspect", + "minecraft:fire_protection", + "minecraft:flame", + "minecraft:fortune", + "minecraft:frost_walker", + "minecraft:impaling", + "minecraft:infinity", + "minecraft:knockback", + "minecraft:looting", + "minecraft:loyalty", + "minecraft:luck_of_the_sea", + "minecraft:lure", + "minecraft:mending", + "minecraft:multishot", + "minecraft:piercing", + "minecraft:power", + "minecraft:projectile_protection", + "minecraft:protection", + "minecraft:punch", + "minecraft:quick_charge", + "minecraft:respiration", + "minecraft:riptide", + "minecraft:sharpness", + "minecraft:silk_touch", + "minecraft:smite", + "minecraft:sweeping", + "minecraft:thorns", + "minecraft:unbreaking" + ], + "biomes": [ + "minecraft:badlands", + "minecraft:badlands_plateau", + "minecraft:bamboo_jungle", + "minecraft:bamboo_jungle_hills", + "minecraft:beach", + "minecraft:birch_forest", + "minecraft:birch_forest_hills", + "minecraft:cold_ocean", + "minecraft:dark_forest", + "minecraft:dark_forest_hills", + "minecraft:deep_cold_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_ocean", + "minecraft:deep_warm_ocean", + "minecraft:desert", + "minecraft:desert_hills", + "minecraft:desert_lakes", + "minecraft:end_barrens", + "minecraft:end_highlands", + "minecraft:end_midlands", + "minecraft:eroded_badlands", + "minecraft:flower_forest", + "minecraft:forest", + "minecraft:frozen_ocean", + "minecraft:frozen_river", + "minecraft:giant_spruce_taiga", + "minecraft:giant_spruce_taiga_hills", + "minecraft:giant_tree_taiga", + "minecraft:giant_tree_taiga_hills", + "minecraft:gravelly_mountains", + "minecraft:ice_spikes", + "minecraft:jungle", + "minecraft:jungle_edge", + "minecraft:jungle_hills", + "minecraft:lukewarm_ocean", + "minecraft:modified_badlands_plateau", + "minecraft:modified_gravelly_mountains", + "minecraft:modified_jungle", + "minecraft:modified_jungle_edge", + "minecraft:modified_wooded_badlands_plateau", + "minecraft:mountain_edge", + "minecraft:mountains", + "minecraft:mushroom_field_shore", + "minecraft:mushroom_fields", + "minecraft:nether", + "minecraft:ocean", + "minecraft:plains", + "minecraft:river", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:shattered_savanna", + "minecraft:shattered_savanna_plateau", + "minecraft:small_end_islands", + "minecraft:snowy_beach", + "minecraft:snowy_mountains", + "minecraft:snowy_taiga", + "minecraft:snowy_taiga_hills", + "minecraft:snowy_taiga_mountains", + "minecraft:snowy_tundra", + "minecraft:stone_shore", + "minecraft:sunflower_plains", + "minecraft:swamp", + "minecraft:swamp_hills", + "minecraft:taiga", + "minecraft:taiga_hills", + "minecraft:taiga_mountains", + "minecraft:tall_birch_forest", + "minecraft:tall_birch_hills", + "minecraft:the_end", + "minecraft:the_void", + "minecraft:warm_ocean", + "minecraft:wooded_badlands_plateau", + "minecraft:wooded_hills", + "minecraft:wooded_mountains" + ], + "structures": [ + "pillager_outpost", + "mineshaft", + "mansion", + "jungle_pyramid", + "desert_pyramid", + "igloo", + "shipwreck", + "swamp_hut", + "stronghold", + "monument", + "ocean_ruin", + "fortress", + "endcity", + "buried_treasure", + "village" + ], + "dimensions": [ + "minecraft:overworld", + "minecraft:the_nether", + "minecraft:the_end" + ], + "status_effects": [ + "minecraft:speed", + "minecraft:slowness", + "minecraft:haste", + "minecraft:mining_fatigue", + "minecraft:strength", + "minecraft:instant_health", + "minecraft:instant_damage", + "minecraft:jump_boost", + "minecraft:nausea", + "minecraft:regeneration", + "minecraft:resistance", + "minecraft:fire_resistance", + "minecraft:water_breathing", + "minecraft:invisibility", + "minecraft:blindness", + "minecraft:night_vision", + "minecraft:hunger", + "minecraft:weakness", + "minecraft:poison", + "minecraft:wither", + "minecraft:health_boost", + "minecraft:absorption", + "minecraft:saturation", + "minecraft:glowing", + "minecraft:levitation", + "minecraft:luck", + "minecraft:unluck", + "minecraft:slow_falling", + "minecraft:conduit_power", + "minecraft:dolphins_grace", + "minecraft:bad_omen", + "minecraft:hero_of_the_village" + ] + } +} diff --git a/schemas/1.14.json b/schemas/1.14.json new file mode 100644 index 00000000..6c05a73b --- /dev/null +++ b/schemas/1.14.json @@ -0,0 +1,1424 @@ +{ + "root": { + "fields": [ + { + "id": "type", + "type": "enum", + "translate": "$table.type", + "translateValue": "$table.$type", + "default": "minecraft:generic", + "values": [ + "minecraft:empty", + "minecraft:entity", + "minecraft:block", + "minecraft:chest", + "minecraft:fishing", + "minecraft:generic" + ] + }, + { + "id": "pools", + "type": "array", + "translate": "pool", + "values": "pool" + } + ] + }, + "components": [ + { + "id": "pool", + "type": "object", + "color": "success", + "fields": [ + { + "id": "rolls", + "type": "random", + "translate": "$pool.rolls" + }, + { + "id": "bonus_rolls", + "type": "random", + "translate": "$pool.bonus_rolls", + "luckBased": true + }, + { + "id": "entries", + "type": "array", + "translate": "entry", + "values": "entry", + "button": "header" + }, + { + "id": "functions", + "type": "array", + "translate": "function", + "values": "function", + "button": "header" + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "entry", + "type": "object", + "color": "light", + "fields": [ + { + "id": "type", + "type": "enum", + "translate": "$entry.type", + "translateValue": "$entry.$type", + "default": "minecraft:item", + "values": [ + "minecraft:empty", + "minecraft:item", + "minecraft:tag", + "minecraft:loot_table", + "minecraft:alternatives", + "minecraft:sequence", + "minecraft:group", + "minecraft:dynamic" + ] + }, + { + "id": "name", + "type": "string", + "translate": "$entry.name", + "require": [ + "minecraft:item", + "minecraft:tag", + "minecraft:loot_table", + "minecraft:dynamic" + ] + }, + { + "id": "weight", + "type": "random", + "translate": "$entry.weight" + }, + { + "id": "quality", + "type": "random", + "translate": "$entry.quality", + "luckBased": true + }, + { + "id": "expand", + "type": "boolean", + "default": "false", + "translate": "$entry.expand", + "require": [ + "minecraft:tag" + ] + }, + { + "id": "children", + "type": "array", + "translate": "child", + "values": "entry", + "button": "field", + "color": "success", + "require": [ + "minecraft:alternatives", + "minecraft:sequence", + "minecraft:group" + ] + }, + { + "id": "functions", + "type": "array", + "translate": "function", + "values": "function", + "button": "header" + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "function", + "type": "object", + "color": "secondary", + "fields": [ + { + "id": "function", + "type": "enum", + "translate": "$function.type", + "translateValue": "$function.$type", + "default": "minecraft:set_count", + "values": [ + "minecraft:set_count", + "minecraft:set_damage", + "minecraft:set_name", + "minecraft:set_lore", + "minecraft:set_nbt", + "minecraft:set_attributes", + "minecraft:set_contents", + "minecraft:enchant_randomly", + "minecraft:enchant_with_levels", + "minecraft:looting_enchant", + "minecraft:limit_count", + "minecraft:furnace_smelt", + "minecraft:explosion_decay", + "minecraft:fill_player_head", + "minecraft:copy_name", + "minecraft:copy_nbt", + "minecraft:apply_bonus", + "minecraft:exploration_map", + "minecraft:set_stew_effect" + ] + }, + { + "id": "count", + "type": "random", + "translate": "$function.count", + "require": [ + "minecraft:set_count", + "minecraft:looting_enchant" + ] + }, + { + "id": "damage", + "type": "random", + "translate": "$function.damage", + "require": [ + "minecraft:set_damage" + ] + }, + { + "id": "name", + "type": "json", + "translate": "$function.name", + "require": [ + "minecraft:set_name" + ] + }, + { + "id": "lore", + "type": "json-list", + "translate": "$function.lore", + "require": [ + "minecraft:set_lore" + ] + }, + { + "id": "tag", + "type": "nbt", + "translate": "$function.nbt", + "require": [ + "minecraft:set_nbt" + ] + }, + { + "id": "levels", + "type": "random", + "translate": "$function.levels", + "require": [ + "minecraft:enchant_with_levels" + ] + }, + { + "id": "treasure", + "type": "boolean", + "translate": "$function.treasure", + "default": false, + "require": [ + "minecraft:enchant_with_levels" + ] + }, + { + "id": "limit", + "type": "int", + "translate": "$function.limit", + "require": [ + "minecraft:looting_enchant" + ] + }, + { + "id": "limit", + "type": "boundary", + "translate": "$function.limit", + "require": [ + "minecraft:limit_count" + ] + }, + { + "id": "destination", + "type": "enum", + "translate": "$function.destination", + "values": "structures", + "require": [ + "minecraft:exploration_map" + ] + }, + { + "id": "decoration", + "type": "enum", + "translate": "$function.decoration", + "values": "map_icons", + "require": [ + "minecraft:exploration_map" + ] + }, + { + "id": "zoom", + "type": "int", + "translate": "$function.zoom", + "require": [ + "minecraft:exploration_map" + ] + }, + { + "id": "search_radius", + "type": "int", + "translate": "$function.searchRadius", + "require": [ + "minecraft:exploration_map" + ] + }, + { + "id": "skip_existing_chunks", + "type": "boolean", + "translate": "$function.skipExistingChunks", + "default": true, + "require": [ + "minecraft:exploration_map" + ] + }, + { + "id": "effects", + "type": "array", + "translate": "potion_effect", + "button": "field", + "values": "potion_effect", + "require": [ + "minecraft:set_stew_effect" + ] + }, + { + "id": "entity", + "type": "enum", + "translate": "$function.entity", + "translateValue": "$source", + "default": "minecraft:this", + "values": [ + "minecraft:this", + "minecraft:killer", + "minecraft:killer_player" + ], + "require": [ + "minecraft:set_name", + "minecraft:set_lore", + "minecraft:fill_player_head" + ] + }, + { + "id": "source", + "type": "enum", + "translate": "$function.source", + "translateValue": "$source", + "default": "minecraft:this", + "values": [ + "minecraft:block_entity", + "minecraft:this", + "minecraft:killer", + "minecraft:killer_player" + ], + "require": [ + "minecraft:copy_name", + "minecraft:copy_nbt" + ] + }, + { + "id": "replace", + "type": "boolean", + "translate": "$function.replace", + "require": [ + "minecraft:set_lore" + ] + }, + { + "id": "enchantments", + "type": "set", + "translate": "$function.enchantments", + "translateValue": "$enchantment", + "values": "enchantments", + "require": [ + "minecraft:enchant_randomly" + ] + }, + { + "id": "modifiers", + "type": "array", + "translate": "attribute_modifier", + "button": "field", + "values": "attribute_modifier", + "require": [ + "minecraft:set_attributes" + ] + }, + { + "id": "ops", + "type": "array", + "translate": "nbt_operation", + "button": "field", + "values": "nbt_operation", + "require": [ + "minecraft:copy_nbt" + ] + }, + { + "id": "enchantment", + "type": "enum", + "translate": "$function.enchantment", + "translateValue": "$enchantment", + "values": "enchantments", + "require": [ + "minecraft:apply_bonus" + ] + }, + { + "id": "formula", + "type": "enum", + "translate": "$function.formula", + "translateValue": "$function.$formula", + "default": "minecraft:uniform_bonus_count", + "values": [ + "minecraft:uniform_bonus_count", + "minecraft:binomial_with_bonus_count", + "minecraft:ore_drops" + ], + "require": [ + "minecraft:apply_bonus" + ] + }, + { + "id": "parameters.bonusMultiplier", + "type": "float", + "translate": "$function.bonusMultiplier", + "require": [ + { + "function": "minecraft:apply_bonus", + "formula": "minecraft:uniform_bonus_count" + } + ] + }, + { + "id": "parameters.extra", + "type": "int", + "translate": "$function.extra", + "require": [ + { + "function": "minecraft:apply_bonus", + "formula": "minecraft:binomial_with_bonus_count" + } + ] + }, + { + "id": "parameters.probability", + "type": "float", + "translate": "$function.probability", + "require": [ + { + "function": "minecraft:apply_bonus", + "formula": "minecraft:binomial_with_bonus_count" + } + ] + }, + { + "id": "conditions", + "type": "array", + "translate": "condition", + "values": "condition", + "button": "header" + } + ] + }, + { + "id": "condition", + "type": "object", + "color": "info", + "fields": [ + { + "id": "condition", + "type": "enum", + "translate": "$condition.type", + "translateValue": "$condition.$type", + "default": "minecraft:random_chance", + "values": [ + "minecraft:alternative", + "minecraft:inverted", + "minecraft:entity_properties", + { + "value": "minecraft:block_state_propery", + "require": ["minecraft:block"] + }, + { + "value": "minecraft:match_tool", + "require": ["minecraft:block", "minecraft:fishing"] + }, + { + "value": "minecraft:damage_source_properties", + "require": ["minecraft:entity"] + }, + "minecraft:location_check", + "minecraft:weather_check", + "minecraft:entity_scores", + "minecraft:random_chance", + "minecraft:random_chance_with_looting", + { + "value": "minecraft:table_bonus", + "require": ["minecraft:block"] + }, + "minecraft:killed_by_player", + { + "value": "survives_explosion", + "require": ["minecraft:block"] + } + ] + }, + { + "id": "chance", + "type": "float", + "translate": "$condition.chance", + "require": [ + "minecraft:random_chance", + "minecraft:random_chance_with_looting" + ] + }, + { + "id": "looting_multiplier", + "type": "float", + "translate": "$condition.looting_multiplier", + "require": [ + "minecraft:random_chance_with_looting" + ] + }, + { + "id": "inverse", + "type": "boolean", + "translate": "$condition.inverse", + "default": false, + "require": [ + "minecraft:killed_by_player" + ] + }, + { + "id": "entity", + "type": "enum", + "translate": "$condition.entity", + "translateValue": "$source", + "default": "this", + "values": [ + "this", + "killer", + "killer_player" + ], + "require": [ + "minecraft:entity_properties", + "minecraft:entity_scores" + ] + }, + { + "id": "enchantment", + "type": "enum", + "translate": "$condition.enchantment", + "translateValue": "$enchantment", + "values": "enchantments", + "require": [ + "minecraft:table_bonus" + ] + }, + { + "id": "chances", + "type": "chance-list", + "translate": "$condition.chances", + "require": [ + "minecraft:table_bonus" + ] + }, + { + "id": "raining", + "type": "boolean", + "translate": "$condition.raining", + "require": [ + "minecraft:weather_check" + ] + }, + { + "id": "thundering", + "type": "boolean", + "translate": "$condition.thundering", + "require": [ + "minecraft:weather_check" + ] + }, + { + "id": "block", + "type": "string", + "translate": "$condition.block", + "require": [ + "minecraft:block_state_propery" + ] + }, + { + "id": "properties", + "type": "map", + "translate": "$condition.block_state", + "values": { + "type": "string" + }, + "require": [ + "minecraft:block_state_propery" + ] + }, + { + "id": "scores", + "type": "map", + "translate": "$condition.score", + "values": { + "type": "range" + }, + "require": [ + "minecraft:entity_scores" + ] + }, + { + "id": "predicate", + "type": "object", + "translate": "entity", + "value": "entity", + "require": [ + "minecraft:entity_properties" + ] + }, + { + "id": "predicate", + "type": "object", + "translate": "location", + "value": "location", + "require": [ + "minecraft:location_check" + ] + }, + { + "id": "predicate", + "type": "object", + "translate": "item", + "value": "item", + "require": [ + "minecraft:match_tool" + ] + }, + { + "id": "predicate", + "type": "object", + "translate": "damage_source", + "value": "damage_source", + "require": [ + "minecraft:damage_source_properties" + ] + }, + { + "id": "term", + "type": "object", + "translate": "condition", + "value": "condition", + "button": "field", + "require": [ + "minecraft:inverted" + ] + }, + { + "id": "terms", + "type": "array", + "translate": "term", + "values": "condition", + "button": "field", + "require": [ + "minecraft:alternative" + ] + } + ] + }, + { + "id": "attribute_modifier", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "attribute", + "type": "enum", + "translate": "$attribute_modifier.attribute", + "translateValue": "$attribute", + "default": "generic.attackDamage", + "values": [ + "generic.maxHealth", + "generic.followRange", + "generic.knockbackResistance", + "generic.movementSpeed", + "generic.attackDamage", + "generic.armor", + "generic.armorToughness", + "generic.attackSpeed", + "generic.luck", + "horse.jumpStrength", + "generic.attackKnockback", + "generic.flyingSpeed", + "zombie.spawnReinforcements" + ] + }, + { + "id": "name", + "type": "string", + "translate": "$attribute_modifier.name" + }, + { + "id": "amount", + "type": "float", + "translate": "$attribute_modifier.amount" + }, + { + "id": "operation", + "type": "enum", + "translate": "$attribute_modifier.operation", + "translateValue": "$attribute_modifier.$operation", + "default": "addition", + "values": [ + "addition", + "multiply_base", + "multiply_total" + ] + }, + { + "id": "slots", + "type": "set", + "translate": "$attribute_modifier.slots", + "translateValue": "$slot", + "values": [ + "mainhand", + "offhand", + "head", + "chest", + "legs", + "feet" + ] + } + ] + }, + { + "id": "nbt_operation", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "source", + "type": "string", + "translate": "$nbt_operation.source", + "class": "code" + }, + { + "id": "target", + "type": "string", + "translate": "$nbt_operation.target", + "class": "code" + }, + { + "id": "op", + "type": "enum", + "translate": "$nbt_operation.operation", + "translateValue": "$nbt_operation.$operation", + "default": "replace", + "values": [ + "replace", + "append", + "merge" + ] + } + ] + }, + { + "id": "entity", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "type", + "type": "enum", + "translate": "$entity.type", + "translateValue": "", + "unset": true, + "values": "entity_types" + }, + { + "id": "nbt", + "type": "nbt", + "translate": "$entity.nbt" + }, + { + "id": "location", + "type": "object", + "translate": "$entity.location", + "value": "location", + "collapse": true + }, + { + "id": "distance", + "type": "object", + "translate": "$entity.distance", + "value": "distance", + "collapse": true + }, + { + "id": "flags", + "type": "object", + "translate": "$entity.flags", + "color": "dark", + "collapse": true, + "fields": [ + { + "id": "is_on_fire", + "type": "boolean", + "translate": "$entity.isOnFire" + }, + { + "id": "is_sneaking", + "type": "boolean", + "translate": "$entity.isSneaking" + }, + { + "id": "is_sprinting", + "type": "boolean", + "translate": "$entity.isSprinting" + }, + { + "id": "is_swimming", + "type": "boolean", + "translate": "$entity.isSwimming" + }, + { + "id": "is_baby", + "type": "boolean", + "translate": "$entity.isBaby" + } + ] + }, + { + "id": "equipment", + "type": "object", + "translate": "$entity.equipment", + "color": "dark", + "collapse": true, + "fields": [ + { + "id": "mainhand", + "type": "object", + "translate": "$slot.mainhand", + "color": "dark", + "collapse": true, + "value": "item" + }, + { + "id": "offhand", + "type": "object", + "translate": "$slot.offhand", + "color": "dark", + "collapse": true, + "value": "item" + }, + { + "id": "head", + "type": "object", + "translate": "$slot.head", + "color": "dark", + "collapse": true, + "value": "item" + }, + { + "id": "chest", + "type": "object", + "translate": "$slot.chest", + "color": "dark", + "collapse": true, + "value": "item" + }, + { + "id": "legs", + "type": "object", + "translate": "$slot.legs", + "color": "dark", + "collapse": true, + "value": "item" + }, + { + "id": "feet", + "type": "object", + "translate": "$slot.feet", + "color": "dark", + "collapse": true, + "value": "item" + } + ] + }, + { + "id": "effects", + "type": "map", + "translate": "$entity.status_effect", + "values": { + "type": "object", + "value": "status_effect" + } + } + ] + }, + { + "id": "location", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "position", + "type": "object", + "translate": "$location.position", + "color": "dark", + "collapse": true, + "fields": [ + { + "id": "x", + "type": "boundary", + "translate": "$location.$position.x" + }, + { + "id": "y", + "type": "boundary", + "translate": "$location.$position.y" + }, + { + "id": "z", + "type": "boundary", + "translate": "$location.$position.z" + } + ] + }, + { + "id": "biome", + "type": "enum", + "translate": "$location.biome", + "translateValue": "", + "unset": true, + "values": "biomes" + }, + { + "id": "feature", + "type": "enum", + "translate": "$location.feature", + "translateValue": "", + "unset": true, + "values": "structures" + }, + { + "id": "dimension", + "type": "enum", + "translate": "$location.dimension", + "translateValue": "$dimension", + "unset": true, + "values": "dimensions" + } + ] + }, + { + "id": "distance", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "x", + "type": "boundary", + "translate": "$distance.x" + }, + { + "id": "y", + "type": "boundary", + "translate": "$distance.y" + }, + { + "id": "z", + "type": "boundary", + "translate": "$distance.z" + }, + { + "id": "absolute", + "type": "boundary", + "translate": "$distance.absolute" + }, + { + "id": "horizontal", + "type": "boundary", + "translate": "$distance.horizontal" + } + ] + }, + { + "id": "status_effect", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "amplifier", + "type": "range", + "translate": "$status_effect.amplifier" + }, + { + "id": "duration", + "type": "range", + "translate": "$status_effect.duration" + }, + { + "id": "ambient", + "type": "boolean", + "translate": "$status_effect.ambient" + }, + { + "id": "visible", + "type": "boolean", + "translate": "$status_effect.visible" + } + ] + }, + { + "id": "potion_effect", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "type", + "type": "string", + "translate": "$potion_effect.type" + }, + { + "id": "duration", + "type": "range", + "translate": "$potion_effect.duration" + } + ] + }, + { + "id": "item", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "name", + "type": "string", + "translate": "$item.name" + }, + { + "id": "tag", + "type": "string", + "translate": "$item.tag" + }, + { + "id": "count", + "type": "range", + "translate": "$item.count" + }, + { + "id": "durability", + "type": "range", + "translate": "$item.durability" + }, + { + "id": "potion", + "type": "string", + "translate": "$item.potion" + }, + { + "id": "nbt", + "type": "nbt", + "translate": "$item.nbt" + } + ] + }, + { + "id": "damage_source", + "type": "object", + "color": "dark", + "fields": [ + { + "id": "is_explosion", + "type": "boolean", + "translate": "$damage_source.is_explosion" + }, + { + "id": "is_projectile", + "type": "boolean", + "translate": "$damage_source.is_projectile" + }, + { + "id": "is_fire", + "type": "boolean", + "translate": "$damage_source.is_fire" + }, + { + "id": "is_lightning", + "type": "boolean", + "translate": "$damage_source.is_lightning" + }, + { + "id": "is_magic", + "type": "boolean", + "translate": "$damage_source.is_magic" + }, + { + "id": "bypasses_magic", + "type": "boolean", + "translate": "$damage_source.bypasses_magic" + }, + { + "id": "bypasses_invulnerability", + "type": "boolean", + "translate": "$damage_source.bypasses_invulnerability" + }, + { + "id": "bypasses_armor", + "type": "boolean", + "translate": "$damage_source.bypasses_armor" + }, + { + "id": "source_entity", + "type": "object", + "translate": "$damage_source.source_entity", + "color": "dark", + "collapse": true, + "value": "entity" + }, + { + "id": "direct_entity", + "type": "object", + "translate": "$damage_source.direct_entity", + "color": "dark", + "collapse": true, + "value": "entity" + } + ] + } + ], + "collections": { + "entity_types": [ + "minecraft:area_effect_cloud", + "minecraft:armor_stand", + "minecraft:arrow", + "minecraft:bat", + "minecraft:blaze", + "minecraft:boat", + "minecraft:cat", + "minecraft:cave_spider", + "minecraft:chest_minecart", + "minecraft:chicken", + "minecraft:cod", + "minecraft:command_block_minecart", + "minecraft:cow", + "minecraft:creeper", + "minecraft:dolphin", + "minecraft:donkey", + "minecraft:dragon_fireball", + "minecraft:drowned", + "minecraft:egg", + "minecraft:elder_guardian", + "minecraft:end_crystal", + "minecraft:ender_dragon", + "minecraft:ender_pearl", + "minecraft:enderman", + "minecraft:endermite", + "minecraft:evoker", + "minecraft:evoker_fangs", + "minecraft:experience_bottle", + "minecraft:experience_orb", + "minecraft:eye_of_ender", + "minecraft:falling_block", + "minecraft:fireball", + "minecraft:firework_rocket", + "minecraft:fishing_bobber", + "minecraft:fox", + "minecraft:furnace_minecart", + "minecraft:ghast", + "minecraft:giant", + "minecraft:guardian", + "minecraft:hopper_minecart", + "minecraft:horse", + "minecraft:husk", + "minecraft:illusioner", + "minecraft:iron_golem", + "minecraft:item", + "minecraft:item_frame", + "minecraft:leash_knot", + "minecraft:lightning_bolt", + "minecraft:llama", + "minecraft:llama_spit", + "minecraft:magma_cube", + "minecraft:minecart", + "minecraft:mooshroom", + "minecraft:mule", + "minecraft:ocelot", + "minecraft:painting", + "minecraft:panda", + "minecraft:parrot", + "minecraft:phantom", + "minecraft:pig", + "minecraft:pillager", + "minecraft:player", + "minecraft:polar_bear", + "minecraft:potion", + "minecraft:pufferfish", + "minecraft:rabbit", + "minecraft:ravager", + "minecraft:salmon", + "minecraft:sheep", + "minecraft:shulker", + "minecraft:shulker_bullet", + "minecraft:silverfish", + "minecraft:skeleton", + "minecraft:skeleton_horse", + "minecraft:slime", + "minecraft:small_fireball", + "minecraft:snow_golem", + "minecraft:snowball", + "minecraft:spawner_minecart", + "minecraft:spectral_arrow", + "minecraft:spider", + "minecraft:squid", + "minecraft:stray", + "minecraft:tnt", + "minecraft:tnt_minecart", + "minecraft:trader_llama", + "minecraft:trident", + "minecraft:tropical_fish", + "minecraft:turtle", + "minecraft:vex", + "minecraft:villager", + "minecraft:vindicator", + "minecraft:wandering_trader", + "minecraft:witch", + "minecraft:wither", + "minecraft:wither_skeleton", + "minecraft:wither_skull", + "minecraft:wolf", + "minecraft:zombie", + "minecraft:zombie_horse", + "minecraft:zombie_pigman", + "minecraft:zombie_villager" + ], + "enchantments": [ + "minecraft:aqua_affinity", + "minecraft:bane_of_arthropods", + "minecraft:blast_protection", + "minecraft:channeling", + "minecraft:binding_curse", + "minecraft:vanishing_curse", + "minecraft:depth_strider", + "minecraft:efficiency", + "minecraft:feather_falling", + "minecraft:fire_aspect", + "minecraft:fire_protection", + "minecraft:flame", + "minecraft:fortune", + "minecraft:frost_walker", + "minecraft:impaling", + "minecraft:infinity", + "minecraft:knockback", + "minecraft:looting", + "minecraft:loyalty", + "minecraft:luck_of_the_sea", + "minecraft:lure", + "minecraft:mending", + "minecraft:multishot", + "minecraft:piercing", + "minecraft:power", + "minecraft:projectile_protection", + "minecraft:protection", + "minecraft:punch", + "minecraft:quick_charge", + "minecraft:respiration", + "minecraft:riptide", + "minecraft:sharpness", + "minecraft:silk_touch", + "minecraft:smite", + "minecraft:sweeping", + "minecraft:thorns", + "minecraft:unbreaking" + ], + "biomes": [ + "minecraft:badlands", + "minecraft:badlands_plateau", + "minecraft:bamboo_jungle", + "minecraft:bamboo_jungle_hills", + "minecraft:beach", + "minecraft:birch_forest", + "minecraft:birch_forest_hills", + "minecraft:cold_ocean", + "minecraft:dark_forest", + "minecraft:dark_forest_hills", + "minecraft:deep_cold_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_ocean", + "minecraft:deep_warm_ocean", + "minecraft:desert", + "minecraft:desert_hills", + "minecraft:desert_lakes", + "minecraft:end_barrens", + "minecraft:end_highlands", + "minecraft:end_midlands", + "minecraft:eroded_badlands", + "minecraft:flower_forest", + "minecraft:forest", + "minecraft:frozen_ocean", + "minecraft:frozen_river", + "minecraft:giant_spruce_taiga", + "minecraft:giant_spruce_taiga_hills", + "minecraft:giant_tree_taiga", + "minecraft:giant_tree_taiga_hills", + "minecraft:gravelly_mountains", + "minecraft:ice_spikes", + "minecraft:jungle", + "minecraft:jungle_edge", + "minecraft:jungle_hills", + "minecraft:lukewarm_ocean", + "minecraft:modified_badlands_plateau", + "minecraft:modified_gravelly_mountains", + "minecraft:modified_jungle", + "minecraft:modified_jungle_edge", + "minecraft:modified_wooded_badlands_plateau", + "minecraft:mountain_edge", + "minecraft:mountains", + "minecraft:mushroom_field_shore", + "minecraft:mushroom_fields", + "minecraft:nether", + "minecraft:ocean", + "minecraft:plains", + "minecraft:river", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:shattered_savanna", + "minecraft:shattered_savanna_plateau", + "minecraft:small_end_islands", + "minecraft:snowy_beach", + "minecraft:snowy_mountains", + "minecraft:snowy_taiga", + "minecraft:snowy_taiga_hills", + "minecraft:snowy_taiga_mountains", + "minecraft:snowy_tundra", + "minecraft:stone_shore", + "minecraft:sunflower_plains", + "minecraft:swamp", + "minecraft:swamp_hills", + "minecraft:taiga", + "minecraft:taiga_hills", + "minecraft:taiga_mountains", + "minecraft:tall_birch_forest", + "minecraft:tall_birch_hills", + "minecraft:the_end", + "minecraft:the_void", + "minecraft:warm_ocean", + "minecraft:wooded_badlands_plateau", + "minecraft:wooded_hills", + "minecraft:wooded_mountains" + ], + "structures": [ + "pillager_outpost", + "mineshaft", + "mansion", + "jungle_pyramid", + "desert_pyramid", + "igloo", + "shipwreck", + "swamp_hut", + "stronghold", + "monument", + "ocean_ruin", + "fortress", + "endcity", + "buried_treasure", + "village" + ], + "dimensions": [ + "minecraft:overworld", + "minecraft:the_nether", + "minecraft:the_end" + ], + "status_effects": [ + "minecraft:speed", + "minecraft:slowness", + "minecraft:haste", + "minecraft:mining_fatigue", + "minecraft:strength", + "minecraft:instant_health", + "minecraft:instant_damage", + "minecraft:jump_boost", + "minecraft:nausea", + "minecraft:regeneration", + "minecraft:resistance", + "minecraft:fire_resistance", + "minecraft:water_breathing", + "minecraft:invisibility", + "minecraft:blindness", + "minecraft:night_vision", + "minecraft:hunger", + "minecraft:weakness", + "minecraft:poison", + "minecraft:wither", + "minecraft:health_boost", + "minecraft:absorption", + "minecraft:saturation", + "minecraft:glowing", + "minecraft:levitation", + "minecraft:luck", + "minecraft:unluck", + "minecraft:slow_falling", + "minecraft:conduit_power", + "minecraft:dolphins_grace", + "minecraft:bad_omen", + "minecraft:hero_of_the_village" + ], + "map_icons": [ + "mansion", + "monument", + "player", + "frame", + "red_marker", + "blue_marker", + "target_x", + "target_point", + "player_off_map", + "player_off_limits", + "red_x", + "banner_white", + "banner_orange", + "banner_magenta", + "banner_light_blue", + "banner_yellow", + "banner_lime", + "banner_pink", + "banner_gray", + "banner_light_gray", + "banner_cyan", + "banner_purple", + "banner_blue", + "banner_brown", + "banner_green", + "banner_red", + "banner_black" + ] + } +} diff --git a/view.js b/view.js index 21c06cf8..3b539309 100644 --- a/view.js +++ b/view.js @@ -1,19 +1,116 @@ +let structure; +let components; +let collections; -function invalidated() { - generateStructure(); +changeVersion('1.14'); +function changeVersion(version) { + $.getJSON('schemas/' + version + '.json', json => { + structure = json.root; + components = json.components; + collections = json.collections; + }).fail((jqXHR, textStatus, errorThrown) => { + let message = 'Failed loading ' + version + ' schema'; + structure = { + fields: [ + { + id: 'pools', + type: 'error', + message: message + } + ] + }; + console.error(message + '\n' + errorThrown); + }).always(() => { + $('#versionLabel').text(version); + updateView(); + }); +} + +function updateView() { + if (structure) { + generateTable(); + if (i18next.isInitialized) { + $('html').localize(); + } + } $('#source').val(JSON.stringify(table, null, indentation)); } -function preventNewline(e) { - if (e.which === 13) { - $(e.target).trigger('change'); - e.preventDefault(); +function generateTable() { + $('#structure').removeClass('d-none').html(''); + + let type = structure.fields.find(e => e.id === 'type'); + if (type) { + $('.table-type').removeClass('d-none'); + $('#tableType').html(''); + for (let option of type.values) { + $('#tableType').append(setValueAndName($('