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:
destro174andauto authored and GitHub committed 2024-02-25 14:02:51 +01:00
1 parent 53d4549573
commit efc6b62b2f
24 files changed
+1128 -56

No files matched your search

@@ -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;
};
}
}