-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
938b10a
commit 3be97b5
Showing
4 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/eu/endermite/togglepvp/listeners/player/PlayerTeleportListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package eu.endermite.togglepvp.listeners.player; | ||
|
||
import eu.endermite.togglepvp.TogglePvp; | ||
import eu.endermite.togglepvp.players.PlayerData; | ||
import eu.endermite.togglepvp.players.SmartCache; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import java.time.Instant; | ||
|
||
@eu.endermite.togglepvp.util.Listener | ||
public class PlayerTeleportListener implements Listener { | ||
|
||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) | ||
public void onPlayerTeleport(org.bukkit.event.player.PlayerTeleportEvent event) { | ||
Player player = event.getPlayer(); | ||
SmartCache smartCache = TogglePvp.getPlugin().getSmartCache(); | ||
PlayerData playerData = smartCache.getPlayerData(player.getUniqueId()); | ||
playerData.setTeleportTimestamp(Instant.now().getEpochSecond()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters