Search in sources :

Example 1 with ActionType

use of com.karanumcoding.adamantineshield.enums.ActionType in project AdamantineShield by Karanum.

the class ContainerLookupResult method readResult.

protected void readResult(ResultSet results) throws SQLException {
    while (results.next()) {
        Vector3i pos = new Vector3i(results.getInt("x"), results.getInt("y"), results.getInt("z"));
        UUID world = UUID.fromString(results.getString("world"));
        ActionType type = ActionType.valueCache[results.getByte("type")];
        String cause = results.getString("cause");
        String data = results.getString("data");
        ItemType item = Sponge.getRegistry().getType(ItemType.class, results.getString("AS_Id.value")).get();
        int count = results.getByte("count");
        int slot = results.getInt("slot");
        boolean rolledBack = results.getBoolean("rolled_back");
        long timestamp = results.getLong("time");
        lines.add(new LookupLine(pos, world, type, cause, data, item, count, slot, rolledBack, timestamp));
    }
}
Also used : ActionType(com.karanumcoding.adamantineshield.enums.ActionType) ItemType(org.spongepowered.api.item.ItemType) Vector3i(com.flowpowered.math.vector.Vector3i) UUID(java.util.UUID)

Example 2 with ActionType

use of com.karanumcoding.adamantineshield.enums.ActionType in project AdamantineShield by Karanum.

the class BlockLookupResult method readResult.

protected void readResult(ResultSet results) throws SQLException {
    while (results.next()) {
        Vector3i pos = new Vector3i(results.getInt("x"), results.getInt("y"), results.getInt("z"));
        UUID world = UUID.fromString(results.getString("world"));
        ActionType type = ActionType.valueCache[results.getByte("type")];
        String cause = results.getString("cause");
        String data = results.getString("data");
        BlockType block = Sponge.getRegistry().getType(BlockType.class, results.getString("AS_Id.value")).get();
        boolean rolledBack = results.getBoolean("rolled_back");
        long timestamp = results.getLong("time");
        lines.add(new LookupLine(pos, world, type, cause, data, block, 1, 0, rolledBack, timestamp));
    }
}
Also used : ActionType(com.karanumcoding.adamantineshield.enums.ActionType) BlockType(org.spongepowered.api.block.BlockType) Vector3i(com.flowpowered.math.vector.Vector3i) UUID(java.util.UUID)

Aggregations

Vector3i (com.flowpowered.math.vector.Vector3i)2 ActionType (com.karanumcoding.adamantineshield.enums.ActionType)2 UUID (java.util.UUID)2 BlockType (org.spongepowered.api.block.BlockType)1 ItemType (org.spongepowered.api.item.ItemType)1