* This constructor is used only by ReloadInfo
*
* @param uuid UUID of the player.
@@ -55,13 +52,12 @@ public class LoginInfo extends HandlingInfo {
* @param nickname Nickname of the player
* @param gm current gamemode of the player
*/
- public LoginInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, Gamemode gm, String worldName) {
+ public LoginInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, String gm, String worldName) {
super(uuid, InfoType.RELOAD, time);
this.ip = ip;
this.banned = banned;
this.nickname = nickname;
- this.gmInfo = new GamemodeInfo(uuid, time, gm);
- worldInfo = new WorldInfo(uuid, time, worldName);
+ this.playtimeDependentInfo = new PlaytimeDependentInfo(uuid, InfoType.OTHER, time, gm, worldName);
this.loginTimes = 0;
}
@@ -71,8 +67,7 @@ public class LoginInfo extends HandlingInfo {
return false;
}
LoginHandling.processLoginInfo(uData, time, ip, banned, nickname, loginTimes);
- gmInfo.process(uData);
- worldInfo.process(uData);
+ playtimeDependentInfo.process(uData);
return true;
}
}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/LogoutInfo.java b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/LogoutInfo.java
index f7545c212..c591190b3 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/LogoutInfo.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/LogoutInfo.java
@@ -1,6 +1,5 @@
package main.java.com.djrapitops.plan.data.handling.info;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.data.SessionData;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.data.handling.LogoutHandling;
@@ -17,8 +16,7 @@ public class LogoutInfo extends HandlingInfo {
private final boolean banned;
private final SessionData sData;
- private final GamemodeInfo gmInfo;
- private final WorldInfo worldInfo;
+ private final PlaytimeDependentInfo playtimeDependentInfo;
/**
* Constructor.
@@ -30,12 +28,11 @@ public class LogoutInfo extends HandlingInfo {
* @param sData session that has been ended at the moment of the logout
* event.
*/
- public LogoutInfo(UUID uuid, long time, boolean banned, Gamemode gm, SessionData sData, String worldName) {
+ public LogoutInfo(UUID uuid, long time, boolean banned, String gm, SessionData sData, String worldName) {
super(uuid, InfoType.LOGOUT, time);
this.banned = banned;
this.sData = sData;
- this.gmInfo = new GamemodeInfo(uuid, time, gm);
- worldInfo = new WorldInfo(uuid, time, worldName);
+ this.playtimeDependentInfo = new PlaytimeDependentInfo(uuid, InfoType.OTHER, time, gm, worldName);
}
@Override
@@ -45,8 +42,7 @@ public class LogoutInfo extends HandlingInfo {
}
uData.addSession(sData);
LogoutHandling.processLogoutInfo(uData, time, banned);
- gmInfo.process(uData);
- worldInfo.process(uData);
+ playtimeDependentInfo.process(uData);
return true;
}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/PlaytimeDependentInfo.java b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/PlaytimeDependentInfo.java
new file mode 100644
index 000000000..757c4e88f
--- /dev/null
+++ b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/PlaytimeDependentInfo.java
@@ -0,0 +1,27 @@
+package main.java.com.djrapitops.plan.data.handling.info;
+
+import main.java.com.djrapitops.plan.data.UserData;
+import main.java.com.djrapitops.plan.data.handling.PlaytimeHandling;
+
+import java.util.UUID;
+
+public class PlaytimeDependentInfo extends HandlingInfo {
+
+ private final String gamemode;
+ private final String worldName;
+
+ public PlaytimeDependentInfo(UUID uuid, InfoType type, long time, String gm, String worldName) {
+ super(uuid, type, time);
+ this.worldName = worldName;
+ this.gamemode = gm;
+ }
+
+ @Override
+ public boolean process(UserData uData) {
+ if (!uuid.equals(uData.getUuid())) {
+ return false;
+ }
+ PlaytimeHandling.processPlaytimeDependentInfo(uData, time, gamemode, worldName);
+ return true;
+ }
+}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/ReloadInfo.java b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/ReloadInfo.java
index e9c8fed67..3b289fd08 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/ReloadInfo.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/ReloadInfo.java
@@ -1,7 +1,5 @@
package main.java.com.djrapitops.plan.data.handling.info;
-import com.djrapitops.plugin.utilities.player.Gamemode;
-
import java.net.InetAddress;
import java.util.UUID;
@@ -23,7 +21,7 @@ public class ReloadInfo extends LoginInfo {
* @param nickname Nickname of the player
* @param gm current gamemode of the player
*/
- public ReloadInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, Gamemode gm, String worldName) {
+ public ReloadInfo(UUID uuid, long time, InetAddress ip, boolean banned, String nickname, String gm, String worldName) {
super(uuid, time, ip, banned, nickname, gm, worldName);
}
}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/WorldInfo.java b/Plan/src/main/java/com/djrapitops/plan/data/handling/info/WorldInfo.java
deleted file mode 100644
index 43405a9cd..000000000
--- a/Plan/src/main/java/com/djrapitops/plan/data/handling/info/WorldInfo.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package main.java.com.djrapitops.plan.data.handling.info;
-
-import main.java.com.djrapitops.plan.data.UserData;
-import main.java.com.djrapitops.plan.data.handling.WorldTimeHandling;
-
-import java.util.UUID;
-
-/**
- * HandlingInfo Class for PlayerChangedWorldEvent information.
- *
- * @author Rsl1122
- * @since 3.6.0
- */
-public class WorldInfo extends HandlingInfo {
-
- private final String currentWorld;
-
- /**
- * Constructor.
- *
- * @param uuid UUID of the player related to the info.
- * @param time Time the event occurred
- * @param currentWorld World the player is currently in.
- */
- public WorldInfo(UUID uuid, long time, String currentWorld) {
- super(uuid, InfoType.WORLD, time);
- this.currentWorld = currentWorld;
- }
-
- @Override
- public boolean process(UserData uData) {
- if (!uData.getUuid().equals(uuid)) {
- return false;
- }
- WorldTimeHandling.processWorldChangeInfo(uData, time, currentWorld);
- return true;
- }
-}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanGamemodeChangeListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanGamemodeChangeListener.java
index 331ae1042..4a21103e5 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanGamemodeChangeListener.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanGamemodeChangeListener.java
@@ -1,10 +1,9 @@
package main.java.com.djrapitops.plan.data.listeners;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.cache.DataCacheHandler;
-import main.java.com.djrapitops.plan.data.handling.info.GamemodeInfo;
-import main.java.com.djrapitops.plan.data.handling.info.WorldInfo;
+import main.java.com.djrapitops.plan.data.handling.info.InfoType;
+import main.java.com.djrapitops.plan.data.handling.info.PlaytimeDependentInfo;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -46,7 +45,6 @@ public class PlanGamemodeChangeListener implements Listener {
Player p = event.getPlayer();
UUID uuid = p.getUniqueId();
long time = MiscUtils.getTime();
- handler.addToPool(new GamemodeInfo(uuid, time, Gamemode.wrap(event.getNewGameMode())));
- handler.addToPool(new WorldInfo(uuid, time, p.getWorld().getName()));
+ handler.addToPool(new PlaytimeDependentInfo(uuid, InfoType.GM, time, event.getNewGameMode().name(), p.getWorld().getName()));
}
}
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
index c5c8669fd..e57d54790 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanPlayerListener.java
@@ -74,7 +74,7 @@ public class PlanPlayerListener implements Listener {
InetAddress ip = player.getAddress().getAddress();
boolean banned = player.isBanned();
String displayName = player.getDisplayName();
- Gamemode gm = Gamemode.wrap(player.getGameMode());
+ String gm = player.getGameMode().name();
String worldName = player.getWorld().getName();
LoginInfo loginInfo = new LoginInfo(uuid, time, ip, banned, displayName, gm, 1, worldName);
@@ -114,7 +114,7 @@ public class PlanPlayerListener implements Listener {
Gamemode gm = Gamemode.wrap(player.getGameMode());
String worldName = player.getWorld().getName();
- handler.addToPool(new LogoutInfo(uuid, time, banned, gm, handler.getSession(uuid), worldName));
+ handler.addToPool(new LogoutInfo(uuid, time, banned, gm.name(), handler.getSession(uuid), worldName));
handler.saveCachedData(uuid);
Log.debug(uuid + ": PlayerQuitEvent_END");
}
@@ -140,7 +140,7 @@ public class PlanPlayerListener implements Listener {
Gamemode gm = Gamemode.wrap(player.getGameMode());
String worldName = player.getWorld().getName();
- handler.addToPool(new LogoutInfo(uuid, time, banned, gm, handler.getSession(uuid), worldName));
+ handler.addToPool(new LogoutInfo(uuid, time, banned, gm.name(), handler.getSession(uuid), worldName));
handler.addToPool(new KickInfo(uuid));
handler.saveCachedData(uuid);
Log.debug(uuid + ": PlayerKickEvent_END");
diff --git a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanWorldChangeListener.java b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanWorldChangeListener.java
index 3c0326a24..d3903c9ce 100644
--- a/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanWorldChangeListener.java
+++ b/Plan/src/main/java/com/djrapitops/plan/data/listeners/PlanWorldChangeListener.java
@@ -1,10 +1,9 @@
package main.java.com.djrapitops.plan.data.listeners;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.cache.DataCacheHandler;
-import main.java.com.djrapitops.plan.data.handling.info.GamemodeInfo;
-import main.java.com.djrapitops.plan.data.handling.info.WorldInfo;
+import main.java.com.djrapitops.plan.data.handling.info.InfoType;
+import main.java.com.djrapitops.plan.data.handling.info.PlaytimeDependentInfo;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -31,7 +30,6 @@ public class PlanWorldChangeListener implements Listener {
}
UUID uuid = p.getUniqueId();
long time = MiscUtils.getTime();
- handler.addToPool(new GamemodeInfo(uuid, time, Gamemode.wrap(p.getGameMode())));
- handler.addToPool(new WorldInfo(uuid, time, worldName));
+ handler.addToPool(new PlaytimeDependentInfo(uuid, InfoType.GM, time, p.getGameMode().name(), p.getWorld().getName()));
}
}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/GamemodeHandlingTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/GamemodeHandlingTest.java
deleted file mode 100644
index d33b17b27..000000000
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/GamemodeHandlingTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test.java.main.java.com.djrapitops.plan.data.handling;
-
-import com.djrapitops.plugin.utilities.player.Gamemode;
-import main.java.com.djrapitops.plan.data.UserData;
-import main.java.com.djrapitops.plan.data.handling.GamemodeHandling;
-import main.java.com.djrapitops.plan.data.time.GMTimes;
-import org.junit.Before;
-import org.junit.Test;
-import test.java.utils.MockUtils;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Rsl1122
- */
-public class GamemodeHandlingTest {
-
- /**
- *
- */
- public GamemodeHandlingTest() {
- }
-
- /**
- *
- */
- @Before
- public void setUp() throws Exception {
- }
-
- /**
- *
- */
- @Test
- public void testProcessGamemodeInfo() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("CREATIVE", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeHandling.processGamemodeInfo(data, time, Gamemode.SURVIVAL);
- Long result = data.getGmTimes().getTime("CREATIVE");
- assertTrue("Gamemode time was " + result, result == 1050L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 1100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 2000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Survival", lastGM.equals("SURVIVAL"));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 1100L);
- }
-
- /**
- *
- */
- @Test
- public void testProcessGamemodeInfoSameGM() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("SURVIVAL", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeHandling.processGamemodeInfo(data, time, Gamemode.SURVIVAL);
- Long result = data.getGmTimes().getTime("SURVIVAL");
- assertTrue("Gamemode time was " + result, result == 1050L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 1100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 2000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Survival", "SURVIVAL".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 1100L);
- }
-
- /**
- *
- */
- @Test
- public void testProcessGamemodeInfoNullNewGM() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("SURVIVAL", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeHandling.processGamemodeInfo(data, time, null);
- Long result = data.getGmTimes().getTime("SURVIVAL");
- assertTrue("Gamemode time was " + result, result == 0L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 1000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Survival", "SURVIVAL".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 50L);
- }
-
- /**
- *
- */
- @Test
- public void testProcessGamemodeInfoNullOldGM() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes(null, 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeHandling.processGamemodeInfo(data, time, Gamemode.SURVIVAL);
- Long result = data.getGmTimes().getTime(Gamemode.SURVIVAL.name());
- assertTrue("Gamemode time was " + result, result == 1050L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 1100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 2000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Survival", "SURVIVAL".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 1100L);
- }
-}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/GamemodeInfoTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/GamemodeInfoTest.java
deleted file mode 100644
index ef240b6e5..000000000
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/GamemodeInfoTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test.java.main.java.com.djrapitops.plan.data.handling.info;
-
-import com.djrapitops.plugin.utilities.player.Gamemode;
-import main.java.com.djrapitops.plan.data.UserData;
-import main.java.com.djrapitops.plan.data.handling.info.GamemodeInfo;
-import main.java.com.djrapitops.plan.data.time.GMTimes;
-import org.junit.Before;
-import org.junit.Test;
-import test.java.utils.MockUtils;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * @author Rsl1122
- */
-public class GamemodeInfoTest {
-
- /**
- *
- */
- public GamemodeInfoTest() {
- }
-
- /**
- *
- */
- @Before
- public void setUp() throws Exception {
- }
-
- /**
- *
- */
- @Test
- public void testProcess() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("CREATIVE", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeInfo i = new GamemodeInfo(data.getUuid(), time, Gamemode.SURVIVAL);
- assertTrue(i.process(data));
- Long result = data.getGmTimes().getTime(Gamemode.CREATIVE.name());
- assertTrue("Gamemode time was " + result, result == 1050L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 1100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 2000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Survival", "SURVIVAL".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 1100L);
- }
-
- /**
- *
- */
- @Test
- public void testProcessWrongUUID() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("CREATIVE", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeInfo i = new GamemodeInfo(null, time, Gamemode.SURVIVAL);
- assertTrue(!i.process(data));
- Long result = data.getGmTimes().getTime(Gamemode.CREATIVE.name());
- assertTrue("Gamemode time was " + result, result == 0L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 1000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Creative", "CREATIVE".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 50L);
- }
-
- /**
- *
- */
- @Test
- public void testProcessNullGM() {
- UserData data = MockUtils.mockUser();
- data.setPlayTime(100L);
- data.setGmTimes(new GMTimes("CREATIVE", 50L));
- data.setLastPlayed(1000L);
- long time = 2000L;
- GamemodeInfo i = new GamemodeInfo(data.getUuid(), time, null);
- assertTrue(!i.process(data));
- Long result = data.getGmTimes().getTime(Gamemode.CREATIVE.name());
- assertTrue("Gamemode time was " + result, result == 0L);
- result = data.getPlayTime();
- assertTrue("Playtime was" + result, result == 100L);
- result = data.getLastPlayed();
- assertTrue("Last Played was" + result, result == 1000L);
- String lastGM = data.getLastGamemode();
- assertTrue("Last gm not Creative", "CREATIVE".equals(lastGM));
- result = data.getLastGmSwapTime();
- assertTrue("Last swaptime was " + result, result == 50L);
- }
-
-}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LoginInfoTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LoginInfoTest.java
index b2a86926f..3daccf064 100644
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LoginInfoTest.java
+++ b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LoginInfoTest.java
@@ -5,7 +5,6 @@
*/
package test.java.main.java.com.djrapitops.plan.data.handling.info;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.data.handling.info.LoginInfo;
import org.bukkit.plugin.java.JavaPlugin;
@@ -54,7 +53,7 @@ public class LoginInfoTest {
long time = 10L;
int loginTimes = data.getLoginTimes();
String nick = "TestProcessLoginInfo";
- LoginInfo i = new LoginInfo(data.getUuid(), time, ip, true, nick, Gamemode.CREATIVE, 1, "World");
+ LoginInfo i = new LoginInfo(data.getUuid(), time, ip, true, nick, "CREATIVE", 1, "World");
assertTrue(i.process(data));
assertTrue("LastPlayed wrong: " + data.getLastPlayed(), data.getLastPlayed() == time);
assertTrue("Ip not added", data.getIps().contains(ip));
@@ -77,7 +76,7 @@ public class LoginInfoTest {
InetAddress ip = InetAddress.getByName("137.19.188.146");
long time = 10L;
String nick = "TestProcessLoginInfo";
- LoginInfo i = new LoginInfo(null, time, ip, true, nick, Gamemode.CREATIVE, 1, "World");
+ LoginInfo i = new LoginInfo(null, time, ip, true, nick, "CREATIVE", 1, "World");
assertTrue(!i.process(data));
}
}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LogoutInfoTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LogoutInfoTest.java
index 82c6769cf..bd83488cf 100644
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LogoutInfoTest.java
+++ b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/LogoutInfoTest.java
@@ -5,7 +5,6 @@
*/
package test.java.main.java.com.djrapitops.plan.data.handling.info;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.data.SessionData;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.data.handling.info.LogoutInfo;
@@ -44,7 +43,7 @@ public class LogoutInfoTest {
data.updateBanned(false);
long time = 20L;
data.getGmTimes().setState("SURVIVAL");
- LogoutInfo i = new LogoutInfo(data.getUuid(), time, true, Gamemode.CREATIVE, new SessionData(0, 1), "World");
+ LogoutInfo i = new LogoutInfo(data.getUuid(), time, true, "CREATIVE", new SessionData(0, 1), "World");
assertTrue(i.process(data));
assertTrue("Last Played wrong", data.getLastPlayed() == 20L);
assertTrue("Playtime wrong", data.getPlayTime() == 10L);
@@ -64,7 +63,7 @@ public class LogoutInfoTest {
data.updateBanned(false);
long time = 20L;
Exception ex = null;
- LogoutInfo i = new LogoutInfo(null, time, true, Gamemode.CREATIVE, new SessionData(0, 1), "World");
+ LogoutInfo i = new LogoutInfo(null, time, true, "CREATIVE", new SessionData(0, 1), "World");
assertTrue(!i.process(data));
}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/ReloadInfoTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/ReloadInfoTest.java
index 2c1f978bf..3dae0caf0 100644
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/ReloadInfoTest.java
+++ b/Plan/src/test/java/main/java/com/djrapitops/plan/data/handling/info/ReloadInfoTest.java
@@ -5,7 +5,6 @@
*/
package test.java.main.java.com.djrapitops.plan.data.handling.info;
-import com.djrapitops.plugin.utilities.player.Gamemode;
import main.java.com.djrapitops.plan.data.UserData;
import main.java.com.djrapitops.plan.data.handling.info.ReloadInfo;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
@@ -55,7 +54,7 @@ public class ReloadInfoTest {
long time = MiscUtils.getTime();
int loginTimes = data.getLoginTimes();
String nick = "TestProcessLoginInfo";
- ReloadInfo i = new ReloadInfo(data.getUuid(), time, ip, true, nick, Gamemode.CREATIVE, "World");
+ ReloadInfo i = new ReloadInfo(data.getUuid(), time, ip, true, nick, "CREATIVE", "World");
assertTrue(i.process(data));
assertTrue("LastPlayed wrong: " + data.getLastPlayed(), data.getLastPlayed() == time);
assertTrue("Ip not added", data.getIps().contains(ip));
@@ -77,7 +76,7 @@ public class ReloadInfoTest {
InetAddress ip = InetAddress.getByName("137.19.188.146");
long time = 10L;
String nick = "TestProcessLoginInfo";
- ReloadInfo i = new ReloadInfo(null, time, ip, true, nick, Gamemode.CREATIVE, "World");
+ ReloadInfo i = new ReloadInfo(null, time, ip, true, nick, "CREATIVE", "World");
assertTrue(!i.process(data));
}
}
diff --git a/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/comparators/HandlingInfoTimeComparatorTest.java b/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/comparators/HandlingInfoTimeComparatorTest.java
deleted file mode 100644
index 5d0f10cd7..000000000
--- a/Plan/src/test/java/main/java/com/djrapitops/plan/utilities/comparators/HandlingInfoTimeComparatorTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test.java.main.java.com.djrapitops.plan.utilities.comparators;
-
-import com.djrapitops.plugin.utilities.player.Gamemode;
-import main.java.com.djrapitops.plan.data.handling.info.GamemodeInfo;
-import main.java.com.djrapitops.plan.data.handling.info.HandlingInfo;
-import main.java.com.djrapitops.plan.utilities.comparators.HandlingInfoTimeComparator;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * @author Rsl1122
- */
-public class HandlingInfoTimeComparatorTest {
-
- /**
- *
- */
- public HandlingInfoTimeComparatorTest() {
- }
-
- /**
- *
- */
- @Test
- public void testCompare() {
- List