use of org.cubeengine.module.vigil.data.LookupData in project modules-extra by CubeEngine.
the class Vigil method onEnable.
@Listener
public void onEnable(GameInitializationEvent event) {
this.tf = mm.getThreadFactory(Vigil.class);
ReportManager reportManager = new ReportManager(this, em, i18n);
qm = new QueryManager(tf, bd.getDatabase().getCollection("vigil"), reportManager, i18n, plugin);
this.cm.getProviders().register(this, new LookupDataParser(i18n), LookupData.class);
;
VigilCommands vc = new VigilCommands(sm, i18n, cm);
cm.addCommand(vc);
vc.addCommand(new VigilAdminCommands(cm, i18n, this));
cm.addCommands(vc, this, new VigilLookupCommands(cm, i18n, qm));
em.registerListener(Vigil.class, new ToolListener(pm, qm));
DataRegistration<LookupData, ImmutableLookupData> dr = DataRegistration.<LookupData, ImmutableLookupData>builder().dataClass(LookupData.class).immutableClass(ImmutableLookupData.class).builder(new LookupDataBuilder()).manipulatorId("vigil-lookup").dataName("CubeEngine vigil Lookup Data").buildAndRegister(plugin);
}
use of org.cubeengine.module.vigil.data.LookupData in project modules-extra by CubeEngine.
the class LookupDataParser method parse.
@Override
public LookupData parse(Class clazz, CommandInvocation ci) throws ParserException {
String token = ci.consume(1);
if (!types.keySet().contains(token.toLowerCase())) {
throw new TranslatedParserException(i18n.translate(ci.getContext(Locale.class), NEGATIVE, "{input} is not a valid log-type. Use chest, container, player, block or kills instead!", token));
}
LookupData data = types.get(token.toLowerCase()).copy();
return data.withCreator(((Player) ci.getCommandSource()).getUniqueId());
}
use of org.cubeengine.module.vigil.data.LookupData in project modules-extra by CubeEngine.
the class VigilLookupCommands method lookup.
@Alias(value = "lookup")
@Command(desc = "Performs a lookup.")
public void lookup(Player context, @Named("radius") int radius) {
LookupData ld = new LookupData();
Lookup lookup = new Lookup(ld).with(context.getLocation()).withRadius(radius);
this.qm.queryAndShow(lookup, context);
}
Aggregations