コード例 #1
0
def registerhook(hookCls, execfunc):
	# Use like this:
	# >>> from net.canarymod.hook.player import BlockDestroyHook
	# >>> def hookfunc(listener, hook):
	# ...	 yell(str(hook.getBlock().getType()))
	# >>> registerhook(BlockDestroyHook,hookfunc)
	Canary.hooks().registerHook(PluginEventListener(), Canary.manager().getPlugin('CanaryConsole'), hookCls, EventDispatcher(execfunc), Priority.NORMAL)
コード例 #2
0
def registerhook(hookCls, execfunc):
	# Use like this:
	# >>> from net.canarymod.hook.player import BlockDestroyHook
	# >>> def hookfunc(listener, hook):
	# ...	 yell(str(hook.getBlock().getType()))
	# >>> registerhook(BlockDestroyHook,hookfunc)
	Canary.hooks().registerHook(PluginEventListener(), Canary.manager().getPlugin('CanaryConsole'), hookCls, EventDispatcher(execfunc), Priority.NORMAL)