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


Java EntityGuardian类代码示例

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


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

示例1: func_175817_a

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
protected boolean func_175817_a(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_)
{
    int i = this.getXWithOffset(p_175817_3_, p_175817_5_);
    int j = this.getYWithOffset(p_175817_4_);
    int k = this.getZWithOffset(p_175817_3_, p_175817_5_);

    if (p_175817_2_.isVecInside(new BlockPos(i, j, k)))
    {
        EntityGuardian entityguardian = new EntityGuardian(worldIn);
        entityguardian.setElder(true);
        entityguardian.heal(entityguardian.getMaxHealth());
        entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F);
        entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null);
        worldIn.spawnEntityInWorld(entityguardian);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:StructureOceanMonumentPieces.java

示例2: handleEntityStatus

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
 * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
 * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
 * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
 */
public void handleEntityStatus(S19PacketEntityStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = packetIn.getEntity(this.clientWorldController);

    if (entity != null)
    {
        if (packetIn.getOpCode() == 21)
        {
            this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
        }
        else
        {
            entity.handleStatusUpdate(packetIn.getOpCode());
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:NetHandlerPlayClient.java

示例3: checkSetTarget

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的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

示例4: spawnElder

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
protected boolean spawnElder(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_)
{
    int i = this.getXWithOffset(p_175817_3_, p_175817_5_);
    int j = this.getYWithOffset(p_175817_4_);
    int k = this.getZWithOffset(p_175817_3_, p_175817_5_);

    if (p_175817_2_.isVecInside(new BlockPos(i, j, k)))
    {
        EntityGuardian entityguardian = new EntityGuardian(worldIn);
        entityguardian.setElder(true);
        entityguardian.heal(entityguardian.getMaxHealth());
        entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F);
        entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null);
        worldIn.spawnEntityInWorld(entityguardian);
        return true;
    }
    else
    {
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:22,代码来源:StructureOceanMonumentPieces.java

示例5: handleEntityStatus

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
 * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
 * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
 * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
 */
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = packetIn.getEntity(this.clientWorldController);

    if (entity != null)
    {
        if (packetIn.getOpCode() == 21)
        {
            this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
        }
        else
        {
            entity.handleStatusUpdate(packetIn.getOpCode());
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:NetHandlerPlayClient.java

示例6: onRenderFog

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
@SubscribeEvent
public void onRenderFog(EntityViewRenderEvent.FogDensity event) {
    if (event.getEntity() instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.getEntity();
        PossessivePlayer possessivePlayer = PossessHandler.get(player);
        if (possessivePlayer != null && (possessivePlayer.getPossessing().canBreatheUnderwater() || possessivePlayer.getPossessing() instanceof EntityGuardian)) {
            if (ActiveRenderInfo.getBlockStateAtEntityViewpoint(ClientEventHandler.MINECRAFT.theWorld, player, (float) event.getRenderPartialTicks()).getMaterial() != Material.WATER) {
                GlStateManager.setFog(GlStateManager.FogMode.EXP);
                event.setDensity(0.125F);
                event.setCanceled(true);
            } else {
                GlStateManager.setFog(GlStateManager.FogMode.EXP);
                event.setDensity(0.02F);
                event.setCanceled(true);
            }
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:19,代码来源:ClientEventHandler.java

示例7: matches

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
@Override
protected boolean matches(EntityLivingBase entity) {
    if (type == BOSS) return !entity.isNonBoss();
    else if (!entity.isNonBoss()) return false;

    switch (type) {
        case ANIMAL:    return entity instanceof EntityAnimal;
        case MONSTER:   return entity instanceof IMob;
        case TAMEABLE:  return entity instanceof IEntityOwnable;
        case PLAYER:    return entity instanceof EntityPlayer;
        case WATER:     return entity instanceof EntityWaterMob || entity instanceof EntityGuardian;
        case NPC:       return entity instanceof INpc;
        case GOLEM:     return entity instanceof EntityGolem;
        default:        return false;
    }
}
 
开发者ID:joshiejack,项目名称:Progression,代码行数:17,代码来源:FilterEntityType.java

示例8: onUpdate

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Called to update the entity's position/logic.
 */
public void onUpdate()
{
    super.onUpdate();

    if (this.entity == null)
    {
        EntityGuardian entityguardian = new EntityGuardian(this.worldObj);
        entityguardian.setElder();
        this.entity = entityguardian;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:15,代码来源:MobAppearance.java

示例9: shouldRender

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.hasTargetedEntity())
        {
            EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();

            if (entitylivingbase != null)
            {
                Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
                Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);

                if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:RenderGuardian.java

示例10: preRenderCallback

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityGuardian entitylivingbaseIn, float partialTickTime)
{
    if (entitylivingbaseIn.isElder())
    {
        GlStateManager.scale(2.35F, 2.35F, 2.35F);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:RenderGuardian.java

示例11: GuardianSound

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public GuardianSound(EntityGuardian guardian)
{
    super(new ResourceLocation("minecraft:mob.guardian.attack"));
    this.guardian = guardian;
    this.attenuationType = ISound.AttenuationType.NONE;
    this.repeat = true;
    this.repeatDelay = 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:9,代码来源:GuardianSound.java

示例12: shouldRender

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender((EntityLiving)livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.hasTargetedEntity())
        {
            EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();

            if (entitylivingbase != null)
            {
                Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
                Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);

                if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:RenderGuardian.java

示例13: handleEntityStatus

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Invokes the entities' handleUpdateHealth method which is implemented in
 * LivingBase (hurt/death), MinecartMobSpawner (spawn delay), FireworkRocket &
 * MinecartTNT (explosion), IronGolem (throwing,...), Witch (spawn particles),
 * Zombie (villager transformation), Animal (breeding mode particles), Horse
 * (breeding/smoke particles), Sheep (...), Tameable (...), Villager (particles
 * for breeding mode, angry and happy), Wolf (...)
 */
public void handleEntityStatus(S19PacketEntityStatus packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	Entity entity = packetIn.getEntity(this.clientWorldController);

	if (entity != null) {
		if (packetIn.getOpCode() == 21) {
			this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
		} else {
			entity.handleStatusUpdate(packetIn.getOpCode());
		}
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:NetHandlerPlayClient.java

示例14: handleEntityStatus

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
 * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
 * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
 * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
 */
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = packetIn.getEntity(this.clientWorldController);

    if (entity != null)
    {
        if (packetIn.getOpCode() == 21)
        {
            this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
        }
        else if (packetIn.getOpCode() == 35)
        {
            int i = 40;
            this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
            this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);

            if (entity == this.gameController.player)
            {
                this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
            }
        }
        else
        {
            entity.handleStatusUpdate(packetIn.getOpCode());
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:35,代码来源:NetHandlerPlayClient.java

示例15: handleEntityStatus

import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
 * Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
 * MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
 * (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
 * particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
 */
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    Entity entity = packetIn.getEntity(this.clientWorldController);

    if (entity != null)
    {
        if (packetIn.getOpCode() == 21)
        {
            this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
        }
        else if (packetIn.getOpCode() == 35)
        {
            int i = 40;
            this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
            this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);

            if (entity == this.gameController.player)
            {
            	if (!Hacks.findMod(AntiTotemAnimation.class).isEnabled()) {
            		this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
             	}
            }
        }
        else
        {
            entity.handleStatusUpdate(packetIn.getOpCode());
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:NetHandlerPlayClient.java


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