• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SkeletonType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.entity.monster.SkeletonType的典型用法代码示例。如果您正苦于以下问题:Java SkeletonType类的具体用法?Java SkeletonType怎么用?Java SkeletonType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SkeletonType类属于net.minecraft.entity.monster包,在下文中一共展示了SkeletonType类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onInitialSpawn

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
@Nullable
@Override
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata) {

    if(!worldObj.isRemote){
        for(int i = 0; i < 4; i++){
            EntitySkeleton mob = new EntitySkeleton(worldObj);
            mob.setSkeletonType(SkeletonType.WITHER);
            mob.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.DIAMOND_SWORD));
            mob.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(4.0D);

            BlockPos pos = pickSpawnPoint();
            mob.setLocationAndAngles(0.5 + pos.getX(), pos.getY(), 0.5 + pos.getZ(), CMath.random.nextFloat() * 360,0);

            worldObj.spawnEntityInWorld(mob);
        }
    }

    return super.onInitialSpawn(difficulty, livingdata);
}
 
开发者ID:KodyJKing,项目名称:RandomToolKit,代码行数:21,代码来源:EntitySkeletonPriest.java


示例2: preRenderCallback

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Allows the render to do state modifications necessary before the model is rendered.
 */
protected void preRenderCallback(EntitySkeleton entitylivingbaseIn, float partialTickTime)
{
    if (entitylivingbaseIn.getSkeletonType() == SkeletonType.WITHER)
    {
        GlStateManager.scale(1.2F, 1.2F, 1.2F);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:RenderSkeleton.java


示例3: doRenderLayer

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
public void doRenderLayer(EntitySkeleton entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getSkeletonType() == SkeletonType.STRAY)
    {
        this.layerModel.setModelAttributes(this.renderer.getMainModel());
        this.layerModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
        this.renderer.bindTexture(STRAY_CLOTHES_TEXTURES);
        this.layerModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:LayerSkeletonType.java


示例4: onAttackEntity

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
@SubscribeEvent
public void onAttackEntity(AttackEntityEvent event) {
    if (event.getTarget() instanceof EntityLivingBase) {
        EntityLivingBase target = (EntityLivingBase) event.getTarget();
        EntityPlayer player = event.getEntityPlayer();
        if (this.isActive(player)) {
            PossessivePlayer possessivePlayer = PossessHandler.get(player);
            EntitySkeleton possessing = (EntitySkeleton) possessivePlayer.getPossessing();
            if (possessing.getSkeletonType() == SkeletonType.WITHER) {
                target.addPotionEffect(new PotionEffect(MobEffects.WITHER, 100, 1));
            }
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:15,代码来源:SkeletonHandler.java


示例5: preRenderCallback

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Allows the render to do state modifications necessary before the model is rendered.
 */
protected void preRenderCallback(EntitySkeleton entitylivingbaseIn, float partialTickTime)
{
    if (entitylivingbaseIn.func_189771_df() == SkeletonType.WITHER)
    {
        GlStateManager.scale(1.2F, 1.2F, 1.2F);
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:11,代码来源:RenderSkeleton.java


示例6: doRenderLayer

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
public void doRenderLayer(EntitySkeleton entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.func_189771_df() == SkeletonType.STRAY)
    {
        this.field_190094_c.setModelAttributes(this.field_190093_b.getMainModel());
        this.field_190094_c.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
        this.field_190093_b.bindTexture(field_190092_a);
        this.field_190094_c.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:11,代码来源:LayerSkeletonType.java


示例7: shouldExecute

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0)
    {
        return false;
    }
    else if (this.targetClass != EntityPlayer.class && this.targetClass != EntityPlayerMP.class)
    {
        List<T> list = this.taskOwner.worldObj.<T>getEntitiesWithinAABB(this.targetClass, this.getTargetableArea(this.getTargetDistance()), this.targetEntitySelector);

        if (list.isEmpty())
        {
            return false;
        }
        else
        {
            Collections.sort(list, this.theNearestAttackableTargetSorter);
            this.targetEntity = list.get(0);
            return true;
        }
    }
    else
    {
        this.targetEntity = (T)this.taskOwner.worldObj.getNearestAttackablePlayer(this.taskOwner.posX, this.taskOwner.posY + (double)this.taskOwner.getEyeHeight(), this.taskOwner.posZ, this.getTargetDistance(), this.getTargetDistance(), new Function<EntityPlayer, Double>()
        {
            @Nullable
            public Double apply(@Nullable EntityPlayer p_apply_1_)
            {
                ItemStack itemstack = p_apply_1_.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

                if (itemstack != null && itemstack.getItem() == Items.SKULL)
                {
                    int i = itemstack.getItemDamage();
                    boolean flag = EntityAINearestAttackableTarget.this.taskOwner instanceof EntitySkeleton && ((EntitySkeleton)EntityAINearestAttackableTarget.this.taskOwner).getSkeletonType() == SkeletonType.NORMAL && i == 0;
                    boolean flag1 = EntityAINearestAttackableTarget.this.taskOwner instanceof EntityZombie && i == 2;
                    boolean flag2 = EntityAINearestAttackableTarget.this.taskOwner instanceof EntityCreeper && i == 4;

                    if (flag || flag1 || flag2)
                    {
                        return Double.valueOf(0.5D);
                    }
                }

                return Double.valueOf(1.0D);
            }
        }, (Predicate<EntityPlayer>)this.targetEntitySelector);
        return this.targetEntity != null;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:53,代码来源:EntityAINearestAttackableTarget.java


示例8: getEntityTexture

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntitySkeleton entity)
{
    SkeletonType skeletontype = entity.getSkeletonType();
    return skeletontype == SkeletonType.WITHER ? WITHER_SKELETON_TEXTURES : (skeletontype == SkeletonType.STRAY ? STRAY_SKELETON_TEXTURES : SKELETON_TEXTURES);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:RenderSkeleton.java


示例9: onArrowLoose

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
@SubscribeEvent
public void onArrowLoose(ArrowLooseEvent event) {
    EntityPlayer player = event.getEntityPlayer();
    if (this.isActive(player)) {
        if (!event.hasAmmo()) {
            ItemStack stack = event.getBow();
            World world = player.getEntityWorld();
            EntitySkeleton skeleton = (EntitySkeleton) PossessHandler.get(player).getPossessing();
            float velocity = ItemBow.getArrowVelocity(event.getCharge());
            if (velocity >= 0.1) {
                if (!world.isRemote) {
                    EntityTippedArrow arrow = new EntityTippedArrow(world, player);
                    if (skeleton.getSkeletonType() != SkeletonType.STRAY) {
                        arrow.setPotionEffect(new ItemStack(Items.ARROW));
                    } else {
                        arrow.setPotionEffect(new ItemStack(Items.TIPPED_ARROW));
                        arrow.addEffect(new PotionEffect(MobEffects.SLOWNESS, 600));
                    }
                    arrow.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, velocity * 3.0F, 1.0F);
                    arrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
                    if (velocity == 1.0F) {
                        arrow.setIsCritical(true);
                    }
                    int power = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stack);
                    if (power > 0) {
                        arrow.setDamage(arrow.getDamage() + (double) power * 0.5 + 0.5);
                    }
                    int punch = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stack);
                    if (punch > 0) {
                        arrow.setKnockbackStrength(punch);
                    }
                    if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stack) > 0) {
                        arrow.setFire(100);
                    }
                    stack.damageItem(1, player);
                    world.spawnEntityInWorld(arrow);
                }
                world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (world.rand.nextFloat() * 0.4F + 1.2F) + velocity * 0.5F);
                player.addStat(StatList.getObjectUseStats(stack.getItem()));
            }
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:44,代码来源:SkeletonHandler.java


示例10: onEntityCollidedWithBlock

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	
	if (world.isRemote)
		return;
	
	if (entity.isDead)
		return;
	
	if (entity instanceof EntitySkeleton) {
		
		EntitySkeleton skeleton = (EntitySkeleton) entity;
		if (skeleton.getSkeletonType() == SkeletonType.NORMAL) {
			skeleton.setSkeletonType(SkeletonType.WITHER);
			skeleton.setHealth(skeleton.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntityCreeper) {
		EntityCreeper creeper = (EntityCreeper) entity;
		if (!creeper.getPowered()) {
			creeper.onStruckByLightning(null);
			creeper.setHealth(creeper.getMaxHealth());
			
			return;
		}
	}
	
	if (entity instanceof EntitySpider && !(entity instanceof EntityCaveSpider)) {
		EntitySpider spider = (EntitySpider) entity;
		spider.setDead();
		
		EntityCaveSpider caveSpider = new EntityCaveSpider(world);
		caveSpider.setLocationAndAngles(spider.posX, spider.posY, spider.posZ, spider.rotationYaw, spider.rotationPitch);
		caveSpider.renderYawOffset = spider.renderYawOffset;
		caveSpider.setHealth(caveSpider.getMaxHealth());
		
		world.spawnEntity(caveSpider);
		
		return;
	}
	
	if (entity instanceof EntitySquid) {
		EntitySquid squid = (EntitySquid) entity;
		squid.setDead();
		
		EntityGhast ghast = new EntityGhast(world);
		ghast.setLocationAndAngles(squid.posX, squid.posY, squid.posZ, squid.rotationYaw, squid.rotationPitch);
		ghast.renderYawOffset = squid.renderYawOffset;
		ghast.setHealth(ghast.getMaxHealth());
		
		world.spawnEntity(ghast);
		
		return;
	}
	
	if (entity instanceof EntityAnimal) {
		((EntityAnimal) entity).onStruckByLightning(null);
		return;
	}
	
	if (entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) entity;
		player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 210, 2));
		player.addPotionEffect(new PotionEffect(MobEffects.WITHER, 210, 0));
		player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 210, 0));
	}
}
 
开发者ID:MikeLydeamore,项目名称:ExNihiloAdscensio,代码行数:72,代码来源:BlockFluidWitchwater.java


示例11: isNetherMob

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
public static boolean isNetherMob(EntityLivingBase e){
	if(e instanceof EntityBlaze||(e instanceof EntitySkeleton&&((EntitySkeleton)e).getSkeletonType()==SkeletonType.WITHER)||isBiomeMob(e, "hell")){
		return true;
	}
	return false;
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:7,代码来源:MethodUtil.java


示例12: isColdMob

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
public static boolean isColdMob(EntityLivingBase e){
	if(e instanceof EntitySnowman||e instanceof EntityPolarBear||(e instanceof EntitySkeleton&&((EntitySkeleton)e).getSkeletonType()==SkeletonType.STRAY)||isEndMob(e)){
		return true;
	}
	return false;
}
 
开发者ID:EnderiumSmith,项目名称:Nuclear-Foundation,代码行数:7,代码来源:MethodUtil.java


示例13: shouldExecute

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Returns whether the EntityAIBase should begin execution.
 */
public boolean shouldExecute()
{
    if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0)
    {
        return false;
    }
    else if (this.targetClass != EntityPlayer.class && this.targetClass != EntityPlayerMP.class)
    {
        List<T> list = this.taskOwner.worldObj.<T>getEntitiesWithinAABB(this.targetClass, this.getTargetableArea(this.getTargetDistance()), this.targetEntitySelector);

        if (list.isEmpty())
        {
            return false;
        }
        else
        {
            Collections.sort(list, this.theNearestAttackableTargetSorter);
            this.targetEntity = list.get(0);
            return true;
        }
    }
    else
    {
        this.targetEntity = (T)this.taskOwner.worldObj.getNearestAttackablePlayer(this.taskOwner.posX, this.taskOwner.posY + (double)this.taskOwner.getEyeHeight(), this.taskOwner.posZ, this.getTargetDistance(), this.getTargetDistance(), new Function<EntityPlayer, Double>()
        {
            @Nullable
            public Double apply(@Nullable EntityPlayer p_apply_1_)
            {
                ItemStack itemstack = p_apply_1_.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

                if (itemstack != null && itemstack.getItem() == Items.SKULL)
                {
                    int i = itemstack.getItemDamage();
                    boolean flag = EntityAINearestAttackableTarget.this.taskOwner instanceof EntitySkeleton && ((EntitySkeleton)EntityAINearestAttackableTarget.this.taskOwner).func_189771_df() == SkeletonType.NORMAL && i == 0;
                    boolean flag1 = EntityAINearestAttackableTarget.this.taskOwner instanceof EntityZombie && i == 2;
                    boolean flag2 = EntityAINearestAttackableTarget.this.taskOwner instanceof EntityCreeper && i == 4;

                    if (flag || flag1 || flag2)
                    {
                        return Double.valueOf(0.5D);
                    }
                }

                return Double.valueOf(1.0D);
            }
        }, (Predicate<EntityPlayer>)this.targetEntitySelector);
        return this.targetEntity != null;
    }
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:53,代码来源:EntityAINearestAttackableTarget.java


示例14: getEntityTexture

import net.minecraft.entity.monster.SkeletonType; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntitySkeleton entity)
{
    SkeletonType skeletontype = entity.func_189771_df();
    return skeletontype == SkeletonType.WITHER ? WITHER_SKELETON_TEXTURES : (skeletontype == SkeletonType.STRAY ? field_190084_m : SKELETON_TEXTURES);
}
 
开发者ID:BlazeAxtrius,项目名称:ExpandedRailsMod,代码行数:9,代码来源:RenderSkeleton.java



注:本文中的net.minecraft.entity.monster.SkeletonType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RowInputInterface类代码示例发布时间:2022-05-23
下一篇:
Java SchemaDOMParser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap