Search in sources :

Example 1 with AcidEffect

use of com.wasteofplastic.acidisland.listeners.AcidEffect in project acidisland by tastybento.

the class ASkyBlock method registerEvents.

/**
 * Registers events
 */
public void registerEvents() {
    final PluginManager manager = getServer().getPluginManager();
    // Nether portal events
    manager.registerEvents(new NetherPortals(this), this);
    // Nether spawning events
    manager.registerEvents(new NetherSpawning(this), this);
    // Island Protection events
    manager.registerEvents(new IslandGuard(this), this);
    // Island Entity Limits
    manager.registerEvents(new EntityLimits(this), this);
    // Player events
    playerEvents = new PlayerEvents(this);
    manager.registerEvents(playerEvents, this);
    try {
        Class<?> clazz = Class.forName("org.bukkit.event.entity.EntityPickupItemEvent", false, getClassLoader());
        if (clazz != null) {
            manager.registerEvents(new PlayerEvents3(this), this);
        }
    } catch (ClassNotFoundException e) {
        manager.registerEvents(new PlayerEvents2(this), this);
    }
    // New V1.8 events
    if (onePointEight) {
        manager.registerEvents(new IslandGuard1_8(this), this);
    }
    // Check for 1.9 material
    for (Material m : Material.values()) {
        if (m.name().equalsIgnoreCase("END_CRYSTAL")) {
            manager.registerEvents(new IslandGuard1_9(this), this);
            break;
        }
    }
    // Events for when a player joins or leaves the server
    manager.registerEvents(new JoinLeaveEvents(this), this);
    // Ensures Lava flows correctly in ASkyBlock world
    lavaListener = new LavaCheck(this);
    manager.registerEvents(lavaListener, this);
    // Ensures that water is acid
    manager.registerEvents(new AcidEffect(this), this);
    // Ensures that boats are safe in ASkyBlock
    if (Settings.acidDamage > 0D) {
        manager.registerEvents(new SafeBoat(this), this);
    }
    // Enables warp signs in ASkyBlock
    warpSignsListener = new WarpSigns(this);
    manager.registerEvents(warpSignsListener, this);
    // Control panel - for future use
    // manager.registerEvents(new ControlPanel(), this);
    // Change names of inventory items
    // manager.registerEvents(new AcidInventory(this), this);
    // Schematics panel
    schematicsPanel = new SchematicsPanel(this);
    manager.registerEvents(schematicsPanel, this);
    // Track incoming world teleports
    manager.registerEvents(new WorldEnter(this), this);
    // Team chat
    chatListener = new ChatListener(this);
    manager.registerEvents(chatListener, this);
    // Wither
    if (Settings.restrictWither) {
        manager.registerEvents(new FlyingMobEvents(this), this);
    }
    if (Settings.recoverSuperFlat) {
        manager.registerEvents(new CleanSuperFlat(), this);
    }
}
Also used : LavaCheck(com.wasteofplastic.acidisland.listeners.LavaCheck) JoinLeaveEvents(com.wasteofplastic.acidisland.listeners.JoinLeaveEvents) IslandGuard(com.wasteofplastic.acidisland.listeners.IslandGuard) Material(org.bukkit.Material) WorldEnter(com.wasteofplastic.acidisland.listeners.WorldEnter) PlayerEvents2(com.wasteofplastic.acidisland.listeners.PlayerEvents2) PlayerEvents3(com.wasteofplastic.acidisland.listeners.PlayerEvents3) PlayerEvents(com.wasteofplastic.acidisland.listeners.PlayerEvents) PluginManager(org.bukkit.plugin.PluginManager) NetherPortals(com.wasteofplastic.acidisland.listeners.NetherPortals) SchematicsPanel(com.wasteofplastic.acidisland.panels.SchematicsPanel) ChatListener(com.wasteofplastic.acidisland.listeners.ChatListener) CleanSuperFlat(com.wasteofplastic.acidisland.listeners.CleanSuperFlat) FlyingMobEvents(com.wasteofplastic.acidisland.listeners.FlyingMobEvents) AcidEffect(com.wasteofplastic.acidisland.listeners.AcidEffect) NetherSpawning(com.wasteofplastic.acidisland.listeners.NetherSpawning) IslandGuard1_9(com.wasteofplastic.acidisland.listeners.IslandGuard1_9) EntityLimits(com.wasteofplastic.acidisland.listeners.EntityLimits) IslandGuard1_8(com.wasteofplastic.acidisland.listeners.IslandGuard1_8)

Aggregations

AcidEffect (com.wasteofplastic.acidisland.listeners.AcidEffect)1 ChatListener (com.wasteofplastic.acidisland.listeners.ChatListener)1 CleanSuperFlat (com.wasteofplastic.acidisland.listeners.CleanSuperFlat)1 EntityLimits (com.wasteofplastic.acidisland.listeners.EntityLimits)1 FlyingMobEvents (com.wasteofplastic.acidisland.listeners.FlyingMobEvents)1 IslandGuard (com.wasteofplastic.acidisland.listeners.IslandGuard)1 IslandGuard1_8 (com.wasteofplastic.acidisland.listeners.IslandGuard1_8)1 IslandGuard1_9 (com.wasteofplastic.acidisland.listeners.IslandGuard1_9)1 JoinLeaveEvents (com.wasteofplastic.acidisland.listeners.JoinLeaveEvents)1 LavaCheck (com.wasteofplastic.acidisland.listeners.LavaCheck)1 NetherPortals (com.wasteofplastic.acidisland.listeners.NetherPortals)1 NetherSpawning (com.wasteofplastic.acidisland.listeners.NetherSpawning)1 PlayerEvents (com.wasteofplastic.acidisland.listeners.PlayerEvents)1 PlayerEvents2 (com.wasteofplastic.acidisland.listeners.PlayerEvents2)1 PlayerEvents3 (com.wasteofplastic.acidisland.listeners.PlayerEvents3)1 WorldEnter (com.wasteofplastic.acidisland.listeners.WorldEnter)1 SchematicsPanel (com.wasteofplastic.acidisland.panels.SchematicsPanel)1 Material (org.bukkit.Material)1 PluginManager (org.bukkit.plugin.PluginManager)1