Java Code Examples for net.minecraft.entity.monster.EntityEnderman

The following are top voted examples for showing how to use net.minecraft.entity.monster.EntityEnderman. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: CustomWorldGen   File: LayerHeldBlock.java   Source Code and License 7 votes vote down vote up
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
Example 2
Project: Bewitchment   File: BlockSaltBarrier.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.UNDEAD)) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityLivingBase && (((EntityLivingBase) entityIn).getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD)) {
		entityIn.attackEntityFrom(DamageSource.MAGIC, 1);
	}
	if (entityIn instanceof EntityBlaze) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityEnderman) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityGhast) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
	if (entityIn instanceof EntityVex) {
		collidingBoxes.add(new AxisAlignedBB(pos).expand(0, 255, 0));
	}
}
 
Example 3
Project: ForgeHax   File: EntityUtils.java   Source Code and License 6 votes vote down vote up
/**
 * Checks if the mob could be possibly hostile towards us (we can't detect their attack target easily)
 * Current entities:
 *                  PigZombie: Aggressive if arms are raised, when arms are put down a internal timer is slowly ticked down from 400
 *                  Wolf: Aggressive if the owner isn't the local player and the wolf is angry
 *                  Enderman: Aggressive if making screaming sounds
 */
public static boolean isMobAggressive(Entity entity) {
    if(entity instanceof EntityPigZombie) {
        // arms raised = aggressive, angry = either game or we have set the anger cooldown
        if(((EntityPigZombie) entity).isArmsRaised() || ((EntityPigZombie) entity).isAngry()) {
            if(!((EntityPigZombie) entity).isAngry()) {
                // set pigmens anger to 400 if it hasn't been angered already
                FastReflection.Fields.EntityPigZombie_angerLevel.set((EntityPigZombie)entity, 400);
            }
            return true;
        }
    } else if(entity instanceof EntityWolf) {
        return ((EntityWolf) entity).isAngry() &&
                !MC.player.equals(((EntityWolf) entity).getOwner());
    } else if(entity instanceof EntityEnderman) {
        return ((EntityEnderman) entity).isScreaming();
    }
    return false;
}
 
Example 4
Project: BaseClient   File: LayerHeldBlock.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman 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)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate.getBlock().getMaterial() != Material.air)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
Example 5
Project: BaseClient   File: LayerEndermanEyes.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman 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)
{
    this.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
Example 6
Project: BaseClient   File: LayerHeldBlock.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman 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)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate.getBlock().getMaterial() != Material.air)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-f, -f, f);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.locationBlocksTexture);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
Example 7
Project: BaseClient   File: LayerEndermanEyes.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman 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)
{
    this.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
Example 8
Project: BaseClient   File: EntityRenderer.java   Source Code and License 6 votes vote down vote up
/**
 * What shader to use when spectating this entity
 */
public void loadEntityShader(Entity entityIn) {
	if (OpenGlHelper.shadersSupported) {
		if (this.theShaderGroup != null) {
			this.theShaderGroup.deleteShaderGroup();
		}

		this.theShaderGroup = null;

		if (entityIn instanceof EntityCreeper) {
			this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
		} else if (entityIn instanceof EntitySpider) {
			this.loadShader(new ResourceLocation("shaders/post/spider.json"));
		} else if (entityIn instanceof EntityEnderman) {
			this.loadShader(new ResourceLocation("shaders/post/invert.json"));
		}
	}
}
 
Example 9
Project: EndermanEvolution   File: ModEvents.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void onTargetSelect(LivingSetAttackTargetEvent e) {
	if (e.getEntityLiving() instanceof EntityEnderman && e.getTarget() instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) e.getTarget();
		ItemStack stack = player.inventory.armorInventory.get(3);
		boolean stopAttack = false;
		if (!stack.isEmpty() && stack.getItem() instanceof ItemSkullBase) {
			ItemSkullBase skull = (ItemSkullBase) stack.getItem();
			if (skull.isEndermanSkull()) {
				stopAttack = true;
			}
		}
		if (stopAttack) {
			((EntityLiving) e.getEntityLiving()).setAttackTarget(null);
		}
	}
}
 
