mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-28 22:57:31 +02:00
Splited PORTAL flag to NETHER_PORTAL and END_PORTAL
#388 Remove the "silent" parameter when doing the check for the End portal: the Notifier will do the job to not spam the player.
This commit is contained in:
parent
3e18669abc
commit
2d533ed8ad
@ -11,17 +11,15 @@ import world.bentobox.bentobox.lists.Flags;
|
|||||||
/**
|
/**
|
||||||
* Handles portal protection
|
* Handles portal protection
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class PortalListener extends FlagListener {
|
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.getCause().equals(TeleportCause.NETHER_PORTAL)) {
|
if (e.getCause().equals(TeleportCause.NETHER_PORTAL)) {
|
||||||
checkIsland(e, e.getFrom(), Flags.PORTAL);
|
checkIsland(e, e.getFrom(), Flags.NETHER_PORTAL);
|
||||||
} else if (e.getCause().equals(TeleportCause.END_PORTAL)) {
|
} else if (e.getCause().equals(TeleportCause.END_PORTAL)) {
|
||||||
// Silent check because it's spammy
|
checkIsland(e, e.getFrom(), Flags.END_PORTAL);
|
||||||
checkIsland(e, e.getFrom(), Flags.PORTAL, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,8 @@ public class Flags {
|
|||||||
public static final Flag LEASH = new FlagBuilder().id("LEASH").icon(Material.LEAD).listener(new LeashListener()).build();
|
public static final Flag LEASH = new FlagBuilder().id("LEASH").icon(Material.LEAD).listener(new LeashListener()).build();
|
||||||
|
|
||||||
// Portal use protection
|
// Portal use protection
|
||||||
public static final Flag PORTAL = new FlagBuilder().id("PORTAL").icon(Material.OBSIDIAN).listener(new PortalListener()).build();
|
public static final Flag NETHER_PORTAL = new FlagBuilder().id("NETHER_PORTAL").icon(Material.OBSIDIAN).listener(new PortalListener()).build();
|
||||||
|
public static final Flag END_PORTAL = new FlagBuilder().id("END_PORTAL").icon(Material.END_PORTAL_FRAME).listener(new PortalListener()).build();
|
||||||
|
|
||||||
// Shearing
|
// Shearing
|
||||||
public static final Flag SHEARING = new FlagBuilder().id("SHEARING").icon(Material.SHEARS).listener(new ShearingListener()).build();
|
public static final Flag SHEARING = new FlagBuilder().id("SHEARING").icon(Material.SHEARS).listener(new ShearingListener()).build();
|
||||||
|
@ -650,9 +650,13 @@ protection:
|
|||||||
description: "Toggle placing"
|
description: "Toggle placing"
|
||||||
name: "Place blocks"
|
name: "Place blocks"
|
||||||
hint: "Not allowed to place blocks"
|
hint: "Not allowed to place blocks"
|
||||||
PORTAL:
|
NETHER_PORTAL:
|
||||||
description: "Toggle use"
|
description: "Toggle use"
|
||||||
name: "Portal"
|
name: "Nether Portal"
|
||||||
|
hint: "Portal use is disallowed"
|
||||||
|
END_PORTAL:
|
||||||
|
description: "Toggle use"
|
||||||
|
name: "End Portal"
|
||||||
hint: "Portal use is disallowed"
|
hint: "Portal use is disallowed"
|
||||||
PRESSURE_PLATE:
|
PRESSURE_PLATE:
|
||||||
description: "Toggle usage"
|
description: "Toggle usage"
|
||||||
|
Loading…
Reference in New Issue
Block a user