-
Notifications
You must be signed in to change notification settings - Fork 4
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
Cow
authored and
Cow
committed
Feb 28, 2022
1 parent
c851220
commit 09f0d4b
Showing
22 changed files
with
370 additions
and
245 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
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,19 @@ | ||
package io.github.punishmentsx; | ||
|
||
import io.github.punishmentsx.utils.Colors; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public enum ConfigValues { | ||
REDIS_CHANNEL("DATABASE.REDIS.CHANNEL"), | ||
MONGO_DATABASE("DATABASE.MONGO.DB"), | ||
MONGO_URI("DATABASE.MONGO.URI"), | ||
|
||
CONSOLE_NAME("GENERAL.CONSOLE_NAME"); | ||
|
||
private String path; | ||
|
||
public String format(PunishmentsX plugin) { | ||
return Colors.convertLegacyColors(plugin.getConfig().getString(path)); | ||
} | ||
} |
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
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
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
31 changes: 31 additions & 0 deletions
31
src/main/java/io/github/punishmentsx/commands/impl/ReloadCommand.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,31 @@ | ||
package io.github.punishmentsx.commands.impl; | ||
|
||
import io.github.punishmentsx.Locale; | ||
import io.github.punishmentsx.PunishmentsX; | ||
import io.github.punishmentsx.commands.BaseCommand; | ||
import io.github.punishmentsx.utils.Colors; | ||
import io.github.punishmentsx.utils.ThreadUtil; | ||
import org.bukkit.command.CommandSender; | ||
|
||
public class ReloadCommand extends BaseCommand { | ||
|
||
private final PunishmentsX plugin; | ||
|
||
public ReloadCommand(PunishmentsX plugin, String name) { | ||
super(name); | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public void execute(CommandSender sender, String[] args, String alias) { | ||
if (!sender.hasPermission(Locale.RELOAD_PERMISSION.format(plugin))) { | ||
sender.sendMessage(Locale.NO_PERMISSION.format(plugin)); | ||
return; | ||
} | ||
|
||
ThreadUtil.runTask(true, plugin, () -> { | ||
plugin.reloadMessages(); | ||
sender.sendMessage(Colors.convertLegacyColors("&aReloading messages.yml file!")); | ||
}); | ||
} | ||
} |
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
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
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
Oops, something went wrong.