mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-01 01:59:33 +00:00
Add item enchantments field
This commit is contained in:
18
model.js
18
model.js
@@ -343,12 +343,6 @@ function addModifier(el) {
|
||||
invalidated();
|
||||
}
|
||||
|
||||
function removeModifier(el) {
|
||||
let index = parseInt($(el).closest('.modifier').attr('data-index'));
|
||||
getSuperParent(el).modifiers.splice(index, 1);
|
||||
invalidated();
|
||||
}
|
||||
|
||||
function addModifierSlot(el) {
|
||||
let modifier = getParent(el);
|
||||
if (!modifier.slot) {
|
||||
@@ -586,3 +580,15 @@ function updateChancesField(el) {
|
||||
}
|
||||
invalidated();
|
||||
}
|
||||
|
||||
function addConditionEnchantment(el) {
|
||||
let condition = getParent(el);
|
||||
if (!condition.enchantments) {
|
||||
condition.enchantments = [];
|
||||
}
|
||||
condition.enchantments.push({
|
||||
enchantment: 'minecraft:silk_touch',
|
||||
level: 1
|
||||
});
|
||||
invalidated();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user