From 77e0dcc7f8edb79046987a236802668ba0aa9f2a Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 May 2013 11:54:17 +1000 Subject: [PATCH] Dont throw exceptions on missing translations --- proxy/src/main/java/net/md_5/bungee/BungeeCord.java | 10 +++++++++- .../net/md_5/bungee/connection/UpstreamBridge.java | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java index e9a74efc..893fa00b 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java @@ -25,6 +25,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Map; +import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.Timer; import java.util.TimerTask; @@ -330,7 +331,14 @@ public class BungeeCord extends ProxyServer @Override public String getTranslation(String name) { - return bundle.getString( name ); + String translation = ""; + try + { + translation = bundle.getString( name ); + } catch ( MissingResourceException ex ) + { + } + return translation; } @Override diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index b1991461..8ed42f85 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -1,6 +1,5 @@ package net.md_5.bungee.connection; -import java.util.Arrays; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.EntityMap; import net.md_5.bungee.UserConnection;