When try to log manipulating with containers, have this code:
@Listener
public void PlayerMoveItemEvent(ClickInventoryEvent event) {
BTRDebugger.DLog("MOVE ITEM");
/*
* Get the Player object.
*/
final Player player = BTRGetPlayer.getPlayer(event.getCause().first(Player.class));
if (player == null) {
return;
}
System.out.println("move " + event.getCursorTransaction());
Transaction<ItemStackSnapshot> moveTransaction = event.getCursorTransaction();
Container targetInventory = event.getTargetInventory();
System.out.println("default " + moveTransaction.getDefault().getType().getTranslation().get(Locale.ENGLISH));
System.out.println("original " + moveTransaction.getOriginal().getType().getTranslation().get(Locale.ENGLISH));
System.out.println("final " + moveTransaction.getFinal().getType().getTranslation().get(Locale.ENGLISH));
System.out.println("target " + targetInventory );
Looks like it works when drag and drop item, but when press shift and then click to item, I cannot get what item is moved.
without shift:
[17:29:26] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:35]: move Transaction{original=SpongeItemStackSnapshot{itemType=net.minecraft.item.ItemCloth@51097500, count=1}, default=SpongeItemStackSnapshot{itemType=net.minecraft.item.Item@4302b2a, count=1}, custom=null, valid=true}
[17:29:26] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:38]: default item.none.name
[17:29:26] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:39]: original Wool
[17:29:26] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:40]: final item.none.name
[17:29:26] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:41]: target cpw.mods.ironchest.ContainerIronChest@55418e1c
with shift:
[17:30:21] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:35]: move Transaction{original=SpongeItemStackSnapshot{itemType=net.minecraft.item.Item@4302b2a, count=1}, default=SpongeItemStackSnapshot{itemType=net.minecraft.item.Item@4302b2a, count=1}, custom=null, valid=true}
[17:30:21] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:38]: default item.none.name
[17:30:21] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:39]: original item.none.name
[17:30:21] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:40]: final item.none.name
[17:30:21] [Server thread/INFO] [STDOUT]: [com.Volition21.BlockTrackR.Event.BTRMoveItemEvent:PlayerMoveItemEvent:41]: target cpw.mods.ironchest.ContainerIronChest@55418e1c
Is shift click implemented?