mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-08 09:42:56 +01:00
Turn manual array copies into System.arrayCopy
This commit is contained in:
parent
d32a077359
commit
009df4a0ad
@ -38,9 +38,7 @@ public class DisguisePlayerCommand extends BaseDisguiseCommand {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String[] newArgs = new String[args.length - 1];
|
String[] newArgs = new String[args.length - 1];
|
||||||
for (int i = 0; i < newArgs.length; i++) {
|
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
|
||||||
newArgs[i] = args[i + 1];
|
|
||||||
}
|
|
||||||
Disguise disguise;
|
Disguise disguise;
|
||||||
try {
|
try {
|
||||||
disguise = parseDisguise(sender, newArgs);
|
disguise = parseDisguise(sender, newArgs);
|
||||||
|
@ -86,9 +86,7 @@ public class DisguiseRadiusCommand extends BaseDisguiseCommand {
|
|||||||
radius = maxRadius;
|
radius = maxRadius;
|
||||||
}
|
}
|
||||||
String[] newArgs = new String[args.length - (starting + 1)];
|
String[] newArgs = new String[args.length - (starting + 1)];
|
||||||
for (int i = 0; i < newArgs.length; i++) {
|
System.arraycopy(args, starting + 1, newArgs, 0, newArgs.length);
|
||||||
newArgs[i] = args[i + (starting + 1)];
|
|
||||||
}
|
|
||||||
Disguise disguise;
|
Disguise disguise;
|
||||||
try {
|
try {
|
||||||
disguise = parseDisguise(sender, newArgs);
|
disguise = parseDisguise(sender, newArgs);
|
||||||
|
@ -152,9 +152,7 @@ public class FlagWatcher {
|
|||||||
|
|
||||||
public ItemStack[] getArmor() {
|
public ItemStack[] getArmor() {
|
||||||
ItemStack[] armor = new ItemStack[4];
|
ItemStack[] armor = new ItemStack[4];
|
||||||
for (int i = 0; i < 4; i++) {
|
System.arraycopy(items, 0, armor, 0, 4);
|
||||||
armor[i] = items[i];
|
|
||||||
}
|
|
||||||
return armor;
|
return armor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,9 +265,7 @@ public abstract class BaseDisguiseCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
// Copy strings to their new range
|
// Copy strings to their new range
|
||||||
String[] newArgs = new String[args.length - toSkip];
|
String[] newArgs = new String[args.length - toSkip];
|
||||||
for (int i = toSkip; i < args.length; i++) {
|
System.arraycopy(args, toSkip, newArgs, 0, args.length - toSkip);
|
||||||
newArgs[i - toSkip] = args[i];
|
|
||||||
}
|
|
||||||
args = newArgs;
|
args = newArgs;
|
||||||
for (int i = 0; i < args.length; i += 2) {
|
for (int i = 0; i < args.length; i += 2) {
|
||||||
String methodName = args[i];
|
String methodName = args[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user