Skip to content

Commit

Permalink
Upgrade to v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia committed Sep 14, 2019
1 parent 3f91979 commit 1734092
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Triton 1.4.0
# Triton 2.0.0
[![Release](https://jitpack.io/v/diogotcorreia/Triton.svg)](https://jitpack.io/#diogotcorreia/Triton)

_Translate your server! Sends the same message on different languages... Hooks into all plugins!_
Expand All @@ -7,7 +7,7 @@ This repository was previously called MultiLanguagePlugin.
Buy it [here](https://www.spigotmc.org/resources/triton.30331/)!


[Download API for Triton 1.4.0](https://cdn.rexcantor64.com/triton/api/TritonAPI-v1.4.0.jar) or [add it to your project using Gradle/Maven](https://jitpack.io/#diogotcorreia/Triton).
[Download API for Triton 2.0.0](https://cdn.rexcantor64.com/triton/api/TritonAPI-v2.0.0.jar) or [add it to your project using Gradle/Maven](https://jitpack.io/#diogotcorreia/Triton).

Need help developing? Take a look at the [JavaDocs](https://triton.rexcantor64.com/javadocs) or join our [Discord](https://triton.rexcantor64.com/discord)!

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.rexcantor64.triton</groupId>
<artifactId>api</artifactId>
<version>1.4.0</version>
<version>2.0.0</version>
<properties>
<build.number/>
<plugin.version>${project.version}-${build.number}</plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@
*/
public interface LanguageManager {

/**
* Checks the message for patterns and returns the translated message.
*
* @param input The messages to be checked.
* @param p The {@link LanguagePlayer LanguagePlayer} to get the language from. Use the
* {@link com.rexcantor64.triton.api.players.PlayerManager PlayerManager} to get it.
* @return A translated message. If no patterns are found, it returns the input.
* @since 2.0.0
*/
String matchPattern(String input, LanguagePlayer p);

/**
* Get a message from its code in a player's language.
*
* @param player The {@link LanguagePlayer LanguagePlayer} to get the language from. Use the {@link com.rexcantor64.triton.api.players.PlayerManager PlayerManager} to get it.
* @param player The {@link LanguagePlayer LanguagePlayer} to get the language from. Use the
* {@link com.rexcantor64.triton.api.players.PlayerManager PlayerManager} to get it.
* @param code The code of the message to get.
* @param args (optional) The variables to replace in the message.
* @return The message in the player's language. If no message is found with the provided code, a standard 404 message will be returned.
* @return The message in the player's language. If no message is found with the provided code, a standard 404
* message will be returned.
* @since 1.0.0
*/
String getText(LanguagePlayer player, String code, Object... args);
Expand All @@ -27,17 +40,20 @@ public interface LanguageManager {
*
* @param code The code of the message to get.
* @param args (optional) The variables to replace in the message.
* @return The message in the main language. If no message is found with the provided code, a standard 404 message will be returned.
* @return The message in the main language. If no message is found with the provided code, a standard 404
* message will be returned.
* @since 1.0.0
*/
String getTextFromMain(String code, Object... args);

/**
* Get the 4 sign lines for a sign in a player's language.
*
* @param player The {@link LanguagePlayer LanguagePlayer} to get the language from. Use the {@link com.rexcantor64.triton.api.players.PlayerManager PlayerManager} to get it.
* @param player The {@link LanguagePlayer LanguagePlayer} to get the language from. Use the
* {@link com.rexcantor64.triton.api.players.PlayerManager PlayerManager} to get it.
* @param location The location of the sign.
* @return The message in the player's language. If no translatable sign is found on that location, null is returned.
* @return The message in the player's language. If no translatable sign is found on that location, null is
* returned.
* @since 1.0.0
*/
String[] getSign(LanguagePlayer player, SignLocation location);
Expand All @@ -47,7 +63,8 @@ public interface LanguageManager {
*
* @param name The name of the {@link Language language}.
* @param fallback Whether to return the main language or not if no language is found with the provided name.
* @return The language with the provided name. If no language is found, the main language will be returned if fallback is true. Otherwise, null is returned.
* @return The language with the provided name. If no language is found, the main language will be returned if
* fallback is true. Otherwise, null is returned.
* @since 1.0.0
*/
Language getLanguageByName(String name, boolean fallback);
Expand All @@ -57,7 +74,8 @@ public interface LanguageManager {
*
* @param locale The name of the locale.
* @param fallback Whether to return the main language or not if no language is found with the provided name.
* @return The language with the provided name. If no language is found, the main language will be returned if fallback is true. Otherwise, null is returned.
* @return The language with the provided name. If no language is found, the main language will be returned if
* fallback is true. Otherwise, null is returned.
* @since 1.3.0
*/
Language getLanguageByLocale(String locale, boolean fallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,16 @@ public enum EntityType {
TROPICAL_FISH,
DROWNED,
DOLPHIN,
LINGERING_POTION,
CAT,
PANDA,
PILLAGER,
RAVAGER,
TRADER_LLAMA,
WANDERING_TRADER,
FOX,
FISHING_HOOK,
LIGHTNING,
WEATHER,
PLAYER,
COMPLEX_PART,
TIPPED_ARROW,
UNKNOWN;

public static EntityType fromBukkit(Object type) {
Expand Down

0 comments on commit 1734092

Please sign in to comment.