Paper/nms-patches/CustomFunctionData.patch

46 lines
1.5 KiB
Diff
Raw Normal View History

2017-05-14 04:00:00 +02:00
--- a/net/minecraft/server/CustomFunctionData.java
+++ b/net/minecraft/server/CustomFunctionData.java
@@ -23,7 +23,14 @@
private CustomFunction f;
private final ArrayDeque<CustomFunctionData.a> g = new ArrayDeque();
private boolean h = false;
- private final ICommandListener i = new ICommandListener() {
+ // CraftBukkit start
+ private final ICommandListener i = new CustomFunctionListener();
+
+ public class CustomFunctionListener implements ICommandListener {
+
+ protected org.bukkit.command.CommandSender sender = new org.bukkit.craftbukkit.command.CraftFunctionCommandSender(this);
+ // CraftBukkit end
+
public String getName() {
return CustomFunctionData.this.e;
}
@@ -33,7 +40,7 @@
2017-05-14 04:00:00 +02:00
}
public World getWorld() {
- return CustomFunctionData.this.c.worldServer[0];
+ return CustomFunctionData.this.c.worlds.get(0); // CraftBukkit
}
public MinecraftServer C_() {
@@ -57,7 +64,7 @@
2017-05-14 04:00:00 +02:00
}
public int c() {
- return this.c.worldServer[0].getGameRules().c("maxCommandChainLength");
+ return this.c.worlds.get(0).getGameRules().c("maxCommandChainLength"); // CraftBukkit
}
public Map<MinecraftKey, CustomFunction> d() {
@@ -65,7 +72,7 @@
2017-05-14 04:00:00 +02:00
}
public void e() {
- String s = this.c.worldServer[0].getGameRules().get("gameLoopFunction");
+ String s = this.c.worlds.get(0).getGameRules().get("gameLoopFunction"); // CraftBukkit
if (!s.equals(this.e)) {
this.e = s;