Add your command caller back

This commit is contained in:
boy0001
2015-07-27 14:30:50 +10:00
parent 6df9024ff1
commit 56fbeb60e5
75 changed files with 152 additions and 125 deletions

View File

@ -31,7 +31,7 @@ import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualsites.commands.callers.CommandCaller;
import com.intellectualsites.commands.CommandCaller;
import com.plotsquared.bukkit.listeners.PlotListener;
import com.intellectualcrafters.plot.object.BlockLoc;
import com.intellectualcrafters.plot.object.ChunkLoc;

View File

@ -21,6 +21,7 @@
package com.intellectualcrafters.plot.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
/**
@ -46,6 +47,10 @@ public class StringComparison<T> {
init(input, objects);
}
public StringComparison(String input, final Collection<T> objects) {
init(input, (T[]) objects.toArray());
}
/**
* You should call init(...) when you are ready to get a String comparison value
*/

View File

@ -26,6 +26,32 @@ public class StringMan {
return sb.toString();
}
public static String replaceFirst(char c, String s) {
if (s == null) {
return "";
}
if (s.isEmpty()) {
return s;
}
char[] chars = s.toCharArray();
char[] newChars = new char[chars.length];
int used = 0;
boolean found = false;
for (char cc : chars) {
if (!found && c == cc) {
found = true;
} else {
newChars[used++] = cc;
}
}
if (found) {
chars = new char[newChars.length - 1];
System.arraycopy(newChars, 0, chars, 0, chars.length);
return String.valueOf(chars);
}
return s;
}
public static String replaceAll(String string, Object... pairs) {
StringBuilder sb = new StringBuilder(string);
for (int i = 0; i < pairs.length; i+=2) {