Example 10
Project: Backmemed   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    IBlockState iblockstate = entity.getHeldBlockState();
    ModelEnderman modelenderman = this.getMainModel();
    modelenderman.isCarrying = iblockstate != null;
    modelenderman.isAttacking = entity.isScreaming();

    if (entity.isScreaming())
    {
        double d0 = 0.02D;
        x += this.rnd.nextGaussian() * 0.02D;
        z += this.rnd.nextGaussian() * 0.02D;
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 11
Project: Backmemed   File: LayerHeldBlock.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
Example 12
Project: CustomWorldGen   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    IBlockState iblockstate = entity.getHeldBlockState();
    this.endermanModel.isCarrying = iblockstate != null;
    this.endermanModel.isAttacking = entity.isScreaming();

    if (entity.isScreaming())
    {
        double d0 = 0.02D;
        x += this.rnd.nextGaussian() * 0.02D;
        z += this.rnd.nextGaussian() * 0.02D;
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 13
Project: CustomWorldGen   File: LayerEndermanEyes.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
Example 14
Project: ExtraUtilities   File: EventHandlerServer.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void magnumTorchDenyTeleport(final EnderTeleportEvent event) {
    if (event.entityLiving instanceof EntityEnderman && !((EntityEnderman)event.entityLiving).isScreaming()) {
        for (final int[] coord : EventHandlerServer.magnumTorchRegistry) {
            if (coord[0] == event.entity.worldObj.provider.dimensionId && event.entity.worldObj.blockExists(coord[1], coord[2], coord[3]) && event.entity.worldObj.getTileEntity(coord[1], coord[2], coord[3]) instanceof IAntiMobTorch) {
                final TileEntity tile = event.entity.worldObj.getTileEntity(coord[1], coord[2], coord[3]);
                final double dx = tile.xCoord + 0.5f - event.targetX;
                final double dy = tile.yCoord + 0.5f - event.targetY;
                final double dz = tile.zCoord + 0.5f - event.targetZ;
                if ((dx * dx + dz * dz) / ((IAntiMobTorch)tile).getHorizontalTorchRangeSquared() + dy * dy / ((IAntiMobTorch)tile).getVerticalTorchRangeSquared() > 1.0) {
                    continue;
                }
                final double dx2 = tile.xCoord + 0.5f - event.entity.posX;
                final double dy2 = tile.yCoord + 0.5f - event.entity.posY;
                final double dz2 = tile.zCoord + 0.5f - event.entity.posZ;
                if (dx * dx + dy * dy + dz * dz >= dx2 * dx2 + dy2 * dy2 + dz2 * dz2) {
                    continue;
                }
                event.setCanceled(true);
            }
        }
    }
}
 
Example 15
Project: ExtraUtilities   File: BlockEnderLily.java   Source Code and License 6 votes vote down vote up
public void onEntityCollidedWithBlock(final World par1World, final int par2, final int par3, final int par4, final Entity par5Entity) {
    if (par1World.getBlockMetadata(par2, par3, par4) >= 3) {
        if (par5Entity instanceof EntityItem) {
            final ItemStack item = ((EntityItem)par5Entity).getEntityItem();
            if (item != null && (item.getItem() == this.getSeedItem() || item.getItem() == this.getCropItem())) {
                return;
            }
            if (par1World.isRemote) {
                par1World.spawnParticle("crit", par5Entity.posX, par5Entity.posY, par5Entity.posZ, 0.0, 0.0, 0.0);
            }
        }
        if (par5Entity instanceof EntityEnderman) {
            return;
        }
        par5Entity.attackEntityFrom(DamageSource.cactus, 0.1f);
    }
}
 
Example 16
Project: 4Space-5   File: ChunkProviderAsteroids.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int i, int j, int k)
{
    if (par1EnumCreatureType == EnumCreatureType.monster)
    {
        final List monsters = new ArrayList();
        monsters.add(new SpawnListEntry(EntityEvolvedZombie.class, 3000, 1, 3));
        monsters.add(new SpawnListEntry(EntityEvolvedSpider.class, 2000, 1, 2));
        monsters.add(new SpawnListEntry(EntityEvolvedSkeleton.class, 1500, 1, 1));
        monsters.add(new SpawnListEntry(EntityEvolvedCreeper.class, 2000, 1, 1));
        if (ConfigManagerCore.challengeMode) monsters.add(new SpawnListEntry(EntityEnderman.class, 250, 1, 1));
        return monsters;
    }
    else
    {
        return null;
    }
}
 
Example 17
Project: CrystalMod   File: ModEntites.java   Source Code and License 6 votes vote down vote up
public static void postInit(){
	addToBiomes(EntityCrystalPigZombie.class, 50, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityPigZombie.class, EnumCreatureType.MONSTER));
	addToBiomes(EntityCrystalCow.class, 6, 1, 4, EnumCreatureType.CREATURE, getBiomesThatCanSpawn(EntityCow.class, EnumCreatureType.CREATURE));
	addToBiomes(EntityCrystalEnderman.class, 8, 1, 4, EnumCreatureType.MONSTER, getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER));
	
	List<Biome> angelBiomeList = getBiomesThatCanSpawn(EntityEnderman.class, EnumCreatureType.MONSTER);
	Biome hell = Biome.REGISTRY.getObject(new ResourceLocation("hell"));
	Biome sky = Biome.REGISTRY.getObject(new ResourceLocation("sky"));
	
	if(sky !=null){
		angelBiomeList.remove(sky);
	}
	
	if(hell !=null){
		angelBiomeList.remove(hell);
		List<Biome> listHell = Lists.newArrayList(hell);
		addToBiomes(EntityAngel.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
		addToBiomes(EntityDevil.class, 50, 4, 4, EnumCreatureType.MONSTER, listHell);
	}
	
	addToBiomes(EntityAngel.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
	addToBiomes(EntityDevil.class, 8, 1, 4, EnumCreatureType.MONSTER, angelBiomeList);
}
 
Example 18
Project: Restructured   File: MobControl.java   Source Code and License 6 votes vote down vote up
public static void initialize() {
	setup(EnumCreatureType.AMBIENT, ModOptions.getMobSpawnAmbientFactor());
	setup(EnumCreatureType.CREATURE, ModOptions.getMobSpawnAnimalFactor());
	setup(EnumCreatureType.MONSTER, ModOptions.getMobSpawnMobFactor());
	setup(EnumCreatureType.WATER_CREATURE, ModOptions.getMobSpawnWaterFactor());

	if (BLOCK_CREEPER_BLOCK_DAMAGE || BLOCK_MOB_TREE_SPAWNING) {
		if (BLOCK_CREEPER_BLOCK_DAMAGE)
			ModLog.info("Blocking Creeper block damage");
		if (BLOCK_MOB_TREE_SPAWNING)
			ModLog.info("Blocking mob tree spawning");
		MinecraftForge.EVENT_BUS.register(new MobControl());
	}

	if (ModOptions.getBlockEndermanGriefing()) {
		try {
			final Field carriable = ReflectionHelper.findField(EntityEnderman.class, "carriable");
			if (carriable != null) {
				carriable.set(null, new IdentityHashMap<Block, Boolean>());
				ModLog.info("Blocking Enderman griefing");
			}
		} catch (final Exception ex) {
			ModLog.warn("Unable to access Enderman block table");
		}
	}
}
 
Example 19
Project: Kingdom-Keys-Re-Coded   File: DriveFormFinal.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public static void getXP(LivingDeathEvent event) {
	 if (!event.getEntity().world.isRemote && event.getEntity() instanceof EntityEnderman) { 
		 if (event.getSource().getTrueSource() instanceof EntityPlayer) {
            EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
            IDriveState DRIVE = player.getCapability(ModCapabilities.DRIVE_STATE, null); 

            if(DRIVE.getActiveDriveName().equals(Strings.Form_Final)) {
            	DRIVE.setDriveExp(DRIVE.getActiveDriveName(), DRIVE.getDriveExp(DRIVE.getActiveDriveName())+1);
	          
	            int[] costs = DriveFormRegistry.get(DRIVE.getActiveDriveName()).getExpCosts();
	            int actualLevel = DRIVE.getDriveLevel(DRIVE.getActiveDriveName());
	            int actualExp = DRIVE.getDriveExp(DRIVE.getActiveDriveName());
	           
	            if(costs.length == 7 && actualLevel < 7) {
	            	if (actualExp >= costs[actualLevel]){
	            		System.out.println("LEVEL UP");
	            		DRIVE.setDriveLevel(DRIVE.getActiveDriveName(),actualLevel+1); 
	                    DRIVE.displayLevelUpMessage(player, DRIVE.getActiveDriveName());
	            	}
	            }
	            PacketDispatcher.sendTo(new SyncDriveData(DRIVE), (EntityPlayerMP) player);
			 }
		 }
	 }
}
 
Example 20
Project: Cyclic   File: MobDropChangesModule.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void onLivingDropsEvent(LivingDropsEvent event) {
  Entity entity = event.getEntity();
  World world = entity.getEntityWorld();
  if (nameTagDeath) {
    if (entity.getCustomNameTag() != null && entity.getCustomNameTag() != "") {
      // item stack NBT needs the name enchanted onto it
      if (world.isRemote == false) {
        ItemStack nameTag = UtilNBT.buildEnchantedNametag(entity.getCustomNameTag());
        UtilItemStack.dropItemStackInWorld(world, entity.getPosition(), nameTag);
      }
    }
  }
  if (endermanDrop && entity instanceof EntityEnderman) {
    EntityEnderman mob = (EntityEnderman) entity;
    IBlockState bs = mob.getHeldBlockState();// mob.func_175489_ck();
    if (bs != null && bs.getBlock() != null && world.isRemote == false) {
      UtilItemStack.dropItemStackInWorld(world, mob.getPosition(), bs.getBlock());
    }
  }
}
 
Example 21
Project: ScottsTweaks   File: EnderDumper.java   Source Code and License 6 votes vote down vote up
private static void dumpEnderman(EntityEnderman enderman, List<EntityItem> drops)
{
    final Settings settings = Settings.INSTANCE;

    if (settings.doEndermenDrops())
    {
        final Block block = enderman.func_146080_bZ();
        if (block.getMaterial().equals(Material.air)) return;

        final int metadata = enderman.getCarryingData();
        final ItemStack itemStack = new ItemStack(block.equals(Blocks.grass) ? Blocks.dirt : block, 1, metadata);

        final EntityItem entityItem =
                new EntityItem(enderman.worldObj, enderman.posX, enderman.posY, enderman.posZ, itemStack);
        drops.add(entityItem);
        enderman.func_146081_a(Blocks.air);
        enderman.setCarryingData(0);
    }
}
 
Example 22
Project: Resilience-Client-Source   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
protected void renderEquippedItems(EntityEnderman par1EntityEnderman, float par2)
{
    super.renderEquippedItems(par1EntityEnderman, par2);

    if (par1EntityEnderman.func_146080_bZ().getMaterial() != Material.air)
    {
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glPushMatrix();
        float var3 = 0.5F;
        GL11.glTranslatef(0.0F, 0.6875F, -0.75F);
        var3 *= 1.0F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-var3, -var3, var3);
        int var4 = par1EntityEnderman.getBrightnessForRender(par2);
        int var5 = var4 % 65536;
        int var6 = var4 / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindTexture(TextureMap.locationBlocksTexture);
        this.field_147909_c.renderBlockAsItem(par1EntityEnderman.func_146080_bZ(), par1EntityEnderman.getCarryingData(), 1.0F);
        GL11.glPopMatrix();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }
}
 
