mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Add resource node + improve default mods
This commit is contained in:
12
src/nodes/custom/ResourceNode.ts
Normal file
12
src/nodes/custom/ResourceNode.ts
Normal 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})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user