-
-
Notifications
You must be signed in to change notification settings - Fork 2
YAML format
Misat11 edited this page May 4, 2019
·
7 revisions
This library use .yml
files for guis!
Just load it as any other .yml
configuration file!
import java.io.File;
import java.io.IOException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.configuration.InvalidConfigurationException;
import misat11.lib.sgui.SimpleGuiFormat;
...
File file = new File(plugin.getDataFolder(), "gui.yml");
YamlConfiguration config = new YamlConfiguration();
try {
config.load(file);
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
List<Map<String, Object>> data = (List<Map<String, Object>>) config.getList("data");
SimpleGuiFormat format = new SimpleGuiFormat(data);
...
data:
- stack:
==: org.bukkit.inventory.ItemStack
v: 1519 # version of ItemStack (1519 = 1.13, 1952 = 1.14, on legacy versions don't use this variable)
type: DIAMOND_CHESTPLATE
amount: 1
meta:
==: ItemMeta
meta-type: UNSPECIFIC
display-name: "Armor"
items:
- myCustomVariable: myCustomValue
myCustomVariable2: myCustomValue2
stack: # another item stack
...
- stack: # another item stack
...
items: # childs
- stack: # another child item stack
...
items: # childs
...
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)