mirror of
https://github.com/SimplexDevelopment/FeelingLucky.git
synced 2024-11-24 19:05:02 +00:00
Alpha 1.0 RELEASE - Patch 0003
This commit is contained in:
parent
057450c585
commit
ea50032a89
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -114,6 +114,11 @@ public class LuckCMD extends Command implements TabCompleter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
|
if (args[0].equalsIgnoreCase("reload") && sender.hasPermission("luck.admin")) {
|
||||||
|
plugin.getConfigMap().values().forEach(PlayerConfig::reload);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if ((sender instanceof Player player) && player.hasPermission("luck.default")) {
|
if ((sender instanceof Player player) && player.hasPermission("luck.default")) {
|
||||||
if (args[0].equalsIgnoreCase("info")) {
|
if (args[0].equalsIgnoreCase("info")) {
|
||||||
Luck luck = plugin.handler.getLuckContainer(player);
|
Luck luck = plugin.handler.getLuckContainer(player);
|
||||||
@ -127,7 +132,7 @@ public class LuckCMD extends Command implements TabCompleter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -153,6 +158,7 @@ public class LuckCMD extends Command implements TabCompleter {
|
|||||||
switch (args[0]) {
|
switch (args[0]) {
|
||||||
case "info":
|
case "info":
|
||||||
case "reset":
|
case "reset":
|
||||||
|
case "reload":
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
case "give":
|
case "give":
|
||||||
case "take":
|
case "take":
|
||||||
|
@ -30,6 +30,7 @@ public class Luck implements LuckContainer {
|
|||||||
this.multiplier = multiplier;
|
this.multiplier = multiplier;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
BASE_VALUE = plugin.getConfigMap().get(player.getUniqueId()).getConfig().getDouble("luck");
|
BASE_VALUE = plugin.getConfigMap().get(player.getUniqueId()).getConfig().getDouble("luck");
|
||||||
|
|
||||||
event = new PlayerLuckChangeEvent(this);
|
event = new PlayerLuckChangeEvent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,6 +75,11 @@ public class PlayerConfig {
|
|||||||
SneakyWorker.sneakyTry(() -> config = YamlConfiguration.loadConfiguration(configFile));
|
SneakyWorker.sneakyTry(() -> config = YamlConfiguration.loadConfiguration(configFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reload() {
|
||||||
|
save();
|
||||||
|
load();
|
||||||
|
}
|
||||||
|
|
||||||
public void setLuck(double luck) {
|
public void setLuck(double luck) {
|
||||||
config.set("luck", luck);
|
config.set("luck", luck);
|
||||||
save();
|
save();
|
||||||
|
Loading…
Reference in New Issue
Block a user