mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
Minecraft by default only uses the World at index 0 for the WorldBorder command. This fixes SPIGOT-12
By: Fabian Faßbender <fabian.fassbender42@googlemail.com>
This commit is contained in:
parent
827be39e55
commit
6c7602a196
2 changed files with 39 additions and 0 deletions
28
paper-server/nms-patches/CommandWorldBorder.patch
Normal file
28
paper-server/nms-patches/CommandWorldBorder.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
--- ../work/decompile-8eb82bde//net/minecraft/server/CommandWorldBorder.java 2014-11-29 00:40:43.197707433 +0000
|
||||
+++ src/main/java/net/minecraft/server/CommandWorldBorder.java 2014-11-29 00:40:17.000000000 +0000
|
||||
@@ -18,11 +18,11 @@
|
||||
return "commands.worldborder.usage";
|
||||
}
|
||||
|
||||
- public void execute(ICommandListener icommandlistener, String[] astring) {
|
||||
+ public void execute(ICommandListener icommandlistener, String[] astring) throws ExceptionUsage { // CraftBukkit - Add Exception
|
||||
if (astring.length < 1) {
|
||||
throw new ExceptionUsage("commands.worldborder.usage", new Object[0]);
|
||||
} else {
|
||||
- WorldBorder worldborder = this.d();
|
||||
+ WorldBorder worldborder = icommandlistener.getWorld().af(); // CraftBukkit - Use the world the player is in instead of the first in Minecraft
|
||||
double d0;
|
||||
double d1;
|
||||
long i;
|
||||
@@ -141,4 +141,11 @@
|
||||
public List tabComplete(ICommandListener icommandlistener, String[] astring, BlockPosition blockposition) {
|
||||
return astring.length == 1 ? a(astring, new String[] { "set", "center", "damage", "warning", "add", "get"}) : (astring.length == 2 && astring[0].equals("damage") ? a(astring, new String[] { "buffer", "amount"}) : (astring.length == 2 && astring[0].equals("warning") ? a(astring, new String[] { "time", "distance"}) : null));
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - Implement compareTo since obfuscation has renamed it to a(ICommand)
|
||||
+ @Override
|
||||
+ public int compareTo( Object o ) {
|
||||
+ return a((ICommand) o);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
11
paper-server/nms-patches/ICommand.patch
Normal file
11
paper-server/nms-patches/ICommand.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- ../work/decompile-8eb82bde//net/minecraft/server/ICommand.java 2014-11-29 00:40:43.197707433 +0000
|
||||
+++ src/main/java/net/minecraft/server/ICommand.java 2014-11-29 00:40:17.000000000 +0000
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
List b();
|
||||
|
||||
- void execute(ICommandListener icommandlistener, String[] astring);
|
||||
+ void execute(ICommandListener icommandlistener, String[] astring) throws ExceptionUsage; // CraftBukkit - Add exception
|
||||
|
||||
boolean canUse(ICommandListener icommandlistener);
|
||||
|
Loading…
Reference in a new issue