mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-10-02 17:47:41 +02:00
Updating listeners
This commit is contained in:
parent
aca96bb0e3
commit
52f58aa3da
@ -94,6 +94,6 @@ public class AdvancedPortalsCore {
|
||||
}
|
||||
|
||||
public CoreListeners getCoreListeners() {
|
||||
return coreListeners;
|
||||
return this.coreListeners;
|
||||
}
|
||||
}
|
||||
|
@ -12,10 +12,14 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
this.portalsCore = new AdvancedPortalsCore(new DataStorage(this.getDataFolder()),
|
||||
new SpigotInfoLogger(this), new CommandRegister(this));
|
||||
this.getServer().getPluginManager().registerEvents(new Listeners(this), this);
|
||||
}
|
||||
|
||||
public void onDisable() {
|
||||
this.portalsCore.onDisable();
|
||||
}
|
||||
|
||||
public AdvancedPortalsCore getPortalsCore() {
|
||||
return portalsCore;
|
||||
}
|
||||
}
|
||||
|
24
src/com/sekwah/advancedportals/spigot/Listeners.java
Normal file
24
src/com/sekwah/advancedportals/spigot/Listeners.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.sekwah.advancedportals.spigot;
|
||||
|
||||
import com.sekwah.advancedportals.core.CoreListeners;
|
||||
import com.sekwah.advancedportals.coreconnector.container.PlayerContainer;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
public class Listeners implements Listener {
|
||||
|
||||
private final AdvancedPortalsPlugin plugin;
|
||||
private final CoreListeners coreListeners;
|
||||
|
||||
public Listeners(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
this.coreListeners = plugin.getPortalsCore().getCoreListeners();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoinEvent(PlayerJoinEvent event) {
|
||||
coreListeners.playerJoin(new PlayerContainer(event.getPlayer()));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user