use of com.wasteofplastic.acidisland.listeners.ChatListener 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);
}
}
Aggregations