Example 23
Project: AdvancedRocketry   File: BiomeGenWatermelon.java   Source Code and License 6 votes vote down vote up
public BiomeGenWatermelon(int biomeId, boolean register) {
	super(biomeId, register);
	
	//cold and dry
	
	enableRain = true;
	enableSnow = false;
	rootHeight=1f;
	heightVariation=0.1f;
	rainfall = 0f;
	temperature = 0.9f;
	this.theBiomeDecorator.generateLakes=false;
	this.theBiomeDecorator.flowersPerChunk=0;
	this.theBiomeDecorator.grassPerChunk=0;
	this.theBiomeDecorator.treesPerChunk=0;
	this.fillerBlock = this.topBlock = Blocks.melon_block;
	this.biomeName="Hot Dry Rock";
	
	this.spawnableMonsterList.clear();
	this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 10));
}
 
Example 24
Project: RidiculousWorld   File: BiomeGenMadness.java   Source Code and License 6 votes vote down vote up
public BiomeGenMadness(int id)
{
    super(id);
    this.spawnableCreatureList.clear();
    this.theBiomeDecorator.treesPerChunk = -1;
    this.theBiomeDecorator.grassPerChunk = -1;
    this.theBiomeDecorator.mushroomsPerChunk = -1;
    this.topBlock = Blocks.packed_ice;
    this.fillerBlock = Blocks.packed_ice;
    this.spawnableCreatureList.clear();
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityShoggoth.class, 90, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 30, 1, 4));
    BiomeManager.addBiome(BiomeManager.BiomeType.ICY, new BiomeManager.BiomeEntry(this, Config.madnessWeight));
    BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeManager.BiomeEntry(this, Config.madnessWeight));
    BiomeManager.addStrongholdBiome(this);
    BiomeDictionary.registerBiomeType(this, BiomeDictionary.Type.COLD, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.MOUNTAIN, BiomeDictionary.Type.SNOWY);
    setBiomeName("Mountain of Madness");
    setTemperatureRainfall(0.05F, 0.5F);
    this.setHeight(BiomeGenBase.height_HighPlateaus);
    this.setColor(0x0E875B);
    this.waterColorMultiplier = 0x004A07;
}
 
