Search in sources :

Example 11 with ControllerMove

use of net.minecraft.server.v1_8_R3.ControllerMove in project Citizens2 by CitizensDev.

the class EntityHumanNPC method initialise.

private void initialise(MinecraftServer minecraftServer) {
    Socket socket = new EmptySocket();
    NetworkManager conn = null;
    try {
        conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
        playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
        conn.a(playerConnection);
        socket.close();
    } catch (IOException e) {
    // swallow
    }
    AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
    if (range == null) {
        range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE);
    }
    range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
    controllerJump = new PlayerControllerJump(this);
    controllerLook = new PlayerControllerLook(this);
    controllerMove = new PlayerControllerMove(this);
    navigation = new PlayerNavigation(this, world);
    invulnerableTicks = 0;
    // the default (0) breaks step climbing
    NMS.setStepHeight(getBukkitEntity(), 1);
    setSkinFlags((byte) 0xFF);
}
Also used : EmptyNetworkManager(net.citizensnpcs.nms.v1_8_R3.network.EmptyNetworkManager) PlayerControllerLook(net.citizensnpcs.nms.v1_8_R3.util.PlayerControllerLook) EmptySocket(net.citizensnpcs.nms.v1_8_R3.network.EmptySocket) EmptyNetHandler(net.citizensnpcs.nms.v1_8_R3.network.EmptyNetHandler) PlayerControllerMove(net.citizensnpcs.nms.v1_8_R3.util.PlayerControllerMove) PlayerNavigation(net.citizensnpcs.nms.v1_8_R3.util.PlayerNavigation) AttributeInstance(net.minecraft.server.v1_8_R3.AttributeInstance) PlayerControllerJump(net.citizensnpcs.nms.v1_8_R3.util.PlayerControllerJump) IOException(java.io.IOException) EmptyNetworkManager(net.citizensnpcs.nms.v1_8_R3.network.EmptyNetworkManager) NetworkManager(net.minecraft.server.v1_8_R3.NetworkManager) EmptySocket(net.citizensnpcs.nms.v1_8_R3.network.EmptySocket) Socket(java.net.Socket)

Aggregations

SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)8 Location (org.bukkit.Location)8 LivingEntity (org.bukkit.entity.LivingEntity)8 Set (java.util.Set)2 ControllerMove (net.minecraft.server.v1_16_R3.ControllerMove)2 EntityInsentient (net.minecraft.server.v1_16_R3.EntityInsentient)2 IOException (java.io.IOException)1 Socket (java.net.Socket)1 EntityHumanNPC (net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_13_R2.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_14_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_15_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_16_R3.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)1 EmptyNetHandler (net.citizensnpcs.nms.v1_8_R3.network.EmptyNetHandler)1 EmptyNetworkManager (net.citizensnpcs.nms.v1_8_R3.network.EmptyNetworkManager)1 EmptySocket (net.citizensnpcs.nms.v1_8_R3.network.EmptySocket)1 PlayerControllerJump (net.citizensnpcs.nms.v1_8_R3.util.PlayerControllerJump)1