當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。