Java 类net.minecraft.entity.monster.EntitySnowman 实例源码

项目:Possessed    文件:SnowmanHandler.java   
@Override
public void onUpdate(PossessivePlayer possessivePlayer, EntityPlayer player) {
    EntitySnowman possessing = (EntitySnowman) possessivePlayer.getPossessing();
    if (player.onGround) {
        EnchantmentFrostWalker.freezeNearby(player, player.worldObj, player.getPosition(), 2);
        for (int i = 0; i < 4; ++i) {
            int x = MathHelper.floor_double(player.posX + (i % 2 * 2 - 1) * 0.25F);
            int y = MathHelper.floor_double(player.posY);
            int z = MathHelper.floor_double(player.posZ + (i / 2 % 2 * 2 - 1) * 0.25F);
            BlockPos pos = new BlockPos(x, y, z);
            IBlockState state = player.worldObj.getBlockState(pos);
            if (state.getMaterial() == Material.AIR && Blocks.SNOW_LAYER.canPlaceBlockAt(player.worldObj, pos)) {
                player.worldObj.setBlockState(pos, Blocks.SNOW_LAYER.getDefaultState());
            }
        }
    }
}
项目:Resilience-Client-Source    文件:RenderSnowMan.java   
protected void renderEquippedItems(EntitySnowman par1EntitySnowman, float par2)
{
    super.renderEquippedItems(par1EntitySnowman, par2);
    ItemStack var3 = new ItemStack(Blocks.pumpkin, 1);

    if (var3.getItem() instanceof ItemBlock)
    {
        GL11.glPushMatrix();
        this.snowmanModel.head.postRender(0.0625F);

        if (RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType()))
        {
            float var4 = 0.625F;
            GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
            GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(var4, -var4, var4);
        }

        this.renderManager.itemRenderer.renderItem(par1EntitySnowman, var3, 0);
        GL11.glPopMatrix();
    }
}
项目:Runes-And-Silver    文件:SnowBiome.java   
public SnowBiome(int par1){
    super(par1);
    this.topBlock = (byte) Block.blockSnow.blockID;
    this.fillerBlock = (byte) Block.blockSnow.blockID;

    this.setMinMaxHeight(0.3F, 0.6F);

    this.spawnableCreatureList.add(new SpawnListEntry(EntitySnowman.class, 25, 2, 6));
    this.spawnableCreatureList.clear();
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new SpawnListEntry(EntityEskimoZombie.class, 15, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityEskimoSkeleton.class, 15, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityYeti.class, 10, 1, 1));


    this.theBiomeDecorator.treesPerChunk = 10;
    this.theBiomeDecorator.grassPerChunk = 4;

}
项目:Cauldron    文件:RenderSnowMan.java   
protected void renderEquippedItems(EntitySnowman p_77029_1_, float p_77029_2_)
{
    super.renderEquippedItems(p_77029_1_, p_77029_2_);
    ItemStack itemstack = new ItemStack(Blocks.pumpkin, 1);

    if (itemstack.getItem() instanceof ItemBlock)
    {
        GL11.glPushMatrix();
        this.snowmanModel.head.postRender(0.0625F);

        IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
        boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

        if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType()))
        {
            float f1 = 0.625F;
            GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
            GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(f1, -f1, f1);
        }

        this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 0);
        GL11.glPopMatrix();
    }
}
项目:Cauldron    文件:RenderSnowMan.java   
protected void renderEquippedItems(EntitySnowman p_77029_1_, float p_77029_2_)
{
    super.renderEquippedItems(p_77029_1_, p_77029_2_);
    ItemStack itemstack = new ItemStack(Blocks.pumpkin, 1);

    if (itemstack.getItem() instanceof ItemBlock)
    {
        GL11.glPushMatrix();
        this.snowmanModel.head.postRender(0.0625F);

        IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
        boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

        if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType()))
        {
            float f1 = 0.625F;
            GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
            GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(f1, -f1, f1);
        }

        this.renderManager.itemRenderer.renderItem(p_77029_1_, itemstack, 0);
        GL11.glPopMatrix();
    }
}
项目:RuneCraftery    文件:RenderSnowMan.java   
protected void func_77093_a(EntitySnowman p_77093_1_, float p_77093_2_) {
   super.func_77029_c(p_77093_1_, p_77093_2_);
   ItemStack var3 = new ItemStack(Block.field_72061_ba, 1);
   if(var3 != null && var3.func_77973_b().field_77779_bT < 256) {
      GL11.glPushMatrix();
      this.field_77094_a.field_78195_c.func_78794_c(0.0625F);
      if(RenderBlocks.func_78597_b(Block.field_71973_m[var3.field_77993_c].func_71857_b())) {
         float var4 = 0.625F;
         GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
         GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
         GL11.glScalef(var4, -var4, var4);
      }

      this.field_76990_c.field_78721_f.func_78443_a(p_77093_1_, var3, 0);
      GL11.glPopMatrix();
   }

}
项目:RuneCraftery    文件:RenderSnowMan.java   
/**
 * Renders this snowman's pumpkin.
 */
