From e781b6be503adb1482fc4d98633ad54e96378d1a Mon Sep 17 00:00:00 2001 From: Steven Scott Date: Sat, 3 Sep 2011 16:55:50 -0700 Subject: [PATCH] [Version 0.6.8] - Fixed unmanned carts losing velocity through gates - /sg reload now properly switches languages [Version 0.6.7] - Added lang option - Removed language debug output - Added German language (lang=de) -- Thanks EduardBaer --- README | 8 ++++++++ src/net/TheDgtl/Stargate/LangLoader.java | 8 ++++++-- src/net/TheDgtl/Stargate/Portal.java | 1 + src/net/TheDgtl/Stargate/Stargate.java | 8 ++++++-- src/net/TheDgtl/Stargate/resources/de.txt | 22 ++++++++++++++++++++++ src/plugin.yml | 2 +- 6 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 src/net/TheDgtl/Stargate/resources/de.txt diff --git a/README b/README index ac1491c..9de7726 100644 --- a/README +++ b/README @@ -148,6 +148,7 @@ chargefreedestination - Enable to allow free travel from any gate to a free gate freegatesgreen - Enable to make gates that won't cost the player money show up as green toowner - Whether the money from gate-use goes to the owner or nobody maxgates - If non-zero, will define the maximum amount of gates allowed on any network. +lang - The language to use (Included languages: en, de) debug - Whether to show massive debug output permdebug - Whether to show massive permission debug output @@ -190,6 +191,13 @@ createConflict=Gate conflicts with existing gate ============= Changes ============= +[Version 0.6.8] + - Fixed unmanned carts losing velocity through gates + - /sg reload now properly switches languages +[Version 0.6.7] + - Added lang option + - Removed language debug output + - Added German language (lang=de) -- Thanks EduardBaer [Version 0.6.6] - Added %cost% and %portal% to all eco* messages - Fixed an issue when creating a gate on a network you don't have access to diff --git a/src/net/TheDgtl/Stargate/LangLoader.java b/src/net/TheDgtl/Stargate/LangLoader.java index 553910f..d4a9142 100644 --- a/src/net/TheDgtl/Stargate/LangLoader.java +++ b/src/net/TheDgtl/Stargate/LangLoader.java @@ -43,10 +43,14 @@ public class LangLoader { return val; } + public void setLang(String lang) { + this.lang = lang; + } + private void loadDefaults() { - InputStream is = Stargate.class.getResourceAsStream("resources/en.txt"); + InputStream is = Stargate.class.getResourceAsStream("resources/" + lang + ".txt"); if (is == null) return; - Stargate.log.info("[Stargate] Extracting initial language file"); + Stargate.log.info("[Stargate] Extracting initial language file -- " + lang + ".txt"); FileOutputStream fos = null; try { diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index 73ccfdd..ea0cde4 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -375,6 +375,7 @@ public class Portal { StorageMinecart smc = (StorageMinecart)mc; smc.getInventory().setContents(((StorageMinecart)vehicle).getInventory().getContents()); } + mc.setVelocity(newVelocity); vehicle.remove(); } } diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 9c42bd5..ff62eaf 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -80,6 +80,7 @@ public class Stargate extends JavaPlugin { private static String defNetwork = "central"; private static boolean destroyExplosion = false; public static int maxGates = 0; + private static String langName = "en"; private static int activeTime = 10; private static int openTime = 10; @@ -116,8 +117,7 @@ public class Stargate extends JavaPlugin { this.reloadConfig(); this.migrate(); this.reloadGates(); - lang = new LangLoader(langFolder, "en"); - lang.debug(); + lang = new LangLoader(langFolder, Stargate.langName); // Check to see if iConomy/Permissions is loaded yet. permissions = (Permissions)checkPlugin("Permissions"); @@ -155,6 +155,7 @@ public class Stargate extends JavaPlugin { defNetwork = config.getString("default-gate-network", defNetwork).trim(); destroyExplosion = config.getBoolean("destroyexplosion", destroyExplosion); maxGates = config.getInt("maxgates", maxGates); + langName = config.getString("lang", langName); // Debug debug = config.getBoolean("debug", debug); permDebug = config.getBoolean("permdebug", permDebug); @@ -180,6 +181,7 @@ public class Stargate extends JavaPlugin { config.setProperty("default-gate-network", defNetwork); config.setProperty("destroyexplosion", destroyExplosion); config.setProperty("maxgates", maxGates); + config.setProperty("lang", langName); // iConomy config.setProperty("useiconomy", iConomyHandler.useiConomy); config.setProperty("createcost", iConomyHandler.createCost); @@ -574,6 +576,7 @@ public class Stargate extends JavaPlugin { public static String replaceVars(String format, String[] search, String[] replace) { if (search.length != replace.length) return ""; for (int i = 0; i < search.length; i++) { + Stargate.debug("replaceVars", "Replacing [" + search[i] + "] With [" + replace[i] + "]"); format = format.replaceAll(search[i], replace[i]); } return format; @@ -1066,6 +1069,7 @@ public class Stargate extends JavaPlugin { // Reload data reloadConfig(); reloadGates(); + lang.setLang(langName); lang.reload(); return true; } diff --git a/src/net/TheDgtl/Stargate/resources/de.txt b/src/net/TheDgtl/Stargate/resources/de.txt new file mode 100644 index 0000000..8e09ee2 --- /dev/null +++ b/src/net/TheDgtl/Stargate/resources/de.txt @@ -0,0 +1,22 @@ +prefix=[Stargate] +teleportMsg=Du wurdest Teleportiert. +destroyMsg=Gate zerstört +invalidMsg=Ungültiges Ziel +blockMsg=Ziel blockiert +destEmpty=Zielliste leer +denyMsg=Zugriff verweigert + +ecoDeduct=%cost% abgezogen +ecoRefund=%cost% zurückerstattet +ecoObtain=%cost% von Stargate %portal% erhalten +ecoInFunds=Das kannst du dir nicht leisten. + +createMsg=Gate erstellt. +createNetDeny=Du hast keinen Zugriff auf dieses Netzwerk. +createGateDeny=Du hast keinen Zugriff auf dieses Gate-Layout. +createPersonal=Gate im persönlichen Netzwerk erstellt. +createNameLength=Name zu kurz oder zu lang. +createExists=Ein Gate mit diesem Name existiert bereits. +createFull=Dieses Netzwerk ist voll. +createWorldDeny=Du hast keinen Zugriff auf diese Welt. +createConflict=Dieses Gate steht im Konflikt mit einem bereits existierenden. \ No newline at end of file diff --git a/src/plugin.yml b/src/plugin.yml index 79c3e69..f0a0955 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.6.6 +version: 0.6.7-dev description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net