summaryrefslogtreecommitdiffstats
path: root/nms-patches/CustomFunctionData.patch
blob: 821ff006aba5763f8ecd9548bf7754471ccf429e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- 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 @@
         }
 
         public World getWorld() {
-            return CustomFunctionData.this.c.worldServer[0];
+            return CustomFunctionData.this.c.worlds.get(0); // CraftBukkit
         }
 
         public MinecraftServer C_() {
@@ -57,7 +64,7 @@
     }
 
     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 @@
     }
 
     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;