2525import net .coreprotect .utility .BlockUtils ;
2626import net .coreprotect .utility .ItemUtils ;
2727import net .coreprotect .utility .MaterialUtils ;
28- import net .coreprotect .utility .SyntheticUsernames ;
2928import net .coreprotect .utility .WorldUtils ;
3029import net .coreprotect .utility .serialize .ItemMetaHandler ;
3130
@@ -58,13 +57,7 @@ else if (type == Material.JUKEBOX || type == Material.ARMOR_STAND) {
5857 return ;
5958 }
6059
61- String uniqueUser = player ;
62- String canonicalUser = SyntheticUsernames .normalize (uniqueUser );
63- if (canonicalUser == null ) {
64- canonicalUser = uniqueUser ;
65- }
66-
67- String loggingContainerId = uniqueUser .toLowerCase (Locale .ROOT ) + "." + location .getBlockX () + "." + location .getBlockY () + "." + location .getBlockZ ();
60+ String loggingContainerId = player .toLowerCase (Locale .ROOT ) + "." + location .getBlockX () + "." + location .getBlockY () + "." + location .getBlockZ ();
6861 List <ItemStack []> oldList = ConfigHandler .oldContainer .get (loggingContainerId );
6962 ItemStack [] oi1 = oldList .get (0 );
7063 ItemStack [] oldInventory = ItemUtils .getContainerState (oi1 );
@@ -74,7 +67,7 @@ else if (type == Material.JUKEBOX || type == Material.ARMOR_STAND) {
7467 }
7568
7669 // Check if this is a dispenser with no actual changes
77- if ("#dispenser" .equals (canonicalUser ) && ItemUtils .compareContainers (oldInventory , newInventory )) {
70+ if ("#dispenser" .equals (player ) && ItemUtils .compareContainers (oldInventory , newInventory )) {
7871 // No changes detected, mark this dispenser in the dispenserNoChange map
7972 // Extract the location key from the loggingContainerId
8073 // Format: #dispenser.x.y.z
@@ -102,7 +95,7 @@ else if (type == Material.JUKEBOX || type == Material.ARMOR_STAND) {
10295
10396 // If we reach here, the dispenser event resulted in changes
10497 // Remove any pending event for this dispenser
105- if ("#dispenser" .equals (canonicalUser )) {
98+ if ("#dispenser" .equals (player )) {
10699 String [] parts = loggingContainerId .split ("\\ ." );
107100 if (parts .length >= 4 ) {
108101 int x = Integer .parseInt (parts [1 ]);
@@ -198,12 +191,12 @@ else if (item != null) {
198191 ItemUtils .mergeItems (type , newInventory );
199192
200193 if (type != Material .ENDER_CHEST ) {
201- logTransaction (preparedStmtContainer , batchCount , canonicalUser , type , faceData , oldInventory , 0 , location );
202- logTransaction (preparedStmtContainer , batchCount , canonicalUser , type , faceData , newInventory , 1 , location );
194+ logTransaction (preparedStmtContainer , batchCount , player , type , faceData , oldInventory , 0 , location );
195+ logTransaction (preparedStmtContainer , batchCount , player , type , faceData , newInventory , 1 , location );
203196 }
204197 else { // pass ender chest transactions to item logger
205- ItemLogger .logTransaction (preparedStmtItems , batchCount , 0 , canonicalUser , location , oldInventory , ItemLogger .ITEM_REMOVE_ENDER );
206- ItemLogger .logTransaction (preparedStmtItems , batchCount , 0 , canonicalUser , location , newInventory , ItemLogger .ITEM_ADD_ENDER );
198+ ItemLogger .logTransaction (preparedStmtItems , batchCount , 0 , player , location , oldInventory , ItemLogger .ITEM_REMOVE_ENDER );
199+ ItemLogger .logTransaction (preparedStmtItems , batchCount , 0 , player , location , newInventory , ItemLogger .ITEM_ADD_ENDER );
207200 }
208201
209202 oldList .remove (0 );
0 commit comments