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:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user