Example 25
Project: GalacticraftPixelGalaxy   File: ChunkProviderGreenPixel.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings({"unchecked","rawtypes"}) 
@Override public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType,int i,int j,int k){
	  if (par1EnumCreatureType == EnumCreatureType.monster) 
	{
	    List monsters=new ArrayList();
	    monsters.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 3));
        monsters.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 8, 2, 3));
        monsters.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 8, 2, 3));
        monsters.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 8, 2, 3));
        monsters.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 8, 1, 3));
        monsters.add(new BiomeGenBase.SpawnListEntry(EntityPixelOneSwingman.class, 1, 1, 1));
	    return monsters;
	}
	if (par1EnumCreatureType == EnumCreatureType.creature) 
	{
		List creatures=new ArrayList();
		creatures.add(new BiomeGenBase.SpawnListEntry(EntityhumanPixel.class, 8, 2, 3));
		creatures.add(new BiomeGenBase.SpawnListEntry(EntitypixelPig.class, 8, 1, 3));
		creatures.add(new BiomeGenBase.SpawnListEntry(EntitypixelCow.class, 8, 1, 3));
		return creatures;
		}
	  return null;
	}
 
Example 26
Project: D3Core   File: EventHandler.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public static void entityDeathEvent(LivingDropsEvent event)
{
    if (event.getEntityLiving() instanceof EntityPlayer && claysTortureMode)
    {
        event.setCanceled(true);
    }
    else if (event.getEntityLiving() instanceof EntityEnderman && EndermanGriefing.dropCarrying)
    {
        EntityEnderman entityEnderman = ((EntityEnderman) event.getEntityLiving());
        IBlockState state = entityEnderman.getHeldBlockState();
        if (state != null && state.getBlock() != Blocks.AIR)
        {
            ItemStack stack = new ItemStack(state.getBlock(), 1, state.getBlock().getMetaFromState(state));
            event.getDrops().add(new EntityItem(entityEnderman.world, entityEnderman.posX, entityEnderman.posY, entityEnderman.posZ, stack));
        }
    }
}
 
Example 27
Project: ExpandedRailsMod   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    IBlockState iblockstate = entity.getHeldBlockState();
    this.endermanModel.isCarrying = iblockstate != null;
    this.endermanModel.isAttacking = entity.isScreaming();

    if (entity.isScreaming())
    {
        double d0 = 0.02D;
        x += this.rnd.nextGaussian() * 0.02D;
        z += this.rnd.nextGaussian() * 0.02D;
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 28
Project: ExpandedRailsMod   File: LayerHeldBlock.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
Example 29
Project: ExpandedRailsMod   File: LayerEndermanEyes.java   Source Code and License 6 votes vote down vote up
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
Example 30
Project: Farrago   File: EntityBlunderbussProjectile.java   Source Code and License 6 votes vote down vote up
@Override
protected void onImpact(MovingObjectPosition pos) {
	if (pos.entityHit instanceof EntityEnderman) return;
	if (pos.typeOfHit == MovingObjectType.BLOCK) {
		if (worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ).getMaterial().isReplaceable()) return;
	}
	setDead();
	if (!worldObj.isRemote) {
		if (pos.entityHit != null && pos.entityHit instanceof EntityLivingBase) {
			float min = (float)FarragoMod.config.getDouble("blunderbuss.damage.min");
			float max = (float)FarragoMod.config.getDouble("blunderbuss.damage.max");
			((EntityLivingBase)pos.entityHit).attackEntityFrom(new EntityDamageSourceIndirect("blunderbuss", this, getThrower()), (rand.nextFloat()*(max-min))+min);
			((EntityLivingBase)pos.entityHit).hurtResistantTime = 1;
		}
		if (worldObj instanceof WorldServer) {
			((WorldServer)worldObj).func_147487_a("smoke", pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 1, 0.2f, 0.2f, 0.2f, 0f);
			((WorldServer)worldObj).playSoundAtEntity(this, "step.stone", 0.5f, 0.3f);
		}
	}
}
 
Example 31
Project: SecurityCraft   File: BlockFullMineBase.java   Source Code and License 6 votes vote down vote up
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity){
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
 }
 
Example 32
Project: SecurityCraft   File: BlockMine.java   Source Code and License 6 votes vote down vote up
/**
  * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
  */
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
 	if(par1World.isRemote){
 		return;
 	}else{
 	
 		if(par5Entity instanceof EntityCreeper || par5Entity instanceof EntityOcelot || par5Entity instanceof EntityEnderman || par5Entity instanceof EntityItem){
 			return;
 		}else{
 			this.explode(par1World, par2, par3, par4);
 		}
 		
 	}
 
 	
}
 
Example 33
Project: Quantum-Anomalies   File: BiomeEndAnomaly.java   Source Code and License 6 votes vote down vote up
public BiomeEndAnomaly(int id) {
    super(id);
    this.setBiomeName("End Anomaly");

    this.rootHeight = -1F;
    this.heightVariation = 3F;

    this.setColor(16711935);
    this.setDisableRain();

    this.func_76733_a(5470985).setTemperatureRainfall(0.9F, 1.0F);

    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCaveCreatureList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4));
    this.topBlock = Blocks.end_stone;
    this.fillerBlock = Blocks.end_stone;
    this.theBiomeDecorator = new BiomeAnomalyDecorator();
}
 
