-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adjust minimum Towny version to 0.96.5.5 - Fix Deprecation warning. - Closes #43. - Fix being able to unclaim land and keep flight. - Closes #42. - Fix some teleport commands bypassing flight removal. - Closes #38. - Prevent PVPListener from removing flight when the attacker is vanished. - Closes #32.
- Loading branch information
Showing
5 changed files
with
80 additions
and
47 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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/gmail/llmdlio/townyflight/listeners/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,32 @@ | ||
package com.gmail.llmdlio.townyflight.listeners; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerTeleportEvent; | ||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; | ||
|
||
import com.gmail.llmdlio.townyflight.TownyFlight; | ||
|
||
public class PlayerTeleportListener implements Listener { | ||
|
||
public PlayerTeleportListener() { | ||
} | ||
|
||
@EventHandler(priority = EventPriority.MONITOR) | ||
private void playerTeleports(PlayerTeleportEvent event) { | ||
if (event.getCause() != TeleportCause.PLUGIN || event.getCause() != TeleportCause.COMMAND) | ||
return; | ||
|
||
Player player = event.getPlayer(); | ||
if (player.hasPermission("townyflight.bypass") | ||
|| !player.getAllowFlight() | ||
|| TownyFlight.canFly(player, true)) { | ||
return; | ||
} | ||
|
||
TownyFlight.removeFlight(player, false, true, ""); | ||
} | ||
|
||
} |
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