Search in sources :

Example 1 with ControllerJump

use of net.minecraft.server.v1_12_R1.ControllerJump in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof EntityInsentient) {
        ControllerJump controller = ((EntityInsentient) handle).getControllerJump();
        controller.a();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : PathEntity(net.minecraft.server.v1_8_R3.PathEntity) LivingEntity(org.bukkit.entity.LivingEntity) Entity(net.minecraft.server.v1_8_R3.Entity) CraftEntity(org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) EntityInsentient(net.minecraft.server.v1_8_R3.EntityInsentient) ControllerJump(net.minecraft.server.v1_8_R3.ControllerJump) EntityHumanNPC(net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)

Example 2 with ControllerJump

use of net.minecraft.server.v1_12_R1.ControllerJump in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof EntityInsentient) {
        ControllerJump controller = ((EntityInsentient) handle).getControllerJump();
        controller.a();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : PathEntity(net.minecraft.server.v1_10_R1.PathEntity) LivingEntity(org.bukkit.entity.LivingEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) CraftEntity(org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity) Entity(net.minecraft.server.v1_10_R1.Entity) EntityInsentient(net.minecraft.server.v1_10_R1.EntityInsentient) ControllerJump(net.minecraft.server.v1_10_R1.ControllerJump) EntityHumanNPC(net.citizensnpcs.nms.v1_10_R1.entity.EntityHumanNPC)

Example 3 with ControllerJump

use of net.minecraft.server.v1_12_R1.ControllerJump in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof EntityInsentient) {
        ControllerJump controller = ((EntityInsentient) handle).getControllerJump();
        controller.a();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : PathEntity(net.minecraft.server.v1_11_R1.PathEntity) LivingEntity(org.bukkit.entity.LivingEntity) CraftEntity(org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) Entity(net.minecraft.server.v1_11_R1.Entity) EntityInsentient(net.minecraft.server.v1_11_R1.EntityInsentient) ControllerJump(net.minecraft.server.v1_11_R1.ControllerJump) EntityHumanNPC(net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)

Example 4 with ControllerJump

use of net.minecraft.server.v1_12_R1.ControllerJump in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof EntityInsentient) {
        ControllerJump controller = ((EntityInsentient) handle).getControllerJump();
        controller.a();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : PathEntity(net.minecraft.server.v1_12_R1.PathEntity) LivingEntity(org.bukkit.entity.LivingEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) CraftEntity(org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity) Entity(net.minecraft.server.v1_12_R1.Entity) EntityInsentient(net.minecraft.server.v1_12_R1.EntityInsentient) ControllerJump(net.minecraft.server.v1_12_R1.ControllerJump) EntityHumanNPC(net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)

Example 5 with ControllerJump

use of net.minecraft.server.v1_12_R1.ControllerJump 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.setPacketListener(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);
    // the default (0) breaks step climbing
    NMS.setStepHeight(getBukkitEntity(), 1);
    setSkinFlags((byte) 0xFF);
    try {
        ADVANCEMENT_DATA_PLAYER.set(this, new EmptyAdvancementDataPlayer(minecraftServer, CitizensAPI.getDataFolder().getParentFile(), this));
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (IllegalAccessException e) {
        e.printStackTrace();
    }
}
Also used : EmptyNetworkManager(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager) PlayerControllerLook(net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerLook) EmptySocket(net.citizensnpcs.nms.v1_12_R1.network.EmptySocket) IOException(java.io.IOException) EmptyNetHandler(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetHandler) PlayerControllerMove(net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerMove) PlayerNavigation(net.citizensnpcs.nms.v1_12_R1.util.PlayerNavigation) AttributeInstance(net.minecraft.server.v1_12_R1.AttributeInstance) PlayerControllerJump(net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerJump) EmptyAdvancementDataPlayer(net.citizensnpcs.nms.v1_12_R1.util.EmptyAdvancementDataPlayer) NetworkManager(net.minecraft.server.v1_12_R1.NetworkManager) EmptyNetworkManager(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager) EmptySocket(net.citizensnpcs.nms.v1_12_R1.network.EmptySocket) Socket(java.net.Socket)

Aggregations

SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)4 LivingEntity (org.bukkit.entity.LivingEntity)4 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 EmptyNetHandler (net.citizensnpcs.nms.v1_12_R1.network.EmptyNetHandler)1 EmptyNetworkManager (net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager)1 EmptySocket (net.citizensnpcs.nms.v1_12_R1.network.EmptySocket)1 EmptyAdvancementDataPlayer (net.citizensnpcs.nms.v1_12_R1.util.EmptyAdvancementDataPlayer)1 PlayerControllerJump (net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerJump)1 PlayerControllerLook (net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerLook)1 PlayerControllerMove (net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerMove)1 PlayerNavigation (net.citizensnpcs.nms.v1_12_R1.util.PlayerNavigation)1 EntityHumanNPC (net.citizensnpcs.nms.v1_8_R3.entity.EntityHumanNPC)1 ControllerJump (net.minecraft.server.v1_10_R1.ControllerJump)1 Entity (net.minecraft.server.v1_10_R1.Entity)1 EntityInsentient (net.minecraft.server.v1_10_R1.EntityInsentient)1 PathEntity (net.minecraft.server.v1_10_R1.PathEntity)1