Fixed item frames and paintings not logging directional data
This commit is contained in:
parent
7398f7dfe6
commit
e462e68806
15 changed files with 132 additions and 68 deletions
|
|
@ -338,7 +338,7 @@ public class Rollback extends Queue {
|
|||
}
|
||||
|
||||
BlockData blockData = null;
|
||||
if (blockDataString != null && blockDataString.length() > 0) {
|
||||
if (blockDataString != null && blockDataString.contains(":")) {
|
||||
try {
|
||||
blockData = Bukkit.getServer().createBlockData(blockDataString);
|
||||
}
|
||||
|
|
@ -564,11 +564,11 @@ public class Rollback extends Queue {
|
|||
|
||||
if ((rowType == Material.AIR) && ((BukkitAdapter.ADAPTER.isItemFrame(oldTypeMaterial)) || (oldTypeMaterial == Material.PAINTING))) {
|
||||
int delay = Util.getHangingDelay(hangingDelay, rowWorldId, rowX, rowY, rowZ);
|
||||
Queue.queueHangingRemove(rowUser, block.getState(), delay);
|
||||
Queue.queueHangingRemove(rowUser, block.getState(), blockDataString, delay);
|
||||
}
|
||||
else if ((BukkitAdapter.ADAPTER.isItemFrame(rowType)) || (rowType == Material.PAINTING)) {
|
||||
int delay = Util.getHangingDelay(hangingDelay, rowWorldId, rowX, rowY, rowZ);
|
||||
Queue.queueHangingSpawn(rowUser, block.getState(), rowType, rowData, delay);
|
||||
Queue.queueHangingSpawn(rowUser, block.getState(), rowType, blockDataString, rowData, delay);
|
||||
}
|
||||
else if ((rowType == Material.ARMOR_STAND)) {
|
||||
Location location1 = block.getLocation();
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.bukkit.Location;
|
|||
import org.bukkit.Material;
|
||||
|
||||
import net.coreprotect.CoreProtect;
|
||||
import net.coreprotect.bukkit.BukkitAdapter;
|
||||
import net.coreprotect.config.ConfigHandler;
|
||||
import net.coreprotect.database.statement.BlockStatement;
|
||||
import net.coreprotect.database.statement.UserStatement;
|
||||
|
|
@ -21,7 +22,7 @@ public class BlockBreakLogger {
|
|||
throw new IllegalStateException("Database class");
|
||||
}
|
||||
|
||||
public static void log(PreparedStatement preparedStmt, int batchCount, String user, Location location, int type, int data, List<Object> meta, String blockData) {
|
||||
public static void log(PreparedStatement preparedStmt, int batchCount, String user, Location location, int type, int data, List<Object> meta, String blockData, String overrideData) {
|
||||
try {
|
||||
if (ConfigHandler.blacklist.get(user.toLowerCase(Locale.ROOT)) != null || location == null) {
|
||||
return;
|
||||
|
|
@ -42,6 +43,9 @@ public class BlockBreakLogger {
|
|||
if (checkType == Material.LECTERN) {
|
||||
blockData = blockData.replaceFirst("has_book=true", "has_book=false");
|
||||
}
|
||||
else if (checkType == Material.PAINTING || BukkitAdapter.ADAPTER.isItemFrame(checkType)) {
|
||||
blockData = overrideData;
|
||||
}
|
||||
|
||||
CoreProtectPreLogEvent event = new CoreProtectPreLogEvent(user);
|
||||
CoreProtect.getInstance().getServer().getPluginManager().callEvent(event);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class SkullBreakLogger {
|
|||
keys.close();
|
||||
}
|
||||
|
||||
BlockBreakLogger.log(preparedStmt, batchCount, user, block.getLocation(), type, skullKey, null, block.getBlockData().getAsString());
|
||||
BlockBreakLogger.log(preparedStmt, batchCount, user, block.getLocation(), type, skullKey, null, block.getBlockData().getAsString(), null);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue