當前位置: 首頁>>代碼示例>>Java>>正文


Java TaskManager類代碼示例

本文整理匯總了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);
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:20,代碼來源:LockManager.java

示例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();
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:17,代碼來源:AnnouncementManager.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:17,代碼來源:AfkCommand.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:8,代碼來源:TeleportRequestCommands.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:9,代碼來源:MailCommand.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:9,代碼來源:TimeCommands.java

示例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);
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:11,代碼來源:KeyBook.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:8,代碼來源:FlyListener.java

示例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);
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:8,代碼來源:RocketCommand.java

示例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<>();
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:8,代碼來源:DiscoCommand.java

示例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);
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:8,代碼來源:DiscoCommand.java

示例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);
    }
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:16,代碼來源:ThrowCommands.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-extra,代碼行數:8,代碼來源:DonationController.java

示例14: getTaskManager

import org.cubeengine.libcube.service.task.TaskManager; //導入依賴的package包/類
public TaskManager getTaskManager()
{
    return tm;
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:5,代碼來源:Locker.java

示例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;
}
 
開發者ID:CubeEngine,項目名稱:modules-main,代碼行數:42,代碼來源:KeyBook.java


注:本文中的org.cubeengine.libcube.service.task.TaskManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。