Example 34
Project: Cauldron   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
protected void renderEquippedItems(EntityEnderman p_77029_1_, float p_77029_2_)
{
    super.renderEquippedItems(p_77029_1_, p_77029_2_);

    if (p_77029_1_.func_146080_bZ().getMaterial() != Material.air)
    {
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glPushMatrix();
        float f1 = 0.5F;
        GL11.glTranslatef(0.0F, 0.6875F, -0.75F);
        f1 *= 1.0F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-f1, -f1, f1);
        int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindTexture(TextureMap.locationBlocksTexture);
        this.field_147909_c.renderBlockAsItem(p_77029_1_.func_146080_bZ(), p_77029_1_.getCarryingData(), 1.0F);
        GL11.glPopMatrix();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }
}
 
Example 35
Project: Cauldron   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
protected void renderEquippedItems(EntityEnderman p_77029_1_, float p_77029_2_)
{
    super.renderEquippedItems(p_77029_1_, p_77029_2_);

    if (p_77029_1_.func_146080_bZ().getMaterial() != Material.air)
    {
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glPushMatrix();
        float f1 = 0.5F;
        GL11.glTranslatef(0.0F, 0.6875F, -0.75F);
        f1 *= 1.0F;
        GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
        GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(-f1, -f1, f1);
        int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindTexture(TextureMap.locationBlocksTexture);
        this.field_147909_c.renderBlockAsItem(p_77029_1_.func_146080_bZ(), p_77029_1_.getCarryingData(), 1.0F);
        GL11.glPopMatrix();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    }
}
 
Example 36
Project: ZeldaSwordSkills   File: ZSSItemEvents.java   Source Code and License 6 votes vote down vote up
private static void init() {
	addDrop(EntityCreeper.class, SkillBase.armorBreak);
	addDrop(EntityIronGolem.class, SkillBase.armorBreak);
	addDrop(EntitySilverfish.class, SkillBase.dash);
	addDrop(EntityHorse.class, SkillBase.dash);
	addDrop(EntityEnderman.class, SkillBase.dodge);
	addDrop(EntityKeese.class, SkillBase.dodge);
	addDrop(EntitySpider.class, SkillBase.endingBlow);
	addDrop(EntityCaveSpider.class, SkillBase.leapingBlow);
	addDrop(EntityMagmaCube.class, SkillBase.leapingBlow);
	addDrop(EntityPigZombie.class, SkillBase.parry);
	addDrop(EntityOcelot.class, SkillBase.parry);
	addDrop(EntityOctorok.class, SkillBase.risingCut);
	addDrop(EntityBlaze.class, SkillBase.spinAttack);
	addDrop(EntityDarknut.class, SkillBase.spinAttack);
	addDrop(EntityZombie.class, SkillBase.swordBasic);
	addDrop(EntitySkeleton.class, SkillBase.swordBasic);
	addDrop(EntityGhast.class, SkillBase.swordBeam);
	addDrop(EntityWitch.class, SkillBase.swordBeam);
	addDrop(EntityWizzrobe.class, SkillBase.swordBreak);
}
 
Example 37
Project: RuneCraftery   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
protected void func_77076_a(EntityEnderman p_77076_1_, float p_77076_2_) {
   super.func_77029_c(p_77076_1_, p_77076_2_);
   if(p_77076_1_.func_70822_p() > 0) {
      GL11.glEnable('\u803a');
      GL11.glPushMatrix();
      float var3 = 0.5F;
      GL11.glTranslatef(0.0F, 0.6875F, -0.75F);
      var3 *= 1.0F;
      GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
      GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
      GL11.glScalef(-var3, -var3, var3);
      int var4 = p_77076_1_.func_70070_b(p_77076_2_);
      int var5 = var4 % 65536;
      int var6 = var4 / 65536;
      OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)var5 / 1.0F, (float)var6 / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      this.func_110776_a(TextureMap.field_110575_b);
      this.field_76988_d.func_78600_a(Block.field_71973_m[p_77076_1_.func_70822_p()], p_77076_1_.func_70824_q(), 1.0F);
      GL11.glPopMatrix();
      GL11.glDisable('\u803a');
   }

}
 
Example 38
Project: RuneCraftery   File: RenderEnderman.java   Source Code and License 6 votes vote down vote up
protected int func_77074_a(EntityEnderman p_77074_1_, int p_77074_2_, float p_77074_3_) {
   if(p_77074_2_ != 0) {
      return -1;
   } else {
      this.func_110776_a(field_110840_a);
      float var4 = 1.0F;
      GL11.glEnable(3042);
      GL11.glDisable(3008);
      GL11.glBlendFunc(1, 1);
      GL11.glDisable(2896);
      if(p_77074_1_.func_82150_aj()) {
         GL11.glDepthMask(false);
      } else {
         GL11.glDepthMask(true);
      }

      char var5 = '\uf0f0';
      int var6 = var5 % 65536;
      int var7 = var5 / 65536;
      OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float)var6 / 1.0F, (float)var7 / 1.0F);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      GL11.glEnable(2896);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, var4);
      return 1;
   }
}
 
Example 39
Project: The-Derpy-Shiz-Mod   File: WuerfeliumSword.java   Source Code and License 6 votes vote down vote up
@Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int p_77663_4_, boolean inHand) {
	super.onUpdate(stack,worldIn,entityIn,p_77663_4_,inHand);
	if (inHand && worldIn.getTotalWorldTime() % 10 == 0) {
		boolean found = false;
		AxisAlignedBB box = AxisAlignedBB.getBoundingBox(entityIn.posX-10,entityIn.posY-5,entityIn.posZ-10,entityIn.posX+10,entityIn.posY+5,entityIn.posZ+10);
		List list = worldIn.getEntitiesWithinAABB(IMob.class, box);
		for (int i = 0;i < list.size() && !found; i++) {
			Entity e = (Entity)list.get(i);
			if (e instanceof IMob && !(e instanceof EntityEnderman)) {
				found = true;
			}
		}
		 NBTTagCompound tag = stack.getTagCompound();
		 if (tag == null) tag = new NBTTagCompound();
		 tag.setBoolean("active", found);
		 stack.setTagCompound(tag);
	}
}
 
