diff --git a/src/main/java/mkremins/fanciful/FancyMessage.java b/src/main/java/mkremins/fanciful/FancyMessage.java index 6dfcc34..779ac80 100644 --- a/src/main/java/mkremins/fanciful/FancyMessage.java +++ b/src/main/java/mkremins/fanciful/FancyMessage.java @@ -36,7 +36,7 @@ /** * Represents a formattable message. Such messages can use elements such as colors, formatting codes, hover and click data, and other features provided by the vanilla Minecraft JSON message formatter. - * This class allows plugins to emulate the functionality of the vanilla minecraft tellraw command. + * This class allows plugins to emulate the functionality of the vanilla Minecraft tellraw command. *

* This class follows the builder pattern, allowing for method chaining. * It is set up such that invocations of property-setting methods will affect the current editing component, @@ -87,10 +87,10 @@ public FancyMessage(final TextualComponent firstPartText) { nmsPacketPlayOutChatConstructor = Reflection.getNMSClass("PacketPlayOutChat").getDeclaredConstructor(Reflection.getNMSClass("IChatBaseComponent")); nmsPacketPlayOutChatConstructor.setAccessible(true); } catch (NoSuchMethodException e) { - Bukkit.getLogger().log(Level.SEVERE, "Could not find mincraft method or constructor.", e); + Bukkit.getLogger().log(Level.SEVERE, "Could not find Minecraft method or constructor.", e); } catch (SecurityException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access constructor.", e); - } + Bukkit.getLogger().log(Level.WARNING, "Could not access constructor.", e); + } } } @@ -223,7 +223,7 @@ public FancyMessage achievementTooltip(final Achievement which) { Object achievement = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getNMSAchievement", Achievement.class).invoke(null, which); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Achievement"), "name").get(achievement)); } catch (IllegalAccessException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access methode.", e); + Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); @@ -250,7 +250,7 @@ public FancyMessage statisticTooltip(final Statistic which) { Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getNMSStatistic", Statistic.class).invoke(null, which); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic)); } catch (IllegalAccessException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access methode.", e); + Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); @@ -281,7 +281,7 @@ public FancyMessage statisticTooltip(final Statistic which, Material item) { Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getMaterialStatistic", Statistic.class, Material.class).invoke(null, which, item); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic)); } catch (IllegalAccessException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access methode.", e); + Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); @@ -312,7 +312,7 @@ public FancyMessage statisticTooltip(final Statistic which, EntityType entity) { Object statistic = Reflection.getMethod(Reflection.getOBCClass("CraftStatistic"), "getEntityStatistic", Statistic.class, EntityType.class).invoke(null, which, entity); return achievementTooltip((String) Reflection.getField(Reflection.getNMSClass("Statistic"), "name").get(statistic)); } catch (IllegalAccessException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access methode.", e); + Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); return this; } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); @@ -550,7 +550,7 @@ private void send(CommandSender sender, String jsonString){ } catch (IllegalArgumentException e) { Bukkit.getLogger().log(Level.WARNING, "Argument could not be passed.", e); } catch (IllegalAccessException e) { - Bukkit.getLogger().log(Level.WARNING, "Could not access methode.", e); + Bukkit.getLogger().log(Level.WARNING, "Could not access method.", e); } catch (InstantiationException e) { Bukkit.getLogger().log(Level.WARNING, "Underlying class is abstract.", e); } catch (InvocationTargetException e) { diff --git a/src/main/java/mkremins/fanciful/TextualComponent.java b/src/main/java/mkremins/fanciful/TextualComponent.java index 22f699a..c56b7da 100644 --- a/src/main/java/mkremins/fanciful/TextualComponent.java +++ b/src/main/java/mkremins/fanciful/TextualComponent.java @@ -23,7 +23,7 @@ public abstract class TextualComponent implements Cloneable { ConfigurationSerialization.registerClass(TextualComponent.ComplexTextTypeComponent.class); } - @Override + @Override public String toString() { return getReadableString(); } @@ -103,7 +103,6 @@ public void setValue(String value) { private String _value; @Override - @SuppressWarnings("CloneDoesntCallSuperClone") public TextualComponent clone() throws CloneNotSupportedException { // Since this is a private and final class, we can just reinstantiate this class instead of casting super.clone return new ArbitraryTextTypeComponent(getKey(), getValue()); @@ -126,10 +125,10 @@ public static ArbitraryTextTypeComponent deserialize(Map map){ return new ArbitraryTextTypeComponent(map.get("key").toString(), map.get("value").toString()); } - @Override - public String getReadableString() { - return getValue(); - } + @Override + public String getReadableString() { + return getValue(); + } } /** @@ -166,7 +165,6 @@ public void setValue(Map value) { private Map _value; @Override - @SuppressWarnings("CloneDoesntCallSuperClone") public TextualComponent clone() throws CloneNotSupportedException { // Since this is a private and final class, we can just reinstantiate this class instead of casting super.clone return new ComplexTextTypeComponent(getKey(), getValue()); @@ -204,11 +202,11 @@ public static ComplexTextTypeComponent deserialize(Map map){ } return new ComplexTextTypeComponent(key, value); } - - @Override - public String getReadableString() { - return getKey(); - } + + @Override + public String getReadableString() { + return getKey(); + } } /**