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


Java EntityCreeper.getPowered方法代码示例

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


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

示例1: onEntityLivingDrops

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityLivingDrops(LivingDropsEvent event) {
    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
        if (event.entityLiving instanceof EntityCreeper) {
            EntityCreeper creeper = (EntityCreeper) event.entityLiving;
            if (creeper.getPowered()) {
                event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 6)));
            }
        }
        if (event.entityLiving instanceof EntityTaintChicken) {
            event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 14)));
        }
    }

    if (event.entityLiving instanceof EntityCreeper) {
        event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 6), 1);
    }
    if (event.entityLiving instanceof EntityTaintChicken) {
        event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 14), 1);
    }
}
 
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:22,代码来源:EventHandlerEMT.java

示例2: doRenderLayer

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
public void doRenderLayer(EntityCreeper entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.getPowered())
    {
        boolean flag = entitylivingbaseIn.isInvisible();
        GlStateManager.depthMask(!flag);
        this.creeperRenderer.bindTexture(LIGHTNING_TEXTURE);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
        GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F);
        GlStateManager.matrixMode(5888);
        GlStateManager.enableBlend();
        float f1 = 0.5F;
        GlStateManager.color(f1, f1, f1, 1.0F);
        GlStateManager.disableLighting();
        GlStateManager.blendFunc(1, 1);
        this.creeperModel.setModelAttributes(this.creeperRenderer.getMainModel());
        this.creeperModel.render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        GlStateManager.matrixMode(5888);
        GlStateManager.enableLighting();
        GlStateManager.disableBlend();
        GlStateManager.depthMask(flag);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:LayerCreeperCharge.java

示例3: doRenderLayer

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
public void doRenderLayer(EntityCreeper entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getPowered())
    {
        boolean flag = entitylivingbaseIn.isInvisible();
        GlStateManager.depthMask(!flag);
        this.creeperRenderer.bindTexture(LIGHTNING_TEXTURE);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
        GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F);
        GlStateManager.matrixMode(5888);
        GlStateManager.enableBlend();
        float f1 = 0.5F;
        GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
        GlStateManager.disableLighting();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
        this.creeperModel.setModelAttributes(this.creeperRenderer.getMainModel());
        Minecraft.getMinecraft().entityRenderer.func_191514_d(true);
        this.creeperModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        Minecraft.getMinecraft().entityRenderer.func_191514_d(false);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        GlStateManager.matrixMode(5888);
        GlStateManager.enableLighting();
        GlStateManager.disableBlend();
        GlStateManager.depthMask(flag);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:LayerCreeperCharge.java

示例4: doRenderLayer

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
public void doRenderLayer(EntityCreeper entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.getPowered())
    {
        boolean flag = entitylivingbaseIn.isInvisible();
        GlStateManager.depthMask(!flag);
        this.creeperRenderer.bindTexture(LIGHTNING_TEXTURE);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
        GlStateManager.translate(f * 0.01F, f * 0.01F, 0.0F);
        GlStateManager.matrixMode(5888);
        GlStateManager.enableBlend();
        float f1 = 0.5F;
        GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
        GlStateManager.disableLighting();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
        this.creeperModel.setModelAttributes(this.creeperRenderer.getMainModel());
        this.creeperModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        GlStateManager.matrixMode(5890);
        GlStateManager.loadIdentity();
        GlStateManager.matrixMode(5888);
        GlStateManager.enableLighting();
        GlStateManager.disableBlend();
        GlStateManager.depthMask(flag);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:LayerCreeperCharge.java

示例5: onEntityLivingDrops

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

    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
        if (event.entityLiving instanceof EntityCreeper) {
            EntityCreeper creeper = (EntityCreeper) event.entityLiving;
            if (creeper.getPowered()) {
                event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 6), 1);
            }
        }
        if (event.entityLiving instanceof EntityTaintChicken) {
            event.entityLiving.entityDropItem(new ItemStack(IC2ItemRegistry.itemEMTItems, 1, 14), 1);
        }
    }
}
 
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:16,代码来源:EntityEventHandler.java

