mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 12:41:50 +01:00
Fix /gamerule always targeting the main world
This commit is contained in:
parent
262c7779fe
commit
3433eeadc2
2 changed files with 28 additions and 3 deletions
25
nms-patches/CommandGamerule.patch
Normal file
25
nms-patches/CommandGamerule.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
--- ../work/decompile-8eb82bde/net/minecraft/server/CommandGamerule.java 2014-12-10 16:21:38.404579167 +0000
|
||||
+++ src/main/java/net/minecraft/server/CommandGamerule.java 2014-12-10 16:18:45.268581046 +0000
|
||||
@@ -19,8 +19,8 @@
|
||||
return "commands.gamerule.usage";
|
||||
}
|
||||
|
||||
- public void execute(ICommandListener icommandlistener, String[] astring) {
|
||||
- GameRules gamerules = this.d();
|
||||
+ public void execute(ICommandListener icommandlistener, String[] astring) throws CommandException { // CraftBukkit - added throws
|
||||
+ GameRules gamerules = icommandlistener.getWorld().getGameRules(); // Use current world
|
||||
String s = astring.length > 0 ? astring[0] : "";
|
||||
String s1 = astring.length > 1 ? a(astring, 1) : "";
|
||||
|
||||
@@ -85,4 +85,11 @@
|
||||
private GameRules d() {
|
||||
return MinecraftServer.getServer().getWorldServer(0).getGameRules();
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - fix decompile error
|
||||
+ @Override
|
||||
+ public int compareTo(Object o) {
|
||||
+ return a((ICommand) o);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
|
@ -1,11 +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
|
||||
--- ../work/decompile-8eb82bde/net/minecraft/server/ICommand.java 2014-12-10 16:21:38.812579162 +0000
|
||||
+++ src/main/java/net/minecraft/server/ICommand.java 2014-12-10 16:18:07.164581460 +0000
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
List b();
|
||||
|
||||
- void execute(ICommandListener icommandlistener, String[] astring);
|
||||
+ void execute(ICommandListener icommandlistener, String[] astring) throws ExceptionUsage; // CraftBukkit - Add exception
|
||||
+ void execute(ICommandListener icommandlistener, String[] astring) throws ExceptionUsage, CommandException; // CraftBukkit - Add exception
|
||||
|
||||
boolean canUse(ICommandListener icommandlistener);
|
||||
|
||||
|
|
Loading…
Reference in a new issue