public boolean apply(Entity p_apply_1_) { if (!p_apply_1_.isEntityAlive()) { return false; } else if (!(p_apply_1_ instanceof EntityLivingBase)) { return false; } else { EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_; return entitylivingbase.getEquipmentInSlot(EntityLiving.getArmorPosition(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer)); } }
public boolean apply(@Nullable Entity p_apply_1_) { if (!p_apply_1_.isEntityAlive()) { return false; } else if (!(p_apply_1_ instanceof EntityLivingBase)) { return false; } else { EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_; return !entitylivingbase.getItemStackFromSlot(EntityLiving.getSlotForItemStack(this.armor)).func_190926_b() ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer)); } }
public boolean apply(@Nullable Entity p_apply_1_) { if (!p_apply_1_.isEntityAlive()) { return false; } else if (!(p_apply_1_ instanceof EntityLivingBase)) { return false; } else { EntityLivingBase entitylivingbase = (EntityLivingBase)p_apply_1_; return entitylivingbase.getItemStackFromSlot(EntityLiving.getSlotForItemStack(this.armor)) != null ? false : (entitylivingbase instanceof EntityLiving ? ((EntityLiving)entitylivingbase).canPickUpLoot() : (entitylivingbase instanceof EntityArmorStand ? true : entitylivingbase instanceof EntityPlayer)); } }
@Override public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if(entity instanceof EntityArmorStand) { // Hack so helmets look right on armor stand netHeadYaw = 0; } headOuter.showModel = slot == EntityEquipmentSlot.HEAD; body.showModel = slot == EntityEquipmentSlot.CHEST; armR.showModel = slot == EntityEquipmentSlot.CHEST; armL.showModel = slot == EntityEquipmentSlot.CHEST; skirt.showModel = slot == EntityEquipmentSlot.LEGS; hideLeg(legR,slot); hideLeg(legL,slot); bipedHeadwear.showModel = false; bipedHead = headOuter; bipedBody = slot == EntityEquipmentSlot.LEGS ? skirt : body; bipedRightArm = armR; bipedLeftArm = armL; bipedRightLeg = legR; bipedLeftLeg = legL; super.render(entity,limbSwing,limbSwingAmount,ageInTicks,netHeadYaw,headPitch,scale); }
@Override public boolean handleEntityCollision(World worldIn, BlockPos pos,IBlockState state, Entity entityIn) { if(!worldIn.isRemote){ if((entityIn instanceof EntityLivingBase) && !(entityIn instanceof EntityPlayer)&&!(entityIn instanceof EntityArmorStand)){ ResourceLocation entID = EntityList.getKey(entityIn); //check if a spawn egg exists TODO also config blacklist? if(EntityList.ENTITY_EGGS.get(entID)!=null){ ItemStack egg = new ItemStack(Items.SPAWN_EGG); NBTTagCompound entityTag = new NBTTagCompound(); entityTag.setString("id", entID.toString()); egg.setTagInfo("EntityTag", entityTag); Utils.spawnItemCentered(worldIn, pos, egg); this.onPatternBroken();//kill the rune entityIn.setDead();//kill the entity }else{ worldIn.getClosestPlayer(pos.getX(),pos.getY(),pos.getZ(), 16, false).sendMessage(new TextComponentTranslation(NO_SPAWN_EGG)); } } } return true; }
/** * Checks whether the given entity accepts an item for a certain slot * * @param entity the entity * @param slot the slot to check * @param stack the item to check * @return whether the entity accepts that item for the slot */ private static boolean acceptStack(Entity entity, EntityEquipmentSlot slot, ItemStack stack) { if (entity instanceof EntityArmorStand || entity instanceof EntityLiving) { if (stack != ItemStack.EMPTY && !EntityLiving.isItemStackInSlot(slot, stack) && slot != EntityEquipmentSlot.HEAD) return false; else return true; } else if (entity instanceof EntityPlayer) { if (slot.getSlotType() == EntityEquipmentSlot.Type.ARMOR && stack != ItemStack.EMPTY && stack.getItem() != null) { if (!(stack.getItem() instanceof ItemArmor) && !(stack.getItem() instanceof ItemElytra)) { if (slot != EntityEquipmentSlot.HEAD) return false; else return true; } else if (EntityLiving.getSlotForItemStack(stack) != slot) return false; else return true; } else return true; } else return true; }
@SubscribeEvent public void onEntityInteractSpecific(PlayerInteractEvent.EntityInteractSpecific event) { if (armorStandSwap) { //added for https://www.twitch.tv/darkphan if (event.getWorld().isRemote) { return; } //server side only if (event.getTarget() == null || event.getTarget() instanceof EntityArmorStand == false) { return; } EntityArmorStand entityStand = (EntityArmorStand) event.getTarget(); EntityPlayer player = event.getEntityPlayer(); if (player.isSneaking() == false) { return; } //bc when not sneaking, we do the normal single item version event.setCanceled(true);//which means we need to now cancel that normal version and do our own for (EntityEquipmentSlot slot : armorStandEquipment) { ItemStack itemPlayer = player.getItemStackFromSlot(slot); ItemStack itemArmorstand = entityStand.getItemStackFromSlot(slot); player.setItemStackToSlot(slot, itemArmorstand); entityStand.setItemStackToSlot(slot, itemPlayer); } } }
@Override public void render (Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float partialTicks) { this.addModelParts(); GlStateManager.pushMatrix(); // Fix for armor stands being annoying if (entity instanceof EntityArmorStand) { netHeadYaw = 0; GlStateManager.translate(0F, 0.15F, 0F); } this.syncModel(entity, partialTicks); super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, partialTicks); GlStateManager.popMatrix(); }
/** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn) { super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entityIn); if (entityIn instanceof EntityArmorStand) { EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; this.bipedLeftArm.showModel = entityarmorstand.getShowArms(); this.bipedRightArm.showModel = entityarmorstand.getShowArms(); this.standBase.showModel = !entityarmorstand.hasNoBasePlate(); this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); float f = (entityarmorstand.getLeftLegRotation().getX() + entityarmorstand.getRightLegRotation().getX()) / 2.0F; float f1 = (entityarmorstand.getLeftLegRotation().getY() + entityarmorstand.getRightLegRotation().getY()) / 2.0F; float f2 = (entityarmorstand.getLeftLegRotation().getZ() + entityarmorstand.getRightLegRotation().getZ()) / 2.0F; this.standBase.rotateAngleX = 0.0F; this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw; this.standBase.rotateAngleZ = 0.0F; } }
/** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn) { if (entityIn instanceof EntityArmorStand) { EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX(); this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY(); this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ(); this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F); this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX(); this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY(); this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ(); this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX(); this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY(); this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ(); this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX(); this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY(); this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ(); this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F); this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX(); this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY(); this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ(); this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F); copyModelAngles(this.bipedHead, this.bipedHeadwear); } }
protected void rotateCorpse(EntityArmorStand entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); float f = (float)(entityLiving.world.getTotalWorldTime() - entityLiving.punchCooldown) + partialTicks; if (f < 5.0F) { GlStateManager.rotate(MathHelper.sin(f / 1.5F * (float)Math.PI) * 3.0F, 0.0F, 1.0F, 0.0F); } }
/** * Renders the desired {@code T} type Entity. */ public void doRender(EntityArmorStand entity, double x, double y, double z, float entityYaw, float partialTicks) { if (entity.hasMarker()) { this.renderMarker = true; } super.doRender(entity, x, y, z, entityYaw, partialTicks); if (entity.hasMarker()) { this.renderMarker = false; } }
/** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); if (entityIn instanceof EntityArmorStand) { EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; this.bipedLeftArm.showModel = entityarmorstand.getShowArms(); this.bipedRightArm.showModel = entityarmorstand.getShowArms(); this.standBase.showModel = !entityarmorstand.hasNoBasePlate(); this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F, 0.0F); this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F, 0.0F); this.standRightSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standRightSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standRightSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.standLeftSide.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standLeftSide.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standLeftSide.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.standWaist.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.standWaist.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.standWaist.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.standBase.rotateAngleX = 0.0F; this.standBase.rotateAngleY = 0.017453292F * -entityIn.rotationYaw; this.standBase.rotateAngleZ = 0.0F; } }
/** * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how * "far" arms and legs can swing at most. */ public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) { if (entityIn instanceof EntityArmorStand) { EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX(); this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY(); this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ(); this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F); this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX(); this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY(); this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ(); this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX(); this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY(); this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ(); this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX(); this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY(); this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ(); this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F); this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX(); this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY(); this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ(); this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F); copyModelAngles(this.bipedHead, this.bipedHeadwear); } }
protected void rotateCorpse(EntityArmorStand entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); float f = (float)(entityLiving.worldObj.getTotalWorldTime() - entityLiving.punchCooldown) + partialTicks; if (f < 5.0F) { GlStateManager.rotate(MathHelper.sin(f / 1.5F * (float)Math.PI) * 3.0F, 0.0F, 1.0F, 0.0F); } }
@Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entity, ItemStack stack, EntityEquipmentSlot armorSlot, ModelBiped defaultModel) { if (entity instanceof EntityArmorStand) { GlStateManager.rotate(entity.rotationYaw, 0.0F, 1.0F, 0.0F); } return ClientProxy.HAT_MODEL; }
@Override protected boolean specialBlockHandling(World world, String c, int x, int y, int z) { if (!c.equals("xx")) { return false; } setBlockState(world, Blocks.AIR.getDefaultState(), x, y, z, boundingBox); int j = this.getXWithOffset(x, z); int k = this.getYWithOffset(y); int l = this.getZWithOffset(x, z); /* * if (!structurebb.isVecInside(new BlockPos(j, k, l))) { return; } */ EntityArmorStand stand = new EntityArmorStand(world); stand.setLocationAndAngles((double) j + 0.5D, (double) k, (double) l + 0.5D, 90F, 0.0F); world.spawnEntity(stand); List<String> entities = new ArrayList<String>(); entities.add(ToroQuest.MODID + ":" + EntityGuard.NAME); specialHandlingForSpawner(world, "xx", c, x, y, z, entities); return true; }
@Override public void render(@Nonnull Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { if (entity instanceof EntityArmorStand) { // Hack so helmets look right on armor stand netHeadYaw = 0; } helm.showModel = slot == EntityEquipmentSlot.HEAD; body.showModel = slot == EntityEquipmentSlot.CHEST; armR.showModel = slot == EntityEquipmentSlot.CHEST; armL.showModel = slot == EntityEquipmentSlot.CHEST; legR.showModel = slot == EntityEquipmentSlot.LEGS; legL.showModel = slot == EntityEquipmentSlot.LEGS; bootL.showModel = slot == EntityEquipmentSlot.FEET; bootR.showModel = slot == EntityEquipmentSlot.FEET; bipedHeadwear.showModel = false; bipedHead = helm; bipedBody = body; bipedRightArm = armR; bipedLeftArm = armL; if (slot == EntityEquipmentSlot.LEGS) { bipedRightLeg = legR; bipedLeftLeg = legL; } else { bipedRightLeg = bootR; bipedLeftLeg = bootL; } super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); }
@Override public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn) { if (entityIn instanceof EntityArmorStand) { EntityArmorStand entityarmorstand = (EntityArmorStand)entityIn; bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX(); bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY(); bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ(); bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F); bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX(); bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY(); bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ(); bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX(); bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY(); bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ(); bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX(); bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY(); bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ(); bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX(); bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY(); bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ(); bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F); bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX(); bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY(); bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ(); bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F); copyModelAngles(bipedHead, bipedHeadwear); } else super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entityIn); }
/** * Called when a Block is right-clicked with this Item */ public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { if (side == EnumFacing.DOWN) { return false; } else { boolean flag = worldIn.getBlockState(pos).getBlock().isReplaceable(worldIn, pos); BlockPos blockpos = flag ? pos : pos.offset(side); if (!playerIn.canPlayerEdit(blockpos, side, stack)) { return false; } else { BlockPos blockpos1 = blockpos.up(); boolean flag1 = !worldIn.isAirBlock(blockpos) && !worldIn.getBlockState(blockpos).getBlock().isReplaceable(worldIn, blockpos); flag1 = flag1 | (!worldIn.isAirBlock(blockpos1) && !worldIn.getBlockState(blockpos1).getBlock().isReplaceable(worldIn, blockpos1)); if (flag1) { return false; } else { double d0 = (double)blockpos.getX(); double d1 = (double)blockpos.getY(); double d2 = (double)blockpos.getZ(); List<Entity> list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.fromBounds(d0, d1, d2, d0 + 1.0D, d1 + 2.0D, d2 + 1.0D)); if (list.size() > 0) { return false; } else { if (!worldIn.isRemote) { worldIn.setBlockToAir(blockpos); worldIn.setBlockToAir(blockpos1); EntityArmorStand entityarmorstand = new EntityArmorStand(worldIn, d0 + 0.5D, d1, d2 + 0.5D); float f = (float)MathHelper.floor_float((MathHelper.wrapAngleTo180_float(playerIn.rotationYaw - 180.0F) + 22.5F) / 45.0F) * 45.0F; entityarmorstand.setLocationAndAngles(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); this.applyRandomRotations(entityarmorstand, worldIn.rand); NBTTagCompound nbttagcompound = stack.getTagCompound(); if (nbttagcompound != null && nbttagcompound.hasKey("EntityTag", 10)) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); entityarmorstand.writeToNBTOptional(nbttagcompound1); nbttagcompound1.merge(nbttagcompound.getCompoundTag("EntityTag")); entityarmorstand.readFromNBT(nbttagcompound1); } worldIn.spawnEntityInWorld(entityarmorstand); } --stack.stackSize; return true; } } } } }
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn) { this.renderEngine = renderEngineIn; this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this)); this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this)); this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F)); this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F)); this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F)); this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F)); this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F)); this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F)); this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F)); this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F)); this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this)); this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this)); this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this)); this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this)); this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this)); this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this)); this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this)); this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this)); this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this)); this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this)); this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F)); this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this)); this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F)); this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this)); this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F)); this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this)); this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this)); this.entityRenderMap.put(EntityBat.class, new RenderBat(this)); this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this)); this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this)); this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this)); this.entityRenderMap.put(EntityWither.class, new RenderWither(this)); this.entityRenderMap.put(Entity.class, new RenderEntity(this)); this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this)); this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn)); this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this)); this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this)); this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn)); this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn)); this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn)); this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn)); this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn)); this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn)); this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn)); this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F)); this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F)); this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this)); this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn)); this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this)); this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this)); this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this)); this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this)); this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this)); this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this)); this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this)); this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this)); this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this)); this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F)); this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this)); this.playerRenderer = new RenderPlayer(this); this.skinMap.put("default", this.playerRenderer); this.skinMap.put("slim", new RenderPlayer(this, true)); }
/** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityArmorStand entity) { return TEXTURE_ARMOR_STAND; }
protected void rotateCorpse(EntityArmorStand bat, float p_77043_2_, float p_77043_3_, float partialTicks) { GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); }
protected boolean canRenderName(EntityArmorStand entity) { return entity.getAlwaysRenderNameTag(); }