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

Java AbstractSkeleton类代码示例

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

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



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

示例1: initEntityAI

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
protected void initEntityAI()
{
    this.aiSit = new EntityAISit(this);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, new EntityWolf.AIAvoidEntity(this, EntityLlama.class, 24.0F, 1.5D, 1.5D));
    this.tasks.addTask(4, new EntityAILeapAtTarget(this, 0.4F));
    this.tasks.addTask(5, new EntityAIAttackMelee(this, 1.0D, true));
    this.tasks.addTask(6, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
    this.tasks.addTask(7, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(9, new EntityAIBeg(this, 8.0F));
    this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(10, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
    this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
    this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true, new Class[0]));
    this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityAnimal.class, false, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ instanceof EntitySheep || p_apply_1_ instanceof EntityRabbit;
        }
    }));
    this.targetTasks.addTask(5, new EntityAINearestAttackableTarget(this, AbstractSkeleton.class, false));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:27,代码来源:EntityWolf.java


示例2: setLivingAnimations

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Used for easily adding entity-dependent animations. The second and third float params here are the same second
 * and third as in the setRotationAngles method.
 */
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
{
    this.rightArmPose = ModelBiped.ArmPose.EMPTY;
    this.leftArmPose = ModelBiped.ArmPose.EMPTY;
    ItemStack itemstack = entitylivingbaseIn.getHeldItem(EnumHand.MAIN_HAND);

    if (itemstack.getItem() == Items.BOW && ((AbstractSkeleton)entitylivingbaseIn).isSwingingArms())
    {
        if (entitylivingbaseIn.getPrimaryHand() == EnumHandSide.RIGHT)
        {
            this.rightArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
        }
        else
        {
            this.leftArmPose = ModelBiped.ArmPose.BOW_AND_ARROW;
        }
    }

    super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:ModelSkeleton.java


示例3: setRotationAngles

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * 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);
    ItemStack itemstack = ((EntityLivingBase)entityIn).getHeldItemMainhand();
    AbstractSkeleton abstractskeleton = (AbstractSkeleton)entityIn;

    if (abstractskeleton.isSwingingArms() && (itemstack.func_190926_b() || itemstack.getItem() != Items.BOW))
    {
        float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
        float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
        this.bipedRightArm.rotateAngleZ = 0.0F;
        this.bipedLeftArm.rotateAngleZ = 0.0F;
        this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
        this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
        this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
        this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
        this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
        this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
        this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
        this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
        this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
        this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:ModelSkeleton.java


示例4: onEntityLivingDeath

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.HIGH)
public void onEntityLivingDeath(LivingDeathEvent event) {
    if (FMLCommonHandler.instance().getEffectiveSide().isServer()) {
        if (ExtendedConfig.spawnSkullCrawlersAtMobsDeath) {
            if (event.getEntity() instanceof AbstractSkeleton) {
                EntitySkullCrawler crawler;
                if (MobSpawn.isWitherSkeleton((AbstractSkeleton) event.getEntity())) {
                    crawler = new EntityWitherSkullCrawler(event.getEntity().getEntityWorld());
                } else if (MobSpawn.isStraySkeleton((AbstractSkeleton) event.getEntity())) {
                    crawler = new EntityStraySkullCrawler(event.getEntity().getEntityWorld());
                } else {
                    crawler = new EntitySkullCrawler(event.getEntity().getEntityWorld());
                }
                MobSpawn.spawnCrawler(event.getEntity(), crawler);
            } else if (event.getEntity() instanceof EntityZombie) {
                MobSpawn.spawnCrawler(event.getEntity(), new EntityZombieSkullCrawler(event.getEntity().getEntityWorld()));
            }
        }
        if (event.getEntity() instanceof EntityCreeper && ((EntityCreeper) event.getEntity()).getPowered()) {
            // drop creeper statue if entity is a charged creeper
            GSBlock.MEMORIAL.dropCreeperMemorial(event.getEntity().getEntityWorld(), new BlockPos(event.getEntity()));
        }
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:25,代码来源:GSEventsHandler.java


示例5: EntityAIAttackRangedBow

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
public EntityAIAttackRangedBow(AbstractSkeleton skeleton, double speedAmplifier, int delay, float maxDistance)
{
    this.entity = skeleton;
    this.moveSpeedAmp = speedAmplifier;
    this.attackCooldown = delay;
    this.maxAttackDistance = maxDistance * maxDistance;
    this.setMutexBits(3);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:EntityAIAttackRangedBow.java


示例6: onEntityJoinWorld

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Listen to {@link EntityJoinWorldEvent} :
 * Adds random special {@link EntityArrow}s data to {@link AbstractSkeleton}s {@link net.minecraft.network.datasync.EntityDataManager} (for display)
 * Replace the vanilla fired {@link EntityTippedArrow} with the custom {@link AbstractMBArrow} (for actual action)
 * Note: Fails silently
 */
@SubscribeEvent(priority = EventPriority.LOW)
public void onEntityJoinWorld(EntityJoinWorldEvent event){
    if(event.getEntity() instanceof AbstractSkeleton){
        registerArrowType((AbstractSkeleton)event.getEntity());
    }else if(event.getEntity() instanceof EntityTippedArrow && ((EntityTippedArrow) event.getEntity()).getColor() == 0){
        EntityArrow arrow = ((EntityArrow)event.getEntity());
        if (arrow.shootingEntity instanceof AbstractSkeleton) {
            AbstractSkeleton skeleton = (AbstractSkeleton) arrow.shootingEntity;
            if(skeleton.getAttackTarget() != null) {
                ItemStack type = getArrowForMob(skeleton);
                if (type.getItem() instanceof ItemArrow) {
                    EntityArrow mbArrow = ((ItemArrow)type.getItem()).createArrow(skeleton.world, type, skeleton);
                    if (!(mbArrow instanceof EntityTippedArrow)) {
                        EntityLivingBase target = skeleton.getAttackTarget();
                        float pow = MathHelper.sqrt(skeleton.getDistanceSq(target.posX, target.getEntityBoundingBox().minY, target.posZ)) / 15F;
                        pow = MathHelper.clamp(pow, 0.1F, 1.0F);

                        mbArrow.setEnchantmentEffectsFromEntity(skeleton, pow);
                        if (skeleton instanceof EntityWitherSkeleton)
                            mbArrow.setFire(100);
                        double d0 = target.posX - skeleton.posX;
                        double d1 = target.getEntityBoundingBox().minY + (double)(target.height / 3.0F) - mbArrow.posY;
                        double d2 = target.posZ - skeleton.posZ;
                        double d3 = (double)MathHelper.sqrt(d0 * d0 + d2 * d2);
                        mbArrow.setThrowableHeading(d0, d1 + d3 * 0.2D, d2, 1.6F, (float)(14 - skeleton.world.getDifficulty().getDifficultyId() * 4));
                        mbArrow.setDamage(arrow.getDamage());
                        if (skeleton.world.spawnEntity(mbArrow))
                            event.setCanceled(true);
                    }
                }
            }
        }
    }
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:41,代码来源:MobHookContainerClass.java


示例7: registerArrowType

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Writes AbstractSkeleton DataManager arrow type data
 * Based on configured chance rates
 * @param skeleton To write data to
 */
private void registerArrowType(AbstractSkeleton skeleton){
    try{
        skeleton.getDataManager().register(SKELETON_ARROW, (byte) -1);
        for(int i = 0; i < ItemMBArrow.names.length; i++){
            if(skeleton.getRNG().nextFloat() < BattlegearConfig.skeletonArrowSpawnRate[i]){
                skeleton.getDataManager().set(SKELETON_ARROW, (byte) i);
                break;
            }
        }
    }catch (Exception ignored){}
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:17,代码来源:MobHookContainerClass.java


示例8: getArrowType

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Reads AbstractSkeleton DataManager arrow type data
 * @param skeleton To read data from
 * @return the arrow type
 */
private int getArrowType(AbstractSkeleton skeleton){
    int type;
    try {
        type = skeleton.getDataManager().get(SKELETON_ARROW);
    }catch (Exception handled){
        type = -1;
    }
    return type;
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:15,代码来源:MobHookContainerClass.java


示例9: getArrowForMob

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Build ItemStack according to AbstractSkeleton DataManager arrow type data
 * @param skeleton To read data from
 * @return the arrow stack
 */
public ItemStack getArrowForMob(AbstractSkeleton skeleton){
    int type = getArrowType(skeleton);
    if(type>-1)
        return new ItemStack(BattlegearConfig.MbArrows, 1, type);
    return new ItemStack(Items.ARROW);
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:12,代码来源:MobHookContainerClass.java


示例10: getEntityTexture

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(AbstractSkeleton entity)
{
    return STRAY_SKELETON_TEXTURES;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:RenderStray.java


示例11: getEntityTexture

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(AbstractSkeleton entity)
{
    return SKELETON_TEXTURES;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:RenderSkeleton.java


示例12: getEntityTexture

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(AbstractSkeleton entity)
{
    return WITHER_SKELETON_TEXTURES;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:RenderWitherSkeleton.java


示例13: preRenderCallback

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


示例14: preRenderCallback

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
@Override
protected void preRenderCallback(AbstractSkeleton entity, float partialTickTime) {
	float scale = ((EntitySkeletonNemesis) entity).getNemesisScale();
	GlStateManager.scale(scale, scale, scale);
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:6,代码来源:RenderSkeletonNemesis.java


示例15: preRenderCallback

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
@Override
protected void preRenderCallback(AbstractSkeleton entity, float partialTickTime) {
	float scale = ((EntityStrayNemesis) entity).getNemesisScale();
	GlStateManager.scale(scale, scale, scale);
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:6,代码来源:RenderStrayNemesis.java


示例16: isWitherSkeleton

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
public static boolean isWitherSkeleton(AbstractSkeleton skeleton) {
    return skeleton instanceof EntityGSSkeleton && ((EntityGSSkeleton) skeleton).getSkeletonType() == SkeletonType.WITHER ||
            skeleton instanceof EntityWitherSkeleton;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:5,代码来源:MobSpawn.java


示例17: isStraySkeleton

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
public static boolean isStraySkeleton(AbstractSkeleton skeleton) {
    return skeleton instanceof EntityGSSkeleton && ((EntityGSSkeleton) skeleton).getSkeletonType() == SkeletonType.STRAY ||
            skeleton instanceof EntityStray;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:5,代码来源:MobSpawn.java


示例18: getEntityTexture

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
@Override
protected ResourceLocation getEntityTexture(AbstractSkeleton entity) {

  return texture;
}
 
开发者ID:SleepyTrousers,项目名称:EnderZoo,代码行数:6,代码来源:RenderFallenKnight.java


示例19: renderLiving

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
/**
    * Render quiver on skeletons if possible
    */
@SubscribeEvent
public void renderLiving(RenderLivingEvent.Post<AbstractSkeleton> event) {

	if (BattlegearConfig.enableSkeletonQuiver && event.getEntity() instanceof EntitySkeleton && event.getRenderer() instanceof RenderSkeleton) {

           GlStateManager.pushMatrix();
           GlStateManager.disableCull();

           GlStateManager.color(1, 1, 1);
		Minecraft.getMinecraft().getTextureManager().bindTexture(quiverDetails);

           GlStateManager.translate((float) event.getX(), (float) event.getY(), (float) event.getZ());

           GlStateManager.scale(1, -1, 1);

		float f2 = interpolateRotation(event.getEntity().prevRenderYawOffset, event.getEntity().renderYawOffset, BattlegearClientTickHandeler.getPartialTick());

           GlStateManager.rotate(180.0F - f2, 0.0F, 1.0F, 0.0F);

		if (event.getEntity().deathTime > 0) {
			float f3 = ((float) event.getEntity().deathTime
					+ BattlegearClientTickHandeler.getPartialTick() - 1.0F) / 20.0F * 1.6F;
			f3 = MathHelper.sqrt(f3);

			if (f3 > 1.0F) {
				f3 = 1.0F;
			}

               GlStateManager.rotate(-f3 * 90, 0.0F, 0.0F, 1.0F);
		}

           GlStateManager.translate(0, -1.5F, 0);

           GlStateManager.rotate(event.getEntity().rotationPitch, 0, 1, 0);

           if(event.getEntity().hasItemInSlot(EntityEquipmentSlot.CHEST)){
               GlStateManager.translate(0, 0, BattlegearRenderHelper.RENDER_UNIT);
           }
           ((ModelBiped)event.getRenderer().mainModel).bipedBody.postRender(BattlegearRenderHelper.RENDER_UNIT);
           GlStateManager.scale(1.05F, 1.05F, 1.05F);
		quiverModel.render(SKELETON_ARROW, BattlegearRenderHelper.RENDER_UNIT);

		Minecraft.getMinecraft().getTextureManager().bindTexture(quiverBase);
           GlStateManager.color(0.10F, 0.10F, 0.10F);
		quiverModel.render(0, BattlegearRenderHelper.RENDER_UNIT);
           GlStateManager.color(1, 1, 1);

           GlStateManager.enableCull();
           GlStateManager.popMatrix();
	}
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:55,代码来源:BattlegearClientEvents.java


示例20: helperForClass

import net.minecraft.entity.monster.AbstractSkeleton; //导入依赖的package包/类
@Override
public Class helperForClass() 
{
	return AbstractSkeleton.class;
}
 
开发者ID:iChun,项目名称:Hats,代码行数:6,代码来源:HelperSkeleton.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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