From b1f1d1c3130166cce8c2c8313ce1b8670746dcf5 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sat, 19 May 2018 20:31:29 +0200 Subject: [PATCH] 2.1.2 see spigotmc.org --- WorldSystem/bin/en.yml | 34 +++++++++---------- WorldSystem/bin/plugin.yml | 7 +++- WorldSystem/bin/settings.yml | 2 +- .../autoupdater/UpdateInformations.java | 4 ++- .../src/de/butzlabben/world/WorldSystem.java | 1 + .../world/command/WSAddmemberCommand.java | 2 +- .../world/command/WSDelmemberCommand.java | 2 +- .../butzlabben/world/config/PluginConfig.java | 11 +++++- .../de/butzlabben/world/gui/GuiCommand.java | 4 +++ .../butzlabben/world/wrapper/SystemWorld.java | 2 +- WorldSystem/src/en.yml | 34 +++++++++---------- WorldSystem/src/plugin.yml | 7 +++- WorldSystem/src/settings.yml | 2 +- 13 files changed, 69 insertions(+), 43 deletions(-) diff --git a/WorldSystem/bin/en.yml b/WorldSystem/bin/en.yml index 870569b..1cebee1 100644 --- a/WorldSystem/bin/en.yml +++ b/WorldSystem/bin/en.yml @@ -1,11 +1,11 @@ -nopermission: "&cYou don't have permissions!" +nopermission: "&cYou do not have permission to that command!" unknown_error: "&cSomething went wrong..." lagdetection: "Lagdetection in world: &c%world" wrong_usage: "&c%usage" not_registered: "&cThis player hasn't joined yet!" world: - reseted: "Your world was reseted!" + reseted: "You would was reset!" still_loaded: "&cYour world is still loaded!" not_on: "&cYou are not on a world!" created: "Your world is now ready. Get there with &a/ws home" @@ -16,8 +16,8 @@ world: does_not_exists: own: "&cYou don't have a world!" other: "&cThis player doesn't has a world!" - setting_up: "&aSetting up world..." - playerlist: "Player in this world: %players" + setting_up: "&aLoading world..." + playerlist: "Players in this world: %players" member: removed: "You removed &c%player&6 from your world!" @@ -25,20 +25,20 @@ member: already_added: "&cThis player is already a member!" not_added: own: "&cThis player isn't a member!" - other: "&cYou are not added to this world" + other: "&cYou have not been added to this world!" request: - expired: "&cYou request is expired!" - confirm: "&cPlease confirm reset of your world: %command" + expired: "&cYour request has expired!" + confirm: "WARNING - Please confirm reset of your world: %command" until_expire: "&cYour request expires in %time seconds!" already_sent: "&cYou already sent a request!" - not_sent: "&cYou didn't send a request!" - invalid_input: "&c%input is not a valid input!" + not_sent: "&cYou have not sent a request!" + invalid_input: "&c%input is not a valid request!" toggle: gamemode: - enabled: "&a%player&6 can now change his gamemode!" - disabled: "&c%player&6 can no longer change his gamemode!" + enabled: "&a%player&6 can now change their gamemode!" + disabled: "&c%player&6 can no longer change their gamemode!" teleport: enabled: "&a%player&6 can now teleport!" disabled: "&c%player&6 can no longer teleport!" @@ -65,16 +65,16 @@ command_help: list: - "/ws get &8- &7Will give you a world" - "/ws home &8- &7Teleports you on your world" - - "/ws gui &8- &7Opens the GUI menu if you are the worldowner" + - "/ws gui &8- &7Opens the GUI menu if you are the world owner" - "/ws tp &8- &7Teleports you on a specific world" - "/ws addmember &8- &7Adds a player to your world" - "/ws delmember &8- &7Removes a player from your world" - "/ws leave &8- &7Leave a world" - - "/ws tnt &8- &7Allows/Denys TNT on your world" - - "/ws fire &8- &7Allows/Denys Fire on your world" - - "/ws togglegm &8- &7Allows/Denys a player changing gamemode" - - "/ws togglebuild &8- &7Allows/Denys a player building" - - "/ws toggletp &8- &7Allows/Denys a player teleporting" + - "/ws tnt &8- &7Allows/Denies TNT on your world" + - "/ws fire &8- &7Allows/Denies Fire on your world" + - "/ws togglegm &8- &7Allows/Denies a player changing gamemode" + - "/ws togglebuild &8- &7Allows/Denies a player building on your world" + - "/ws toggletp &8- &7Allows/Denies a player teleporting on your world" - "/ws info &8- &7Shows information about the world" - "/ws reset &8- &7Will reset your world" delete_command: "/ws delete &8- &7Will delete a world" \ No newline at end of file diff --git a/WorldSystem/bin/plugin.yml b/WorldSystem/bin/plugin.yml index 53741f1..f278f33 100644 --- a/WorldSystem/bin/plugin.yml +++ b/WorldSystem/bin/plugin.yml @@ -1,5 +1,5 @@ name: WorldSystem -version: 2.1.1 +version: 2.1.2 author: Butzlabben main: de.butzlabben.world.WorldSystem @@ -9,6 +9,7 @@ commands: usage: /ws ws get: usage: /ws get + permission: ws.get ws help: usage: /ws help ws home: @@ -50,6 +51,7 @@ permissions: description: Gives '*'-Perms to all Commands children: ws.tp.*: true + ws.get: true ws.tp.world: true ws.tp.toother: true ws.tp.other: true @@ -70,6 +72,9 @@ permissions: ws.build: default: op description: You can build on other Worlds without WorldPermissions + ws.get: + default: true + description: You can create a world via /ws get ws.delete: default: op description: You can delete a world diff --git a/WorldSystem/bin/settings.yml b/WorldSystem/bin/settings.yml index a630b02..118a334 100644 --- a/WorldSystem/bin/settings.yml +++ b/WorldSystem/bin/settings.yml @@ -9,7 +9,7 @@ worldborder: # Size with ws.large permission large: 5000 - # Set a specialized center wich is not the spawn + # Set a specialized center which is not the spawn center: as_spawn: true x: 0 diff --git a/WorldSystem/src/de/butzlabben/autoupdater/UpdateInformations.java b/WorldSystem/src/de/butzlabben/autoupdater/UpdateInformations.java index 960e9f5..62fb9c0 100644 --- a/WorldSystem/src/de/butzlabben/autoupdater/UpdateInformations.java +++ b/WorldSystem/src/de/butzlabben/autoupdater/UpdateInformations.java @@ -9,6 +9,8 @@ import java.nio.charset.Charset; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import de.butzlabben.world.WorldSystem; + /** * @author Butzlabben * @since 02.05.2018 @@ -19,7 +21,7 @@ public class UpdateInformations { private final boolean silent; public static synchronized UpdateInformations getInformations() { - String json = callURL("https://seagiants.eu/worldsystem/info.php"); + String json = callURL("https://seagiants.eu/worldsystem/info.php?version=" + WorldSystem.getInstance().getDescription().getVersion()); Gson gson = new GsonBuilder().create(); UpdateInformations ui = gson.fromJson(json, UpdateInformations.class); return ui; diff --git a/WorldSystem/src/de/butzlabben/world/WorldSystem.java b/WorldSystem/src/de/butzlabben/world/WorldSystem.java index 1aeaf25..03611e8 100644 --- a/WorldSystem/src/de/butzlabben/world/WorldSystem.java +++ b/WorldSystem/src/de/butzlabben/world/WorldSystem.java @@ -173,6 +173,7 @@ public class WorldSystem extends JavaPlugin { if (languages.exists() == false) languages.mkdirs(); PluginConfig.checkConfig(config); + // Done with #6 MessageConfig.checkConfig(new File(languages, "en.yml")); MessageConfig.checkConfig(new File(languages, "de.yml")); MessageConfig.checkConfig(new File(languages, "hu.yml")); diff --git a/WorldSystem/src/de/butzlabben/world/command/WSAddmemberCommand.java b/WorldSystem/src/de/butzlabben/world/command/WSAddmemberCommand.java index 6e44241..3872090 100644 --- a/WorldSystem/src/de/butzlabben/world/command/WSAddmemberCommand.java +++ b/WorldSystem/src/de/butzlabben/world/command/WSAddmemberCommand.java @@ -37,7 +37,7 @@ public class WSAddmemberCommand implements CommandExecutor{ OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]); WorldConfig wc = WorldConfig.getWorldConfig(dc.getWorldname()); if (a == null) { - p.sendMessage(MessageConfig.getNotRegistered()); + p.sendMessage(MessageConfig.getNotRegistered().replaceAll("%player", args[1])); return true; } else if (wc.isMember(a.getUniqueId())) { p.sendMessage(MessageConfig.getAlreadyMember()); diff --git a/WorldSystem/src/de/butzlabben/world/command/WSDelmemberCommand.java b/WorldSystem/src/de/butzlabben/world/command/WSDelmemberCommand.java index 40c6a58..4b61ebc 100644 --- a/WorldSystem/src/de/butzlabben/world/command/WSDelmemberCommand.java +++ b/WorldSystem/src/de/butzlabben/world/command/WSDelmemberCommand.java @@ -37,7 +37,7 @@ public class WSDelmemberCommand implements CommandExecutor { OfflinePlayer a = Bukkit.getOfflinePlayer(args[1]); WorldConfig wc = WorldConfig.getWorldConfig(dc.getWorldname()); if (a == null) { - p.sendMessage(MessageConfig.getNotRegistered()); + p.sendMessage(MessageConfig.getNotRegistered().replaceAll("%player", args[1])); return true; } else if (!wc.isMember(a.getUniqueId())) { p.sendMessage(MessageConfig.getNoMemberOwn()); diff --git a/WorldSystem/src/de/butzlabben/world/config/PluginConfig.java b/WorldSystem/src/de/butzlabben/world/config/PluginConfig.java index 9558678..e1b39e6 100644 --- a/WorldSystem/src/de/butzlabben/world/config/PluginConfig.java +++ b/WorldSystem/src/de/butzlabben/world/config/PluginConfig.java @@ -1,8 +1,12 @@ package de.butzlabben.world.config; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.StandardCopyOption; import java.text.SimpleDateFormat; @@ -86,7 +90,12 @@ public class PluginConfig { } private static YamlConfiguration getConfig() { - return YamlConfiguration.loadConfiguration(file); + try { + return YamlConfiguration.loadConfiguration(new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"))); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + return null; } public static String getLicenseKey() { diff --git a/WorldSystem/src/de/butzlabben/world/gui/GuiCommand.java b/WorldSystem/src/de/butzlabben/world/gui/GuiCommand.java index e07a59d..7e73ac2 100644 --- a/WorldSystem/src/de/butzlabben/world/gui/GuiCommand.java +++ b/WorldSystem/src/de/butzlabben/world/gui/GuiCommand.java @@ -18,6 +18,10 @@ public class GuiCommand implements CommandExecutor { return true; } WorldPlayer wp = new WorldPlayer((Player) sender); + if(!wp.isOnSystemWorld()) { + sender.sendMessage(MessageConfig.getNotOnWorld()); + return true; + } if (!wp.isOwnerofWorld()) { sender.sendMessage(MessageConfig.getNoPermission()); return true; diff --git a/WorldSystem/src/de/butzlabben/world/wrapper/SystemWorld.java b/WorldSystem/src/de/butzlabben/world/wrapper/SystemWorld.java index 820cbde..0590e02 100644 --- a/WorldSystem/src/de/butzlabben/world/wrapper/SystemWorld.java +++ b/WorldSystem/src/de/butzlabben/world/wrapper/SystemWorld.java @@ -242,7 +242,7 @@ public class SystemWorld { DependenceConfig dc = new DependenceConfig(p); String uuid = p.getUniqueId().toString(); - int id = dc.getHighestID(); + int id = dc.getHighestID() + 1; String worldname = "ID" + id + "-" + uuid; WorldCreator creator = new WorldCreator(worldname); diff --git a/WorldSystem/src/en.yml b/WorldSystem/src/en.yml index 870569b..1cebee1 100644 --- a/WorldSystem/src/en.yml +++ b/WorldSystem/src/en.yml @@ -1,11 +1,11 @@ -nopermission: "&cYou don't have permissions!" +nopermission: "&cYou do not have permission to that command!" unknown_error: "&cSomething went wrong..." lagdetection: "Lagdetection in world: &c%world" wrong_usage: "&c%usage" not_registered: "&cThis player hasn't joined yet!" world: - reseted: "Your world was reseted!" + reseted: "You would was reset!" still_loaded: "&cYour world is still loaded!" not_on: "&cYou are not on a world!" created: "Your world is now ready. Get there with &a/ws home" @@ -16,8 +16,8 @@ world: does_not_exists: own: "&cYou don't have a world!" other: "&cThis player doesn't has a world!" - setting_up: "&aSetting up world..." - playerlist: "Player in this world: %players" + setting_up: "&aLoading world..." + playerlist: "Players in this world: %players" member: removed: "You removed &c%player&6 from your world!" @@ -25,20 +25,20 @@ member: already_added: "&cThis player is already a member!" not_added: own: "&cThis player isn't a member!" - other: "&cYou are not added to this world" + other: "&cYou have not been added to this world!" request: - expired: "&cYou request is expired!" - confirm: "&cPlease confirm reset of your world: %command" + expired: "&cYour request has expired!" + confirm: "WARNING - Please confirm reset of your world: %command" until_expire: "&cYour request expires in %time seconds!" already_sent: "&cYou already sent a request!" - not_sent: "&cYou didn't send a request!" - invalid_input: "&c%input is not a valid input!" + not_sent: "&cYou have not sent a request!" + invalid_input: "&c%input is not a valid request!" toggle: gamemode: - enabled: "&a%player&6 can now change his gamemode!" - disabled: "&c%player&6 can no longer change his gamemode!" + enabled: "&a%player&6 can now change their gamemode!" + disabled: "&c%player&6 can no longer change their gamemode!" teleport: enabled: "&a%player&6 can now teleport!" disabled: "&c%player&6 can no longer teleport!" @@ -65,16 +65,16 @@ command_help: list: - "/ws get &8- &7Will give you a world" - "/ws home &8- &7Teleports you on your world" - - "/ws gui &8- &7Opens the GUI menu if you are the worldowner" + - "/ws gui &8- &7Opens the GUI menu if you are the world owner" - "/ws tp &8- &7Teleports you on a specific world" - "/ws addmember &8- &7Adds a player to your world" - "/ws delmember &8- &7Removes a player from your world" - "/ws leave &8- &7Leave a world" - - "/ws tnt &8- &7Allows/Denys TNT on your world" - - "/ws fire &8- &7Allows/Denys Fire on your world" - - "/ws togglegm &8- &7Allows/Denys a player changing gamemode" - - "/ws togglebuild &8- &7Allows/Denys a player building" - - "/ws toggletp &8- &7Allows/Denys a player teleporting" + - "/ws tnt &8- &7Allows/Denies TNT on your world" + - "/ws fire &8- &7Allows/Denies Fire on your world" + - "/ws togglegm &8- &7Allows/Denies a player changing gamemode" + - "/ws togglebuild &8- &7Allows/Denies a player building on your world" + - "/ws toggletp &8- &7Allows/Denies a player teleporting on your world" - "/ws info &8- &7Shows information about the world" - "/ws reset &8- &7Will reset your world" delete_command: "/ws delete &8- &7Will delete a world" \ No newline at end of file diff --git a/WorldSystem/src/plugin.yml b/WorldSystem/src/plugin.yml index 53741f1..f278f33 100644 --- a/WorldSystem/src/plugin.yml +++ b/WorldSystem/src/plugin.yml @@ -1,5 +1,5 @@ name: WorldSystem -version: 2.1.1 +version: 2.1.2 author: Butzlabben main: de.butzlabben.world.WorldSystem @@ -9,6 +9,7 @@ commands: usage: /ws ws get: usage: /ws get + permission: ws.get ws help: usage: /ws help ws home: @@ -50,6 +51,7 @@ permissions: description: Gives '*'-Perms to all Commands children: ws.tp.*: true + ws.get: true ws.tp.world: true ws.tp.toother: true ws.tp.other: true @@ -70,6 +72,9 @@ permissions: ws.build: default: op description: You can build on other Worlds without WorldPermissions + ws.get: + default: true + description: You can create a world via /ws get ws.delete: default: op description: You can delete a world diff --git a/WorldSystem/src/settings.yml b/WorldSystem/src/settings.yml index a630b02..118a334 100644 --- a/WorldSystem/src/settings.yml +++ b/WorldSystem/src/settings.yml @@ -9,7 +9,7 @@ worldborder: # Size with ws.large permission large: 5000 - # Set a specialized center wich is not the spawn + # Set a specialized center which is not the spawn center: as_spawn: true x: 0