public void setRevengeTarget(EntityLivingBase livingBase) { super.setRevengeTarget(livingBase); if (livingBase != null) { this.angerTargetUUID = livingBase.getUniqueID(); } }
public static EntityLivingBase searchEntityByIdRaw(UUID ID) { EntityLivingBase newEntity = null; for (Object o : Minecraft.getMinecraft().theWorld.loadedEntityList) if (isCorrectEntity(o, false)) { EntityLivingBase en = (EntityLivingBase) o; if (!(o instanceof EntityPlayerSP) && !en.isDead) if (newEntity == null && en.getUniqueID().equals(ID)) newEntity = en; } return newEntity; }
/** Called when the block is placed in the world. */ @Override public void onBlockPlacedBy( World par1World, int x, int y, int z, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { TileEntity te = par1World.getTileEntity(x, y, z); ((TileEntityDoorController) te).setOwner(par5EntityLivingBase.getUniqueID().toString()); ((TileEntityDoorController) te) .overrideTexture( ContentRegistry.DoorController, new ItemStack(Item.getItemFromBlock(ContentRegistry.DoorController)), ForgeDirection.getOrientation(1)); }
// meant for server side global dimension scan, when to use though? with chunkloading and all this // might need to get used a lot... perhaps use a range based one // in fact, feed in a list of potentially loadable UUIDs while iterating over a list, for more // efficient processing private static Entity getEntityFromUUID(World parWorld, long UUIDMost, long UUIDLeast) { Entity ent = null; UUID uuid = new UUID(UUIDMost, UUIDLeast); List list = parWorld.loadedEntityList; // .getEntitiesWithinAABB(EntityLivingBase.class, // this.boundingBox.expand(10.0D, 10.0D, 10.0D)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { EntityLivingBase entitylivingbase = (EntityLivingBase) iterator.next(); if (entitylivingbase.getUniqueID().equals(uuid)) { ent = entitylivingbase; break; } } return ent; }
@Override public int get_target_id(EntityLivingBase caster) throws SpellException { List lst; int count; lst = SpellUtils.getEntitiesAround(caster, 16.0d, 16.0d, 16.0d); count = 0; for (Object obj : lst) { if (obj instanceof EntityDoppleganger) { if (((EntityDoppleganger) obj).getOwnerId().equals(caster.getUniqueID().toString())) { count++; if (count == 2) { throw (new SpellException("You already have 2 Doppleganger summoned")); } } } } return (-1); }
public void render( EntityLivingBase entity, PartInfo info, double x, double y, double z, float partialTicks) { if (info.needsTextureCompile || info.getTexture() == null) { info.setTexture(TextureHelper.generateTexture(entity.getUniqueID(), info)); info.needsTextureCompile = false; } GL11.glPushMatrix(); IRenderHelper helper; // Support for Galacticraft as it adds its own EntityPlayer if (entity instanceof EntityPlayer) helper = getRenderHelper(EntityPlayer.class); else helper = getRenderHelper(entity.getClass()); if (helper != null) { helper.onPreRenderTail(entity, this, info, x, y, z); } this.doRender(entity, info, partialTicks); GL11.glPopMatrix(); }
@Override public void collideWithEntity(Entity entity) { if (target != null) { if (entity.getUniqueID().compareTo(target.getUniqueID()) == 0) { target.attackEntityFrom(DamageSource.generic, damage); this.getEntityWorld().removeEntity(this); for (int i = 0; i < 80; i++) { Roots.proxy.spawnParticleMagicAuraFX( getEntityWorld(), posX, posY + height / 2.0f, posZ, Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0), Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0), Math.pow(1.15f * (random.nextFloat() - 0.5f), 3.0), 76, 230, 0); } } } }