<repositories>
<repository>
<id>darkwaterapi</id>
<url>https://repo.kiinse.me/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>kiinse.plugins.darkwaterapi</groupId>
<artifactId>darkwater-core</artifactId>
<version>ENTER_VERSION_HERE</version>
<scope>provided</scope>
</dependency>
</dependencies>
repositories {
maven {
url "https://repo.kiinse.me/releases"
}
}
dependencies {
compileOnly 'kiinse.plugins.darkwaterapi:darkwater-core:ENTER_VERSION_HERE'
}
.
└── resources
└── messages
├── en.json
└── ru.json
public final class TestPlugin extends DarkWaterJavaPlugin { // Main class
@Override
public void onStart() throws Exception {
// Code at startup
}
@Override
public void onStop() throws Exception {
// Shutdown code
}
private void sendMessageToPlayer(Player player) {
MessagesUtils messagesUtils = new DarkMessagesUtils(this);
messagesUtils.sendMessageWithPrefix(player, Message.MESSAGE_HELLO); // We send to player the message "message_hello" from the json file.
// This text will correspond to the selected localization of the player.
}
}
{
"prefix": "message prefix",
"message_hello": "Hello player!"
}
{
"prefix": "message prefix",
"message_hello": "Привет, игрок!"
}
Command | Permission | Description |
/locale change | locale.change | Opens a GUI to change the selected language |
/locale help | locale.help | Help command |
/locale set [locale] | locale.change | Setting the language without opening the GUI |
/locale list | locale.list | List of languages available for selection |
/locale get [player] | locale.get | View player's language |
/darkwater reload [plugin] | darkwater.reload | Reloading a plugin using DarkWaterAPI |
/darkwater disable [plugin] | darkwater.disable | Disabling a plugin using DarkWaterAPI |
/darkwater enable [plugin] | darkwater.enable | Enabling a plugin using DarkWaterAPI |
/statistic | darkwater.statistic | View statistics on the number of killed mobs. |
Placeholder | Description | |
%statistic_PUT-HERE-MOB% (Example: %statistic_CREEPER%) | Display the number of killed mob | |
%locale_player% |
| |
%locale_list% | Displaying a list of languages available for selection |
locale.default: en # The default language if the player's language is not available on the server, or it has not been defined
first.join.message: true # A message when the player enters, telling about the definition of the player's language and the possibility of changing this language.
actionbar.indicators: true # Indicators above the player's toolbar. This function is needed for some plugins that use DarkWaterAPI. Requires PlaceHolderAPI to work.
config.version: 3 # DO NOT TOUCH THIS PLEASE =)
debug: false # This line is not in the config by default, but you can enter it in the DarkWaterAPI config to display config logs in the server console.