Removes the last remnants of Player Demographics

This commit is contained in:
Fuzzlemann 2017-07-30 00:46:09 +02:00
parent 84217a7839
commit 28489f07c1
3 changed files with 5 additions and 7 deletions

View File

@ -14,19 +14,16 @@ import java.util.UUID;
public class ChatInfo extends HandlingInfo { public class ChatInfo extends HandlingInfo {
private final String nickname; private final String nickname;
private final String message;
/** /**
* Constructor. * Constructor.
* *
* @param uuid UUID of the player. * @param uuid UUID of the player.
* @param nickname Nickname of the player. * @param nickname Nickname of the player.
* @param message Message the player sent.
*/ */
public ChatInfo(UUID uuid, String nickname, String message) { public ChatInfo(UUID uuid, String nickname) {
super(uuid, InfoType.CHAT, 0L); super(uuid, InfoType.CHAT, 0L);
this.nickname = nickname; this.nickname = nickname;
this.message = message;
} }
@Override @Override

View File

@ -37,7 +37,8 @@ public class PlanChatListener implements Listener {
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }
Player p = event.getPlayer(); Player p = event.getPlayer();
handler.addToPool(new ChatInfo(p.getUniqueId(), p.getDisplayName(), event.getMessage())); handler.addToPool(new ChatInfo(p.getUniqueId(), p.getDisplayName()));
} }
} }

View File

@ -32,7 +32,7 @@ public class ChatInfoTest {
public void testProcessNick() { public void testProcessNick() {
UserData data = MockUtils.mockUser(); UserData data = MockUtils.mockUser();
String expected = "TestNicknameChatInfo"; String expected = "TestNicknameChatInfo";
ChatInfo i = new ChatInfo(data.getUuid(), expected, "im 18 male"); ChatInfo i = new ChatInfo(data.getUuid(), expected);
assertTrue("Didn't succeed", i.process(data)); assertTrue("Didn't succeed", i.process(data));
assertTrue("Didn't add nickname", data.getNicknames().contains(expected)); assertTrue("Didn't add nickname", data.getNicknames().contains(expected));
} }
@ -44,7 +44,7 @@ public class ChatInfoTest {
public void testProcessWrongUUID() { public void testProcessWrongUUID() {
UserData data = MockUtils.mockUser(); UserData data = MockUtils.mockUser();
String expected = "TestNicknameChatInfo"; String expected = "TestNicknameChatInfo";
ChatInfo i = new ChatInfo(null, expected, "im 18 male"); ChatInfo i = new ChatInfo(null, expected);
assertTrue("Succeeded.", !i.process(data)); assertTrue("Succeeded.", !i.process(data));
} }
} }