@Override public void updateTick(World world, int x, int y, int z, Random rand) { if (!world.isRemote) { TileIncenseBase tile = (TileIncenseBase) world.getTileEntity(x, y, z); boolean active = tile.getActive(); if (active) { ItemStack item = tile.getItemstack(); if (item != null && item.getItem() instanceof IIncenseEffect) { IIncenseEffect effect = (IIncenseEffect) item.getItem(); EffectType type = effect.getEffectType(); int area = effect.effectAreaRange(); if (type == EffectType.Player) { List list = this.searchPlayer(world, x, y, z, area); if (list != null && !list.isEmpty()) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); if (entity instanceof EntityLivingBase) { EntityLivingBase target = (EntityLivingBase) entity; effect.formEffect(world, x, y, z, target, effect); } } } } else if (type == EffectType.EntityLiving) { List list = this.searchEntity(world, x, y, z, area); if (list != null && !list.isEmpty()) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); if (entity instanceof EntityLivingBase) { EntityLivingBase target = (EntityLivingBase) entity; effect.formEffect(world, x, y, z, target, effect); } } } } else if (type == EffectType.Block) { for (int i = 0; i < effect.effectAreaRange(); i++) { int[] pos = this.searchBlock(world, x, y, z, area); if (pos != null && pos.length == 3) { effect.formEffect(world, pos[0], pos[1], pos[2], null, effect); } } } } world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world)); } } }