Search in sources :

Example 6 with Action

use of org.cubeengine.module.vigil.report.Action in project modules-extra by CubeEngine.

the class PlaceBlockReport method showReport.

@Override
public void showReport(List<Action> actions, Receiver receiver) {
    Action action = actions.get(0);
    Optional<BlockSnapshot> orig = action.getCached(BLOCKS_ORIG, Recall::origSnapshot);
    Optional<BlockSnapshot> repl = action.getCached(BLOCKS_REPL, Recall::replSnapshot);
    if (!repl.isPresent()) {
        throw new IllegalStateException();
    }
    showReport(actions, receiver, action, orig, repl.get());
}
Also used : Action(org.cubeengine.module.vigil.report.Action) BlockSnapshot(org.spongepowered.api.block.BlockSnapshot) Recall(org.cubeengine.module.vigil.report.Recall)

Example 7 with Action

use of org.cubeengine.module.vigil.report.Action in project modules-extra by CubeEngine.

the class ChatReport method observe.

@Override
public Action observe(MessageChannelEvent.Chat event) {
    Action action = newReport();
    action.addData(CAUSE, Observe.causes(event.getCause()));
    action.addData(CHAT, event.getRawMessage().toPlain());
    action.addData(LOCATION, Observe.location(event.getCause().first(Player.class).get().getLocation()));
    return action;
}
Also used : Action(org.cubeengine.module.vigil.report.Action)

Example 8 with Action

use of org.cubeengine.module.vigil.report.Action in project modules-extra by CubeEngine.

the class CommandReport method observe.

@Override
public Action observe(SendCommandEvent event) {
    Action action = newReport();
    action.addData(CAUSE, Observe.causes(event.getCause()));
    action.addData(COMMAND, event.getCommand());
    action.addData(LOCATION, Observe.location(event.getCause().first(Player.class).get().getLocation()));
    return action;
}
Also used : Action(org.cubeengine.module.vigil.report.Action)

Example 9 with Action

use of org.cubeengine.module.vigil.report.Action in project modules-extra by CubeEngine.

the class JoinReport method observe.

@Override
protected Action observe(ClientConnectionEvent.Join event) {
    Action action = newReport();
    action.addData(CAUSE, Observe.causes(Cause.of(EventContext.empty(), event.getTargetEntity())));
    action.addData(LOCATION, Observe.location(event.getTargetEntity().getLocation()));
    return action;
}
Also used : Action(org.cubeengine.module.vigil.report.Action)

Example 10 with Action

use of org.cubeengine.module.vigil.report.Action in project modules-extra by CubeEngine.

the class JoinReport method showReport.

@Override
public void showReport(List<Action> actions, Receiver receiver) {
    Action action = actions.get(0);
    receiver.sendReport(this, actions, actions.size(), "{txt} joined the game", "{txt} joined the game x{}", Recall.cause(action), actions.size());
}
Also used : Action(org.cubeengine.module.vigil.report.Action)

Aggregations

Action (org.cubeengine.module.vigil.report.Action)24 BlockSnapshot (org.spongepowered.api.block.BlockSnapshot)5 Text (org.spongepowered.api.text.Text)4 ArrayList (java.util.ArrayList)3 Recall (org.cubeengine.module.vigil.report.Recall)3 Map (java.util.Map)2 ItemStack (org.spongepowered.api.item.inventory.ItemStack)2 SlotTransaction (org.spongepowered.api.item.inventory.transaction.SlotTransaction)2 TextActions.showText (org.spongepowered.api.text.action.TextActions.showText)2 Vector3i (com.flowpowered.math.vector.Vector3i)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 UUID (java.util.UUID)1 Document (org.bson.Document)1 Report (org.cubeengine.module.vigil.report.Report)1 ReportActions (org.cubeengine.module.vigil.report.ReportActions)1 Transaction (org.spongepowered.api.data.Transaction)1 MutableBoundedValue (org.spongepowered.api.data.value.mutable.MutableBoundedValue)1 EntitySnapshot (org.spongepowered.api.entity.EntitySnapshot)1 Living (org.spongepowered.api.entity.living.Living)1