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();
}
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);
}
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);
}
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;
}
}
Aggregations