mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-02 11:11:58 +01:00
[Fix] Listen to PortalCreateEvent to cancel portal creation by fire. Fixes #164
This commit is contained in:
parent
fb4af9fefc
commit
a134e99c8c
@ -10,6 +10,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.world.PortalCreateEvent;
|
||||
|
||||
|
||||
public class EssentialsProtectBlockListener implements Listener {
|
||||
@ -77,4 +78,11 @@ public class EssentialsProtectBlockListener implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPortalLight(PortalCreateEvent event) {
|
||||
if (event.getReason() == PortalCreateEvent.CreateReason.FIRE) {
|
||||
event.setCancelled(prot.getSettingBool(ProtectConfig.prevent_portal_creation));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user