This repository has been archived by the owner on Jun 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added command rewards to treasure chests
- Loading branch information
1 parent
3f2c46f
commit e1ce6b9
Showing
3 changed files
with
157 additions
and
32 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
core/src/main/java/be/isach/ultracosmetics/treasurechests/CommandReward.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,56 @@ | ||
package be.isach.ultracosmetics.treasurechests; | ||
|
||
import be.isach.ultracosmetics.UltraCosmeticsData; | ||
import be.isach.ultracosmetics.util.CustomConfiguration; | ||
import java.util.List; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.Material; | ||
|
||
/** | ||
* A command reward. | ||
* | ||
* @author RadBuilder | ||
* @since 10-21-2017 | ||
*/ | ||
public class CommandReward { | ||
private String name; | ||
private Material material; | ||
private int chance; | ||
private boolean messageEnabled; | ||
private String message; | ||
private List<String> commands; | ||
|
||
public CommandReward(String path) { | ||
CustomConfiguration config = UltraCosmeticsData.get().getPlugin().getConfig(); | ||
chance = config.getInt(path + ".Chance"); | ||
messageEnabled = config.getBoolean(path + ".Message.enabled"); | ||
message = config.getString(path + ".Message.message"); | ||
commands = config.getStringList(path + ".Commands"); | ||
material = Material.valueOf(config.getString(path + ".Material")); | ||
name = ChatColor.translateAlternateColorCodes('&', config.getString(path + ".Name")); | ||
} | ||
|
||
public int getChance() { | ||
return chance; | ||
} | ||
|
||
public boolean getMessageEnabled() { | ||
return messageEnabled; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
public List<String> getCommands() { | ||
return commands; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Material getMaterial() { | ||
return material; | ||
} | ||
} |
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
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