|
36 | 36 | import net.tfminecraft.coreprotect.listener.channel.PluginChannelListener; |
37 | 37 | import net.tfminecraft.coreprotect.model.action.EntityActionFilter; |
38 | 38 | import net.tfminecraft.coreprotect.model.action.LockChange; |
| 39 | +import net.tfminecraft.coreprotect.model.action.MythicIdentity; |
| 40 | +import net.tfminecraft.coreprotect.database.statement.EntityStatement; |
| 41 | +import net.tfminecraft.coreprotect.utility.AuditLabels; |
39 | 42 | import net.tfminecraft.coreprotect.model.action.LookupActions; |
40 | 43 | import net.tfminecraft.coreprotect.model.action.SessionActions; |
41 | 44 | import net.tfminecraft.coreprotect.model.entity.EntitySpawnRecord; |
@@ -321,6 +324,17 @@ else if (pageStart < rows) { |
321 | 324 | ? Lookup.performPartialLookup(statement, player, uuidList, userList, blockList, excludedBlocks, excludedUsers, actions, entityActionFilter, messageFilters, entityContext, finalLocation, radius, rowData, timeStart, timeEnd, (int) pageStart, displayResults, restrict_world, true, entityContainerId, rollbackState) |
322 | 325 | : lookupPage.getRows(); |
323 | 326 |
|
| 327 | + Set<Integer> killedEntities = new HashSet<>(); |
| 328 | + for (String[] row : lookupList) { |
| 329 | + if (row.length > 11 && row[7] != null && row[10] != null |
| 330 | + && Integer.parseInt(row[7]) == LookupActions.ENTITY_KILL |
| 331 | + && Integer.parseInt(row[10]) == -1 && Integer.parseInt(row[5]) != 0 |
| 332 | + && (row.length <= 13 || row[13] == null |
| 333 | + || Integer.parseInt(row[13]) != InventorySources.ENTITY_INTERACTION)) { |
| 334 | + killedEntities.add(Integer.parseInt(row[6])); |
| 335 | + } |
| 336 | + } |
| 337 | + Map<Integer, List<Object>> killedEntityData = EntityStatement.loadData(connection, killedEntities); |
324 | 338 | Map<Integer, EntitySpawnRecord> entitySpawnRecords = Collections.emptyMap(); |
325 | 339 | Map<UUID, Location> loadedEntityLocations = Collections.emptyMap(); |
326 | 340 | Set<Integer> entitySpawnRowIds = new HashSet<>(); |
@@ -462,6 +476,7 @@ else if (LookupActions.isInventoryLookup(actions)) { |
462 | 476 | Material blockType = ItemUtils.itemFilter(MaterialUtils.getType(dtype), (Integer.parseInt(data[13]) == 0)); |
463 | 477 | String dname = StringUtils.nameFilter(blockType.name().toLowerCase(Locale.ROOT), ddata); |
464 | 478 | byte[] metadata = data[11] == null ? null : data[11].getBytes(StandardCharsets.ISO_8859_1); |
| 479 | + dname = AuditLabels.item(metadata, dtype, amount, dname); |
465 | 480 | String tooltip = ItemUtils.getEnchantments(metadata, dtype, amount); |
466 | 481 | Integer itemId = ItemUtils.makeGivableItem(ItemUtils.getItemStack(metadata, dtype, amount)); |
467 | 482 |
|
@@ -566,12 +581,18 @@ else if ((daction == LookupActions.ENTITY_KILL || daction == LookupActions.ENTIT |
566 | 581 |
|
567 | 582 | // Functions.sendMessage(player2, timeago+" " + ChatColors.WHITE + "- " + ChatColors.DARK_AQUA+rbd+""+dplayer+" " + ChatColors.WHITE+rbd+""+a+" " + ChatColors.DARK_AQUA+rbd+"#"+dtype+ChatColors.WHITE + ". " + ChatColors.GREY + "(x"+x+"/y"+y+"/z"+z+")"); |
568 | 583 |
|
| 584 | + if (!entityInteraction && daction == LookupActions.ENTITY_KILL && amount == -1 && !isPlayer) { |
| 585 | + MythicIdentity identity = MythicIdentity.fromLookupString(data[11]); |
| 586 | + dname = AuditLabels.mob(dname, killedEntityData.get(ddata), identity == null ? null : identity.id()); |
| 587 | + } |
| 588 | + |
569 | 589 | Phrase phrase = Phrase.LOOKUP_BLOCK; |
570 | 590 | String selector = Selector.FIRST; |
571 | 591 | String action = "a:block"; |
572 | 592 | LockChange lockChange = null; |
573 | 593 | if (actions.contains(LookupActions.CONTAINER) || actions.contains(5) || actions.contains(LookupActions.ITEM) || amount > -1) { |
574 | 594 | byte[] metadata = data[11] == null ? null : data[11].getBytes(StandardCharsets.ISO_8859_1); |
| 595 | + dname = AuditLabels.item(metadata, dtype, amount, dname); |
575 | 596 | String tooltip = ItemUtils.getEnchantments(metadata, dtype, amount); |
576 | 597 | Integer itemId = ItemUtils.makeGivableItem(ItemUtils.getItemStack(metadata, dtype, amount)); |
577 | 598 |
|
|
0 commit comments