Example 40
Project: PneumaticCraft   File: HackableHandler.java   Source Code and License 6 votes vote down vote up
public static void addDefaultEntries(){
    PneumaticRegistry.getInstance().addHackable(Blocks.tnt, HackableTNT.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.mob_spawner, HackableMobSpawner.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.lever, HackableLever.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.stone_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_door, HackableDoor.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.tripwire_hook, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dispenser, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dropper, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blockss.securityStation, HackableSecurityStation.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.monster_egg, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.noteblock, HackableNoteblock.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.jukebox, HackableJukebox.class);

    PneumaticRegistry.getInstance().addHackable(EntityCreeper.class, HackableCreeper.class);
    PneumaticRegistry.getInstance().addHackable(EntityTameable.class, HackableTameable.class);
    PneumaticRegistry.getInstance().addHackable(EntityCow.class, HackableCow.class);
    PneumaticRegistry.getInstance().addHackable(EntityCaveSpider.class, HackableCaveSpider.class);
    PneumaticRegistry.getInstance().addHackable(EntityBlaze.class, HackableBlaze.class);
    PneumaticRegistry.getInstance().addHackable(EntityGhast.class, HackableGhast.class);
    PneumaticRegistry.getInstance().addHackable(EntityWitch.class, HackableWitch.class);
    PneumaticRegistry.getInstance().addHackable(EntityLiving.class, HackableLivingDisarm.class);
    PneumaticRegistry.getInstance().addHackable(EntityEnderman.class, HackableEnderman.class);
    PneumaticRegistry.getInstance().addHackable(EntityBat.class, HackableBat.class);
}
 
Example 41
Project: EnderIO   File: ItemDarkSteelSword.java   Source Code and License 6 votes vote down vote up
private ItemStack getSkullForEntity(EntityLivingBase entityLiving) {
  // ItemSkull: {"skeleton", "wither", "zombie", "char", "creeper", "dragon"}
  if (entityLiving instanceof EntitySkeleton) {
    return new ItemStack(Items.SKULL, 1, 0);
  } else if (entityLiving instanceof EntityWitherSkeleton) {
    return new ItemStack(Items.SKULL, 1, 1);
  } else if (entityLiving.getClass() == EntityZombie.class) { // sic! not PigZombie, ZombieVillager or Husk
    return new ItemStack(Items.SKULL, 1, 2);
  } else if (entityLiving instanceof EntityCreeper) {
    return new ItemStack(Items.SKULL, 1, 4);
  } else if (entityLiving instanceof EntityEnderman) {
    return new ItemStack(blockEndermanSkull.getBlockNN());
  }

  return null;
}
 
Example 42
Project: Loot-Slash-Conquer   File: DungeonHelper.java   Source Code and License 5 votes vote down vote up
private static ResourceLocation getRandomMonster()
{
	ArrayList<ResourceLocation> entities = new ArrayList<ResourceLocation>();
	
	entities.add(EntityList.getKey(EntityZombie.class));
	entities.add(EntityList.getKey(EntitySpider.class));
	entities.add(EntityList.getKey(EntitySkeleton.class));
	entities.add(EntityList.getKey(EntityEnderman.class));
	entities.add(EntityList.getKey(EntityCreeper.class));
	entities.add(EntityList.getKey(EntityCaveSpider.class));
	
	return entities.get((int) (Math.random() * entities.size()));
}
 
Example 43
Project: harshencastle   File: EntitySoullessKnight.java   Source Code and License 5 votes vote down vote up
public EntitySoullessKnight(World worldIn) {
	super(worldIn);
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(0, new EntityAIAttackMelee(this, 1d, true));
	this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEnderman.class, 50f, 1d, 2d));
	this.tasks.addTask(0, new AIEntityWanderNoWater(this, 1d, 0));
	this.tasks.addTask(0, new EntityAIMoveTowardsTarget(this, 1d, 100));
	
	this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
       this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));
	
	this.experienceValue = 50;
}
 
Example 44
Project: harshencastle   File: EntityHarshenSoul.java   Source Code and License 5 votes vote down vote up
@Override
protected void initEntityAI() {
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(0, new EntityAIAttackMelee(this, 1d, true));
	this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEnderman.class, 10f, 1d, 1.2d));
	this.tasks.addTask(0, new EntityAIWanderAvoidWater(this, 0.35));
	this.tasks.addTask(0, new EntityAIMoveTowardsTarget(this, 0.5d, 100));
	
	this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
}
 
Example 45
Project: harshencastle   File: PontusBiome.java   Source Code and License 5 votes vote down vote up
public PontusBiome() {
	super("Pontus");
	
	this.spawnableCaveCreatureList.clear();
	this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityEnderman.class, 25, 2, 5));
	
	this.spawnableCreatureList.clear();
	this.spawnableCreatureList.add(new SpawnListEntry(EntityEndermite.class, 50, 1, 10));	
}
 
Example 46
Project: BaseClient   File: BiomeGenEnd.java   Source Code and License 5 votes vote down vote up
public BiomeGenEnd(int p_i1990_1_)
{
    super(p_i1990_1_);
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCaveCreatureList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4));
    this.topBlock = Blocks.dirt.getDefaultState();
    this.fillerBlock = Blocks.dirt.getDefaultState();
    this.theBiomeDecorator = new BiomeEndDecorator();
}
 
