Collection Tick Stack Traceability

This commit is contained in:
Olof Larsson 2015-02-02 00:25:59 +01:00
parent ad529d7542
commit e93f7c12d8
6 changed files with 87 additions and 18 deletions

View File

@ -18,6 +18,16 @@ public class AspectColl extends Coll<Aspect>
{
super("massivecore_aspect", Aspect.class, MStore.getDb("default"), MassiveCore.get());
}
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- //
// EXTRAS

View File

@ -0,0 +1,45 @@
package com.massivecraft.massivecore;
import org.bukkit.plugin.Plugin;
import com.massivecraft.massivecore.store.Coll;
public class EngineCollTick extends EngineAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
protected static EngineCollTick i = new EngineCollTick();
public static EngineCollTick get() { return i; }
// -------------------------------------------- //
// OVERRIDE: ENGINE
// -------------------------------------------- //
@Override
public Plugin getPlugin()
{
return MassiveCore.get();
}
@Override
public Long getPeriod()
{
return 1L;
}
// -------------------------------------------- //
// OVERRIDE: RUNNABLE
// -------------------------------------------- //
@Override
public void run()
{
for (Coll<?> coll : Coll.getInstances())
{
coll.onTick();
}
}
}

View File

@ -44,7 +44,6 @@ import com.massivecraft.massivecore.integration.vault.IntegrationVault;
import com.massivecraft.massivecore.mixin.EngineTeleportMixinCause;
import com.massivecraft.massivecore.ps.PS;
import com.massivecraft.massivecore.ps.PSAdapter;
import com.massivecraft.massivecore.store.Coll;
import com.massivecraft.massivecore.store.ExamineThread;
import com.massivecraft.massivecore.teleport.EngineScheduledTeleport;
import com.massivecraft.massivecore.util.IdUtil;
@ -141,19 +140,6 @@ public class MassiveCore extends MassivePlugin
private CmdMassiveCoreCmdurl outerCmdMassiveCoreCmdurl;
public CmdMassiveCoreCmdurl getOuterCmdMassiveCoreCmdurl() { return this.outerCmdMassiveCoreCmdurl; }
// Runnables
// TODO: Make this one a singleton
private Runnable collTickTask = new Runnable()
{
public void run()
{
for (Coll<?> coll : Coll.getInstances())
{
coll.onTick();
}
}
};
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@ -178,7 +164,8 @@ public class MassiveCore extends MassivePlugin
// Setup IdUtil
IdUtil.setup();
// Register events
// Engine
EngineCollTick.get().activate();
MassiveCoreEngineMain.get().activate();
MassiveCoreEngineVariable.get().activate();
EngineScheduledTeleport.get().activate();
@ -187,9 +174,6 @@ public class MassiveCore extends MassivePlugin
MassiveCoreEngineCommandRegistration.get().activate();
PlayerUtil.get().activate();
// Tasks
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, this.collTickTask, 1, 1);
// Collections
MultiverseColl.get().init();
AspectColl.get().init();

View File

@ -16,6 +16,16 @@ public class MassiveCoreMConfColl extends Coll<MassiveCoreMConf>
{
super("massivecore_mconf", MassiveCoreMConf.class, MStore.getDb(ConfServer.dburi), MassiveCore.get());
}
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- //
// OVERRIDE

View File

@ -15,6 +15,16 @@ public class MultiverseColl extends Coll<Multiverse>
{
super("massivecore_multiverse", Multiverse.class, MStore.getDb("default"), MassiveCore.get());
}
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- //
// EXTRAS

View File

@ -33,6 +33,16 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
{
super(name, entityClass, db, plugin, true, true, true);
}
// -------------------------------------------- //
// STACK TRACEABILITY
// -------------------------------------------- //
@Override
public void onTick()
{
super.onTick();
}
// -------------------------------------------- //
// OVERRIDE: Coll