From a71c2197011bd7e8ea7bd077f060cf19e129f5f8 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Mon, 11 May 2020 01:35:47 +0200 Subject: [PATCH] Created Requirements (markdown) --- Requirements.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Requirements.md diff --git a/Requirements.md b/Requirements.md new file mode 100644 index 0000000..74c5095 --- /dev/null +++ b/Requirements.md @@ -0,0 +1,69 @@ +## List +This is a list of all built-in requirements of DungeonsXL. + +### Level fee +Makes the player pay experience levels. +``` +requirements: + feeLevel: 1 +``` + +### Monetary fee +Makes the player pay Vault money. +``` +requirements: + feeMoney: 50.0 +``` + +### Forbidden items +Items that may not be taken into the dungeon. +``` +requirements: + forbiddenItems: + - ENDER_PEARL + - MY_CUSTOM_ITEM +``` + +### Group size +Sets the allowed amount of group members. +``` +requirements: + groupSize: + minimum: 2 + maximum: 4 +``` + +### Item keys +Items the player must have to play the dungeon. +``` +requirements: + keyItems: + - GOLD_INGOT + - MY_CUSTOM_ITEM +``` + +### Permission +Permissions the player must have to play the dungeon. +``` +requirements: + permission: + - my.custom.node + - yet.another.node +``` + +### Time frame +The time when the dungeon may be played. +In this example, it can only be played on a friday and from sunday to tuesday respectively at 15-16 o'clock. +Note that the week in the Java Calendar API begins with sunday, so SATURDAY-SUNDAY does not work. +``` +requirements: + timeframe: + - "FRIDAY" + - "SUNDAY-TUESDAY" + - "15-16" +``` + +## API +Creating a requirement is as easy as implementing the [Requirement](https://erethon.de/javadocs/dungeonsxl/de/erethon/dungeonsxl/api/Requirement.html) interface in a class with a [DungeonsAPI](https://erethon.de/javadocs/dungeonsxl/de/erethon/dungeonsxl/api/DungeonsAPI.html) parameter. See [here](https://github.com/DRE2N/DungeonsXL/blob/master/core/src/main/java/de/erethon/dungeonsxl/requirement/FeeMoneyRequirement.java) for reference. + +Requirements fire [RequirementCheckEvent](https://erethon.de/javadocs/dungeonsxl/de/erethon/dungeonsxl/api/event/requirement/RequirementCheckEvent.html) and [RequirementDemandEvent](https://erethon.de/javadocs/dungeonsxl/de/erethon/dungeonsxl/api/event/requirement/RequirementDemandEvent.html). \ No newline at end of file