InventoryListener - Add InvMove listener

This commit is contained in:
CaptainObvious0 2019-03-21 20:56:40 -05:00 committed by GitHub
parent 2101e9496f
commit 4aa7333541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -77,6 +77,9 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
/** The drop check. */
private final Drop drop = addCheck(new Drop());
/** Inventory Move check */
private final InventoryMove invMove = addCheck(new InventoryMove());
/** The fast click check. */
private final FastClick fastClick = addCheck(new FastClick());
@ -264,6 +267,15 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
}
}
}
// Inventory Move check
if (invMove.isEnabled(player, pData)) {
if (invMove.check(player, data, pData)) {
cancel = true;
}
}
data.lastClickTime = now;
if (cancel) {
event.setCancelled(true);