Added interaction logging for players clicking item frames

This commit is contained in:
Intelli 2022-02-17 21:10:49 -07:00
parent fb79071ee7
commit c652ce852f
7 changed files with 14 additions and 9 deletions

View file

@ -296,10 +296,10 @@ public class Queue {
queueStandardData(consumerId, currentConsumer, new String[] { player.getName(), null }, new Object[] { timestamp, player.getLocation().clone() });
}
protected static void queuePlayerInteraction(String user, BlockState block) {
protected static void queuePlayerInteraction(String user, BlockState block, Material type) {
int currentConsumer = Consumer.currentConsumer;
int consumerId = Consumer.newConsumerId(currentConsumer);
addConsumer(currentConsumer, new Object[] { consumerId, Process.PLAYER_INTERACTION, null, 0, null, 0, 0, null });
addConsumer(currentConsumer, new Object[] { consumerId, Process.PLAYER_INTERACTION, type, 0, null, 0, 0, null });
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, block);
}

View file

@ -2,16 +2,17 @@ package net.coreprotect.consumer.process;
import java.sql.PreparedStatement;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import net.coreprotect.database.logger.PlayerInteractLogger;
class PlayerInteractionProcess {
static void process(PreparedStatement preparedStmt, int batchCount, String user, Object object) {
static void process(PreparedStatement preparedStmt, int batchCount, String user, Object object, Material type) {
if (object instanceof BlockState) {
BlockState block = (BlockState) object;
PlayerInteractLogger.log(preparedStmt, batchCount, user, block);
PlayerInteractLogger.log(preparedStmt, batchCount, user, block, type);
}
}
}

View file

@ -143,7 +143,7 @@ public class Process {
ContainerBreakProcess.process(preparedStmtContainers, i, processId, id, blockType, user, object);
break;
case Process.PLAYER_INTERACTION:
PlayerInteractionProcess.process(preparedStmtBlocks, i, user, object);
PlayerInteractionProcess.process(preparedStmtBlocks, i, user, object, blockType);
break;
case Process.CONTAINER_TRANSACTION:
ContainerTransactionProcess.process(preparedStmtContainers, preparedStmtItems, i, processId, id, blockType, forceData, user, object);