Add resource node + improve default mods

This commit is contained in:
Misode
2020-05-26 15:11:51 +02:00
parent f77997f633
commit a6661a8563
10 changed files with 52 additions and 30 deletions

View File

@@ -0,0 +1,12 @@
import { NodeMods, RenderOptions } from '../AbstractNode'
import { StringNode } from '../StringNode'
export class ResourceNode extends StringNode {
constructor(mods?: NodeMods<string>) {
super({
transform: (v) => {
if (v === undefined) return undefined
return v.startsWith('minecraft:') ? v : 'minecraft:' + v
}, ...mods})
}
}