Skip to content

Commit

Permalink
25-02-2023_02:22
Browse files Browse the repository at this point in the history
Removed Lang.
It was causing issues.
  • Loading branch information
Valorless committed Feb 25, 2023
1 parent f708719 commit 8022d01
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 13 deletions.
35 changes: 29 additions & 6 deletions src/main/java/valorless/valorlessutils/ValorlessUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void Error(JavaPlugin caller, String msg) {

public static void Debug(JavaPlugin caller, String msg) {
if(Config.GetBool(thisPlugin, "debug") == true) {
Logger.getLogger("Minecraft").log(Level.CONFIG, "[DEBUG]: [" + caller.getName() + "] " + msg);
Logger.getLogger("Minecraft").log(Level.WARNING, "[DEBUG]: [" + caller.getName() + "] " + msg);
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@ public static Boolean Has(JavaPlugin caller, PersistentDataContainer container,

}

public static class Lang {
/*public static class Lang {
// Example, new Placeholder(this, "%target%", "PlayerName");
public static class Placeholder {
Expand All @@ -154,19 +154,42 @@ public static void AddPlaceholder(JavaPlugin caller, String key, String value) {
if (caller == null) { Log.Error(thisPlugin, "Lang.AddPlaceholder() was called without a null caller!"); return; }
if (Utils.IsStringNullOrEmpty(key)) { Log.Debug(caller, "[ValorlessUtils] Lang.AddPlaceholder() was called without a null or empty key!"); return; }
if (Utils.IsStringNullOrEmpty(value)) { Log.Debug(caller, "[ValorlessUtils] Lang.AddPlaceholder() was called without a null or empty value!\nWas this intentional?"); }
placeholders.add(new Placeholder(caller.getName(),key,value));
for(int i = 0; i < placeholders.size(); i++){
Log.Error(caller, "[PH] " + placeholders.get(i).plugin + placeholders.get(i).key + placeholders.get(i).value);
if(placeholders.get(i).plugin == caller.getName()) {
Log.Error(caller, "[PH] " + placeholders.get(i).plugin + caller.getName());
if(placeholders.get(i).key == key) {
Log.Error(caller, "[PH] " + placeholders.get(i).key + key);
placeholders.set(i, new Placeholder(caller.getName(),key,value));
Log.Debug(caller, "Updated Placeholder " + placeholders.get(i).key + " - " + placeholders.get(i).value);
return;
}else {
placeholders.add(new Placeholder(caller.getName(),key,value));
Log.Debug(caller, "Added Placeholder " + placeholders.get(i).key + " - " + placeholders.get(i).value);
return;
}
} else {
placeholders.add(new Placeholder(caller.getName(),key,value));
Log.Debug(caller, "Added Placeholder " + placeholders.get(i).key + " - " + placeholders.get(i).value);
return;
}
}
if(placeholders.size() == 0) {
placeholders.add(new Placeholder(caller.getName(),key,value));
Log.Debug(caller, "Added Placeholder " + key + " - " + value);
}
}
public static String Parse(JavaPlugin caller, String text) {
if (caller == null) { Log.Error(thisPlugin, "Lang.Parse() was called without a null caller!"); return ""; }
if (Utils.IsStringNullOrEmpty(text)) { Log.Debug(caller, "[ValorlessUtils] Lang.Parse() was called without a null or empty text!\nWas this intentional?"); }
Log.Debug(caller, text);
Log.Debug(caller, "[PARSE] " + text);
if(text.contains("&")) text = text.replace("&", "§");
for(Placeholder placeholder : placeholders) {
//Log.Warning(caller, placeholder.plugin + placeholder.key + placeholder.value);
if(placeholder.plugin.equalsIgnoreCase(caller.getName())) {
Log.Warning(caller, placeholder.plugin + placeholder.key + placeholder.value);
//Log.Warning(caller, placeholder.plugin + placeholder.key + placeholder.value);
if(text.contains(placeholder.key)) {
text = text.replace(placeholder.key, placeholder.value);
}
Expand All @@ -181,7 +204,7 @@ public static String Get(JavaPlugin caller, String key) {
if (Utils.IsStringNullOrEmpty(key)) { Log.Error(caller, "[ValorlessUtils] Lang.Get() was called without a null or empty key!"); return ""; }
return Parse(caller, Config.GetString(caller, key));
}
}
}*/

public static class Config {

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Feb 24 22:26:51 CET 2023
buildNumber=76
#Sat Feb 25 01:48:42 CET 2023
buildNumber=88
Binary file added target/ValorlessUtils-1.0.0.77-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.78-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.79-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.80-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.81-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.82-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.83-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.84-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.85-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.86-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.87-SNAPSHOT.jar
Binary file not shown.
Binary file added target/ValorlessUtils-1.0.0.88-SNAPSHOT.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions target/classes/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Feb 24 22:26:51 CET 2023
buildNumber=76
#Sat Feb 25 01:48:42 CET 2023
buildNumber=88
2 changes: 1 addition & 1 deletion target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ValorlessUtils
main: valorless.valorlessutils.ValorlessUtils
version: 1.0.0.76
version: 1.0.0.88
author: Valorless
api-version: 1.18
commands:
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified target/classes/valorless/valorlessutils/ValorlessUtils$Log.class
Binary file not shown.
Binary file modified target/classes/valorless/valorlessutils/ValorlessUtils.class
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
valorless\valorlessutils\ValorlessUtils$Config.class
valorless\valorlessutils\ValorlessUtils$Lang$Placeholder.class
valorless\valorlessutils\ValorlessUtils$Log.class
valorless\valorlessutils\ValorlessUtils$Tags.class
valorless\valorlessutils\ValorlessUtils$Utils.class
valorless\valorlessutils\ValorlessUtils$Config$ValidationListEntry.class
valorless\valorlessutils\ValorlessUtils$Lang.class
valorless\valorlessutils\ValorlessUtils.class

0 comments on commit 8022d01

Please sign in to comment.