Add a base layer for challenges.

Implement a challenge system. This allows players to work towards them and add some goals to reach.
Demo challenges are included in file challenges.yml. This should provide details on how to create your own challenges.

---------

Co-authored-by: Teriuihi <[email protected]>
This commit is contained in:
destro174
2024-02-25 14:02:51 +01:00
committed by GitHub
co-authored by auto
parent 53d4549573
commit efc6b62b2f
24 changed files with 1128 additions and 56 deletions
@@ -0,0 +1,9 @@
package com.alttd.cometskyblock.api.challenges;
public enum ChallengeDifficulty {
EASY,
MEDIUM,
HARD,
LEGENDARY,
EXOTIC
}
@@ -0,0 +1,28 @@
package com.alttd.cometskyblock.api.challenges;
public enum ChallengeType {
/**
* Player must have the items to turn in
*/
ON_PLAYER,
/**
* Requirements must be on the island
*/
ON_ISLAND,
/**
* Island level requirement
*/
ISLAND_LEVEL;
public static ChallengeType of(String challengeType) {
if (challengeType == null || challengeType.isEmpty())
return null;
return switch (challengeType.toUpperCase()) {
case "ON_PLAYER" -> ChallengeType.ON_PLAYER;
case "ON_ISLAND" -> ChallengeType.ON_ISLAND;
case "ISLAND_LEVEL" -> ChallengeType.ISLAND_LEVEL;
default -> null;
};
}
}