diff --git a/pom.xml b/pom.xml index b60fd3b..3bfa442 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ com.imaginarycode.minecraft RedisBungee - 0.3.5-SNAPSHOT + 0.3.6-SNAPSHOT diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/DataManager.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/DataManager.java index 1c9527e..f096a99 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/DataManager.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/DataManager.java @@ -6,6 +6,7 @@ */ package com.imaginarycode.minecraft.redisbungee; +import com.google.common.net.InetAddresses; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; @@ -24,7 +25,6 @@ import redis.clients.jedis.Jedis; import redis.clients.jedis.exceptions.JedisConnectionException; import java.net.InetAddress; -import java.net.UnknownHostException; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -122,11 +122,7 @@ public class DataManager implements Listener { try { String result = tmpRsc.hget("player:" + uuid, "ip"); if (result != null) { - address = InetAddress.getByName(result); - - if (address == null) - return null; - + address = InetAddresses.forString(result); ipCache.put(uuid, address); return address; } @@ -137,8 +133,6 @@ public class DataManager implements Listener { if (tmpRsc != null) plugin.getPool().returnBrokenResource(tmpRsc); throw new RuntimeException("Unable to get server for " + uuid, e); - } catch (UnknownHostException e) { - return null; } finally { plugin.getPool().returnResource(tmpRsc); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 9338d63..0d30b2e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: RedisBungee main: com.imaginarycode.minecraft.redisbungee.RedisBungee -version: 0.3.5 +version: 0.3.6 author: tuxed # This is used so that we can automagically override default BungeeCord behavior. softDepends: ["cmd_find", "cmd_list"] \ No newline at end of file diff --git a/src/test/java/com/imaginarycode/minecraft/redisbungee/test/UUIDNameTest.java b/src/test/java/com/imaginarycode/minecraft/redisbungee/test/UUIDNameTest.java index 244187a..ff90c8d 100644 --- a/src/test/java/com/imaginarycode/minecraft/redisbungee/test/UUIDNameTest.java +++ b/src/test/java/com/imaginarycode/minecraft/redisbungee/test/UUIDNameTest.java @@ -1,3 +1,9 @@ +/** + * Copyright © 2013 tuxed + * This work is free. You can redistribute it and/or modify it under the + * terms of the Do What The Fuck You Want To Public License, Version 2, + * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. + */ package com.imaginarycode.minecraft.redisbungee.test; import com.imaginarycode.minecraft.redisbungee.util.NameFetcher;