aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHackOS <63157139+HackedOS@users.noreply.github.com>2022-05-17 23:06:47 +0530
committerGitHub <noreply@github.com>2022-05-17 19:36:47 +0200
commit4a85bf6754c101b43d2d0d3a6c9ed5744dd0308d (patch)
treede9d56c7f833dffbb5201181caa81eebc332f03c
parent7f7f8587d3e06354ef0cc80a1a06ef76ba0387ff (diff)
downloadCOFL-4a85bf6754c101b43d2d0d3a6c9ed5744dd0308d.tar.gz
COFL-4a85bf6754c101b43d2d0d3a6c9ed5744dd0308d.tar.bz2
COFL-4a85bf6754c101b43d2d0d3a6c9ed5744dd0308d.zip
Dont spam chat with config updates (#62)
* Dont spam chat with config updates * Fix bcz im dumb * Show value of setting
-rw-r--r--src/main/java/de/torui/coflsky/configuration/ConfigurationManager.java24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/main/java/de/torui/coflsky/configuration/ConfigurationManager.java b/src/main/java/de/torui/coflsky/configuration/ConfigurationManager.java
index 7930210..38dd525 100644
--- a/src/main/java/de/torui/coflsky/configuration/ConfigurationManager.java
+++ b/src/main/java/de/torui/coflsky/configuration/ConfigurationManager.java
@@ -51,26 +51,26 @@ public class ConfigurationManager {
case "int":
if (f.getInt(old) != f.getInt(newConfiguration)) {
- UpdatedProperty(f);
+ UpdatedProperty(f,newConfiguration);
updatedProperties++;
}
break;
case "boolean":
if (f.getBoolean(old) != f.getBoolean(newConfiguration)) {
- UpdatedProperty(f);
+ UpdatedProperty(f,newConfiguration);
updatedProperties++;
}
break;
case "java.lang.String":
if (f.get(old) != null && !f.get(old).equals(f.get(newConfiguration))) {
- UpdatedProperty(f);
+ UpdatedProperty(f,newConfiguration);
updatedProperties++;
}
break;
case "java.lang.String[]":
if (!Arrays.deepEquals((String[]) f.get(old), (String[]) f.get(newConfiguration))) {
- UpdatedProperty(f);
+ UpdatedProperty(f,newConfiguration);
updatedProperties++;
}
break;
@@ -100,20 +100,8 @@ public class ConfigurationManager {
}
- public void UpdatedProperty(Field propertyName) {
- IChatComponent comp;
-
- comp = new ChatComponentText("The Configuration Setting ")
- .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.BLUE))
- .appendSibling(GetNameFormatted(propertyName))
- .appendSibling(new ChatComponentText(" has been updated")
- .setChatStyle(new ChatStyle().setColor(EnumChatFormatting.BLUE)));
-
-
- System.out.println("Field " + propertyName.getName() + " has no description!");
-
-
- Minecraft.getMinecraft().thePlayer.addChatMessage(comp);
+ public void UpdatedProperty(Field propertyName,Configuration confignew) throws IllegalAccessException {
+ System.out.println("The Configuration Setting " + propertyName.getName() + " has been updated to " + propertyName.get(confignew));
}
}