protected void renderSnowmanPumpkin(EntitySnowman par1EntitySnowman, float par2)
{
    super.renderEquippedItems(par1EntitySnowman, par2);
    ItemStack itemstack = new ItemStack(Block.pumpkin, 1);

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
    {
        GL11.glPushMatrix();
        this.snowmanModel.head.postRender(0.0625F);

        IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
        boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

        if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
        {
            float f1 = 0.625F;
            GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
            GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(f1, -f1, f1);
        }

        this.renderManager.itemRenderer.renderItem(par1EntitySnowman, itemstack, 0);
        GL11.glPopMatrix();
    }
}
项目:BetterNutritionMod    文件:RenderSnowMan.java   
/**
 * Renders this snowman's pumpkin.
 */
protected void renderSnowmanPumpkin(EntitySnowman par1EntitySnowman, float par2)
{
    super.renderEquippedItems(par1EntitySnowman, par2);
    ItemStack itemstack = new ItemStack(Block.pumpkin, 1);

    if (itemstack != null && itemstack.getItem() instanceof ItemBlock)
    {
        GL11.glPushMatrix();
        this.snowmanModel.head.postRender(0.0625F);

        IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemstack, EQUIPPED);
        boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper(EQUIPPED, itemstack, BLOCK_3D));

        if (is3D || RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
        {
            float f1 = 0.625F;
            GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
            GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(f1, -f1, f1);
        }

        this.renderManager.itemRenderer.renderItem(par1EntitySnowman, itemstack, 0);
        GL11.glPopMatrix();
    }
}
项目:iChunUtil    文件:HeadSnowman.java   
@Override
public float[] getEyeOffsetFromJoint(EntitySnowman living, float partialTick, int eye)
{
    if(living.isPumpkinEquipped())
    {
        return eyeOffset;
    }
    else
    {
        if(eye == 0)
        {
            return eyeOffsetNoPumpkinRight;
        }
        return eyeOffsetNoPumpkinLeft;
    }
}
项目:DecompiledMinecraft    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman 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.isInvisible())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(f, -f, -f);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.pumpkin, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:BaseClient    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman 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.isInvisible())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(f, -f, -f);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.pumpkin, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:BaseClient    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman 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.isInvisible())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(f, -f, -f);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.pumpkin, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:connor41-etfuturum2    文件:ServerEventHandler.java   
@SubscribeEvent
public void livingUpdate(LivingUpdateEvent event) {
    ModEnchantments.onLivingUpdate(event.entityLiving);

    if (EtFuturum.enableVillagerZombies)
        if (!event.entityLiving.worldObj.isRemote && event.entityLiving.getClass() == EntityZombie.class) {
            EntityZombie zombie = (EntityZombie) event.entityLiving;
            if (zombie.isVillager()) {
                EntityZombieVillager villagerZombie = new EntityZombieVillager(zombie.worldObj);
                villagerZombie.copyLocationAndAnglesFrom(zombie);
                villagerZombie.onSpawnWithEgg(null);
                villagerZombie.worldObj.spawnEntityInWorld(villagerZombie);

                zombie.setDead();
            }
        }

    if (EtFuturum.enableShearableGolems)
        if (!event.entityLiving.worldObj.isRemote && event.entityLiving.getClass() == EntitySnowman.class) {
            EntityNewSnowGolem golen = new EntityNewSnowGolem(event.entityLiving.worldObj);
            golen.copyLocationAndAnglesFrom(event.entityLiving);
            golen.onSpawnWithEgg(null);
            golen.worldObj.spawnEntityInWorld(golen);

            event.entityLiving.setDead();
        }
}
项目:Backmemed    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (!entitylivingbaseIn.isInvisible() && entitylivingbaseIn.isPumpkinEquipped())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(0.625F, -0.625F, -0.625F);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.PUMPKIN, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:IceMod    文件:IceLands.java   
public IceLands(int par1)
{
    super(par1);

    this.setBiomeName("Icelands");

    this.topBlock = (byte)IceMod.IcyOre.blockID;
    this.fillerBlock = (byte)Block.ice.blockID;

    this.theBiomeDecorator.bigMushroomsPerChunk = 10;
    this.theBiomeDecorator.treesPerChunk = 5;
    this.theBiomeDecorator.clayPerChunk  = 3;
    this.theBiomeDecorator.reedsPerChunk = 1;

    this.spawnableMonsterList.add(new SpawnListEntry(EntitySnowman.class, 25, 4, 8));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 25, 4, 8));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityDragon.class, 1, 1, 1));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityIronGolem.class, 1, 1, 1));

    this.setMinMaxHeight(0.1F, 0.5F);
    //mnmx
    this.setTemperatureRainfall(0.7F, 0.2F);

}
项目:CustomWorldGen    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (!entitylivingbaseIn.isInvisible() && !entitylivingbaseIn.isPumpkinEquipped())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(0.625F, -0.625F, -0.625F);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.PUMPKIN, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:CivRadar    文件:Config.java   
public Config() {
    mobs = new ArrayList<Entity>(Arrays.asList(new Entity[]{
            new Entity(EntityBat.class), 
            new Entity(EntityChicken.class),
            new Entity(EntityCow.class),
            new Entity(EntityHorse.class),
            new Entity(EntityMooshroom.class),
            new Entity(EntityOcelot.class),
            new Entity(EntityPig.class),
            new Entity(EntityRabbit.class),
            new Entity(EntitySheep.class),
            new Entity(EntitySquid.class),
            new Entity(EntityVillager.class),
            new Entity(EntityWolf.class),
            new Entity(EntityBlaze.class),
            new Entity(EntityCaveSpider.class),
            new Entity(EntityCreeper.class),
            new Entity(EntityEnderman.class),
            new Entity(EntityGhast.class),
            new Entity(EntityGolem.class),
            new Entity(EntityGuardian.class),
            new Entity(EntityIronGolem.class),
            new Entity(EntityMagmaCube.class),
            new Entity(EntityPigZombie.class),
            new Entity(EntitySilverfish.class),
            new Entity(EntitySkeleton.class),
            new Entity(EntitySlime.class),
            new Entity(EntitySnowman.class),
            new Entity(EntitySpider.class),
            new Entity(EntityWitch.class),
            new Entity(EntityZombie.class),
            new Entity(EntityItem.class),
            new Entity(EntityMinecart.class),
            new Entity(EntityPlayer.class)
            }));
}
项目:Et-Futurum    文件:ServerEventHandler.java   
@SubscribeEvent
public void livingUpdate(LivingUpdateEvent event) {
    ModEnchantments.onLivingUpdate(event.entityLiving);

    if (EtFuturum.enableVillagerZombies)
        if (!event.entityLiving.worldObj.isRemote && event.entityLiving.getClass() == EntityZombie.class) {
            EntityZombie zombie = (EntityZombie) event.entityLiving;
            if (zombie.isVillager()) {
                EntityZombieVillager villagerZombie = new EntityZombieVillager(zombie.worldObj);
                villagerZombie.copyLocationAndAnglesFrom(zombie);
                villagerZombie.onSpawnWithEgg(null);
                villagerZombie.worldObj.spawnEntityInWorld(villagerZombie);

                zombie.setDead();
            }
        }

    if (EtFuturum.enableShearableGolems)
        if (!event.entityLiving.worldObj.isRemote && event.entityLiving.getClass() == EntitySnowman.class) {
            EntityNewSnowGolem golen = new EntityNewSnowGolem(event.entityLiving.worldObj);
            golen.copyLocationAndAnglesFrom(event.entityLiving);
            golen.onSpawnWithEgg(null);
            golen.worldObj.spawnEntityInWorld(golen);

            event.entityLiving.setDead();
        }
}
项目:ExpandedRailsMod    文件:LayerSnowmanHead.java   
public void doRenderLayer(EntitySnowman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (!entitylivingbaseIn.isInvisible() && !entitylivingbaseIn.isPumpkinEquipped())
    {
        GlStateManager.pushMatrix();
        this.snowManRenderer.getMainModel().head.postRender(0.0625F);
        float f = 0.625F;
        GlStateManager.translate(0.0F, -0.34375F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.scale(0.625F, -0.625F, -0.625F);
        Minecraft.getMinecraft().getItemRenderer().renderItem(entitylivingbaseIn, new ItemStack(Blocks.PUMPKIN, 1), ItemCameraTransforms.TransformType.HEAD);
        GlStateManager.popMatrix();
    }
}
项目:ZeldaSwordSkills    文件:BackSlice.java   
private static void init() {
    if (immuneEntities == null) {
        immuneEntities = new HashSet<Class<? extends EntityLivingBase>>();
        immuneEntities.add(EntityBlaze.class);
        immuneEntities.add(EntityChu.class);
        immuneEntities.add(EntitySnowman.class);
        immuneEntities.add(EntitySlime.class);
    }
}
项目:Kingdom-Keys    文件:Munny10Drops.java   
@ForgeSubscribe
public void onPassiveEntityDrop(LivingDropsEvent event) {
    if (event.source.getDamageType().equals("player")) {
        rand = Math.random();
        if (event.entityLiving instanceof EntityBat || event.entityLiving instanceof EntitySheep || event.entityLiving instanceof EntityCow || event.entityLiving instanceof EntityPig || event.entityLiving instanceof EntityChicken || event.entityLiving instanceof EntityHorse || event.entityLiving instanceof EntityOcelot || event.entityLiving instanceof EntitySquid || event.entityLiving instanceof EntityWolf || event.entityLiving instanceof EntitySnowman) {
            //The integer at the end relates to how many Items will be dropped(percentage). 
            if (rand < 0.15d && ConfigBooleans.munnyDrops){
                //The integer at the end relates to how many Items will be dropped(amount). 
                event.entityLiving.dropItem(AddedItems.Munny10.itemID, 1);
            }
        }
    }
}
项目:Kingdom-Keys    文件:Munny5Drops.java   
@ForgeSubscribe
public void onEntityDrop(LivingDropsEvent event) {
    if (event.source.getDamageType().equals("player")) {
        rand = Math.random();
        if (event.entityLiving instanceof EntityBat || event.entityLiving instanceof EntitySheep || event.entityLiving instanceof EntityCow || event.entityLiving instanceof EntityPig || event.entityLiving instanceof EntityChicken || event.entityLiving instanceof EntityHorse || event.entityLiving instanceof EntityOcelot || event.entityLiving instanceof EntitySquid || event.entityLiving instanceof EntityWolf || event.entityLiving instanceof EntitySnowman) {
            //The integer at the end relates to how many Items will be dropped(percentage). 
            if (rand < 0.20d && ConfigBooleans.munnyDrops){
                //The integer at the end relates to how many Items will be dropped(amount). 
                event.entityLiving.dropItem(AddedItems.Munny5.itemID, 1);
            }
        }
    }
}
项目:Kingdom-Keys    文件:Munny20Drops.java   
@ForgeSubscribe
public void onEntityDrop(LivingDropsEvent event) {
    if (event.source.getDamageType().equals("player")) {
        rand = Math.random();
        if (event.entityLiving instanceof EntityBat || event.entityLiving instanceof EntitySheep || event.entityLiving instanceof EntityCow || event.entityLiving instanceof EntityPig || event.entityLiving instanceof EntityChicken || event.entityLiving instanceof EntityHorse || event.entityLiving instanceof EntityOcelot || event.entityLiving instanceof EntitySquid || event.entityLiving instanceof EntityWolf || event.entityLiving instanceof EntitySnowman) {
            //The integer at the end relates to how many Items will be dropped(percentage). 
            if (rand < 0.10d && ConfigBooleans.munnyDrops){
                //The integer at the end relates to how many Items will be dropped(amount). 
                event.entityLiving.dropItem(AddedItems.Munny.itemID, 1);
            }
        }
    }
}
项目:Kingdom-Keys    文件:Munny1Drops.java   
@ForgeSubscribe
public void onEntityDrop(LivingDropsEvent event) {
    if (event.source.getDamageType().equals("player")) {
        rand = Math.random();
        if (event.entityLiving instanceof EntityBat || event.entityLiving instanceof EntitySheep || event.entityLiving instanceof EntityCow || event.entityLiving instanceof EntityPig || event.entityLiving instanceof EntityChicken || event.entityLiving instanceof EntityHorse || event.entityLiving instanceof EntityOcelot || event.entityLiving instanceof EntitySquid || event.entityLiving instanceof EntityWolf || event.entityLiving instanceof EntitySnowman) {
            //The integer at the end relates to how many Items will be dropped(percentage). 
            if (rand < 0.66d && ConfigBooleans.munnyDrops){
                //The integer at the end relates to how many Items will be dropped(amount). 
                event.entityLiving.dropItem(AddedItems.Munny1.itemID, 1);
            }
        }
    }
}
项目:WuppyMods    文件:CleanSnowGolem.java   
@SubscribeEvent
public void checkSnowGolems(EntityJoinWorldEvent event)
{
    if (event.entity instanceof EntitySnowman && !(event.entity instanceof EntityCleanSnowGolem))
    {
        if (!event.world.isRemote)
        {
            EntityCleanSnowGolem golem = new EntityCleanSnowGolem(event.world);
            golem.setLocationAndAngles(event.entity.posX, event.entity.posY, event.entity.posZ, 0, 0);

            event.world.spawnEntityInWorld(golem);
            event.entity.setDead();
        }
    }
}
项目:VillagerTweaks    文件:EntityEventHandler.java   
@SubscribeEvent
public void onLivingAttack(LivingAttackEvent event)
{
    Entity target = event.entity;


    if (target instanceof EntityGolem || event.source.getSourceOfDamage() instanceof EntityGolem) {
        LogHelper.info("== onLivingAttack() ==");
    }


    // NOTE: since the offensive enchantments apply special effect and don't just add more damage, 
    // I can intercept this event. If I were to do any damage modifier, the correct event is LivingHurtEvent.
    // NOTE 2: This code also works on LivingHurtEvent, but I feel it's more appropriate here.

    // An iron golem attacked a target, apply the offensive enchantments
    if (event.source.getDamageType() == "mob" && event.source.getSourceOfDamage() instanceof EntityIronGolem) {
        MagicHelper.applyAttackEffects(event.source.getSourceOfDamage(), target);
    }

    // A snow golem attacked a target, apply the offensive enchantments
    else if (event.source.getSourceOfDamage() instanceof EntitySnowball && ((EntitySnowball)event.source.getSourceOfDamage()).getThrower() instanceof EntitySnowman) {
        MagicHelper.applyAttackEffects(((EntitySnowball)event.source.getSourceOfDamage()).getThrower(), target);
    }


    // A golem was attacked by a target, check if should cancel the event
    if (target instanceof EntityGolem) {
        boolean ignoreDamage = MagicHelper.applyDamageCancelEffects(target, event.source);
        if (ignoreDamage) event.setCanceled(true);
    }

}
项目:VillagerTweaks    文件:EntityEventHandler.java   
@SubscribeEvent
public void onLivingHurt(LivingHurtEvent event)
{
    Entity target = event.entity;


    if (target instanceof EntityGolem || event.source.getSourceOfDamage() instanceof EntityGolem) {
        LogHelper.info("== onLivingHurt() ==");
        LogHelper.info("    " + event.entity);
        LogHelper.info("    source: " + event.source.getDamageType());
        LogHelper.info("    source: " + event.source.getSourceOfDamage());
        LogHelper.info("    damage: " + event.ammount);
    }



    // A golem was attacked, apply the defensive enchantments
    if (target instanceof EntityGolem) {
        event.ammount = MagicHelper.applyDefenseEffects(target, event.source, event.ammount);
    }

    // An iron golem caused damage, apply damage modifiers
    else if (event.source.getDamageType() == "mob" && event.source.getSourceOfDamage() instanceof EntityIronGolem) {
        event.ammount = MagicHelper.applyDamagingEffects(event.source.getSourceOfDamage(), target, event.ammount);
    }

    // A snow golem caused damage, apply damage modifiers
    else if (event.source.getSourceOfDamage() instanceof EntitySnowball && ((EntitySnowball)event.source.getSourceOfDamage()).getThrower() instanceof EntitySnowman) {
        event.ammount = MagicHelper.applyDamagingEffects(((EntitySnowball)event.source.getSourceOfDamage()).getThrower(), target, event.ammount);
    }

}
项目:VillagerTweaks    文件:ModVillagerTweaks.java   
@SuppressWarnings("unchecked")
@Mod.EventHandler
public void load(FMLInitializationEvent event)
{
    // Achievements
    MyAchievements.register();

    // Event Handlers
    MinecraftForge.EVENT_BUS.register(new PlayerEventHandler());
    MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
    MinecraftForge.EVENT_BUS.register(new WorldEventHandler());

    FMLCommonHandler.instance().bus().register(new TickEventHandler());

    // Entity renderer
    if (event.getSide() == Side.CLIENT) {
        Minecraft.getMinecraft().getRenderManager().entityRenderMap.remove(EntityIronGolem.class);
        Minecraft.getMinecraft().getRenderManager().entityRenderMap.put(EntityIronGolem.class, new RenderCrackedIronGolem(Minecraft.getMinecraft().getRenderManager()));

        Minecraft.getMinecraft().getRenderManager().entityRenderMap.remove(EntitySnowman.class);
        Minecraft.getMinecraft().getRenderManager().entityRenderMap.put(EntitySnowman.class, new RenderCustomSnowMan(Minecraft.getMinecraft().getRenderManager()));

        Minecraft.getMinecraft().getRenderManager().entityRenderMap.remove(EntityZombie.class);
        Minecraft.getMinecraft().getRenderManager().entityRenderMap.put(EntityZombie.class, new RenderZombieVillager(Minecraft.getMinecraft().getRenderManager()));
    }

    // Custom dispenser behavior
    LogHelper.debug("Overriding pumpkin dispenser behaviour");
    BlockDispenser.dispenseBehaviorRegistry.putObject(Item.getItemFromBlock(Blocks.pumpkin), new BehaviorMagicPumpkinDispense());

}
项目:iChunUtil    文件:HeadSnowman.java   
@Override
public float getEyeScale(EntitySnowman living, float partialTick, int eye)
{
    if(living.isPumpkinEquipped())
    {
        return eyeScale;
    }
    else
    {
        return eye == 0 ? 0.65F : 0.75F;
    }
}
项目:DecompiledMinecraft    文件:BlockPumpkin.java   
private void trySpawnGolem(World worldIn, BlockPos pos)
{
    BlockPattern.PatternHelper blockpattern$patternhelper;

    if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null)
    {
        for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
        {
            BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
            worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2);
        }

        EntitySnowman entitysnowman = new EntitySnowman(worldIn);
        BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
        entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entitysnowman);

        for (int j = 0; j < 120; ++j)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
        {
            BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
            worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air);
        }
    }
    else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null)
    {
        for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
        {
            for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
            {
                worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2);
            }
        }

        BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
        EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
        entityirongolem.setPlayerCreated(true);
        entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityirongolem);

        for (int j1 = 0; j1 < 120; ++j1)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
        {
            for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
            {
                BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
                worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:BlockPumpkin.java   
private void trySpawnGolem(World worldIn, BlockPos pos)
{
    BlockPattern.PatternHelper blockpattern$patternhelper;

    if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null)
    {
        for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
        {
            BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
            worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2);
        }

        EntitySnowman entitysnowman = new EntitySnowman(worldIn);
        BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
        entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entitysnowman);

        for (int j = 0; j < 120; ++j)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
        {
            BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
            worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air);
        }
    }
    else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null)
    {
        for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
        {
            for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
            {
                worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2);
            }
        }

        BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
        EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
        entityirongolem.setPlayerCreated(true);
        entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityirongolem);

        for (int j1 = 0; j1 < 120; ++j1)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
        {
            for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
            {
                BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
                worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:RenderManager.java   
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
    this.renderEngine = renderEngineIn;
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
    this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
    this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
    this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
    this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
    this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
    this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
    this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
    this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
    this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
    this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
    this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
    this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
    this.entityRenderMap.put(Entity.class, new RenderEntity(this));
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
    this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
    this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
    this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
    this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
    this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
    this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
    this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
    this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
    this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
    this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
    this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
    this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
    this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
    this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
    this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
    this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
    this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
    this.playerRenderer = new RenderPlayer(this);
    this.skinMap.put("default", this.playerRenderer);
    this.skinMap.put("slim", new RenderPlayer(this, true));
}
项目:DecompiledMinecraft    文件:RenderSnowMan.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntitySnowman entity)
{
    return snowManTextures;
}
项目:BaseClient    文件:BlockPumpkin.java   
private void trySpawnGolem(World worldIn, BlockPos pos)
{
    BlockPattern.PatternHelper blockpattern$patternhelper;

    if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null)
    {
        for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
        {
            BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
            worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2);
        }

        EntitySnowman entitysnowman = new EntitySnowman(worldIn);
        BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
        entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entitysnowman);

        for (int j = 0; j < 120; ++j)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
        {
            BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
            worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air);
        }
    }
    else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null)
    {
        for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
        {
            for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
            {
                worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2);
            }
        }

        BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
        EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
        entityirongolem.setPlayerCreated(true);
        entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityirongolem);

        for (int j1 = 0; j1 < 120; ++j1)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
        {
            for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
            {
                BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
                worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
            }
        }
    }
}
项目:BaseClient    文件:RenderManager.java   
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
    this.renderEngine = renderEngineIn;
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
    this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
    this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
    this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
    this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
    this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
    this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
    this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
    this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
    this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
    this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
    this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
    this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
    this.entityRenderMap.put(Entity.class, new RenderEntity(this));
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
    this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
    this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
    this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
    this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
    this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
    this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
    this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
    this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
    this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
    this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
    this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
    this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
    this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
    this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
    this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
    this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
    this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
    this.playerRenderer = new RenderPlayer(this);
    this.skinMap.put("default", this.playerRenderer);
    this.skinMap.put("slim", new RenderPlayer(this, true));
    PlayerItemsLayer.register(this.skinMap);

    if (Reflector.RenderingRegistry_loadEntityRenderers.exists())
    {
        Reflector.call(Reflector.RenderingRegistry_loadEntityRenderers, new Object[] {this.entityRenderMap});
    }
}
项目:BaseClient    文件:RenderSnowMan.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntitySnowman entity)
{
    return snowManTextures;
}
项目:BaseClient    文件:BlockPumpkin.java   
private void trySpawnGolem(World worldIn, BlockPos pos)
{
    BlockPattern.PatternHelper blockpattern$patternhelper;

    if ((blockpattern$patternhelper = this.getSnowmanPattern().match(worldIn, pos)) != null)
    {
        for (int i = 0; i < this.getSnowmanPattern().getThumbLength(); ++i)
        {
            BlockWorldState blockworldstate = blockpattern$patternhelper.translateOffset(0, i, 0);
            worldIn.setBlockState(blockworldstate.getPos(), Blocks.air.getDefaultState(), 2);
        }

        EntitySnowman entitysnowman = new EntitySnowman(worldIn);
        BlockPos blockpos1 = blockpattern$patternhelper.translateOffset(0, 2, 0).getPos();
        entitysnowman.setLocationAndAngles((double)blockpos1.getX() + 0.5D, (double)blockpos1.getY() + 0.05D, (double)blockpos1.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entitysnowman);

        for (int j = 0; j < 120; ++j)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOW_SHOVEL, (double)blockpos1.getX() + worldIn.rand.nextDouble(), (double)blockpos1.getY() + worldIn.rand.nextDouble() * 2.5D, (double)blockpos1.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int i1 = 0; i1 < this.getSnowmanPattern().getThumbLength(); ++i1)
        {
            BlockWorldState blockworldstate1 = blockpattern$patternhelper.translateOffset(0, i1, 0);
            worldIn.notifyNeighborsRespectDebug(blockworldstate1.getPos(), Blocks.air);
        }
    }
    else if ((blockpattern$patternhelper = this.getGolemPattern().match(worldIn, pos)) != null)
    {
        for (int k = 0; k < this.getGolemPattern().getPalmLength(); ++k)
        {
            for (int l = 0; l < this.getGolemPattern().getThumbLength(); ++l)
            {
                worldIn.setBlockState(blockpattern$patternhelper.translateOffset(k, l, 0).getPos(), Blocks.air.getDefaultState(), 2);
            }
        }

        BlockPos blockpos = blockpattern$patternhelper.translateOffset(1, 2, 0).getPos();
        EntityIronGolem entityirongolem = new EntityIronGolem(worldIn);
        entityirongolem.setPlayerCreated(true);
        entityirongolem.setLocationAndAngles((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.05D, (double)blockpos.getZ() + 0.5D, 0.0F, 0.0F);
        worldIn.spawnEntityInWorld(entityirongolem);

        for (int j1 = 0; j1 < 120; ++j1)
        {
            worldIn.spawnParticle(EnumParticleTypes.SNOWBALL, (double)blockpos.getX() + worldIn.rand.nextDouble(), (double)blockpos.getY() + worldIn.rand.nextDouble() * 3.9D, (double)blockpos.getZ() + worldIn.rand.nextDouble(), 0.0D, 0.0D, 0.0D, new int[0]);
        }

        for (int k1 = 0; k1 < this.getGolemPattern().getPalmLength(); ++k1)
        {
            for (int l1 = 0; l1 < this.getGolemPattern().getThumbLength(); ++l1)
            {
                BlockWorldState blockworldstate2 = blockpattern$patternhelper.translateOffset(k1, l1, 0);
                worldIn.notifyNeighborsRespectDebug(blockworldstate2.getPos(), Blocks.air);
            }
        }
    }
}
项目:BaseClient    文件:RenderManager.java   
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
    this.renderEngine = renderEngineIn;
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
    this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
    this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
    this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
    this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
    this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
    this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
    this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
    this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
    this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
    this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
    this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
    this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
    this.entityRenderMap.put(Entity.class, new RenderEntity(this));
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
    this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
    this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
    this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
    this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
    this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
    this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
    this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
    this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
    this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
    this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
    this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
    this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
    this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
    this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
    this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
    this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
    this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
    this.playerRenderer = new RenderPlayer(this);
    this.skinMap.put("default", this.playerRenderer);
    this.skinMap.put("slim", new RenderPlayer(this, true));
}
项目:BaseClient    文件:RenderSnowMan.java   
/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntitySnowman entity)
{
    return snowManTextures;
}
项目:connor41-etfuturum2    文件:NewSnowGolemRenderer.java   
@Override
protected void renderEquippedItems(EntitySnowman entity, float partialTickTime) {
    if (((EntityNewSnowGolem) entity).hasPumpkin())
        super.renderEquippedItems(entity, partialTickTime);
}