mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Single module setup
This commit is contained in:
1 parent
ad9a794156
commit
66217f6534
70 files changed
+92
-138
No files matched your search
@@ -0,0 +1,44 @@
|
||||
package net.draycia.carbon.events;
|
||||
|
||||
import net.draycia.carbon.channels.ChatChannel;
|
||||
import net.draycia.carbon.util.Registry;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ChannelRegisterEvent extends Event {
|
||||
|
||||
/** Bukkit event stuff **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public @NotNull HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/** Relevant stuff **/
|
||||
private final List<ChatChannel> registeredChannels;
|
||||
private final Registry<ChatChannel> registry;
|
||||
|
||||
public ChannelRegisterEvent(List<ChatChannel> registeredChannels, Registry<ChatChannel> registry) {
|
||||
super(!Bukkit.isPrimaryThread());
|
||||
|
||||
this.registeredChannels = registeredChannels;
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
public void register(ChatChannel chatChannel) {
|
||||
registry.register(chatChannel.getKey(), chatChannel);
|
||||
}
|
||||
|
||||
public List<ChatChannel> getRegisteredChannels() {
|
||||
return registeredChannels;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user