This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner-utils/sync.py
2015-09-20 01:47:36 +02:00

21 lines
475 B
Python

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