This commit is contained in:
Misode
2019-10-15 20:35:22 +02:00
8 changed files with 1644 additions and 12 deletions

View File

@@ -28,6 +28,7 @@
<div id="versionList" class="dropdown-menu">
<a class="dropdown-item" onclick="changeVersion('1.13')">1.13</a>
<a class="dropdown-item" onclick="changeVersion('1.14')">1.14</a>
<a class="dropdown-item" onclick="changeVersion('1.15')">1.15</a>
</div>
</li>
<li class="nav-item dropdown">

View File

@@ -3,6 +3,7 @@
"$type": {
"alternative": "Alternative",
"inverted": "Inverted",
"reference": "Reference",
"entity_properties": "Entity Properties",
"block_state_propery": "Block Properties",
"match_tool": "Tool Properties",
@@ -17,6 +18,7 @@
"survives_explosion": "Survives Explosion"
},
"type": "Condition",
"name": "Predicate Name",
"chance": "Chance",
"looting_multiplier": "Looting Multiplier",
"inverse": "Inverted",
@@ -129,6 +131,7 @@
"fill_player_head": "Fill Player Head",
"copy_name": "Copy Name",
"copy_nbt": "Copy NBT",
"copy_state": "Copy Block States",
"apply_bonus": "Apply Bonus",
"exploration_map": "Exploration Map Properties",
"set_stew_effect": "Set Stew Effect"
@@ -143,6 +146,8 @@
"levels": "Levels",
"treasure": "Treasure",
"limit": "Limit",
"block": "Block",
"properties": "Properties",
"entity": "Entity",
"source": "Source",
"replace": "Replace",
@@ -263,7 +268,28 @@
},
"biome": "Biome",
"feature": "Feature",
"dimension": "Dimension"
"dimension": "Dimension",
"light": "Light",
"$light": {
"light": "Visible Level"
},
"block": "Block",
"$block": {
"block": "Block ID",
"tag": "Block Tag",
"nbt": "NBT",
"state": "Block State",
"state_add": "Add Block State",
"state_remove": "Remove Block State"
},
"fluid": "Fluid",
"$fluid": {
"fluid": "Fluid ID",
"tag": "Fluid Tag",
"state": "Fluid State",
"state_add": "Add Fluid State",
"state_remove": "Remove Fluid State"
}
},
"$distance": {
"x": "X",
@@ -288,13 +314,16 @@
"count": "Count",
"durability": "Durability",
"potion": "Potion",
"nbt": "NBT"
"nbt": "NBT",
"enchantment": "Enchantment",
"levels": "Levels"
},
"2_spaces": "2 Spaces",
"4_spaces": "4 Spaces",
"child_add": "Add Child",
"condition_add": "Add Condition",
"enchantment_add": "Add Enchantment",
"stored_enchantment_add": "Add Stored Enchantment",
"entry_add": "Add Entry",
"function_add": "Add Function",
"attribute_modifier_add": "Add Modifier",

View File

@@ -140,6 +140,7 @@
"levels": "Уровень",
"treasure": "Чары-сокровища",
"limit": "Ограничение",
"block": "Блок",
"entity": "Сущность",
"source": "Источник",
"replace": "Заменить старое",
@@ -252,7 +253,9 @@
"count": "Количество",
"durability": "Прочность",
"potion": "Зелье",
"nbt": "NBT"
"nbt": "NBT",
"enchantment": "Чары",
"levels": "Уровень"
},
"2_spaces": "2 пробела",
"4_spaces": "4 пробела",

View File

@@ -140,6 +140,7 @@
"levels": "等级",
"treasure": "宝藏型附魔",
"limit": "限制",
"block": "方块",
"entity": "实体",
"source": "源",
"replace": "覆盖",
@@ -257,7 +258,9 @@
"count": "数量",
"durability": "耐久度",
"potion": "药水",
"nbt": "NBT"
"nbt": "NBT",
"enchantment": "附魔",
"levels": "等级"
},
"2_spaces": "2 空格缩进",
"4_spaces": "4 空格缩进",

View File

@@ -283,7 +283,7 @@ function updateField(el) {
let type = getType(el);
let value = undefined;
if (type === 'string' || type === 'int' || type === 'float' || type === 'enum' || type === 'json' || type === 'nbt' || type === 'chance-list') {
if (type === 'string' || type === 'int' || type === 'float' || type === 'enum' || type === 'json' || type === 'nbt' || type === 'string-list' || type === 'chance-list') {
value = $(el).val();
}
if (type === 'int') {
@@ -296,19 +296,21 @@ 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) {
} else if (type === 'string-list' || type === 'chance-list') {
value = value.split(',');
for (let i = 0; i < value.length; i += 1) {
value[i] = value[i].trim();
if (type === 'chance-list') {
if (isNaN(value[i])) {
value = [];
break;
}
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') {

View File

@@ -1059,6 +1059,32 @@
"id": "nbt",
"type": "nbt",
"translate": "$item.nbt"
},
{
"id": "enchantments",
"type": "array",
"translate": "enchantment",
"button": "field",
"values": "enchantment"
}
]
},
{
"id": "enchantment",
"type": "object",
"color": "dark",
"fields": [
{
"id": "enchantment",
"type": "enum",
"translate": "$item.enchantment",
"translateValue": "$enchantment",
"values": "enchantments"
},
{
"id": "levels",
"type": "range",
"translate": "$item.levels"
}
]
},

1567
schemas/1.15.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -70,6 +70,7 @@ function generateComponent(data, struct) {
case 'string': return generateString(data, struct);
case 'int': return generateString(data, struct);
case 'float': return generateString(data, struct);
case 'string-list': return generateString(data, struct);
case 'chance-list': return generateString(data, struct);
case 'boolean': return generateBoolean(data, struct);
case 'random': return generateRandom(data, struct);