mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-02 05:13:51 -07:00
Update CraftBukkit to Minecraft 1.7.5
This commit is contained in:
@@ -33,7 +33,7 @@ public class PlayerSelector {
|
||||
}
|
||||
|
||||
public static EntityPlayer[] getPlayers(ICommandListener icommandlistener, String s) {
|
||||
// CraftBukkit start
|
||||
// CraftBukkit start - disable playerselections for ICommandListeners other than command blocks
|
||||
if (!(icommandlistener instanceof CommandBlockListenerAbstract)) {
|
||||
return null;
|
||||
}
|
||||
@@ -41,9 +41,7 @@ public class PlayerSelector {
|
||||
|
||||
Matcher matcher = a.matcher(s);
|
||||
|
||||
if (!matcher.matches()) {
|
||||
return null;
|
||||
} else {
|
||||
if (matcher.matches()) {
|
||||
Map map = h(matcher.group(2));
|
||||
String s1 = matcher.group(1);
|
||||
int i = c(s1);
|
||||
@@ -111,18 +109,20 @@ public class PlayerSelector {
|
||||
List list;
|
||||
|
||||
if (!s1.equals("p") && !s1.equals("a")) {
|
||||
if (!s1.equals("r")) {
|
||||
return null;
|
||||
} else {
|
||||
if (s1.equals("r")) {
|
||||
list = MinecraftServer.getServer().getPlayerList().a(chunkcoordinates, i, j, 0, j1, k, l, map1, s2, s3, world);
|
||||
Collections.shuffle(list);
|
||||
list = list.subList(0, Math.min(i1, list.size()));
|
||||
return list != null && !list.isEmpty() ? (EntityPlayer[]) list.toArray(new EntityPlayer[0]) : new EntityPlayer[0];
|
||||
return list.isEmpty() ? new EntityPlayer[0] : (EntityPlayer[]) list.toArray(new EntityPlayer[list.size()]);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
list = MinecraftServer.getServer().getPlayerList().a(chunkcoordinates, i, j, i1, j1, k, l, map1, s2, s3, world);
|
||||
return list != null && !list.isEmpty() ? (EntityPlayer[]) list.toArray(new EntityPlayer[0]) : new EntityPlayer[0];
|
||||
return list.isEmpty() ? new EntityPlayer[0] : (EntityPlayer[]) list.toArray(new EntityPlayer[list.size()]);
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user