mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Fix selectors in non-bukkit commands for command blocks
This commit is contained in:
parent
3c4a02ed33
commit
2422099346
@ -1,5 +1,5 @@
|
|||||||
--- ../work/decompile-8eb82bde//net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 20:19:48.021499587 +0000
|
--- ../work/decompile-8eb82bde//net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-02 20:23:51.921621335 +0000
|
||||||
+++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-11-28 20:18:58.289500691 +0000
|
+++ src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java 2014-12-02 20:23:10.809622247 +0000
|
||||||
@@ -4,6 +4,13 @@
|
@@ -4,6 +4,13 @@
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
@ -134,7 +134,7 @@
|
|||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
|
CrashReport crashreport = CrashReport.a(throwable, "Executing command block");
|
||||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
|
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Command to be executed");
|
||||||
@@ -91,8 +202,26 @@
|
@@ -91,8 +202,27 @@
|
||||||
} else {
|
} else {
|
||||||
this.b = 0;
|
this.b = 0;
|
||||||
}
|
}
|
||||||
@ -143,7 +143,8 @@
|
|||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ private ArrayList<String[]> buildCommands(String[] args, int pos) {
|
+ private ArrayList<String[]> buildCommands(String[] args, int pos) {
|
||||||
+ ArrayList<String[]> commands = new ArrayList<String[]>();
|
+ ArrayList<String[]> commands = new ArrayList<String[]>();
|
||||||
+ EntityPlayer[] players = ((java.util.List<EntityPlayer>)PlayerSelector.getPlayers(this, args[pos], EntityPlayer.class)).toArray(new EntityPlayer[0]);
|
+ java.util.List<EntityPlayer> players = (java.util.List<EntityPlayer>)PlayerSelector.getPlayers(this, args[pos], EntityPlayer.class);
|
||||||
|
+
|
||||||
+ if (players != null) {
|
+ if (players != null) {
|
||||||
+ for (EntityPlayer player : players) {
|
+ for (EntityPlayer player : players) {
|
||||||
+ if (player.world != this.getWorld()) {
|
+ if (player.world != this.getWorld()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
--- ../work/decompile-8eb82bde//net/minecraft/server/PlayerSelector.java 2014-11-28 17:43:43.337707430 +0000
|
--- ../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-11-28 17:38:17.000000000 +0000
|
+++ src/main/java/net/minecraft/server/PlayerSelector.java 2014-12-02 20:22:46.409622789 +0000
|
||||||
@@ -52,6 +52,11 @@
|
@@ -52,6 +52,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,3 +12,12 @@
|
|||||||
Matcher matcher = PlayerSelector.a.matcher(s);
|
Matcher matcher = PlayerSelector.a.matcher(s);
|
||||||
|
|
||||||
if (matcher.matches() && icommandlistener.a(1, "@")) {
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user