Skip to content

Commit

Permalink
Updated version to v.1.4.4 and optimized configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming12846 committed May 10, 2023
1 parent c215ed8 commit 2ad58b5
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 140 deletions.
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>de.gaming12846</groupId>
<artifactId>TrollPlus</artifactId>
<version>1.4.4-pre1</version>
<version>1.4.4</version>
<packaging>jar</packaging>

<name>TrollPlus</name>
Expand Down
20 changes: 7 additions & 13 deletions src/main/java/de/gaming12846/trollplus/TrollPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public class TrollPlus extends JavaPlugin {

// Create ConfigUtils
private ConfigUtil blocklistConfig;
private ConfigUtil langConfig;
private ConfigUtil langenConfig;
private ConfigUtil langdeConfig;
private ConfigUtil langCustomConfig;
private ConfigUtil langEnglishConfig;

private InventoryClickListener inventoryClickListener;
private TrollCommand trollCommand;
Expand Down Expand Up @@ -77,21 +76,16 @@ private void loadConfigs() {
this.saveDefaultConfig();

blocklistConfig = new ConfigUtil(this, "blocklist.yml");
langConfig = new ConfigUtil(this, "lang.yml");
langenConfig = new ConfigUtil(this, "lang_en.yml");
langdeConfig = new ConfigUtil(this, "lang_de.yml");
langCustomConfig = new ConfigUtil(this, "lang_custom.yml");
langEnglishConfig = new ConfigUtil(this, "lang_en.yml");

Constants constants = new Constants(this);
}

public ConfigUtil getLanguageConfig() {
if (Objects.equals(getConfig().getString("language"), "en")) {
return langenConfig;
} else if (Objects.equals(getConfig().getString("language"), "de")) {
return langdeConfig;
} else {
return langConfig;
}
if (Objects.equals(getConfig().getString("language"), "custom")) {
return langCustomConfig;
} else return langEnglishConfig;
}

public ConfigUtil getBlocklistConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ private void onPlayerJoin(PlayerJoinEvent event) {
player.removeMetadata("TROLLPLUS_CONTROL_PLAYER", plugin);
}
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/de/gaming12846/trollplus/utils/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class Constants {
public Constants(TrollPlus plugin) {
PLUGIN_NO_PERMISSION = ChatColor.RED + plugin.getLanguageConfig().getConfig().getString("no-permission");
PLUGIN_NO_CONSOLE = " " + plugin.getLanguageConfig().getConfig().getString("no-console");
String invalidSyntaxReplace = PLUGIN_PREFIX + ChatColor.RED + plugin.getLanguageConfig().getConfig().getString("invalid-syntax");
PLUGIN_INVALID_SYNTAX = invalidSyntaxReplace.replace("[color-code]", ChatColor.RESET.toString());
PLUGIN_INVALID_SYNTAX = PLUGIN_PREFIX + ChatColor.RED + plugin.getLanguageConfig().getConfig().getString("invalid-syntax") + " " + ChatColor.RESET + plugin.getLanguageConfig().getConfig().getString("invalid-syntax-use");
}
}
4 changes: 2 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

#####################Global settings#########################

# Set the language for the plugin, available options are default, en and de.
language: default
# Set the language for the plugin, available options are custom and en.
language: en

# Enable the metrics.
metrics-enabled: true
Expand Down
108 changes: 0 additions & 108 deletions src/main/resources/lang.yml

This file was deleted.

109 changes: 109 additions & 0 deletions src/main/resources/lang_custom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# This is the custom language config file for TrollPlus.
# If you want to translate the plugin, use this file.
# If you want, you can send me your translated language config file and I can add it to the plugin.
# This language config was generated for version ${project.version}.
# Language config by:

############################Global###########################

metrics-enabled: ""

checking-updates: ""
no-update-available: ""
update-available: ""
unable-check-updates: ""

no-permission: ""
no-console: ""
invalid-syntax: ""
invalid-syntax-use: ""

#######################"Trollplus" command###################

trollplus-version: ""
trollplus-developer: ""
trollplus-plugin-website: ""
trollplus-report-bugs: ":"
trollplus-reload: ""

trollplus-already-in-blocklist: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-added-to-blocklist: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-not-in-blocklist: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-removed-from-blocklist: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.

#######################"Troll" command#######################

troll-player-not-online: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.
troll-player-is-immune: "[player]" # The "[player]" must be included in the message as it will be replaced by the name of the player.

troll-vanish-not-available: ""
troll-teleport-not-available: ""
troll-control-not-available: ""
troll-slowly-kill-not-available: ""
troll-rocket-cannot-launch: ""
troll-rocket-launch-stopped: ""

#######################"Troll" GUI###########################

troll-close: ""
troll-close-description: ""
troll-vanish: ""
troll-vanish-description: ""
troll-teleport: ""
troll-teleport-description: ""
troll-kill: ""
troll-kill-description: ""
troll-invsee: ""
troll-invsee-description: ""
troll-invsee-ender-chest: ""
troll-invsee-ender-chest-description: ""

troll-freeze: ""
troll-freeze-description: ""
troll-hand-item-drop: ""
troll-hand-item-drop-description: ""
troll-control: ""
troll-control-description: ""
troll-flip-backwards: ""
troll-flip-backwards-description: ""
troll-spam-messages: ""
troll-spam-messages-description: ""
troll-spam-sounds: ""
troll-spam-sounds-description: ""
troll-semi-ban: ""
troll-semi-ban-description: ""
troll-tnt-track: ""
troll-tnt-track-description: ""
troll-mob-spawner: ""
troll-mob-spawner-description: ""
troll-slowly-kill: ""
troll-slowly-kill-description: ""
troll-random-scary-sound: ""
troll-random-scary-sound-description: ""
troll-inventory-drop: ""
troll-inventory-drop-description: ""
troll-rocket: ""
troll-rocket-description: ""
troll-fake-ban: ""
troll-fake-ban-description: ""
troll-fake-op: ""
troll-fake-op-description: ""

#######################"Trollbows" GUI#######################

trollbows-close: ""
trollbows-close-description: ""
trollbows-explosion-bow: ""
trollbows-explosion-bow-description: ""
trollbows-tnt-bow: ""
trollbows-tnt-bow-description: ""
trollbows-lighting-bolt-bow: ""
trollbows-lighting-bolt-bow-description: ""
trollbows-silverfish-bow: ""
trollbows-silverfish-bow-description: ""

#######################GUIs##################################

gui-placeholder-description: ""
gui-placeholder-coming-soon: ""
gui-placeholder-coming-soon-description: ""
3 changes: 0 additions & 3 deletions src/main/resources/lang_de.yml

This file was deleted.

19 changes: 9 additions & 10 deletions src/main/resources/lang_en.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This is the default language config file for TrollPlus.
# If you want to translate the plugin, use this file.
# If you want, you can send me your translated language config file and I can add it to the plugin.
# This is the english language config file for TrollPlus.
# This language config was generated for version ${project.version}.
# Language config by: Gaming12846

Expand All @@ -15,7 +13,8 @@ unable-check-updates: "Unable to check for updates:"

no-permission: "You do not have sufficient permissions to execute this command"
no-console: "command cannot be used from the console"
invalid-syntax: "Invalid command syntax! [color-code]Use /" # The "[color-code]" must be included in the message
invalid-syntax: "Invalid command syntax!"
invalid-syntax-use: "Use /"

#######################"Trollplus" command###################

Expand All @@ -25,15 +24,15 @@ trollplus-plugin-website: "Plugin website:"
trollplus-report-bugs: "Report bugs to:"
trollplus-reload: "Configurations were successfully reloaded"

trollplus-already-in-blocklist: "The player [player] is already in the blocklist" # The "[player]" must be included in the message
trollplus-added-to-blocklist: "The player [player] was added to the blocklist" # The "[player]" must be included in the message
trollplus-not-in-blocklist: "The player [player] is not in the blocklist" # The "[player]" must be included in the message
trollplus-removed-from-blocklist: "The player [player] has been removed from the blocklist" # The "[player]" must be included in the message
trollplus-already-in-blocklist: "The player [player] is already in the blocklist" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-added-to-blocklist: "The player [player] was added to the blocklist" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-not-in-blocklist: "The player [player] is not in the blocklist" # The "[player]" must be included in the message as it will be replaced by the name of the player.
trollplus-removed-from-blocklist: "The player [player] has been removed from the blocklist" # The "[player]" must be included in the message as it will be replaced by the name of the player.

#######################"Troll" command#######################

troll-player-not-online: "The player [player] is currently not online" # The "[player]" must be included in the message
troll-player-is-immune: "The player [player] is immune" # The "[player]" must be included in the message
troll-player-not-online: "The player [player] is currently not online" # The "[player]" must be included in the message as it will be replaced by the name of the player.
troll-player-is-immune: "The player [player] is immune" # The "[player]" must be included in the message as it will be replaced by the name of the player.

troll-vanish-not-available: "Sorry mate, but you can't hide from yourself"
troll-teleport-not-available: "Nice try, but you are already in your own position :)"
Expand Down

0 comments on commit 2ad58b5

Please sign in to comment.