Search in sources :

Example 91 with Entity

use of net.minecraft.server.v1_10_R1.Entity in project Citizens2 by CitizensDev.

the class NMSImpl method getVehicle.

@Override
public org.bukkit.entity.Entity getVehicle(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null) {
        return null;
    }
    Entity e = handle.getVehicle();
    return (e == handle || e == null) ? null : e.getBukkitEntity();
}
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)

Example 92 with Entity

use of net.minecraft.server.v1_10_R1.Entity in project Citizens2 by CitizensDev.

the class PlayerlistTrackerEntry method updatePlayer.

@Override
public void updatePlayer(final EntityPlayer entityplayer) {
    // prevent updates to NPC "viewers"
    if (entityplayer instanceof EntityHumanNPC)
        return;
    Entity tracker = getTracker(this);
    if (entityplayer != tracker && c(entityplayer)) {
        if (!this.trackedPlayers.contains(entityplayer) && ((entityplayer.x().getPlayerChunkMap().a(entityplayer, tracker.ab, tracker.ad)) || (tracker.attachedToPlayer))) {
            if ((tracker instanceof SkinnableEntity)) {
                SkinnableEntity skinnable = (SkinnableEntity) tracker;
                Player player = skinnable.getBukkitEntity();
                if (!entityplayer.getBukkitEntity().canSee(player))
                    return;
                skinnable.getSkinTracker().updateViewer(entityplayer.getBukkitEntity());
            }
        }
    }
    super.updatePlayer(entityplayer);
}
Also used : Entity(net.minecraft.server.v1_12_R1.Entity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) EntityPlayer(net.minecraft.server.v1_12_R1.EntityPlayer) Player(org.bukkit.entity.Player) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) EntityHumanNPC(net.citizensnpcs.nms.v1_12_R1.entity.EntityHumanNPC)

Example 93 with Entity

use of net.minecraft.server.v1_10_R1.Entity in project Citizens2 by CitizensDev.

the class PlayerlistTrackerEntry method updatePlayer.

@Override
public void updatePlayer(final EntityPlayer entityplayer) {
    // prevent updates to NPC "viewers"
    if (entityplayer instanceof EntityHumanNPC)
        return;
    Entity tracker = getTracker(this);
    if (entityplayer != tracker && c(entityplayer)) {
        if (!this.trackedPlayers.contains(entityplayer) && ((entityplayer.x().getPlayerChunkMap().a(entityplayer, tracker.ab, tracker.ad)) || (tracker.attachedToPlayer))) {
            if ((tracker instanceof SkinnableEntity)) {
                SkinnableEntity skinnable = (SkinnableEntity) tracker;
                Player player = skinnable.getBukkitEntity();
                if (!entityplayer.getBukkitEntity().canSee(player))
                    return;
                skinnable.getSkinTracker().updateViewer(entityplayer.getBukkitEntity());
            }
        }
    }
    super.updatePlayer(entityplayer);
}
Also used : Entity(net.minecraft.server.v1_11_R1.Entity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) EntityPlayer(net.minecraft.server.v1_11_R1.EntityPlayer) Player(org.bukkit.entity.Player) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) EntityHumanNPC(net.citizensnpcs.nms.v1_11_R1.entity.EntityHumanNPC)

Example 94 with Entity

use of net.minecraft.server.v1_10_R1.Entity in project NoCheatPlus by NoCheatPlus.

the class MCAccessSpigotCB1_10_R1 method getHeight.

@Override
public double getHeight(final Entity entity) {
    final net.minecraft.server.v1_10_R1.Entity mcEntity = ((CraftEntity) entity).getHandle();
    AxisAlignedBB boundingBox = mcEntity.getBoundingBox();
    final double entityHeight = Math.max(mcEntity.length, Math.max(mcEntity.getHeadHeight(), boundingBox.e - boundingBox.b));
    if (entity instanceof LivingEntity) {
        return Math.max(((LivingEntity) entity).getEyeHeight(), entityHeight);
    } else {
        return entityHeight;
    }
}
Also used : AxisAlignedBB(net.minecraft.server.v1_10_R1.AxisAlignedBB) LivingEntity(org.bukkit.entity.LivingEntity) CraftEntity(org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity)

Aggregations

SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)41 LivingEntity (org.bukkit.entity.LivingEntity)39 CraftEntity (org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity)17 Entity (net.minecraft.server.v1_12_R1.Entity)13 Entity (net.minecraft.server.v1_11_R1.Entity)12 Entity (net.minecraft.server.v1_8_R3.Entity)11 Entity (net.minecraft.server.v1_10_R1.Entity)10 PathEntity (net.minecraft.server.v1_12_R1.PathEntity)10 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)9 PathEntity (net.minecraft.server.v1_10_R1.PathEntity)9 PathEntity (net.minecraft.server.v1_11_R1.PathEntity)9 PathEntity (net.minecraft.server.v1_8_R3.PathEntity)9 CraftEntity (org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity)9 CraftEntity (org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity)9 Entity (com.google.datastore.v1.Entity)8 CraftEntity (org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity)8 DeleteEntity (org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.DeleteEntity)6 CommandException (net.citizensnpcs.api.command.exception.CommandException)5 CraftWorld (org.bukkit.craftbukkit.v1_10_R1.CraftWorld)5 Player (org.bukkit.entity.Player)5