@SubscribeEvent(priority = EventPriority.HIGHEST) public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event) { if(!hasShownFirstGui) { hasShownFirstGui = true; //Add the layer renderers Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityLlama.class); if(renderer instanceof RenderLlama) { RenderLlama renderLlama = (RenderLlama)renderer; renderLlama.addLayer(new LayerFancyLlama(renderLlama)); } } }
private boolean func_190858_a(EntityLlama p_190858_1_, int p_190858_2_) { if (p_190858_2_ > 8) { return false; } else if (p_190858_1_.func_190718_dR()) { if (p_190858_1_.func_190716_dS().getLeashed()) { return true; } else { EntityLlama entityllama = p_190858_1_.func_190716_dS(); ++p_190858_2_; return this.func_190858_a(entityllama, p_190858_2_); } } else { return false; } }
private void func_190537_j() { if (this.field_190540_b != null && this.field_190540_b.hasUniqueId("OwnerUUID")) { UUID uuid = this.field_190540_b.getUniqueId("OwnerUUID"); for (EntityLlama entityllama : this.world.getEntitiesWithinAABB(EntityLlama.class, this.getEntityBoundingBox().expandXyz(15.0D))) { if (entityllama.getUniqueID().equals(uuid)) { this.field_190539_a = entityllama; break; } } } this.field_190540_b = null; }
protected BiomeHills(BiomeHills.Type p_i46710_1_, Biome.BiomeProperties properties) { super(properties); if (p_i46710_1_ == BiomeHills.Type.EXTRA_TREES) { this.theBiomeDecorator.treesPerChunk = 3; } this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityLlama.class, 5, 4, 6)); this.type = p_i46710_1_; }
protected BiomeSavanna(Biome.BiomeProperties properties) { super(properties); this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityHorse.class, 1, 2, 6)); this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityDonkey.class, 1, 1, 1)); if (this.getBaseHeight() > 1.1F) { this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityLlama.class, 8, 4, 4)); } this.theBiomeDecorator.treesPerChunk = 1; this.theBiomeDecorator.flowersPerChunk = 4; this.theBiomeDecorator.grassPerChunk = 20; }
/** * Updates the task */ public void updateTask() { if (this.field_190859_a.func_190718_dR()) { EntityLlama entityllama = this.field_190859_a.func_190716_dS(); double d0 = (double)this.field_190859_a.getDistanceToEntity(entityllama); float f = 2.0F; Vec3d vec3d = (new Vec3d(entityllama.posX - this.field_190859_a.posX, entityllama.posY - this.field_190859_a.posY, entityllama.posZ - this.field_190859_a.posZ)).normalize().scale(Math.max(d0 - 2.0D, 0.0D)); this.field_190859_a.getNavigator().tryMoveToXYZ(this.field_190859_a.posX + vec3d.xCoord, this.field_190859_a.posY + vec3d.yCoord, this.field_190859_a.posZ + vec3d.zCoord, this.field_190860_b); } }
public EntityLlamaSpit(World p_i47273_1_, EntityLlama p_i47273_2_) { super(p_i47273_1_); this.field_190539_a = p_i47273_2_; this.setPosition(p_i47273_2_.posX - (double)(p_i47273_2_.width + 1.0F) * 0.5D * (double)MathHelper.sin(p_i47273_2_.renderYawOffset * 0.017453292F), p_i47273_2_.posY + (double)p_i47273_2_.getEyeHeight() - 0.10000000149011612D, p_i47273_2_.posZ + (double)(p_i47273_2_.width + 1.0F) * 0.5D * (double)MathHelper.cos(p_i47273_2_.renderYawOffset * 0.017453292F)); this.setSize(0.25F, 0.25F); }
public void doRenderLayer(EntityLlama entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (entitylivingbaseIn.func_190717_dN()) { this.field_191365_b.bindTexture(field_191364_a[entitylivingbaseIn.func_190704_dO().getMetadata()]); this.field_191366_c.setModelAttributes(this.field_191365_b.getMainModel()); this.field_191366_c.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); } }
/** * Draws the background layer of this container (behind the items). */ protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(HORSE_GUI_TEXTURES); int i = (this.width - this.xSize) / 2; int j = (this.height - this.ySize) / 2; this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); if (this.horseEntity instanceof AbstractChestHorse) { AbstractChestHorse abstractchesthorse = (AbstractChestHorse)this.horseEntity; if (abstractchesthorse.func_190695_dh()) { this.drawTexturedModalRect(i + 79, j + 17, 0, this.ySize, abstractchesthorse.func_190696_dl() * 18, 54); } } if (this.horseEntity.func_190685_dA()) { this.drawTexturedModalRect(i + 7, j + 35 - 18, 18, this.ySize + 54, 18, 18); } if (this.horseEntity.func_190677_dK()) { if (this.horseEntity instanceof EntityLlama) { this.drawTexturedModalRect(i + 7, j + 35, 36, this.ySize + 54, 18, 18); } else { this.drawTexturedModalRect(i + 7, j + 35, 0, this.ySize + 54, 18, 18); } } GuiInventory.drawEntityOnScreen(i + 51, j + 60, 17, (float)(i + 51) - this.mousePosx, (float)(j + 75 - 50) - this.mousePosY, this.horseEntity); }
public boolean isPassive(EntityLivingBase entity) { if(entity instanceof EntityBat) return true; else if(entity instanceof EntityChicken) return true; else if(entity instanceof EntityCow) return true; else if(entity instanceof EntityHorse) return true; else if(entity instanceof EntityMooshroom) return true; else if(entity instanceof EntityOcelot) return true; else if(entity instanceof EntityPig) return true; else if(entity instanceof EntitySheep) return true; else if(entity instanceof EntitySquid) return true; else if(entity instanceof EntityVillager) return true; else if(entity instanceof EntitySlime) return true; else if(entity instanceof EntityDonkey) return true; else if(entity instanceof EntityLlama) return true; else if(entity instanceof EntityMule) return true; else if(entity instanceof EntityRabbit) return true; return false; }
public EntityAILlamaFollowCaravan(EntityLlama p_i47305_1_, double p_i47305_2_) { this.field_190859_a = p_i47305_1_; this.field_190860_b = p_i47305_2_; this.setMutexBits(1); }
/** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { if (!this.field_190859_a.getLeashed() && !this.field_190859_a.func_190718_dR()) { List<EntityLlama> list = this.field_190859_a.world.<EntityLlama>getEntitiesWithinAABB(this.field_190859_a.getClass(), this.field_190859_a.getEntityBoundingBox().expand(9.0D, 4.0D, 9.0D)); EntityLlama entityllama = null; double d0 = Double.MAX_VALUE; for (EntityLlama entityllama1 : list) { if (entityllama1.func_190718_dR() && !entityllama1.func_190712_dQ()) { double d1 = this.field_190859_a.getDistanceSqToEntity(entityllama1); if (d1 <= d0) { d0 = d1; entityllama = entityllama1; } } } if (entityllama == null) { for (EntityLlama entityllama2 : list) { if (entityllama2.getLeashed() && !entityllama2.func_190712_dQ()) { double d2 = this.field_190859_a.getDistanceSqToEntity(entityllama2); if (d2 <= d0) { d0 = d2; entityllama = entityllama2; } } } } if (entityllama == null) { return false; } else if (d0 < 4.0D) { return false; } else if (!entityllama.getLeashed() && !this.func_190858_a(entityllama, 1)) { return false; } else { this.field_190859_a.func_190715_a(entityllama); return true; } } else { return false; } }
/** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityLlama entity) { return field_191350_a[entity.func_190719_dM()]; }
public VanillaLlama(EntityLlama llama) { super(llama); this.llama = llama; }
@Override public Class helperForClass() { return EntityLlama.class; }