@SuppressWarnings("unchecked") public static List<Entity> getEntitiesIn(World world, Entity ignore, AxisAlignedBB bounds) { return (List<Entity>) world.getEntities(ignore, bounds.grow(0.25, 0.25, 0.25)); }
@SuppressWarnings("unchecked") private static List<Object> getCraftRecipes() { return (List<Object>) CraftingManager.getInstance().getRecipes(); } }
/** * Reads an NBTTagCompound handle from an input stream. * This method expects an Input Stream containing raw, uncompressed data. * * @param stream to read from * @return NBTTagCompound * @throws IOException */ public static Object readCompoundUncompressed(InputStream stream) throws IOException { return NBTCompressedStreamTools.a(stream); }
@Override protected void a(MovingObjectPosition movingObjectPosition) { if (movingObjectPosition.entity != null) { if (movingObjectPosition.entity instanceof EntityLiving) { movingObjectPosition.entity.damageEntity(DamageSource.projectile(this, getShooter()), damage); } } for (int i = 0; i < 8; i++) { this.world.addParticle("snowballpoof", this.locX, this.locY, this.locZ, 0.0D, 0.0D, 0.0D); } die(); }
@Override protected void a(MovingObjectPosition movingObjectPosition) { if (movingObjectPosition.entity != null) { if (movingObjectPosition.entity instanceof EntityLiving) { movingObjectPosition.entity.damageEntity(DamageSource.fireball(this, this.shooter), damage); } } die(); }
public void sendMessageRaw(Player player, String message) { if (player instanceof CraftPlayer) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(new PacketPlayOutChat(ChatSerializer.a(message))); } }
public void setPetEquipment(int slot, ItemStack itemStack) { ((WorldServer) this.world).getTracker().a(this, new PacketPlayOutEntityEquipment(getId(), slot, itemStack)); }
private static int getBrightness(Object chunkHandle, int x, int y, int z, EnumSkyBlock mode) { if (y < 0) { return 0; } else if (y >= ((Chunk) chunkHandle).world.getWorld().getMaxHeight()) { return mode.c; } return ((Chunk) chunkHandle).getBrightness(mode, x & XZ_MASK, y, z & XZ_MASK); }
/** * Gets the path finding range * * @return range of path finding */ public double getPathfindingRange() { EntityLiving nmsEntity = CommonNMS.getNative(entity); return nmsEntity.getAttributeInstance(GenericAttributes.b).getValue(); }
public LivingEntity getTarget() { if (target != null) { if (target.isAlive()) { return (LivingEntity) target.getBukkitEntity(); } target = null; } return null; }
@Override public void tick() { this.petEntity.getControllerLook().a(this.targetPlayer.locX, this.targetPlayer.locY + this.targetPlayer.getHeadHeight(), this.targetPlayer.locZ, 10.0F, this.petEntity.x()); this.ticksUntilStopLooking -= 1; } }
/** * Gets a value from this nibble array * * @param x - coordinate * @param y - coordinate * @param z - coordinate * @return value */ public int get(int x, int y, int z) { return super.a(x, y, z); }
/** * Gets the y-coordinate of the highest chunk section * * @param chunkHandle to get it from * @return chunk section highest y-position */ public static int getTopSectionY(Object chunkHandle) { return ((Chunk) chunkHandle).h(); }
public boolean hasTarget() { if (target != null) { if (target.isAlive()) { return true; } target = null; } return false; }
@Override protected void a(MovingObjectPosition movingObjectPosition) { if (movingObjectPosition.entity != null) { if (movingObjectPosition.entity instanceof EntityLiving) { movingObjectPosition.entity.damageEntity(DamageSource.projectile(this, getShooter()), damage); } } for (int i = 0; i < 8; ++i) { this.world.addParticle("snowballpoof", this.locX, this.locY, this.locZ, 0.0D, 0.0D, 0.0D); } die(); }
/** * Reads an NBTTagCompound handle from an input stream. * This method expects an Input Stream containing GZIP-compressed data. * * @param stream to read from * @return NBTTagCompound * @throws IOException */ public static Object readCompound(InputStream stream) throws IOException { return NBTCompressedStreamTools.a(stream); }
/** * Sets a value in this nibble array * * @param x - coordinate * @param y - coordinate * @param z - coordinate * @param value to set to */ public void set(int x, int y, int z, int value) { super.a(x, y, z, value); }
/** * Writes an NBTTagCompound to an output stream. * This method writes the compound as raw, uncompressed data. * * @param compound to write * @param stream to write to * @throws IOException */ public static void writeCompoundUncompressed(Object compound, OutputStream stream) throws IOException { NBTCompressedStreamTools.a((NBTTagCompound) compound, stream); }