All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.event.player.PlayerCreationEvent Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.event.player;

import cn.nukkit.Player;
import cn.nukkit.event.Event;
import cn.nukkit.event.HandlerList;
import cn.nukkit.network.SourceInterface;

import java.net.InetSocketAddress;

/**
 * @author MagicDroidX (Nukkit Project)
 */
public class PlayerCreationEvent extends Event {

    private static final HandlerList handlers = new HandlerList();

    public static HandlerList getHandlers() {
        return handlers;
    }

    private final SourceInterface interfaz;

    private final Long clientId;

    private final InetSocketAddress socketAddress;

    private Class baseClass;

    private Class playerClass;

    public PlayerCreationEvent(SourceInterface interfaz, Class baseClass, Class playerClass, Long clientId, InetSocketAddress socketAddress) {
        this.interfaz = interfaz;
        this.clientId = clientId;
        this.socketAddress = socketAddress;

        this.baseClass = baseClass;
        this.playerClass = playerClass;
    }

    public SourceInterface getInterface() {
        return interfaz;
    }

    public String getAddress() {
        return this.socketAddress.getAddress().toString();
    }

    public int getPort() {
        return this.socketAddress.getPort();
    }

    public InetSocketAddress getSocketAddress() {
        return socketAddress;
    }

    public Long getClientId() {
        return clientId;
    }

    public Class getBaseClass() {
        return baseClass;
    }

    public void setBaseClass(Class baseClass) {
        this.baseClass = baseClass;
    }

    public Class getPlayerClass() {
        return playerClass;
    }

    public void setPlayerClass(Class playerClass) {
        this.playerClass = playerClass;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy