Log resetting of fastconsume data for the obvious spots.

This commit is contained in:
asofold 2016-11-28 22:24:51 +01:00
parent e926f34963
commit 380ed8a185
2 changed files with 9 additions and 0 deletions

View File

@ -147,6 +147,9 @@ public class FastConsume extends Check implements Listener, INotifyReload {
data.instantEatFood = actualStack == null ? null : actualStack.getType();
// TODO: Allows some abuse: 1. try instantly eat (cancelled) 2. consume item directly when needed.
} else {
if (data.debug) {
debug(player, "PlayerItemConsumeEvent, reset fastconsume: " + data.instantEatFood);
}
data.instantEatFood = null;
}
data.instantEatInteract = time;

View File

@ -351,6 +351,9 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
if (resetAll) {
// Nothing that we are interested in, reset data.
if (data.debug && data.instantEatFood != null) {
debug(player, "PlayerInteractEvent, reset fastconsume (legacy: instanteat).");
}
data.instantBowInteract = 0;
data.instantEatInteract = 0;
data.instantEatFood = null;
@ -385,6 +388,9 @@ public class InventoryListener extends CheckListener implements JoinLeaveListen
public void onItemHeldChange(final PlayerItemHeldEvent event) {
final Player player = event.getPlayer();
final InventoryData data = InventoryData.getData(player);
if (data.debug && data.instantEatFood != null) {
debug(player, "PlayerItemHeldEvent, reset fastconsume (legacy: instanteat).");
}
data.instantBowInteract = 0;
data.instantEatInteract = 0;
data.instantEatFood = null;