-
-
Notifications
You must be signed in to change notification settings - Fork 2
Variable: clone method
Misat11 edited this page May 9, 2020
·
3 revisions
This sets clone method!
There are three clone methods:
-
default
,missing
- This is the default mehod! It clones just missing variables! Yaml:- id: hello stack: APPLE - clone-method: default clone: $hello stack: DIRT # Final item will be DIRT
Groovy:
item('APPLE') { id 'hello' } itemClone('$hello') { cloneMethod 'default' stack.type 'DIRT' // Final item will be DIRT }
-
override
- This always clones all variables from parent item!Yaml:
- id: hello stack: APPLE - clone-method: override clone: $hello stack: DIRT # Final item will be APPLE
Groovy:
item('APPLE') { id 'hello' } itemClone('$hello') { cloneMethod 'override' stack.type 'DIRT' // Final item will be APPLE }
-
increment
,increment-<method>
- This merges two lists (for exampleitems:
) and for other variables uses method after dashincrement-missing
,increment-override
Yaml:
- id: hello stack: APPLE items: - stack: ... - stack: ... - clone-method: increment clone: $hello stack: DIRT # Final item will be DIRT items: - stack: ... - stack: ... # Final number of childs will be 4
Groovy:
item('APPLE') { id 'hello' item('...') item('...') } itemClone('$hello') { cloneMethod 'increment' stack.type 'DIRT' // Final item will be DIRT item('...') item('...') // Final number of childs will be 4 }
Can't find what are you looking for on this wiki? Maybe our automatically generated javadoc could help you https://docs.screamingsandals.org/simpleinventories/simpleinventories-core/
- Welcome on this wiki
- Formats:
- Variables:
- Callbacks: (Groovy only)
-
Examples:
- Making shop (Groovy only)
- Making vault shop (Groovy only)