@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onToggleSprint(final PlayerToggleSprintEvent event)
{
final User user = UserManager.getUser(event.getPlayer().getUniqueId());
if (user != null) {
user.getDataMap().setValue(DataKey.SPRINTING, event.isSprinting());
if (!event.isSprinting()) {
user.getDataMap().setValue(DataKey.LAST_SPRINT_DURATION, user.getTimestampMap().passedTime(TimestampKey.LAST_SPRINT_TOGGLE));
}
user.getTimestampMap().updateTimeStamp(TimestampKey.LAST_SPRINT_TOGGLE);
}
}
@EventHandler
public void onSprint(PlayerToggleSprintEvent e) {
if (e.isSprinting()) {
Talisman.checkFor(e, SlimefunItems.TALISMAN_TRAVELLER);
}
}