mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-26 10:29:49 -05:00
added #259
This commit is contained in:
1 parent
e50107f3b9
commit
a27e2aef48
1 file changed
+12
-3
@@ -148,9 +148,7 @@ public class Property {
|
||||
if (pl != null) string = pl.set(string, owner);
|
||||
}
|
||||
string = TAB.getInstance().getPlaceholderManager().color(string);
|
||||
for (String removed : TAB.getInstance().getConfiguration().removeStrings) {
|
||||
if (string.contains(removed)) string = string.replace(removed, "");
|
||||
}
|
||||
string = applyRemoveStrings(string);
|
||||
if (lastReplacedValue == null || !lastReplacedValue.equals(string)) {
|
||||
lastReplacedValue = string;
|
||||
return true;
|
||||
@@ -158,6 +156,17 @@ public class Property {
|
||||
return false;
|
||||
}
|
||||
|
||||
private String applyRemoveStrings(String text) {
|
||||
String reformatted = text;
|
||||
for (String removed : TAB.getInstance().getConfiguration().removeStrings) {
|
||||
if (removed.startsWith("CONTAINS:") && reformatted.contains(removed.substring(9))) return "";
|
||||
if (removed.startsWith("STARTS:") && reformatted.startsWith(removed.substring(7))) return "";
|
||||
if (removed.startsWith("ENDS:") && reformatted.endsWith(removed.substring(5))) return "";
|
||||
if (reformatted.contains(removed)) reformatted = reformatted.replace(removed, "");
|
||||
}
|
||||
return reformatted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns last known value
|
||||
* @return last known value
|
||||
|
||||
Reference in new issue
Block a user