Search in sources :

Example 1 with GuildUpdateEvent

use of io.discloader.discloader.common.event.guild.GuildUpdateEvent in project DiscLoader by R3alCl0ud.

the class GuildUpdate method handle.

@Override
public void handle(SocketPacket packet) {
    String d = gson.toJson(packet.d);
    GuildJSON data = gson.fromJson(d, GuildJSON.class);
    IGuild guild = EntityRegistry.getGuildByID(data.id);
    IGuild oldGuild = guild.clone();
    guild.setup(data);
    GuildUpdateEvent event = new GuildUpdateEvent(guild, oldGuild);
    loader.emit(DLUtil.Events.GUILD_UPDATE, event);
    loader.emit(event);
}
Also used : GuildUpdateEvent(io.discloader.discloader.common.event.guild.GuildUpdateEvent) GuildJSON(io.discloader.discloader.network.json.GuildJSON) IGuild(io.discloader.discloader.entity.guild.IGuild)

Aggregations

GuildUpdateEvent (io.discloader.discloader.common.event.guild.GuildUpdateEvent)1 IGuild (io.discloader.discloader.entity.guild.IGuild)1 GuildJSON (io.discloader.discloader.network.json.GuildJSON)1