Example 47
Project: BaseClient   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 48
Project: BaseClient   File: RenderEnderman.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    this.endermanModel.isCarrying = entity.getHeldBlockState().getBlock().getMaterial() != Material.air;
    this.endermanModel.isAttacking = entity.isScreaming();

    if (entity.isScreaming())
    {
        double d0 = 0.02D;
        x += this.rnd.nextGaussian() * d0;
        z += this.rnd.nextGaussian() * d0;
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 49
Project: BaseClient   File: EntityRenderer.java   Source Code and License 5 votes vote down vote up
/**
 * What shader to use when spectating this entity
 */
public void loadEntityShader(Entity entityIn)
{
    if (OpenGlHelper.shadersSupported)
    {
        if (this.theShaderGroup != null)
        {
            this.theShaderGroup.deleteShaderGroup();
        }

        this.theShaderGroup = null;

        if (entityIn instanceof EntityCreeper)
        {
            this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
        }
        else if (entityIn instanceof EntitySpider)
        {
            this.loadShader(new ResourceLocation("shaders/post/spider.json"));
        }
        else if (entityIn instanceof EntityEnderman)
        {
            this.loadShader(new ResourceLocation("shaders/post/invert.json"));
        }
        else if (Reflector.ForgeHooksClient_loadEntityShader.exists())
        {
            Reflector.call(Reflector.ForgeHooksClient_loadEntityShader, new Object[] {entityIn, this});
        }
    }
}
 
Example 50
Project: BaseClient   File: BiomeGenEnd.java   Source Code and License 5 votes vote down vote up
public BiomeGenEnd(int p_i1990_1_)
{
    super(p_i1990_1_);
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCaveCreatureList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4));
    this.topBlock = Blocks.dirt.getDefaultState();
    this.fillerBlock = Blocks.dirt.getDefaultState();
    this.theBiomeDecorator = new BiomeEndDecorator();
}
 
Example 51
Project: BaseClient   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 52
Project: BaseClient   File: RenderEnderman.java   Source Code and License 5 votes vote down vote up
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityEnderman entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    this.endermanModel.isCarrying = entity.getHeldBlockState().getBlock().getMaterial() != Material.air;
    this.endermanModel.isAttacking = entity.isScreaming();

    if (entity.isScreaming())
    {
        double d0 = 0.02D;
        x += this.rnd.nextGaussian() * d0;
        z += this.rnd.nextGaussian() * d0;
    }

    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
Example 53
Project: connor41-etfuturum2   File: EntityEndermite.java   Source Code and License 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public void onLivingUpdate() {
	super.onLivingUpdate();

	if (worldObj.isRemote)
		for (int i = 0; i < 2; i++)
			worldObj.spawnParticle("portal", posX + (rand.nextDouble() - 0.5D) * width, posY + rand.nextDouble() * height, posZ + (rand.nextDouble() - 0.5D) * width, (rand.nextDouble() - 0.5D) * 2.0D, -rand.nextDouble(), (rand.nextDouble() - 0.5D) * 2.0D);
	else {
		if (!isNoDespawnRequired())
			lifetime++;

		if (lifetime >= 2400)
			setDead();
	}

	if (isSpawnedByPlayer()) {
		double range = 64;
		double radius = range / 2.0;
		int tagetChance = 10;
		if (rand.nextInt(tagetChance) != 0) {
			List<EntityEnderman> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - radius, posY - 4, posZ - radius, posX + radius, posY + 4, posZ + radius), new IEntitySelector() {
				@Override
				public boolean isEntityApplicable(Entity entity) {
					return entity instanceof EntityEnderman;
				}
			});
			Collections.sort(list, sorter);
			if (!list.isEmpty()) {
				EntityEnderman enderman = list.get(0);
				enderman.setTarget(this);
			}
		}
	}
}
 
Example 54
Project: EndermanEvolution   File: ModEntities.java   Source Code and License 5 votes vote down vote up
private static Biome[] getBiomeList() {
	List<Biome> biomes = new ArrayList<Biome>();
	List<Biome> biomeList = BiomeUtils.getBiomeList();
	for (Biome currentBiome : biomeList) {
		List<SpawnListEntry> spawnList = currentBiome.getSpawnableList(EnumCreatureType.MONSTER);
		for (SpawnListEntry spawnEntry : spawnList) {
			if (spawnEntry.entityClass == EntityEnderman.class) {
				biomes.add(currentBiome);
			}
		}
	}
	return biomes.toArray(new Biome[biomes.size()]);
}
 
Example 55
Project: EndermanEvolution   File: ModEvents.java   Source Code and License 5 votes vote down vote up
@SubscribeEvent
public void onLiving(LivingEvent.LivingUpdateEvent e) {
	if (e.getEntityLiving() instanceof EntityEnderman) {
		EntityEnderman enderman = (EntityEnderman) e.getEntityLiving();
		if (enderman.getAttackTarget() == null) {
			MCPrivateUtils.setEndermanScreaming(enderman, false);
		}
	}
}
 
Example 56
Project: EndermanEvolution   File: EntityUtils.java   Source Code and License 5 votes vote down vote up
public static ItemStack getSkullDrop(EntityLivingBase entity) {
	if (entity instanceof EntitySkeleton) {
		return new ItemStack(Items.SKULL, 1, 0);
	}
	if (entity instanceof EntityWitherSkeleton) {
		return new ItemStack(Items.SKULL, 1, 1);
	}
	if (entity instanceof EntityZombie) {
		return new ItemStack(Items.SKULL, 1, 2);
	}
	if (entity instanceof EntityCreeper) {
		return new ItemStack(Items.SKULL, 1, 4);
	}
	if (entity instanceof EntityPlayer) {
		ItemStack head = new ItemStack(Items.SKULL, 1, 3);
		NBTTagCompound nametag = new NBTTagCompound();
		nametag.setString("SkullOwner", entity.getDisplayName().getFormattedText());
		head.setTagCompound(nametag);
		return head;
	}
	if (entity instanceof EntityDragon) {
		return new ItemStack(Items.SKULL, 1, 5);
	}
	if (entity instanceof EntityEnderman) {
		if (entity instanceof EntityEvolvedEnderman) {
			return new ItemStack(ModItems.SKULL_EVOLVED_ENDERMAN);
		}
		return new ItemStack(ModItems.SKULL_ENDERMAN);
	}
	if (entity instanceof EntityFrienderman) {
		return new ItemStack(ModItems.SKULL_FRIENDERMAN);
	}
	return null;
}
 
