generated from Rosewood-Development/RoseTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/java/xyz/oribuin/fishing/manager/ConfigurationManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/main/java/xyz/oribuin/fishing/storage/FishingUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package xyz.oribuin.fishing.storage; | ||
|
||
import dev.rosewood.rosegarden.utils.StringPlaceholders; | ||
import xyz.oribuin.fishing.manager.ConfigurationManager.Setting; | ||
import xyz.oribuin.fishing.util.FishUtils; | ||
|
||
import java.util.UUID; | ||
|
||
public class FishingUser { | ||
|
||
private final UUID uuid; | ||
private int entropy; | ||
private int level; | ||
private int experience; | ||
private int skillPoints; | ||
|
||
public FishingUser(UUID uuid) { | ||
this.uuid = uuid; | ||
this.entropy = 0; | ||
this.level = 1; | ||
this.experience = 0; | ||
this.skillPoints = 0; | ||
} | ||
|
||
/** | ||
* Check the required experience to level up based on the current level | ||
* | ||
* @return The required experience to level up | ||
*/ | ||
public int getXpToNextLevel() { | ||
StringPlaceholders placeholders = StringPlaceholders.of("level", this.level); | ||
return (int) FishUtils.evaluate(placeholders.apply(Setting.REQUIRED_XP_FORMULA.getString())); | ||
} | ||
|
||
public UUID uuid() { | ||
return this.uuid; | ||
} | ||
|
||
public int entropy() { | ||
return this.entropy; | ||
} | ||
|
||
public void entropy(int entropy) { | ||
this.entropy = entropy; | ||
} | ||
|
||
public int level() { | ||
return this.level; | ||
} | ||
|
||
public void level(int level) { | ||
this.level = level; | ||
} | ||
|
||
public int experience() { | ||
return this.experience; | ||
} | ||
|
||
public void experience(int experience) { | ||
this.experience = experience; | ||
} | ||
|
||
public int skillCaught() { | ||
return this.skillPoints; | ||
} | ||
|
||
public void skillCaught(int skillCaught) { | ||
this.skillPoints = skillCaught; | ||
} | ||
|
||
} |