示例6: explodeIceBlock

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
public static void explodeIceBlock(World world, int posX, int posY, int posZ, int side, Entity entity) {
   int x = posX + (side == 4?-1:(side == 5?1:0));
   int z = posZ + (side == 2?-1:(side == 3?1:0));
   int y = posY + (side == 0?-1:(side == 1?1:0)) - 1;
   if(side == 1 && !world.getBlock(x, posY, z).getMaterial().isSolid()) {
      --y;
   }

   Block block = Blocks.ice;
   boolean resistent = entity instanceof EntityDemon || entity instanceof EntityBlaze || entity instanceof EntityDragon || entity instanceof EntityHornedHuntsman || entity instanceof EntityEnt || entity instanceof EntityWither || entity instanceof EntityIronGolem;
   if(resistent) {
      setBlockIfNotSolid(world, x, y + 1, z, Blocks.flowing_water);
   } else {
      int HEIGHT = resistent?2:4;

      for(int creeper = 0; creeper < HEIGHT; ++creeper) {
         setBlockIfNotSolid(world, x - 2, y + creeper, z - 1, block);
         setBlockIfNotSolid(world, x - 2, y + creeper, z, block);
         setBlockIfNotSolid(world, x - 1, y + creeper, z + 1, block);
         setBlockIfNotSolid(world, x, y + creeper, z + 1, block);
         setBlockIfNotSolid(world, x + 1, y + creeper, z, block);
         setBlockIfNotSolid(world, x + 1, y + creeper, z - 1, block);
         setBlockIfNotSolid(world, x, y + creeper, z - 2, block);
         setBlockIfNotSolid(world, x - 1, y + creeper, z - 2, block);
         setBlockIfNotSolid(world, x - 2, y + creeper, z - 2, block);
         setBlockIfNotSolid(world, x - 2, y + creeper, z + 1, block);
         setBlockIfNotSolid(world, x + 1, y + creeper, z + 1, block);
         setBlockIfNotSolid(world, x + 1, y + creeper, z - 2, block);
      }

      setBlockIfNotSolid(world, x, y, z, block);
      if(!resistent) {
         setBlockIfNotSolid(world, x, y + HEIGHT - 1, z, block);
         setBlockIfNotSolid(world, x - 1, y + HEIGHT - 1, z - 1, block);
         setBlockIfNotSolid(world, x - 1, y + HEIGHT - 1, z, block);
         setBlockIfNotSolid(world, x, y + HEIGHT - 1, z - 1, block);
      }

      if(entity instanceof EntityCreeper) {
         EntityCreeper var14 = (EntityCreeper)entity;
         boolean flag = world.getGameRules().getGameRuleBooleanValue("mobGriefing");
         if(var14.getPowered()) {
            world.createExplosion(var14, var14.posX, var14.posY, var14.posZ, 6.0F, flag);
         } else {
            world.createExplosion(var14, var14.posX, var14.posY, var14.posZ, 3.0F, flag);
         }

         var14.setDead();
      }
   }

}
 
开发者ID:lerion13,项目名称:witchery,代码行数:53,代码来源:EntityWitchProjectile.java

示例7: onEntityCollidedWithBlock

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

示例8: shouldRenderPass

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntityCreeper par1EntityCreeper, int par2, float par3)
{
    if (par1EntityCreeper.getPowered())
    {
        if (par1EntityCreeper.isInvisible())
        {
            GL11.glDepthMask(false);
        }
        else
        {
            GL11.glDepthMask(true);
        }

        if (par2 == 1)
        {
            float var4 = (float)par1EntityCreeper.ticksExisted + par3;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float var5 = var4 * 0.01F;
            float var6 = var4 * 0.01F;
            GL11.glTranslatef(var5, var6, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float var7 = 0.5F;
            GL11.glColor4f(var7, var7, var7, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (par2 == 2)
        {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:48,代码来源:RenderCreeper.java

示例9: shouldRenderPass

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
protected int shouldRenderPass(EntityCreeper p_77032_1_, int p_77032_2_, float p_77032_3_)
{
    if (p_77032_1_.getPowered())
    {
        if (p_77032_1_.isInvisible())
        {
            GL11.glDepthMask(false);
        }
        else
        {
            GL11.glDepthMask(true);
        }

        if (p_77032_2_ == 1)
        {
            float f1 = (float)p_77032_1_.ticksExisted + p_77032_3_;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float f2 = f1 * 0.01F;
            float f3 = f1 * 0.01F;
            GL11.glTranslatef(f2, f3, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float f4 = 0.5F;
            GL11.glColor4f(f4, f4, f4, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (p_77032_2_ == 2)
        {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:45,代码来源:RenderCreeper.java

示例10: renderCreeperPassModel

import net.minecraft.entity.monster.EntityCreeper; //导入方法依赖的package包/类
/**
 * A method used to render a creeper's powered form as a pass model.
 */
protected int renderCreeperPassModel(EntityCreeper par1EntityCreeper, int par2, float par3)
{
    if (par1EntityCreeper.getPowered())
    {
        if (par1EntityCreeper.isInvisible())
        {
            GL11.glDepthMask(false);
        }
        else
        {
            GL11.glDepthMask(true);
        }

        if (par2 == 1)
        {
            float f1 = (float)par1EntityCreeper.ticksExisted + par3;
            this.bindTexture(armoredCreeperTextures);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            float f2 = f1 * 0.01F;
            float f3 = f1 * 0.01F;
            GL11.glTranslatef(f2, f3, 0.0F);
            this.setRenderPassModel(this.creeperModel);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_BLEND);
            float f4 = 0.5F;
            GL11.glColor4f(f4, f4, f4, 1.0F);
            GL11.glDisable(GL11.GL_LIGHTING);
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            return 1;
        }

        if (par2 == 2)
        {
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glLoadIdentity();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDisable(GL11.GL_BLEND);
        }
    }

    return -1;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:48,代码来源:RenderCreeper.java


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