Example 57
Project: mc-Slingshot   File: EntityBall.java   Source Code and License 5 votes vote down vote up
@Override
protected void onImpact(RayTraceResult result) {
	if (result.typeOfHit == RayTraceResult.Type.ENTITY) {
		EntityLivingBase thrower = getThrower();
		// prevent damaging thrower
		if (result.entityHit == thrower)
			return;

		Entity entity = result.entityHit;
		DamageSource ds = createDamageSource(null == thrower ? this : thrower);

		if (isBurning() && !(entity instanceof EntityEnderman))
			entity.setFire(5);
		if (entity.attackEntityFrom(ds, getDamage())) {
			if (entity instanceof EntityLivingBase) {
				EntityLivingBase base = (EntityLivingBase) entity;

				if (knockbackStrength > 0) {
					float f1 = MathHelper.sqrt_double(motionX * motionX + motionZ * motionZ);
					if (f1 > 0f) {
						base.addVelocity(motionX * knockbackStrength * 0.6000000238418579D / f1,
							0.1D, motionZ * knockbackStrength * 0.6000000238418579D / f1);
					}
				}

				if (null != thrower) {
					EnchantmentHelper.applyThornEnchantments(base, thrower);
					EnchantmentHelper.applyArthropodEnchantments(thrower, base);
					if (base != thrower && base instanceof EntityPlayer && thrower instanceof EntityPlayerMP)
					{
						((EntityPlayerMP)thrower).connection.sendPacket(new SPacketChangeGameState(6, 0.0F));
					}
				}
			}
		}
	}
	if (!worldObj.isRemote)
        setDead();
}
 
Example 58
Project: EMC   File: IEntity.java   Source Code and License 5 votes vote down vote up
public boolean instanceOf(EntityType e) {
	// Generic types and players
	if (e.equals(EntityType.ENTITY_PLAYER_SP)) {
		return entity instanceof EntityPlayerSP;
	} else if (e.equals(EntityType.ENTITY_PLAYER)) {
		return entity instanceof EntityPlayer;
	} else if (e.equals(EntityType.ENTITY_LIVING_BASE)) {
		return entity instanceof EntityLivingBase;
	} else if (e.equals(EntityType.ENTITY_LIVING)) {
		return entity instanceof EntityLiving;
	}
	// Mobs
	if (e.equals(EntityType.ENTITY_WOLF)) {
		return entity instanceof EntityWolf;
	} else if (e.equals(EntityType.Entity_Ageable)) {
		return entity instanceof EntityAgeable;
	} else if (e.equals(EntityType.EntityAmbientCreature)) {
		return entity instanceof EntityAmbientCreature;
	} else if (e.equals(EntityType.EntityWaterMob)) {
		return entity instanceof EntityWaterMob;
	} else if (e.equals(EntityType.EntityMob)) {
		return entity instanceof EntityMob;
	} else if (e.equals(EntityType.EntitySlime)) {
		return entity instanceof EntitySlime;
	} else if (e.equals(EntityType.EntityFlying)) {
		return entity instanceof EntityFlying;
	} else if (e.equals(EntityType.EntityGolem)) {
		return entity instanceof EntityGolem;
	} else if (e.equals(EntityType.ENTITY_SPIDER)) {
		return entity instanceof EntitySpider;
	} else if (e.equals(EntityType.ENTITY_SPIDER)) {
		return entity instanceof EntitySpider;
	} else if (e.equals(EntityType.ENTITY_ZOMBIE_PIGMAN)) {
		return entity instanceof EntityZombie;
	} else if (e.equals(EntityType.ENTITY_ENDERMAN)) {
		return entity instanceof EntityEnderman;
	}
	return false;
}
 
Example 59
Project: uniquecrops   File: BlockDarkBlock.java   Source Code and License 5 votes vote down vote up
public BlockDarkBlock() {
	
	super("darkblock", Material.ROCK);
	setSoundType(SoundType.STONE);
	setHardness(10.0F);
	setResistance(6000000.0F);
	EntityEnderman.setCarriable(this, true);
	GameRegistry.register(new ItemBlock(this), getRegistryName());
}
 
Example 60
Project: minecraft-quiverbow   File: EnderAno.java   Source Code and License 5 votes vote down vote up
@Override
public void onImpact(MovingObjectPosition target)
{
	if (target.entityHit != null) 		// We hit a living thing!
   	{			
		if (target.entityHit instanceof EntityEnderman && this.shootingEntity instanceof EntityPlayer)
		{
			target.entityHit.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) this.shootingEntity), (float) this.damage);	// Capable of hurting endermen
		}
		else
		{
			target.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this), (float) this.damage);	// Anonymous
		}
		
           target.entityHit.hurtResistantTime = 0;	// No immunity frames
       }
	else 
       {			
		// Glass breaking
       	Helper.tryBlockBreak(this.worldObj, this, target, 1);	// Medium strength
           
       }
	
	// SFX
	NetHelper.sendParticleMessageToAllPlayers(this.worldObj, this.getEntityId(), (byte) 6, (byte) 8);
	this.worldObj.playSoundAtEntity(this, "fireworks.largeBlast", 0.7F, 0.5F);
	
	this.setDead();	// Hit something, so we're done here
}