From 55df5b5ede2038a8d6f3a99b5c31a3589dcfb087 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 8 Dec 2016 21:36:56 +0100 Subject: [PATCH] Made integer data optional https://github.com/TBMCPlugins/DiscordPlugin/issues/19 --- src/main/java/buttondevteam/chat/ChatPlayer.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/buttondevteam/chat/ChatPlayer.java b/src/main/java/buttondevteam/chat/ChatPlayer.java index ddcf935..1f0c805 100644 --- a/src/main/java/buttondevteam/chat/ChatPlayer.java +++ b/src/main/java/buttondevteam/chat/ChatPlayer.java @@ -1,6 +1,8 @@ package buttondevteam.chat; import java.util.List; +import java.util.Optional; + import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -27,7 +29,7 @@ public class ChatPlayer extends TBMCPlayer { } public short getFlairTime() { - return getIntData(Short.class); + return getIntData(Short.class).orElse(FlairTimeNone); } private void setFlairTime(short time) { @@ -43,7 +45,7 @@ public class ChatPlayer extends TBMCPlayer { } public int getFCount() { - return getIntData(Integer.class); + return getIntData(Integer.class).orElse(0); } public void setFCount(int count) { @@ -51,7 +53,7 @@ public class ChatPlayer extends TBMCPlayer { } public int getFDeaths() { - return getIntData(Integer.class); + return getIntData(Integer.class).orElse(0); } public void setFDeaths(int count) {