parent
8558c89871
commit
8c87b9f830
@ -0,0 +1,87 @@
|
||||
package net.alexmcs.bukkit.serverstopper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
|
||||
/**
|
||||
* ServerStopper
|
||||
* net.alexmcs.bukkit.serverstopper.Translations
|
||||
* An extension of ConfigManager that does the same thing, but for translations.
|
||||
* This is in a separate class mostly just to make it easier to call from other classes to get strings.
|
||||
*/
|
||||
public class Translations {
|
||||
|
||||
// Wow! Look at all those strings!
|
||||
|
||||
// See the comments in the bukkit-translations.yml resource for the commented key for information on each String.
|
||||
|
||||
static String broadcastPrefix; // chat-broadcast.prefix
|
||||
static String broadcastWarning; // chat-broadcast.warning
|
||||
static String broadcastNotify; // chat-broadcast.notify
|
||||
static String broadcastCancel; // chat-broadcast.cancel
|
||||
|
||||
static String bossbarWarning; // bossbar-warning
|
||||
|
||||
static String tmActionbarWarning; // titles.actionbar-warning
|
||||
static String tmSubtitleWarning; // titles.subtitle-warning
|
||||
static String tmTitleWarning; // titles.title-warning
|
||||
static String tmTabFooterWarning; // titles.tabfoot-warning
|
||||
|
||||
static String errorPrefix; // error.prefix
|
||||
static String errorPermission; // error.permission-generic
|
||||
static String errorPermissionStop; // error.permission-stop
|
||||
static String errorPermissionNow; // error.permission-now
|
||||
static String errorPermissionCancel; // error.permission-cancel
|
||||
static String errorUnknownCommand; // error.unknown-command
|
||||
static String errorNotImplemented; // error.not-implemented
|
||||
|
||||
static String help1; // help.1
|
||||
static String help2; // help.2
|
||||
static String help3; // help.3
|
||||
static String help4; // help.4
|
||||
static String help5; // help.5
|
||||
static String help6; // help.6
|
||||
static String help7; // help.7
|
||||
static String help8; // help.8
|
||||
static String help9; // help.9
|
||||
static String help10; // help.10
|
||||
|
||||
static String aboutTranslator; // about.translator
|
||||
static String aboutHelp; // about.help
|
||||
static String aboutUri; // about.uri
|
||||
|
||||
// Store these values in ProxyHelper class?
|
||||
static String phBossbarWarning; // bungeecord.bossbar-warning
|
||||
static String phTmTitlebarWarning; // bungeecord.titlebar-warning
|
||||
static String phTmSubtitleWarning; // bungeecord.subtitle-warning
|
||||
static String phTmTitleWarning; // bungeecord.title-warning
|
||||
static String phTmTabFooterWarning; // bungeecord.tabfoot-warning
|
||||
|
||||
|
||||
// Load up those bitches!
|
||||
static void loadTranslations() {
|
||||
|
||||
// thisPlugin.getDataFolder().mkdirs(); // This is called long after ConfigManager does this. No need.
|
||||
File config = new File(ConfigManager.thisPlugin.getDataFolder(), "translations.yml");
|
||||
|
||||
// The ability to focus is something I do not possess.
|
||||
|
||||
// If the configuration does not exist, create it.
|
||||
if (!config.exists()) {
|
||||
ConfigManager.thisPlugin.getLogger().warning("The config does not exist. Creating it.");
|
||||
try {
|
||||
config.createNewFile();
|
||||
InputStream defaultConfig = (ConfigManager.thisPlugin.getResource("/bukkit-translations.yml"));
|
||||
Files.copy(defaultConfig, config.getAbsoluteFile().toPath());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Unable to write config", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
# ServerStopper for Bukkit/Spigot/Paper
|
||||
# Main configuration file (config.yml)
|
||||
|
||||
# Default shutdown delay in seconds when calling /stop
|
||||
delay: 60
|
||||
|
||||
# Default time units when calling /stop <integer> in multiples of seconds. (1 for seconds, 60 for minutes, 3600 for hours)
|
||||
timeunits: 60
|
||||
|
||||
# Minimum delay in seconds. Any attempt to stop with a delay lower than this will not be processed. Does not apply to /stop now
|
||||
min-delay: 30
|
||||
|
||||
# Use generic permissions errors for all permission fails.
|
||||
generic-permission-errors: false
|
||||
|
||||
# Simple chat warnings
|
||||
warnings:
|
||||
# Chat warning intervals in seconds
|
||||
intervals: [3600,1800,900,600,300,60,30,15]
|
||||
# This is the final countdown in seconds. All integers lower than this (and higher than 0) will be announced.
|
||||
countdown: 10
|
||||
|
||||
# BossBarAPI support
|
||||
bossbar:
|
||||
# Set enabled: false if you do not want to use BossBarAPI to show the shutdown warnings.
|
||||
enabled: true
|
||||
# The BossBar mode. Supports "simple" or "colorshift". For help on using the "colorshift" mode, see <insert link>
|
||||
mode: "simple"
|
||||
# Countdown in seconds. The bossbar will show and count down from this to 0 before a shutdown.
|
||||
simple-countdown: 60
|
||||
|
||||
# TitleManager API support
|
||||
titles:
|
||||
# Set enabled: false if you do not want to use TitleManager API to show the shutdown warnings.
|
||||
enabled: true
|
||||
# Action bar intervals. The action bar will appear briefly at these intervals in seconds.
|
||||
actionbar-intervals: [3600,1800,900,600]
|
||||
# Action bar countdown. The action bar will appear and count down from max to min in seconds.
|
||||
actionbar-countdown-max: 60
|
||||
actionbar-countdown-min: 16
|
||||
# Subtitle intervals. The subtitle will appear briefly at these intervals in seconds.
|
||||
subtitle-intervals: [300, 60, 30]
|
||||
# Subtitle countdown. The subtitle will appear and count down from max to min in seconds.
|
||||
subtitle-max: 15
|
||||
subtitle-min: 0
|
||||
# Main title countdown. The main title will appear and count down from max to min in seconds. I recommend making title-min and subtitle-min the same due to the limited space on the main title.
|
||||
title-max: 10
|
||||
title-min: 0
|
||||
# Display countdown in tab footer? This will be always-on if the server is stopping.
|
||||
tabfoot: true
|
||||
# These features currently support TitleManager by Puharesource. If your favourite title manager plugin is not supported and has an API, let me know and I'll attempt to add it!
|
||||
|
||||
|
||||
|
||||
# ProxyStopper integration (requires ProxyStopper v1.1+ and ServerStopper v1.2+)
|
||||
bungeecord:
|
||||
# Set enabled: true if you are using ProxyStopper for BungeeCord and want ServerStopper to handle bossbar and titles for it.
|
||||
enabled: false
|
||||
# The bossbar settings, if enabled, are shared with this instance of ServerStopper
|
||||
bossbar: true
|
||||
# The titles settings, if enabled, are shared with this instance of ServerStopper, excepting tabfoot.
|
||||
titles: true
|
||||
# Display proxy countdown in tab footer? Requires titles: true above.
|
||||
tabfoot: true
|
||||
|
||||
|
||||
|
||||
# DANGER ZONE! Untested options. Don't change if you're not prepared for things to break.
|
||||
|
||||
# Notify everyone with a broadcast when a restart is first initialized?
|
||||
notify: true # Disabling this option might be a little buggy right now. I haven't properly tested it.
|
||||
|
||||
# If true, time units like hours, minutes, seconds, or now will be calculated. Otherwise, all time will be displayed in seconds.
|
||||
timeunits: false # This option might be a little buggy right now. I haven't properly tested it.
|
||||
|
||||
# These options may have been stablized and moved into the above secion in a later version of ProxyStopper. Check the wiki page for more information.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# config-version is used internally. DO NOT ALTER.
|
||||
config-version: "SNAPSHOT"
|
@ -0,0 +1,84 @@
|
||||
# ServerStopper for Bukkit/Spigot/Paper
|
||||
# Translation file (translation.yml)
|
||||
# You can change this file if you want to translate ServerStopper to a different language, or just customize the strings.
|
||||
# Make sure to leave trailing spaces intact where present in the original file to avoid things getting squished together.
|
||||
|
||||
# Main chat broadcast translations
|
||||
chat-broadcast:
|
||||
# The prefix used for all chat broadcasts. The default mimics Essentials' /broadcast format
|
||||
prefix: "&6[&4Broadcast&6]&a "
|
||||
# The warning broadcast at scheduled intervals and during countdown.
|
||||
warning: "&4&lATTENTION&a: The server will be restarting in &6&l{count}&a {timeunits}."
|
||||
# The initial notification when someone initiates a restart.
|
||||
notify: "{displayname}&a has initiated a server restart. The server will restart in &6&l{timecount}&a {timeunits}."
|
||||
# The restart cancelation notification.
|
||||
cancel: "{displayname}&a has canceled the server restart. The server will not restart."
|
||||
|
||||
# BossBarAPI translation
|
||||
bossbar-warning: "&aThe server will be restarting in &6&l{count}&a {timeunits}."
|
||||
|
||||
# TitleManager translations, not to be confused with the titles section of config.yml
|
||||
titles:
|
||||
# Action bar text
|
||||
actionbar-warning: "&aThe server will be restarting in &6&l{count}&a {timeunits}."
|
||||
# Subtitle text
|
||||
subtitle-warning: "&aThe server will be restarting in &6&l{count}&a {timeunits}."
|
||||
# Title text
|
||||
title-warning: "&aServer restart: &6&l{count}&a {timeunits}"
|
||||
# Tab footer text
|
||||
tabfoot-warning: "&aServer restart: &6&l{count}&a {timeunits}"
|
||||
|
||||
# Error handling
|
||||
error:
|
||||
prefix: "&4&lERROR&r: "
|
||||
permission-generic: "You do not have permission to do that."
|
||||
permission-stop: "You do not have permission to stop the server."
|
||||
permission-now: "You do not have permission to stop the server immediately."
|
||||
permission-cancel: "You do not have permission to cancel a server stop."
|
||||
unknown-command: "Unknown argument(s). See /serverstopper help"
|
||||
not-implemented: "This feature is not implemented yet."
|
||||
|
||||
# Help (the first line with the version string cannot be changed from here)
|
||||
help:
|
||||
1: "&cTo stop the server, use &b&l/stop"
|
||||
2: "&cTo stop the server immediately, use &b&l/stop now"
|
||||
3: "&cTo cancel a pending server stop, use &b&l/stop cancel"
|
||||
4: "&cTo stop the server in a certain amount of time, use &b&l/stop <time> [units]"
|
||||
5: "&cTo learn more about ServerStopper, use &b&l/serverstopper info"
|
||||
6: "&cTo reload the ServerStopper configuration, use /serverstopper reload"
|
||||
# Supports up to ten lines. Leave extra unneeded lines blank. All lines after the first blank line will be skipped.
|
||||
7: ""
|
||||
8: ""
|
||||
9: ""
|
||||
10: ""
|
||||
|
||||
# Adjustable about fields. You cannot change the version or author lines from here.
|
||||
about:
|
||||
# translator line will be added below the author line. Leave blank to disable. Use for "Translated by Yourname" or "Yournetwork Edition" messages.
|
||||
translator: ""
|
||||
help: "&aTo learn how to use ServerStopper, do &b&l/serverstopper help&a."
|
||||
uri: "&cMore information: &9http://gitlab.com/AlexMCS/ServerStopper/"
|
||||
|
||||
# Translations for ProxyStopper integration, not to be confused with the bungeecord section of config.yml
|
||||
# All other ProxyStopper translations should be done in the ProxyStopper configuration.
|
||||
bungeecord:
|
||||
# BossBarAPI Proxy translation
|
||||
bossbar-warning: "&aThe proxy will be restarting in &6&l{count}&a {timeunits}."
|
||||
# Action bar text
|
||||
actionbar-warning: "&aThe proxy will be restarting in &6&l{count}&a {timeunits}."
|
||||
# Subtitle text
|
||||
subtitle-warning: "&aThe proxy will be restarting in &6&l{count}&a {timeunits}."
|
||||
# Title text
|
||||
title-warning: "&aProxy restart: &6&l{count}&a {timeunits}"
|
||||
# Tab footer text
|
||||
tabfoot-warning: "&aProxy restart: &6&l{count}&a {timeunits}"
|
||||
|
||||
# You're all done here. If you've translated ServerStopper to another language and you want to contribute your translations for others to use, see <insert link>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# translation-version is used internally. DO NOT ALTER!
|
||||
translation-version: "SNAPSHOT"
|
Reference in new issue