Fixed some redundant Flag-related calls

This commit is contained in:
Florian CUNY 2018-12-01 11:45:33 +01:00
parent f828f23c2f
commit a735bfdf5c
3 changed files with 1 additions and 5 deletions

View File

@ -17,9 +17,6 @@ public class PortalListener extends FlagListener {
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerPortal(PlayerPortalEvent e) { public void onPlayerPortal(PlayerPortalEvent e) {
if (e.getPlayer().isOp()) {
return;
}
if (e.getCause().equals(TeleportCause.NETHER_PORTAL)) { if (e.getCause().equals(TeleportCause.NETHER_PORTAL)) {
checkIsland(e, e.getFrom(), Flags.PORTAL); checkIsland(e, e.getFrom(), Flags.PORTAL);
} else if (e.getCause().equals(TeleportCause.END_PORTAL)) { } else if (e.getCause().equals(TeleportCause.END_PORTAL)) {

View File

@ -22,7 +22,6 @@ public class TeleportationListener extends FlagListener {
*/ */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerTeleport(final PlayerTeleportEvent e) { public void onPlayerTeleport(final PlayerTeleportEvent e) {
if (e.getCause() != null) { if (e.getCause() != null) {
if (e.getCause().equals(TeleportCause.ENDER_PEARL)) { if (e.getCause().equals(TeleportCause.ENDER_PEARL)) {
checkIsland(e, e.getTo(), Flags.ENDER_PEARL); checkIsland(e, e.getTo(), Flags.ENDER_PEARL);

View File

@ -140,7 +140,7 @@ public class Flags {
public static final Flag ITEM_PICKUP = new FlagBuilder().id("ITEM_PICKUP").icon(Material.BEETROOT_SEEDS).build(); public static final Flag ITEM_PICKUP = new FlagBuilder().id("ITEM_PICKUP").icon(Material.BEETROOT_SEEDS).build();
// TNT // TNT
public static final Flag TNT = new FlagBuilder().id("TNT").icon(Material.TNT).listener(new TNTListener()).allowedByDefault(false).type(Type.PROTECTION).build(); public static final Flag TNT = new FlagBuilder().id("TNT").icon(Material.TNT).listener(new TNTListener()).allowedByDefault(false).build();
// Island lock // Island lock
public static final Flag LOCK = new FlagBuilder().id("LOCK") public static final Flag LOCK = new FlagBuilder().id("LOCK")