当前位置: 首页>>代码示例>>Java>>正文


Java EntityShulker类代码示例

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


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

示例1: checkSetTarget

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void checkSetTarget(LivingSetAttackTargetEvent event) {
	
	if (event.getTarget() == null)
		return;
	if (!(event.getTarget() instanceof EntityPlayer) || event.getTarget() instanceof FakePlayer)
		return;
	if (!(event.getEntity() instanceof EntityLiving))
		return;
	
	EntityPlayer player = (EntityPlayer)event.getTarget();
	EntityLiving ent = (EntityLiving)event.getEntity();
	boolean flag = player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == UCItems.poncho && NBTUtils.getInt(player.inventory.armorInventory[2], ItemGeneric.TAG_UPGRADE, -1) == 10;
	if (flag && ent.isNonBoss() && !(ent instanceof EntityGuardian || ent instanceof EntityShulker))
	{
		ent.setAttackTarget(null);
		ent.setRevengeTarget(null);
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:20,代码来源:UCEventHandlerServer.java

示例2: doRender

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    int i = entity.getClientTeleportInterp();

    if (i > 0 && entity.isAttachedToBlock())
    {
        BlockPos blockpos = entity.getAttachmentPos();
        BlockPos blockpos1 = entity.getOldAttachPos();
        double d0 = (double)((float)i - partialTicks) / 6.0D;
        d0 = d0 * d0;
        double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
        double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
        double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
        super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
    }
    else
    {
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:RenderShulker.java

示例3: shouldRender

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
public boolean shouldRender(EntityShulker livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock())
        {
            BlockPos blockpos = livingEntity.getOldAttachPos();
            BlockPos blockpos1 = livingEntity.getAttachmentPos();
            Vec3d vec3d = new Vec3d((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ());
            Vec3d vec3d1 = new Vec3d((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());

            if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
            {
                return true;
            }
        }

        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:RenderShulker.java

示例4: handleDataMarker

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void handleDataMarker(String p_186175_1_, BlockPos p_186175_2_, World p_186175_3_, Random p_186175_4_, StructureBoundingBox p_186175_5_)
{
    if (p_186175_1_.startsWith("Chest"))
    {
        BlockPos blockpos = p_186175_2_.down();

        if (p_186175_5_.isVecInside(blockpos))
        {
            TileEntity tileentity = p_186175_3_.getTileEntity(blockpos);

            if (tileentity instanceof TileEntityChest)
            {
                ((TileEntityChest)tileentity).setLootTable(LootTableList.CHESTS_END_CITY_TREASURE, p_186175_4_.nextLong());
            }
        }
    }
    else if (p_186175_1_.startsWith("Sentry"))
    {
        EntityShulker entityshulker = new EntityShulker(p_186175_3_);
        entityshulker.setPosition((double)p_186175_2_.getX() + 0.5D, (double)p_186175_2_.getY() + 0.5D, (double)p_186175_2_.getZ() + 0.5D);
        entityshulker.setAttachmentPos(p_186175_2_);
        p_186175_3_.spawnEntityInWorld(entityshulker);
    }
    else if (p_186175_1_.startsWith("Elytra"))
    {
        EntityItemFrame entityitemframe = new EntityItemFrame(p_186175_3_, p_186175_2_, this.rotation.rotate(EnumFacing.SOUTH));
        entityitemframe.setDisplayedItem(new ItemStack(Items.ELYTRA));
        p_186175_3_.spawnEntityInWorld(entityitemframe);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:31,代码来源:StructureEndCityPieces.java

示例5: rotateCorpse

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void rotateCorpse(EntityShulker entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);

    switch (entityLiving.getAttachmentFacing())
    {
        case DOWN:
        default:
            break;

        case EAST:
            GlStateManager.translate(0.5F, 0.5F, 0.0F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
            break;

        case WEST:
            GlStateManager.translate(-0.5F, 0.5F, 0.0F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
            break;

        case NORTH:
            GlStateManager.translate(0.0F, 0.5F, -0.5F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            break;

        case SOUTH:
            GlStateManager.translate(0.0F, 0.5F, 0.5F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
            break;

        case UP:
            GlStateManager.translate(0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:RenderShulker.java

示例6: setRotationAngles

import net.minecraft.entity.monster.EntityShulker; //导入依赖的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)
{
    EntityShulker entityshulker = (EntityShulker)entityIn;
    float f = ageInTicks - (float)entityshulker.ticksExisted;
    float f1 = (0.5F + entityshulker.getClientPeekAmount(f)) * (float)Math.PI;
    float f2 = -1.0F + MathHelper.sin(f1);
    float f3 = 0.0F;

    if (f1 > (float)Math.PI)
    {
        f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
    }

    this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);

    if (entityshulker.getClientPeekAmount(f) > 0.3F)
    {
        this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
    }
    else
    {
        this.lid.rotateAngleY = 0.0F;
    }

    this.head.rotateAngleX = headPitch * 0.017453292F;
    this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:ModelShulker.java

示例7: doRender

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    if (this.modelVersion != ((ModelShulker)this.mainModel).getModelVersion())
    {
        this.mainModel = new ModelShulker();
        this.modelVersion = ((ModelShulker)this.mainModel).getModelVersion();
    }

    int i = entity.getClientTeleportInterp();

    if (i > 0 && entity.isAttachedToBlock())
    {
        BlockPos blockpos = entity.getAttachmentPos();
        BlockPos blockpos1 = entity.getOldAttachPos();
        double d0 = (double)((float)i - partialTicks) / 6.0D;
        d0 = d0 * d0;
        double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
        double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
        double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
        super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
    }
    else
    {
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:RenderShulker.java

示例8: rotateCorpse

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void rotateCorpse(EntityShulker entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
    super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);

    switch (entityLiving.getAttachmentFacing())
    {
        case DOWN:
        default:
            break;
        case EAST:
            GlStateManager.translate(0.5F, 0.5F, 0.0F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
            break;
        case WEST:
            GlStateManager.translate(-0.5F, 0.5F, 0.0F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
            break;
        case NORTH:
            GlStateManager.translate(0.0F, 0.5F, -0.5F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            break;
        case SOUTH:
            GlStateManager.translate(0.0F, 0.5F, 0.5F);
            GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
            break;
        case UP:
            GlStateManager.translate(0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:RenderShulker.java

示例9: onEntityDrop

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
    EntityLivingBase living = event.getEntityLiving();
    if (living == null || living.world == null) return;
    Random rand = living.world.rand;

    if (living instanceof EntityShulker) {
        if (rand.nextFloat() < 1.0f) {
            event.getEntityLiving().entityDropItem(ModItems.material.getMaterial("ender_cream", 1 + rand.nextInt(2)), 0);
        }
    }
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:13,代码来源:AssortedHandler.java

示例10: isHostileMob

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
private boolean isHostileMob(EntityLivingBase victim) {
	return victim instanceof EntityMob ||
			victim instanceof EntitySlime ||
			victim instanceof EntityMagmaCube ||
			victim instanceof EntityGhast ||
			victim instanceof EntityShulker;
}
 
开发者ID:ToroCraft,项目名称:ToroQuest,代码行数:8,代码来源:CivilizationHandlers.java

示例11: initEntityAI

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@Override
protected void initEntityAI()
{
	super.initEntityAI();
	this.tasks.addTask(1, new MobAIRangedAttack(this, 0, 0, 15));	
	this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityDragon>(this, EntityDragon.class, true));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityGhast>(this, EntityGhast.class, true));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, true));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityShulker>(this, EntityShulker.class, true));
	this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntitySlime>(this, EntitySlime.class, true));
}
 
开发者ID:murapix,项目名称:Inhuman-Resources,代码行数:13,代码来源:MobRanged.java

示例12: attachCapabilities

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
 * Called every time a target is constructed. Allows for capabilities to be attatched to
 * the target.
 *
 * @param event The forge event.
 */
@SubscribeEvent
public void attachCapabilities (AttachCapabilitiesEvent<Entity> event) {

    if (event.getObject() instanceof EntityShulker) {
        event.addCapability(new ResourceLocation(DarkUtils.MOD_ID, "shulker_info"), new Provider());
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Dark-Utilities,代码行数:14,代码来源:ShulkerDataHandler.java

示例13: onLivingDrops

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onLivingDrops (LivingDropsEvent event) {

    if (event.getEntity() instanceof EntityShulker) {

        final ICustomData data = ShulkerDataHandler.getData(event.getEntity());

        if (data != null && data.getCooldown() <= 0) {

            final Vec3d pos = event.getEntity().getPositionVector();
            event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), pos.x, pos.y, pos.z, new ItemStack(itemShulkerPearl)));
            data.setCooldown(this.maxCooldown);
        }
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Dark-Utilities,代码行数:16,代码来源:FeatureShulkerPearlItem.java

示例14: onEntityInteract

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityInteract (EntityInteract event) {

    if (event.getSide().equals(Side.SERVER) && this.harvestablePearls && event.getTarget() instanceof EntityShulker) {

        final ICustomData data = ShulkerDataHandler.getData(event.getTarget());

        if (data != null && data.getCooldown() <= 0) {

            event.getTarget().entityDropItem(new ItemStack(itemShulkerPearl), 0.5f);
            data.setCooldown(this.maxCooldown);
        }
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Dark-Utilities,代码行数:15,代码来源:FeatureShulkerPearlItem.java

示例15: onEntityUpdate

import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityUpdate (LivingUpdateEvent event) {

    if (this.harvestablePearls && event.getEntity() instanceof EntityShulker) {

        final ICustomData data = ShulkerDataHandler.getData(event.getEntity());
        final int current = data.getCooldown();

        if (data != null && current > 0) {
            data.setCooldown(current - 1);
        }
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Dark-Utilities,代码行数:14,代码来源:FeatureShulkerPearlItem.java


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