Prepped logging for skull skin textures on Paper servers

This commit is contained in:
Intelli 2024-07-09 18:51:46 -06:00
parent dbd8723752
commit 4bf4f4eb92
8 changed files with 89 additions and 4 deletions

View file

@ -28,10 +28,12 @@ public class SkullBreakLogger {
int type = Util.getBlockId(block.getType().name(), true);
Skull skull = (Skull) block;
String skullOwner = "";
String skullSkin = null;
int skullKey = 0;
if (skull.hasOwner()) {
skullOwner = PaperAdapter.ADAPTER.getSkullOwner(skull);
ResultSet resultSet = SkullStatement.insert(preparedStmt2, time, skullOwner);
skullSkin = PaperAdapter.ADAPTER.getSkullSkin(skull);
ResultSet resultSet = SkullStatement.insert(preparedStmt2, time, skullOwner, skullSkin);
if (Database.hasReturningKeys()) {
resultSet.next();
skullKey = resultSet.getInt(1);

View file

@ -31,9 +31,11 @@ public class SkullPlaceLogger {
if (block instanceof Skull) {
Skull skull = (Skull) block;
String skullOwner = "";
String skullSkin = null;
if (skull.hasOwner()) {
skullOwner = PaperAdapter.ADAPTER.getSkullOwner(skull);
ResultSet resultSet = SkullStatement.insert(preparedStmt2, time, skullOwner);
skullSkin = PaperAdapter.ADAPTER.getSkullSkin(skull);
ResultSet resultSet = SkullStatement.insert(preparedStmt2, time, skullOwner, skullSkin);
if (Database.hasReturningKeys()) {
resultSet.next();
skullKey = resultSet.getInt(1);

View file

@ -18,7 +18,7 @@ public class SkullStatement {
throw new IllegalStateException("Database class");
}
public static ResultSet insert(PreparedStatement preparedStmt, int time, String owner) {
public static ResultSet insert(PreparedStatement preparedStmt, int time, String owner, String skin) {
try {
preparedStmt.setInt(1, time);
preparedStmt.setString(2, owner);