summaryrefslogtreecommitdiffstats
path: root/nms-patches/PlayerSelector.patch
blob: a31e8db628385431b74f87c3237575bfc85d15b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- ../work/decompile-8eb82bde//net/minecraft/server/PlayerSelector.java	2014-12-02 20:23:52.649621319 +0000
+++ src/main/java/net/minecraft/server/PlayerSelector.java	2014-12-02 20:22:46.409622789 +0000
@@ -52,6 +52,11 @@
     }
 
     public static List getPlayers(ICommandListener icommandlistener, String s, Class oclass) {
+        // CraftBukkit start - disable playerselections for ICommandListeners other than command blocks
+        if (!(icommandlistener instanceof CommandBlockListenerAbstract)) {
+            return com.google.common.collect.ImmutableList.of();
+        }
+        // CraftBukkit end
         Matcher matcher = PlayerSelector.a.matcher(s);
 
         if (matcher.matches() && icommandlistener.a(1, "@")) {
@@ -97,7 +102,7 @@
         if (h(map)) {
             arraylist.add(icommandlistener.getWorld());
         } else {
-            Collections.addAll(arraylist, MinecraftServer.getServer().worldServer);
+            arraylist.addAll(MinecraftServer.getServer().worlds); // CraftBukkit
         }
 
         return arraylist;