summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sync.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/sync.py b/sync.py
new file mode 100644
index 0000000..0a2cd0b
--- /dev/null
+++ b/sync.py
@@ -0,0 +1,21 @@
+from helpers import *
+from java.lang import Runnable
+
+class Sync_class(Runnable):
+
+ def __init__(self,function,*args,**kwargs):
+ self.function = function
+ self.args = args
+ self.kwargs = kwargs
+
+ def run(self):
+ self.function(self.args,self.kwargs)
+
+
+
+def sync(function):
+ def wrapper(*args,**kwargs):
+ sync_function = Sync_class(function)
+ server.getScheduler().runTask(server.getPluginManager().getPlugin("RedstonerUtils"),sync_function)
+ return None
+ return wrapper \ No newline at end of file