本文整理汇总了Java中org.cubeengine.libcube.service.task.TaskManager类的典型用法代码示例。如果您正苦于以下问题:Java TaskManager类的具体用法?Java TaskManager怎么用?Java TaskManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskManager类属于org.cubeengine.libcube.service.task包,在下文中一共展示了TaskManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LockManager
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
@Inject
public LockManager(Locker module, EventManager em, TaskManager tm, I18n i18n, ModuleManager mm)
{
this.tm = tm;
this.i18n = i18n;
logger = mm.getLoggerFor(Locker.class);
this.module = module;
try
{
messageDigest = MessageDigest.getInstance("SHA-1");
}
catch (NoSuchAlgorithmException e)
{
throw new RuntimeException("SHA-1 hash algorithm not available!");
}
this.commandListener = new CommandListener(module, this, i18n);
em.registerListener(Locker.class, this.commandListener);
em.registerListener(Locker.class, this);
}
示例2: AnnouncementManager
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public AnnouncementManager(Shout module, Path modulePath, I18n i18n, PermissionManager pm, TaskManager tm,
StringMatcher stringMatcher, Reflector reflector)
{
this.module = module;
this.pm = pm;
this.tm = tm;
this.stringMatcher = stringMatcher;
this.reflector = reflector;
this.log = module.getLog();
this.i18n = i18n;
this.dynamicAnnouncements = new HashMap<>();
this.fixedCycleAnnouncements = new LinkedHashMap<>();
this.modulePath = modulePath;
this.handleFirstRun();
}
示例3: AfkCommand
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public AfkCommand(Chat module, long autoAfk, long afkCheck, Broadcaster bc, TaskManager tm, EventManager em)
{
this.module = module;
this.autoAfk = autoAfk;
this.afkCheck = afkCheck;
this.listener = new AfkListener(module, this);
if (afkCheck > 0)
{
em.registerListener(Chat.class, listener);
if (autoAfk > 0)
{
tm.runTimer(Chat.class, this, 20, afkCheck / 50); // this is in ticks so /50
}
}
this.bc = bc;
}
示例4: TeleportRequestCommands
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public TeleportRequestCommands(Teleport module, TaskManager taskManager, TeleportListener tl, I18n i18n)
{
this.module = module;
this.taskManager = taskManager;
this.tl = tl;
this.i18n = i18n;
}
示例5: MailCommand
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public MailCommand(CommandManager base, MailModule module, TaskManager taskManager, Database db, I18n i18n)
{
super(base, MailModule.class);
this.module = module;
this.taskManager = taskManager;
this.db = db;
this.i18n = i18n;
}
示例6: TimeCommands
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public TimeCommands(PermissionManager pm, I18n i18n, TimeMatcher tm, WorldMatcher worldMatcher, TaskManager tam)
{
super(pm, VanillaPlus.class);
this.i18n = i18n;
this.tm = tm;
this.worldMatcher = worldMatcher;
this.tam = tam;
}
示例7: playUnlockSound
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public static void playUnlockSound(Player holder, final Location effectLocation, TaskManager tm)
{
holder.playSound(BLOCK_PISTON_EXTEND, effectLocation.getPosition(), 1, 2);
holder.playSound(BLOCK_PISTON_EXTEND, effectLocation.getPosition(), 1, (float) 1.5);
tm.runTaskDelayed(Locker.class, () -> {
holder.playSound(BLOCK_PISTON_EXTEND, effectLocation.getPosition(), 1, 2);
holder.playSound(BLOCK_PISTON_EXTEND, effectLocation.getPosition(), 1, (float)1.5);
}, 3);
}
示例8: FlyListener
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public FlyListener(Fly module, PermissionManager pm, I18n i18n, TaskManager tm)
{
this.module = module;
this.i18n = i18n;
FLY_FEATHER = pm.register(Fly.class, "feather", "", null);
this.tm = tm;
}
示例9: RocketCommand
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public RocketCommand(Fun module, EventManager em, TaskManager tm)
{
this.module = module;
this.tm = tm;
this.rocketListener = new RocketListener();
em.registerListener(Fun.class, rocketListener);
}
示例10: DiscoCommand
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public DiscoCommand(Fun module, I18n i18n, TaskManager tm)
{
this.module = module;
this.i18n = i18n;
this.tm = tm;
this.activeTasks = new HashMap<>();
}
示例11: DiscoTask
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public DiscoTask(World world, final long delay, TaskManager tm)
{
this.world = world;
this.tm = tm;
this.originalTime = world.getProperties().getTotalTime();
this.taskID = tm.runTimer(Fun.class, this, delay, delay);
}
示例12: ThrowCommands
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public ThrowCommands(Fun module, EventManager em, PermissionManager pm, TaskManager tm, EntityMatcher entityMatcher, I18n i18n)
{
this.module = module;
this.tm = tm;
this.entityMatcher = entityMatcher;
this.i18n = i18n;
this.thrownItems = new HashMap<>();
this.throwListener = new ThrowListener();
em.registerListener(Fun.class, this.throwListener);
for (EntityType type : Sponge.getRegistry().getAllOf(EntityType.class)) // TODO only entities that can be thrown
{
Permission perm = pm.register(Fun.class, "command.throw." + type.getName().toLowerCase().replace("_", "-"), "", null);
perms.put(type, perm);
}
}
示例13: DonationController
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public DonationController(DonationsConfig config, CommandManager cm, TaskManager tm, Broadcaster bc)
{
this.config = config;
this.cm = cm;
this.tm = tm;
this.bc = bc;
}
示例14: getTaskManager
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public TaskManager getTaskManager()
{
return tm;
}
示例15: check
import org.cubeengine.libcube.service.task.TaskManager; //导入依赖的package包/类
public boolean check(Lock lock, Location effectLocation)
{
if (!lock.getId().equals(lockID)) // Id matches ?
{
if (!lock.isOwner(holder))
{
i18n.send(ACTION_BAR, holder, NEUTRAL, "You try to open the container with your KeyBook but nothing happens!");
holder.playSound(ENTITY_BLAZE_HURT, effectLocation.getPosition(), 1, 1);
holder.playSound(ENTITY_BLAZE_HURT, effectLocation.getPosition(), 1, (float)0.8);
}
return false;
}
if (!this.isValidFor(lock))
{
i18n.send(ACTION_BAR, holder, NEGATIVE, "You try to open the container with your KeyBook but you get forcefully pushed away!");
this.invalidate();
holder.playSound(ENTITY_GHAST_SCREAM, effectLocation.getPosition(), 1, 1);
final Vector3d userDirection = holder.getRotation();
Sponge.getCauseStackManager().pushCause(item);
holder.damage(0, DamageSources.MAGIC);
VelocityData velocity = holder.getOrCreate(VelocityData.class).get();
Sponge.getCauseStackManager().popCause();
velocity.velocity().set(userDirection.mul(-3));
holder.offer(velocity);
return false;
}
if (effectLocation != null)
{
if (!lock.isOwner(holder))
{
i18n.send(ACTION_BAR, holder, POSITIVE, "As you approach with your KeyBook the magic lock disappears!");
}
TaskManager tm = module.getTaskManager();
playUnlockSound(holder, effectLocation, tm);
lock.notifyKeyUsage(holder);
}
return true;
}