	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
		if (tmpworld instanceof CCWorld)
		{
			CCWorld world = (CCWorld) tmpworld;
			teleCoord teleto = new teleCoord();
			teleto.instanceId = world.instanceId;
			if (event.equalsIgnoreCase("TeleportOut"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 149413;
				tele.y = 173078;
				tele.z = -5014;
				exitInstance(player, tele);
			}
			else if (event.equalsIgnoreCase("TeleportParme"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 153689;
				tele.y = 142226;
				tele.z = -9750;
				tele.instanceId = world.instanceId;
				teleportplayer(player, tele);
			}
			else if (event.equalsIgnoreCase("Timer2") || event.equalsIgnoreCase("Timer3") || event.equalsIgnoreCase("Timer4") || event.equalsIgnoreCase("Timer5"))
			{
				teleto.x = 144653;
				teleto.y = 152606;
				teleto.z = -12126;
				if (player.getInstanceId() == world.instanceId)
				{
					teleportplayer(player, teleto);
					player.stopSkillEffects(5239);
					SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player);
					startQuestTimer("Timer2", 300000, npc, player);
				}
			}
			else if (event.equalsIgnoreCase("Timer21") || event.equalsIgnoreCase("Timer31") || event.equalsIgnoreCase("Timer41") || event.equalsIgnoreCase("Timer51"))
			{
				InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs();
				world.npcList2.clear();
				runSteamRooms(world, STEAM1_SPAWNS, 22);
				startQuestTimer("Timer21", 300000, npc, null);
			}

			else if (event.equalsIgnoreCase("checkKechiAttack"))
			{
				if (npc.isInCombat())
				{
					startQuestTimer("spawnGuards", SPAWN[0], npc, null);
					cancelQuestTimers("checkKechiAttack");
					closeDoor(DOOR4, npc.getInstanceId());
					closeDoor(DOOR3, npc.getInstanceId());
				}
				else
					startQuestTimer("checkKechiAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("spawnGuards"))
			{
				world.kechisHenchmanSpawn++;
				world.guards.add(addSpawn(KECHIGUARD, 153622, 149699, -12131, 56890, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153609, 149622, -12131, 64023, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153606, 149428, -12131, 64541, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153601, 149534, -12131, 64901, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153620, 149354, -12131, 1164, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153637, 149776, -12131, 61733, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153638, 149292, -12131, 64071, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153647, 149857, -12131, 59402, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153661, 149227, -12131, 65275, false, 0, false, world.instanceId));
				if (world.kechisHenchmanSpawn <= 5)
					startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null);
				else
					cancelQuestTimers("spawnGuards");
			}
			else if (event.equalsIgnoreCase("EmeraldSteam"))
			{
				runEmerald(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("CoralGarden"))
			{
				runCoral(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("spawn_oracle"))
			{
				addSpawn(32271, 153572, 142075, -9728, 10800, false, 0, false, world.instanceId);
				addSpawn((getRandom(10) < 5 ? 29116 : 29117), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false, world.instanceId); // Baylor's Chest
				addSpawn(ORACLE_GUIDE_4, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				this.cancelQuestTimer("baylor_despawn", npc, null);
				this.cancelQuestTimers("baylor_skill");
			}
			else if (event.equalsIgnoreCase("baylorEffect0"))
			{
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
				npc.broadcastSocialAction(1);
				startQuestTimer("baylorCamera0", 11000, npc, null);
				startQuestTimer("baylorEffect1", 19000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorCamera0"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, -45, 170, 5000, 9000, 0, 0, 1, 0));
			}
			else if (event.equalsIgnoreCase("baylorEffect1"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, 0, 120, 2000, 5000, 0, 0, 1, 0));
				npc.broadcastSocialAction(3);
				startQuestTimer("baylorEffect2", 4000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorEffect2"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 747, 0, 160, 2000, 3000, 0, 0, 1, 0));
				npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0));
				startQuestTimer("RaidStart", 2000, npc, null);
			}
			else if (event.equalsIgnoreCase("BaylorMinions"))
			{
				for (int i = 0; i < 10; i++)
				{
					int radius = 300;
					int x = (int) (radius * Math.cos(i * 0.618));
					int y = (int) (radius * Math.sin(i * 0.618));
					L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.instanceId);
					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
					world._animationMobs.add(mob);
				}
				startQuestTimer("baylorEffect0", 200, npc, null);
			}
			else if (event.equalsIgnoreCase("RaidStart"))
			{
				world._camera.decayMe();
				world._camera = null;
				npc.setIsParalyzed(false);
				for (L2PcInstance p : world._raiders)
				{
					p.setIsParalyzed(false);
					Throw(npc, p);
					if (p.getPet() != null)
						Throw(npc, p.getPet());
				}
				world._raidStatus = 0;
				for (L2Npc mob : world._animationMobs)
				{
					mob.doDie(mob);
				}
				world._animationMobs.clear();
				startQuestTimer("baylor_despawn", 60000, npc, null, true);
				startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("checkBaylorAttack"))
			{
				if (npc.isInCombat())
				{
					cancelQuestTimers("checkBaylorAttack");
					startQuestTimer("baylor_alarm", 40000, npc, null);
					startQuestTimer("baylor_skill", 5000, npc, null, true);
					world._raidStatus++;
				}
				else
					startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylor_alarm"))
			{
				if (world._alarm == null)
				{
					int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
					npc.addSkill(SkillTable.getInstance().getInfo(5244, 1));
					npc.addSkill(SkillTable.getInstance().getInfo(5245, 1));
					world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.instanceId);
					world._alarm.disableCoreAI(true);
					world._alarm.setIsImmobilized(true);
					world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(), 1, world._alarm.getName(), NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY));
				}
			}
			else if (event.equalsIgnoreCase("baylor_skill"))
			{
				if (world._baylor == null)
				{
					cancelQuestTimers("baylor_skill");
				}
				else
				{
					int maxHp = npc.getMaxHp();
					double nowHp = npc.getStatus().getCurrentHp();
					int rand = getRandom(100);

					if (nowHp < maxHp * 0.2 && world._raidStatus < 3 && npc.getFirstEffect(5224) == null && npc.getFirstEffect(5225) == null)
					{
						if (nowHp < maxHp * 0.15 && world._raidStatus == 2)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
						}
						else if (rand < 10 || nowHp < maxHp * 0.15)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
							startQuestTimer("baylor_remove_invul", 30000, world._baylor, null);
						}
					}
					else if (nowHp < maxHp * 0.3 && rand > 50 && npc.getFirstEffect(5225) == null && npc.getFirstEffect(5224) == null)
					{
						npc.doCast(SkillTable.getInstance().getInfo(5224, 1));
					}
					else if (rand < 33)
					{
						npc.setTarget(world._raiders.get(getRandom(world._raiders.size())));
						npc.doCast(SkillTable.getInstance().getInfo(5229, 1));
					}
				}
			}
			else if (event.equalsIgnoreCase("baylor_remove_invul"))
			{
				npc.stopSkillEffects(5225);
			}
			else if (event.equalsIgnoreCase("Baylor"))
			{
				world._baylor = addSpawn(29099, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				world._baylor.setIsParalyzed(true);
				world._camera = addSpawn(29120, 153273, 141400, -12738, 10800, false, 0, false, world.instanceId);
				world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(), 700, -45, 160, 500, 15200, 0, 0, 1, 0));
				startQuestTimer("baylorMinions", 2000, world._baylor, null);
			}
			else if (!event.endsWith("Food"))
				return "";
			else if (event.equalsIgnoreCase("autoFood"))
			{
				if (!world.crystalGolems.containsKey(npc))
					world.crystalGolems.put(npc, new CrystalGolem());
				if (world.status != 3 || !world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination)
					return "";
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				List<L2Object> crystals = new FastList<>();
				for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
				{
					if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD)
						crystals.add(object);
				}
				int minDist = 300000;
				for (L2Object crystal : crystals)
				{
					int dx = npc.getX() - crystal.getX();
					int dy = npc.getY() - crystal.getY();
					int d = dx * dx + dy * dy;
					if (d < minDist)
					{
						minDist = d;
						cryGolem.foodItem = (L2ItemInstance) crystal;
					}
				}
				if (minDist != 300000)
					startQuestTimer("getFood", 2000, npc, null);
				else
				{
					if (getRandom(100) < 5)
						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.AH_IM_HUNGRY));
					startQuestTimer("autoFood", 2000, npc, null);
				}
				return "";
			}
			else if (!world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).isAtDestination)
				return "";
			else if (event.equalsIgnoreCase("backFood"))
			{
				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					cancelQuestTimers("backFood");
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					world.crystalGolems.get(npc).foodItem = null;
					startQuestTimer("autoFood", 2000, npc, null);
				}
			}
			else if (event.equalsIgnoreCase("reachFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				int dx;
				int dy;
				if (cryGolem.foodItem == null || !cryGolem.foodItem.isVisible())
				{
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, cryGolem.oldpos);
					cancelQuestTimers("reachFood");
					startQuestTimer("backFood", 2000, npc, null, true);
					return "";
				}
				else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					L2World.getInstance().removeVisibleObject(cryGolem.foodItem, cryGolem.foodItem.getWorldRegion());
					L2World.getInstance().removeObject(cryGolem.foodItem);
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					cryGolem.foodItem = null;
					dx = npc.getX() - 142999;
					dy = npc.getY() - 151671;
					int d1 = dx * dx + dy * dy;
					dx = npc.getX() - 139494;
					dy = npc.getY() - 151668;
					int d2 = dx * dx + dy * dy;
					if (d1 < 10000 || d2 < 10000)
					{
						npc.broadcastPacket(new MagicSkillUse(npc, npc, 5441, 1, 1, 0));
						cryGolem.isAtDestination = true;
						world.correctGolems++;
						if (world.correctGolems >= 2)
						{
							openDoor(24220026, world.instanceId);
							world.status = 4;
						}
					}
					else
						startQuestTimer("autoFood", 2000, npc, null);
					cancelQuestTimers("reachFood");
				}
				return "";
			}
			else if (event.equalsIgnoreCase("getFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				L2CharPosition newpos = new L2CharPosition(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
				cryGolem.oldpos = new L2CharPosition(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newpos);
				startQuestTimer("reachFood", 2000, npc, null, true);
				cancelQuestTimers("getFood");
			}
		}
		return "";
	}

	@Override
	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId());
		if (tmpworld instanceof CCWorld)
		{
			CCWorld world = (CCWorld) tmpworld;
			teleCoord teleto = new teleCoord();
			teleto.instanceId = world.instanceId;
			if (event.equalsIgnoreCase("TeleportOut"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 149413;
				tele.y = 173078;
				tele.z = -5014;
				exitInstance(player, tele);
			}
			else if (event.equalsIgnoreCase("TeleportParme"))
			{
				teleCoord tele = new teleCoord();
				tele.x = 153689;
				tele.y = 142226;
				tele.z = -9750;
				tele.instanceId = world.instanceId;
				teleportplayer(player, tele);
			}
			else if (event.equalsIgnoreCase("Timer2") || event.equalsIgnoreCase("Timer3") || event.equalsIgnoreCase("Timer4") || event.equalsIgnoreCase("Timer5"))
			{
				teleto.x = 144653;
				teleto.y = 152606;
				teleto.z = -12126;
				if (player.getInstanceId() == world.instanceId)
				{
					teleportplayer(player, teleto);
					player.stopSkillEffects(5239);
					SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player);
					startQuestTimer("Timer2", 300000, npc, player);
				}
			}
			else if (event.equalsIgnoreCase("Timer21") || event.equalsIgnoreCase("Timer31") || event.equalsIgnoreCase("Timer41") || event.equalsIgnoreCase("Timer51"))
			{
				InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs();
				world.npcList2.clear();
				runSteamRooms(world, STEAM1_SPAWNS, 22);
				startQuestTimer("Timer21", 300000, npc, null);
			}

			else if (event.equalsIgnoreCase("checkKechiAttack"))
			{
				if (npc.isInCombat())
				{
					startQuestTimer("spawnGuards", SPAWN[0], npc, null);
					cancelQuestTimers("checkKechiAttack");
					closeDoor(DOOR4, npc.getInstanceId());
					closeDoor(DOOR3, npc.getInstanceId());
				}
				else
					startQuestTimer("checkKechiAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("spawnGuards"))
			{
				world.kechisHenchmanSpawn++;
				world.guards.add(addSpawn(KECHIGUARD, 153622, 149699, -12131, 56890, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153609, 149622, -12131, 64023, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153606, 149428, -12131, 64541, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153601, 149534, -12131, 64901, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153620, 149354, -12131, 1164, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153637, 149776, -12131, 61733, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153638, 149292, -12131, 64071, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153647, 149857, -12131, 59402, false, 0, false, world.instanceId));
				world.guards.add(addSpawn(KECHIGUARD, 153661, 149227, -12131, 65275, false, 0, false, world.instanceId));
				if (world.kechisHenchmanSpawn <= 5)
					startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null);
				else
					cancelQuestTimers("spawnGuards");
			}
			else if (event.equalsIgnoreCase("EmeraldSteam"))
			{
				runEmerald(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("CoralGarden"))
			{
				runCoral(world);
				for (L2Npc oracle : world.oracle)
					oracle.decayMe();
			}
			else if (event.equalsIgnoreCase("spawn_oracle"))
			{
				addSpawn(32271, 153572, 142075, -9728, 10800, false, 0, false, world.instanceId);
				addSpawn((getRandom(10) < 5 ? 29116 : 29117), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false, world.instanceId); // Baylor's Chest
				addSpawn(ORACLE_GUIDE_4, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				this.cancelQuestTimer("baylor_despawn", npc, null);
				this.cancelQuestTimers("baylor_skill");
			}
			else if (event.equalsIgnoreCase("baylorEffect0"))
			{
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
				npc.broadcastSocialAction(1);
				startQuestTimer("baylorCamera0", 11000, npc, null);
				startQuestTimer("baylorEffect1", 19000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorCamera0"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, -45, 170, 5000, 9000, 0, 0, 1, 0));
			}
			else if (event.equalsIgnoreCase("baylorEffect1"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, 0, 120, 2000, 5000, 0, 0, 1, 0));
				npc.broadcastSocialAction(3);
				startQuestTimer("baylorEffect2", 4000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylorEffect2"))
			{
				npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 747, 0, 160, 2000, 3000, 0, 0, 1, 0));
				npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0));
				startQuestTimer("RaidStart", 2000, npc, null);
			}
			else if (event.equalsIgnoreCase("BaylorMinions"))
			{
				for (int i = 0; i < 10; i++)
				{
					int radius = 300;
					int x = (int) (radius * Math.cos(i * 0.618));
					int y = (int) (radius * Math.sin(i * 0.618));
					L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.instanceId);
					mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
					world._animationMobs.add(mob);
				}
				startQuestTimer("baylorEffect0", 200, npc, null);
			}
			else if (event.equalsIgnoreCase("RaidStart"))
			{
				world._camera.decayMe();
				world._camera = null;
				npc.setIsParalyzed(false);
				for (L2PcInstance p : world._raiders)
				{
					p.setIsParalyzed(false);
					Throw(npc, p);
					if (p.getPet() != null)
						Throw(npc, p.getPet());
				}
				world._raidStatus = 0;
				for (L2Npc mob : world._animationMobs)
				{
					mob.doDie(mob);
				}
				world._animationMobs.clear();
				startQuestTimer("baylor_despawn", 60000, npc, null, true);
				startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("checkBaylorAttack"))
			{
				if (npc.isInCombat())
				{
					cancelQuestTimers("checkBaylorAttack");
					startQuestTimer("baylor_alarm", 40000, npc, null);
					startQuestTimer("baylor_skill", 5000, npc, null, true);
					world._raidStatus++;
				}
				else
					startQuestTimer("checkBaylorAttack", 1000, npc, null);
			}
			else if (event.equalsIgnoreCase("baylor_alarm"))
			{
				if (world._alarm == null)
				{
					int[] spawnLoc = ALARMSPAWN[getRandom(ALARMSPAWN.length)];
					npc.addSkill(SkillTable.getInstance().getInfo(5244, 1));
					npc.addSkill(SkillTable.getInstance().getInfo(5245, 1));
					world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.instanceId);
					world._alarm.disableCoreAI(true);
					world._alarm.setIsImmobilized(true);
					world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(), 1, world._alarm.getName(), NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY));
				}
			}
			else if (event.equalsIgnoreCase("baylor_skill"))
			{
				if (world._baylor == null)
				{
					cancelQuestTimers("baylor_skill");
				}
				else
				{
					int maxHp = npc.getMaxHp();
					double nowHp = npc.getStatus().getCurrentHp();
					int rand = getRandom(100);

					if (nowHp < maxHp * 0.2 && world._raidStatus < 3 && npc.getFirstEffect(5224) == null && npc.getFirstEffect(5225) == null)
					{
						if (nowHp < maxHp * 0.15 && world._raidStatus == 2)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
						}
						else if (rand < 10 || nowHp < maxHp * 0.15)
						{
							npc.doCast(SkillTable.getInstance().getInfo(5225, 1));
							npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH));
							startQuestTimer("baylor_remove_invul", 30000, world._baylor, null);
						}
					}
					else if (nowHp < maxHp * 0.3 && rand > 50 && npc.getFirstEffect(5225) == null && npc.getFirstEffect(5224) == null)
					{
						npc.doCast(SkillTable.getInstance().getInfo(5224, 1));
					}
					else if (rand < 33)
					{
						npc.setTarget(world._raiders.get(getRandom(world._raiders.size())));
						npc.doCast(SkillTable.getInstance().getInfo(5229, 1));
					}
				}
			}
			else if (event.equalsIgnoreCase("baylor_remove_invul"))
			{
				npc.stopSkillEffects(5225);
			}
			else if (event.equalsIgnoreCase("Baylor"))
			{
				world._baylor = addSpawn(29099, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId);
				world._baylor.setIsParalyzed(true);
				world._camera = addSpawn(29120, 153273, 141400, -12738, 10800, false, 0, false, world.instanceId);
				world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(), 700, -45, 160, 500, 15200, 0, 0, 1, 0));
				startQuestTimer("baylorMinions", 2000, world._baylor, null);
			}
			else if (!event.endsWith("Food"))
				return "";
			else if (event.equalsIgnoreCase("autoFood"))
			{
				if (!world.crystalGolems.containsKey(npc))
					world.crystalGolems.put(npc, new CrystalGolem());
				if (world.status != 3 || !world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination)
					return "";
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				List<L2Object> crystals = new FastList<L2Object>();
				for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300))
				{
					if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD)
						crystals.add(object);
				}
				int minDist = 300000;
				for (L2Object crystal : crystals)
				{
					int dx = npc.getX() - crystal.getX();
					int dy = npc.getY() - crystal.getY();
					int d = dx * dx + dy * dy;
					if (d < minDist)
					{
						minDist = d;
						cryGolem.foodItem = (L2ItemInstance) crystal;
					}
				}
				if (minDist != 300000)
					startQuestTimer("getFood", 2000, npc, null);
				else
				{
					if (getRandom(100) < 5)
						npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.AH_IM_HUNGRY));
					startQuestTimer("autoFood", 2000, npc, null);
				}
				return "";
			}
			else if (!world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).isAtDestination)
				return "";
			else if (event.equalsIgnoreCase("backFood"))
			{
				if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					cancelQuestTimers("backFood");
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					world.crystalGolems.get(npc).foodItem = null;
					startQuestTimer("autoFood", 2000, npc, null);
				}
			}
			else if (event.equalsIgnoreCase("reachFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				int dx;
				int dy;
				if (cryGolem.foodItem == null || !cryGolem.foodItem.isVisible())
				{
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, cryGolem.oldpos);
					cancelQuestTimers("reachFood");
					startQuestTimer("backFood", 2000, npc, null, true);
					return "";
				}
				else if (npc.getAI().getIntention() == CtrlIntention.AI_INTENTION_ACTIVE)
				{
					L2World.getInstance().removeVisibleObject(cryGolem.foodItem, cryGolem.foodItem.getWorldRegion());
					L2World.getInstance().removeObject(cryGolem.foodItem);
					npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null);
					cryGolem.foodItem = null;
					dx = npc.getX() - 142999;
					dy = npc.getY() - 151671;
					int d1 = dx * dx + dy * dy;
					dx = npc.getX() - 139494;
					dy = npc.getY() - 151668;
					int d2 = dx * dx + dy * dy;
					if (d1 < 10000 || d2 < 10000)
					{
						npc.broadcastPacket(new MagicSkillUse(npc, npc, 5441, 1, 1, 0));
						cryGolem.isAtDestination = true;
						world.correctGolems++;
						if (world.correctGolems >= 2)
						{
							openDoor(24220026, world.instanceId);
							world.status = 4;
						}
					}
					else
						startQuestTimer("autoFood", 2000, npc, null);
					cancelQuestTimers("reachFood");
				}
				return "";
			}
			else if (event.equalsIgnoreCase("getFood"))
			{
				CrystalGolem cryGolem = world.crystalGolems.get(npc);
				L2CharPosition newpos = new L2CharPosition(cryGolem.foodItem.getX(), cryGolem.foodItem.getY(), cryGolem.foodItem.getZ(), 0);
				cryGolem.oldpos = new L2CharPosition(npc.getX(), npc.getY(), npc.getZ(), npc.getHeading());
				npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, newpos);
				startQuestTimer("reachFood", 2000, npc, null, true);
				cancelQuestTimers("getFood");
			}
		}
		return "";
	}

Replace Generic With Diamond FastList<L2Object> with FastList<> in method public onAdvEvent(event String, npc L2Npc, player L2PcInstance) : String from class instances.CrystalCaverns.CrystalCaverns


		@Override
		public void run()
		{
			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
				return;
			switch (_status)
			{
				case 0: // new song play
					if (_world.isVideo)
						_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 1000);
					else if (_world.frintezza != null && !_world.frintezza.isDead())
					{
						int rnd = getRandom(100);
						for (int i = 0; i < FRINTEZZASONGLIST.length; i++)
						{
							if (rnd < FRINTEZZASONGLIST[i].chance)
							{
								_world.OnSong = FRINTEZZASONGLIST[i];
								broadCastPacket(_world, new ExShowScreenMessage(FRINTEZZASONGLIST[i].songName, 2, 500));
								broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, FRINTEZZASONGLIST[i].skill.getSkillId(), FRINTEZZASONGLIST[i].skill.getSkillLvl(), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime(), 0));
								_world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime() - 10000);
								_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime());
								break;
							}
						}
					}
					break;
				case 1: // Frintezza song effect
					_world.songEffectTask = null;
					L2Skill skill = _world.OnSong.effectSkill.getSkill();
					if (skill == null)
						return;

					if (_world.frintezza != null && !_world.frintezza.isDead() && _world.activeScarlet != null && !_world.activeScarlet.isDead())
					{
						List<L2Character> targetList = new FastList<>();
						if (skill.getSkillType() == L2SkillType.STUN || skill.getSkillType() == L2SkillType.DEBUFF)
						{
							for (int objId : _world.allowed)
							{
								L2PcInstance player = L2World.getInstance().getPlayer(objId);
								if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
								{
									if (!player.isDead())
										targetList.add(player);
									if (player.getPet() != null && !player.getPet().isDead())
										targetList.add(player.getPet());
								}
							}
						}
						else
							targetList.add(_world.activeScarlet);
						if (targetList.size() > 0)
							_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
					}
					break;
				case 2: // finish morph
					_world.activeScarlet.setRHandId(SECOND_SCARLET_WEAPON);
					_world.activeScarlet.setIsInvul(false);
					break;
			}
		}

		@Override
		public void run()
		{
			if (InstanceManager.getInstance().getWorld(_world.instanceId) != _world)
				return;
			switch (_status)
			{
				case 0: // new song play
					if (_world.isVideo)
						_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), 1000);
					else if (_world.frintezza != null && !_world.frintezza.isDead())
					{
						int rnd = getRandom(100);
						for (int i = 0; i < FRINTEZZASONGLIST.length; i++)
						{
							if (rnd < FRINTEZZASONGLIST[i].chance)
							{
								_world.OnSong = FRINTEZZASONGLIST[i];
								broadCastPacket(_world, new ExShowScreenMessage(FRINTEZZASONGLIST[i].songName, 2, 500));
								broadCastPacket(_world, new MagicSkillUse(_world.frintezza, _world.frintezza, FRINTEZZASONGLIST[i].skill.getSkillId(), FRINTEZZASONGLIST[i].skill.getSkillLvl(), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime(), 0));
								_world.songEffectTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 1), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime() - 10000);
								_world.songTask = ThreadPoolManager.getInstance().scheduleGeneral(new SongTask(_world, 0), FRINTEZZASONGLIST[i].skill.getSkill().getHitTime());
								break;
							}
						}
					}
					break;
				case 1: // Frintezza song effect
					_world.songEffectTask = null;
					L2Skill skill = _world.OnSong.effectSkill.getSkill();
					if (skill == null)
						return;

					if (_world.frintezza != null && !_world.frintezza.isDead() && _world.activeScarlet != null && !_world.activeScarlet.isDead())
					{
						List<L2Character> targetList = new FastList<L2Character>();
						if (skill.getSkillType() == L2SkillType.STUN || skill.getSkillType() == L2SkillType.DEBUFF)
						{
							for (int objId : _world.allowed)
							{
								L2PcInstance player = L2World.getInstance().getPlayer(objId);
								if (player != null && player.isOnline() && player.getInstanceId() == _world.instanceId)
								{
									if (!player.isDead())
										targetList.add(player);
									if (player.getPet() != null && !player.getPet().isDead())
										targetList.add(player.getPet());
								}
							}
						}
						else
							targetList.add(_world.activeScarlet);
						if (targetList.size() > 0)
							_world.frintezza.doCast(skill, targetList.get(0), targetList.toArray(new L2Character[targetList.size()]));
					}
					break;
				case 2: // finish morph
					_world.activeScarlet.setRHandId(SECOND_SCARLET_WEAPON);
					_world.activeScarlet.setIsInvul(false);
					break;
			}
		}

Replace Generic With Diamond FastList<L2Character> with FastList<> in method public run() : void from class instances.FinalEmperialTomb.FinalEmperialTomb.SongTask


	@Override
	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		// Must be here, because of player == null
		if ((npc.getNpcId() == FOLLOWERS) && event.equals("follower_cast"))
		{
			if (!npc.isCastingNow() && !npc.isDead() && !_lematanNpc.isDead())
			{
				npc.setTarget(_lematanNpc);
				npc.doCast(energy_skill);
			}
			startQuestTimer("follower_cast", 2000 + Rnd.get(100, 1000), npc, null);
			return null;
		}
		else if ((npc.getNpcId() == POWDER_KEG) && event.equalsIgnoreCase("keg_trigger"))
		{
			onAttack(npc, player, 600, false);
		}

		final QuestState st = player.getQuestState(qn);
		if (st == null)
		{
			return getNoQuestMsg(player);
		}

		final int cond = st.getInt("cond");

		if (event.equalsIgnoreCase("enter"))
		{
			enterInstance(player);
			if (st.getInt("cond") == 1)
			{
				st.set("cond", "2");
				return "32498-07.htm";
			}
			return "32498-09.htm";
		}
		else if (event.equalsIgnoreCase("32498-05.htm"))
		{
			if (cond == 0)
			{
				st.set("cond", "1");
				st.setState(State.STARTED);
				st.playSound("ItemSound.quest_accept");
			}
		}
		else if (event.equalsIgnoreCase("32501-03.htm"))
		{
			if (cond == 2)
			{
				st.giveItems(SWORD, 1);
				st.set("cond", "3");
				st.playSound("ItemSound.quest_middle");
			}
		}
		else if (event.equalsIgnoreCase("32510-02.htm"))
		{
			st.unset("cond");
			st.playSound("ItemSound.quest_finish");
			st.exitQuest(false);

			Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
			inst.setDuration(EXIT_TIME * 60000);
			inst.setEmptyDestroyTime(0);

			if (inst.containsPlayer(player.getObjectId()))
			{
				player.setVitalityPoints(20000, true);
				st.addExpAndSp(810000, 50000);
				for (int id : REWARDS)
				{
					st.giveItems(id, 1);
				}
			}
		}
		else if (event.equalsIgnoreCase("lematan_teleport"))
		{
			if ((npc.getNpcId() == LEMATAN) && !npc.isMovementDisabled() && !_isOnShip)
			{
				// Reduce Hate
				((L2Attackable) npc).reduceHate(player, 9999);
				((L2Attackable) npc).abortAttack();
				((L2Attackable) npc).abortCast();
				// Broadcast Escape
				npc.broadcastPacket(new MagicSkillUse(npc, 2100, 1, 1000, 0));
				// Schedule telport - when Lematan Finish casting
				startQuestTimer("lematan_finish_teleport", 1500, npc, player);
			}
			else
			{
				_isTeleportScheduled = false;
			}
			return null;
		}
		else if ((npc.getNpcId() == LEMATAN) && event.equalsIgnoreCase("lematan_finish_teleport") && !_isOnShip)
		{
			// Teleport Lematan
			npc.teleToLocation(84973, -208721, -3340);
			// Set onShip
			_isOnShip = true;
			// Set Spawn loc to ship. If he loose aggro he should stay on board ;)
			npc.getSpawn().setLocx(84973);
			npc.getSpawn().setLocy(-208721);
			npc.getSpawn().setLocz(-3340);
			// To be sure, reduce again
			((L2Attackable) npc).reduceHate(player, 9999);
			// Spawn followers
			_followerslist = new FastList<>();
			for (int[] SPAWN : FOLLOWERS_SPAWNS)
			{
				L2Npc _follower = addSpawn(FOLLOWERS, SPAWN[0], SPAWN[1], SPAWN[2], SPAWN[3], false, 0, true, player.getInstanceId());
				if (_follower != null)
				{
					_followerslist.add(_follower);
				}
			}
			return null;
		}
		return event;
	}

	@Override
	public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
	{
		// Must be here, because of player == null
		if ((npc.getNpcId() == FOLLOWERS) && event.equals("follower_cast"))
		{
			if (!npc.isCastingNow() && !npc.isDead() && !_lematanNpc.isDead())
			{
				npc.setTarget(_lematanNpc);
				npc.doCast(energy_skill);
			}
			startQuestTimer("follower_cast", 2000 + Rnd.get(100, 1000), npc, null);
			return null;
		}
		else if ((npc.getNpcId() == POWDER_KEG) && event.equalsIgnoreCase("keg_trigger"))
		{
			onAttack(npc, player, 600, false);
		}

		final QuestState st = player.getQuestState(qn);
		if (st == null)
		{
			return getNoQuestMsg(player);
		}

		final int cond = st.getInt("cond");

		if (event.equalsIgnoreCase("enter"))
		{
			enterInstance(player);
			if (st.getInt("cond") == 1)
			{
				st.set("cond", "2");
				return "32498-07.htm";
			}
			return "32498-09.htm";
		}
		else if (event.equalsIgnoreCase("32498-05.htm"))
		{
			if (cond == 0)
			{
				st.set("cond", "1");
				st.setState(State.STARTED);
				st.playSound("ItemSound.quest_accept");
			}
		}
		else if (event.equalsIgnoreCase("32501-03.htm"))
		{
			if (cond == 2)
			{
				st.giveItems(SWORD, 1);
				st.set("cond", "3");
				st.playSound("ItemSound.quest_middle");
			}
		}
		else if (event.equalsIgnoreCase("32510-02.htm"))
		{
			st.unset("cond");
			st.playSound("ItemSound.quest_finish");
			st.exitQuest(false);

			Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId());
			inst.setDuration(EXIT_TIME * 60000);
			inst.setEmptyDestroyTime(0);

			if (inst.containsPlayer(player.getObjectId()))
			{
				player.setVitalityPoints(20000, true);
				st.addExpAndSp(810000, 50000);
				for (int id : REWARDS)
				{
					st.giveItems(id, 1);
				}
			}
		}
		else if (event.equalsIgnoreCase("lematan_teleport"))
		{
			if ((npc.getNpcId() == LEMATAN) && !npc.isMovementDisabled() && !_isOnShip)
			{
				// Reduce Hate
				((L2Attackable) npc).reduceHate(player, 9999);
				((L2Attackable) npc).abortAttack();
				((L2Attackable) npc).abortCast();
				// Broadcast Escape
				npc.broadcastPacket(new MagicSkillUse(npc, 2100, 1, 1000, 0));
				// Schedule telport - when Lematan Finish casting
				startQuestTimer("lematan_finish_teleport", 1500, npc, player);
			}
			else
			{
				_isTeleportScheduled = false;
			}
			return null;
		}
		else if ((npc.getNpcId() == LEMATAN) && event.equalsIgnoreCase("lematan_finish_teleport") && !_isOnShip)
		{
			// Teleport Lematan
			npc.teleToLocation(84973, -208721, -3340);
			// Set onShip
			_isOnShip = true;
			// Set Spawn loc to ship. If he loose aggro he should stay on board ;)
			npc.getSpawn().setLocx(84973);
			npc.getSpawn().setLocy(-208721);
			npc.getSpawn().setLocz(-3340);
			// To be sure, reduce again
			((L2Attackable) npc).reduceHate(player, 9999);
			// Spawn followers
			_followerslist = new FastList<L2Npc>();
			for (int[] SPAWN : FOLLOWERS_SPAWNS)
			{
				L2Npc _follower = addSpawn(FOLLOWERS, SPAWN[0], SPAWN[1], SPAWN[2], SPAWN[3], false, 0, true, player.getInstanceId());
				if (_follower != null)
				{
					_followerslist.add(_follower);
				}
			}
			return null;
		}
		return event;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public onAdvEvent(event String, npc L2Npc, player L2PcInstance) : String from class instances.Pailaka.PailakaDevilsLegacy


	@Override
	public boolean eventStart()
	{
		// Don't start event if its active
		if (_isactive)
		{
			return false;
		}

		// Check Custom Table - we use custom NPC's
		if (!Config.CUSTOM_NPC_TABLE)
		{
			return false;
		}

		// Initialize list
		_npclist = new FastList<>();

		// Set Event active
		_isactive = true;

		// Spawn Elpy's
		int location = getRandom(0, _locations.length - 1);

		int[] _spawndata = _spawns[location];

		_elpies_count = 0;

		for (int i = 0; i < _option_howmuch; i++)
		{
			int x = getRandom(_spawndata[0], _spawndata[1]);
			int y = getRandom(_spawndata[2], _spawndata[3]);
			recordSpawn(_elpy, x, y, _spawndata[4], 0, true, _event_time * 60 * 1000);
			_elpies_count++;
		}

		// Announce event start
		Announcements.getInstance().announceToAll("*Squeak Squeak*");
		Announcements.getInstance().announceToAll("Elpy invasion in " + _locations[location]);
		Announcements.getInstance().announceToAll("Help us exterminate them!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

	@Override
	public boolean eventStart()
	{
		// Don't start event if its active
		if (_isactive)
		{
			return false;
		}

		// Check Custom Table - we use custom NPC's
		if (!Config.CUSTOM_NPC_TABLE)
		{
			return false;
		}

		// Initialize list
		_npclist = new FastList<L2Npc>();

		// Set Event active
		_isactive = true;

		// Spawn Elpy's
		int location = getRandom(0, _locations.length - 1);

		int[] _spawndata = _spawns[location];

		_elpies_count = 0;

		for (int i = 0; i < _option_howmuch; i++)
		{
			int x = getRandom(_spawndata[0], _spawndata[1]);
			int y = getRandom(_spawndata[2], _spawndata[3]);
			recordSpawn(_elpy, x, y, _spawndata[4], 0, true, _event_time * 60 * 1000);
			_elpies_count++;
		}

		// Announce event start
		Announcements.getInstance().announceToAll("*Squeak Squeak*");
		Announcements.getInstance().announceToAll("Elpy invasion in " + _locations[location]);
		Announcements.getInstance().announceToAll("Help us exterminate them!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public eventStart() : boolean from class mods.eventmodElpies.eventmodElpies


	@Override
	public boolean eventStart()
	{
		// Don't start event if its active
		if (_isactive)
		{
			return false;
		}

		// Check Custom Table - we use custom NPC's
		if (!Config.CUSTOM_NPC_TABLE)
		{
			return false;
		}

		// Initialize list
		_npclist = new FastList<>();

		// Set Event active
		_isactive = true;

		// Spawn Manager
		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);

		// Spawn Chests
		for (int i = 0; i < _option_howmuch; i++)
		{
			int x = getRandom(-60653, -58772);
			int y = getRandom(-55830, -57718);
			recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time * 60 * 1000);
			_chest_count++;
		}

		// Announce event start
		Announcements.getInstance().announceToAll("Rabbit Event : Chests spawned!");
		Announcements.getInstance().announceToAll("Go to Fantasy Isle and grab some rewards!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min - after that time all chests will disappear...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

	@Override
	public boolean eventStart()
	{
		// Don't start event if its active
		if (_isactive)
		{
			return false;
		}

		// Check Custom Table - we use custom NPC's
		if (!Config.CUSTOM_NPC_TABLE)
		{
			return false;
		}

		// Initialize list
		_npclist = new FastList<L2Npc>();

		// Set Event active
		_isactive = true;

		// Spawn Manager
		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);

		// Spawn Chests
		for (int i = 0; i < _option_howmuch; i++)
		{
			int x = getRandom(-60653, -58772);
			int y = getRandom(-55830, -57718);
			recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time * 60 * 1000);
			_chest_count++;
		}

		// Announce event start
		Announcements.getInstance().announceToAll("Rabbit Event : Chests spawned!");
		Announcements.getInstance().announceToAll("Go to Fantasy Isle and grab some rewards!");
		Announcements.getInstance().announceToAll("You have " + _event_time + " min - after that time all chests will disappear...");

		// Schedule Event end
		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				timeUp();
			}
		}, _event_time * 60 * 1000);

		return true;
	}

Replace Generic With Diamond FastList<L2Npc> with FastList<> in method public eventStart() : boolean from class mods.eventmodRabbits.eventmodRabbits


	private void load()
	{
		try
		{
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			factory.setValidating(false);
			factory.setIgnoringComments(true);

			File file = new File(Config.DATAPACK_ROOT, "data/levelUpCrystalData.xml");
			if (!file.exists())
			{
				_log.severe("[EnhanceYourWeapon] Missing levelUpCrystalData.xml. The quest wont work without it!");
				return;
			}

			Document doc = factory.newDocumentBuilder().parse(file);
			Node first = doc.getFirstChild();
			if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
			{
				for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
				{
					if ("crystal".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("itemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing itemId in Crystal List, skipping");
									continue;
								}
								int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue());

								att = attrs.getNamedItem("level");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing level in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int level = Integer.parseInt(attrs.getNamedItem("level").getNodeValue());

								att = attrs.getNamedItem("leveledItemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing leveledItemId in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int leveledItemId = Integer.parseInt(attrs.getNamedItem("leveledItemId").getNodeValue());

								_soulCrystals.put(itemId, new SoulCrystal(level, itemId, leveledItemId));
							}
						}
					}
					else if ("npc".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("npcId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing npcId in NPC List, skipping");
									continue;
								}
								int npcId = Integer.parseInt(att.getNodeValue());

								FastMap<Integer, LevelingInfo> temp = new FastMap<>();

								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
								{
									boolean isSkillNeeded = false;
									int chance = 5;
									AbsorbCrystalType absorbType = AbsorbCrystalType.LAST_HIT;

									if ("detail".equalsIgnoreCase(cd.getNodeName()))
									{
										attrs = cd.getAttributes();

										att = attrs.getNamedItem("absorbType");
										if (att != null)
										{
											absorbType = Enum.valueOf(AbsorbCrystalType.class, att.getNodeValue());
										}

										att = attrs.getNamedItem("chance");
										if (att != null)
										{
											chance = Integer.parseInt(att.getNodeValue());
										}

										att = attrs.getNamedItem("skill");
										if (att != null)
										{
											isSkillNeeded = Boolean.parseBoolean(att.getNodeValue());
										}

										Node att1 = attrs.getNamedItem("maxLevel");
										Node att2 = attrs.getNamedItem("levelList");
										if ((att1 == null) && (att2 == null))
										{
											_log.severe("[EnhanceYourWeapon] Missing maxlevel/levelList in NPC List npcId: " + npcId + ", skipping");
											continue;
										}
										LevelingInfo info = new LevelingInfo(absorbType, isSkillNeeded, chance);
										if (att1 != null)
										{
											int maxLevel = Integer.parseInt(att1.getNodeValue());
											for (int i = 0; i <= maxLevel; i++)
											{
												temp.put(i, info);
											}
										}
										else
										{
											StringTokenizer st = new StringTokenizer(att2.getNodeValue(), ",");
											int tokenCount = st.countTokens();
											for (int i = 0; i < tokenCount; i++)
											{
												Integer value = Integer.decode(st.nextToken().trim());
												if (value == null)
												{
													_log.severe("[EnhanceYourWeapon] Bad Level value!! npcId: " + npcId + " token: " + i);
													value = 0;
												}
												temp.put(value, info);
											}
										}
									}
								}

								if (temp.isEmpty())
								{
									_log.severe("[EnhanceYourWeapon] No leveling info for npcId: " + npcId + ", skipping");
									continue;
								}
								_npcLevelingInfos.put(npcId, temp);
							}
						}
					}
				}
			}
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "[EnhanceYourWeapon] Could not parse levelUpCrystalData.xml file: " + e.getMessage(), e);
		}
		_log.info("[EnhanceYourWeapon] Loaded " + _soulCrystals.size() + " Soul Crystal data.");
		_log.info("[EnhanceYourWeapon] Loaded " + _npcLevelingInfos.size() + " npc Leveling info data.");
	}

	private void load()
	{
		try
		{
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
			factory.setValidating(false);
			factory.setIgnoringComments(true);

			File file = new File(Config.DATAPACK_ROOT, "data/levelUpCrystalData.xml");
			if (!file.exists())
			{
				_log.severe("[EnhanceYourWeapon] Missing levelUpCrystalData.xml. The quest wont work without it!");
				return;
			}

			Document doc = factory.newDocumentBuilder().parse(file);
			Node first = doc.getFirstChild();
			if ((first != null) && "list".equalsIgnoreCase(first.getNodeName()))
			{
				for (Node n = first.getFirstChild(); n != null; n = n.getNextSibling())
				{
					if ("crystal".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("itemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing itemId in Crystal List, skipping");
									continue;
								}
								int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue());

								att = attrs.getNamedItem("level");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing level in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int level = Integer.parseInt(attrs.getNamedItem("level").getNodeValue());

								att = attrs.getNamedItem("leveledItemId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing leveledItemId in Crystal List itemId: " + itemId + ", skipping");
									continue;
								}
								int leveledItemId = Integer.parseInt(attrs.getNamedItem("leveledItemId").getNodeValue());

								_soulCrystals.put(itemId, new SoulCrystal(level, itemId, leveledItemId));
							}
						}
					}
					else if ("npc".equalsIgnoreCase(n.getNodeName()))
					{
						for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
						{
							if ("item".equalsIgnoreCase(d.getNodeName()))
							{
								NamedNodeMap attrs = d.getAttributes();
								Node att = attrs.getNamedItem("npcId");
								if (att == null)
								{
									_log.severe("[EnhanceYourWeapon] Missing npcId in NPC List, skipping");
									continue;
								}
								int npcId = Integer.parseInt(att.getNodeValue());

								FastMap<Integer, LevelingInfo> temp = new FastMap<Integer, LevelingInfo>();

								for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling())
								{
									boolean isSkillNeeded = false;
									int chance = 5;
									AbsorbCrystalType absorbType = AbsorbCrystalType.LAST_HIT;

									if ("detail".equalsIgnoreCase(cd.getNodeName()))
									{
										attrs = cd.getAttributes();

										att = attrs.getNamedItem("absorbType");
										if (att != null)
										{
											absorbType = Enum.valueOf(AbsorbCrystalType.class, att.getNodeValue());
										}

										att = attrs.getNamedItem("chance");
										if (att != null)
										{
											chance = Integer.parseInt(att.getNodeValue());
										}

										att = attrs.getNamedItem("skill");
										if (att != null)
										{
											isSkillNeeded = Boolean.parseBoolean(att.getNodeValue());
										}

										Node att1 = attrs.getNamedItem("maxLevel");
										Node att2 = attrs.getNamedItem("levelList");
										if ((att1 == null) && (att2 == null))
										{
											_log.severe("[EnhanceYourWeapon] Missing maxlevel/levelList in NPC List npcId: " + npcId + ", skipping");
											continue;
										}
										LevelingInfo info = new LevelingInfo(absorbType, isSkillNeeded, chance);
										if (att1 != null)
										{
											int maxLevel = Integer.parseInt(att1.getNodeValue());
											for (int i = 0; i <= maxLevel; i++)
											{
												temp.put(i, info);
											}
										}
										else
										{
											StringTokenizer st = new StringTokenizer(att2.getNodeValue(), ",");
											int tokenCount = st.countTokens();
											for (int i = 0; i < tokenCount; i++)
											{
												Integer value = Integer.decode(st.nextToken().trim());
												if (value == null)
												{
													_log.severe("[EnhanceYourWeapon] Bad Level value!! npcId: " + npcId + " token: " + i);
													value = 0;
												}
												temp.put(value, info);
											}
										}
									}
								}

								if (temp.isEmpty())
								{
									_log.severe("[EnhanceYourWeapon] No leveling info for npcId: " + npcId + ", skipping");
									continue;
								}
								_npcLevelingInfos.put(npcId, temp);
							}
						}
					}
				}
			}
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "[EnhanceYourWeapon] Could not parse levelUpCrystalData.xml file: " + e.getMessage(), e);
		}
		_log.info("[EnhanceYourWeapon] Loaded " + _soulCrystals.size() + " Soul Crystal data.");
		_log.info("[EnhanceYourWeapon] Loaded " + _npcLevelingInfos.size() + " npc Leveling info data.");
	}

Replace Generic With Diamond FastMap<Integer,LevelingInfo> with FastMap<> in method private load() : void from class quests.Q350_EnhanceYourWeapon.Q350_EnhanceYourWeapon


	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		int npcId = npc.getNpcId();
		QuestState st = player.getQuestState(qn);
		for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
		{
			if (npcId == Archon_Minion)
			{
				L2Party party = player.getParty();
				if (party != null)
				{
					L2FastList<QuestState> PartyQuestMembers = new L2FastList<>();
					for (L2PcInstance player1 : party.getMembers())
					{
						QuestState st1 = findQuest(player1);
						if ((st1 != null) && player1.isInsideRadius(player, Config.ALT_PARTY_RANGE2, false, false))
						{
							if (st1.getInt("cond") == 15)
							{
								PartyQuestMembers.add(st1);
							}
						}
					}
					if (PartyQuestMembers.size() > 0)
					{
						QuestState st2 = PartyQuestMembers.get(getRandom(PartyQuestMembers.size()));
						giveHallishaMark(st2);
					}
				}
				else
				{
					QuestState st1 = findQuest(player);
					if (st1 != null)
					{
						if (st1.getInt("cond") == 15)
						{
							giveHallishaMark(st1);
						}
					}
				}
				return super.onKill(npc, player, isPet);
			}
		}

		int[] Archon_Hellisha_Norm =
		{
			18212,
			18214,
			18215,
			18216,
			18218
		};
		for (int element : Archon_Hellisha_Norm)
		{
			if (npcId == element)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 15)
					{
						// This is just a guess....not really sure what it actually says, if anything
						AutoChat(npc, Text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
						st1.giveItems(Items[8], 1);
						st1.takeItems(Items[3], -1);
						st1.set("cond", "16");
						st1.playSound("ItemSound.quest_middle");
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}

		for (int Guardian_Angel = 27214; Guardian_Angel < 27217; Guardian_Angel++)
		{
			if (npcId == Guardian_Angel)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 6)
					{
						if (st1.getInt("kills") < 9)
						{
							st1.set("kills", String.valueOf(st1.getInt("kills") + 1));
						}
						else
						{
							st1.playSound("ItemSound.quest_middle");
							st1.giveItems(Items[5], 1);
							st1.set("cond", "7");
						}
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}
		if ((st != null) && (npcId != Mob[2]))
		{
			QuestState st2 = findRightState(npc);
			if (st2 == null)
			{
				return super.onKill(npc, player, isPet);
			}
			int cond = st.getInt("cond");
			if ((npcId == Mob[0]) && (cond == 8))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[12].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[6], 1);
						st.set("cond", "9");
						st.playSound("ItemSound.quest_middle");
					}
				}
				cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
			else if ((npcId == Mob[1]) && (cond == 15))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[4].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[8], 1);
						st.takeItems(Items[3], -1);
						st.set("cond", "16");
						st.playSound("ItemSound.quest_middle");
					}
					else
					{
						AutoChat(npc, Text[5].replace("PLAYERNAME", player.getName()));
					}
				}
				cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
		}
		else
		{
			if (npcId == Mob[0])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Mob_1 has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
			else if (npcId == Mob[1])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Archon Hellisha has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
		}
		return super.onKill(npc, player, isPet);
	}

	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		int npcId = npc.getNpcId();
		QuestState st = player.getQuestState(qn);
		for (int Archon_Minion = 21646; Archon_Minion < 21652; Archon_Minion++)
		{
			if (npcId == Archon_Minion)
			{
				L2Party party = player.getParty();
				if (party != null)
				{
					L2FastList<QuestState> PartyQuestMembers = new L2FastList<QuestState>();
					for (L2PcInstance player1 : party.getMembers())
					{
						QuestState st1 = findQuest(player1);
						if ((st1 != null) && player1.isInsideRadius(player, Config.ALT_PARTY_RANGE2, false, false))
						{
							if (st1.getInt("cond") == 15)
							{
								PartyQuestMembers.add(st1);
							}
						}
					}
					if (PartyQuestMembers.size() > 0)
					{
						QuestState st2 = PartyQuestMembers.get(getRandom(PartyQuestMembers.size()));
						giveHallishaMark(st2);
					}
				}
				else
				{
					QuestState st1 = findQuest(player);
					if (st1 != null)
					{
						if (st1.getInt("cond") == 15)
						{
							giveHallishaMark(st1);
						}
					}
				}
				return super.onKill(npc, player, isPet);
			}
		}

		int[] Archon_Hellisha_Norm =
		{
			18212,
			18214,
			18215,
			18216,
			18218
		};
		for (int element : Archon_Hellisha_Norm)
		{
			if (npcId == element)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 15)
					{
						// This is just a guess....not really sure what it actually says, if anything
						AutoChat(npc, Text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
						st1.giveItems(Items[8], 1);
						st1.takeItems(Items[3], -1);
						st1.set("cond", "16");
						st1.playSound("ItemSound.quest_middle");
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}

		for (int Guardian_Angel = 27214; Guardian_Angel < 27217; Guardian_Angel++)
		{
			if (npcId == Guardian_Angel)
			{
				QuestState st1 = findQuest(player);
				if (st1 != null)
				{
					if (st1.getInt("cond") == 6)
					{
						if (st1.getInt("kills") < 9)
						{
							st1.set("kills", String.valueOf(st1.getInt("kills") + 1));
						}
						else
						{
							st1.playSound("ItemSound.quest_middle");
							st1.giveItems(Items[5], 1);
							st1.set("cond", "7");
						}
					}

				}
				return super.onKill(npc, player, isPet);
			}
		}
		if ((st != null) && (npcId != Mob[2]))
		{
			QuestState st2 = findRightState(npc);
			if (st2 == null)
			{
				return super.onKill(npc, player, isPet);
			}
			int cond = st.getInt("cond");
			if ((npcId == Mob[0]) && (cond == 8))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[12].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[6], 1);
						st.set("cond", "9");
						st.playSound("ItemSound.quest_middle");
					}
				}
				cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
			else if ((npcId == Mob[1]) && (cond == 15))
			{
				if (!player.isInParty())
				{
					if (st == st2)
					{
						AutoChat(npc, Text[4].replace("PLAYERNAME", player.getName()));
						st.giveItems(Items[8], 1);
						st.takeItems(Items[3], -1);
						st.set("cond", "16");
						st.playSound("ItemSound.quest_middle");
					}
					else
					{
						AutoChat(npc, Text[5].replace("PLAYERNAME", player.getName()));
					}
				}
				cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				DeleteSpawn(st2, npc);
			}
		}
		else
		{
			if (npcId == Mob[0])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Mob_1 has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
			else if (npcId == Mob[1])
			{
				st = findRightState(npc);
				if (st != null)
				{
					cancelQuestTimer("Archon Hellisha has despawned", npc, st.getPlayer());
					st.set("spawned", "0");
					DeleteSpawn(st, npc);
				}
			}
		}
		return super.onKill(npc, player, isPet);
	}

Replace Generic With Diamond L2FastList<QuestState> with L2FastList<> in method public onKill(npc L2Npc, player L2PcInstance, isPet boolean) : String from class quests.SagasScripts.SagasSuperClass


    @Override
    public Map<RoboTaxi, Link> keepFree(Collection<RoboTaxi> stayingRobotaxis, //
            Collection<RoboTaxi> rebalancingRobotaxis, long now) {
        Objects.requireNonNull(distanceFunction);
        Objects.requireNonNull(parkingLPHelper);
        Map<Link, Set<RoboTaxi>> linkStayTaxi = StaticHelper.getOccupiedLinks(stayingRobotaxis);
        Map<Link, Set<RoboTaxi>> taxisToGo = parkingLPHelper.getTaxisToGo(linkStayTaxi);
        /** if there are ongoing parking violations, resolve, otherwise skip */
        if (!taxisToGo.isEmpty()) {
            Map<Link, Integer> freeSpacesToGo = parkingLPHelper.getFreeSpacesToGo(linkStayTaxi, //
                    StaticHelper.getDestinationCount(rebalancingRobotaxis));
            /** skip any action if no free spaces */
            if (!freeSpacesToGo.isEmpty()) {
                /** at this point the parking repositioning problem is solved */
                /** creating unitsToMove map */
                Map<Link, Integer> unitsToMove = RedistributionProblemHelper.getFlow(taxisToGo);

                /** set up the flow problem and solve */
                RedistributionProblemSolver<Link> parkingLP = //
                        new RedistributionProblemSolver<>(unitsToMove, freeSpacesToGo, //
                                (l1, l2) -> distanceFunction.getDistance(l1, l2), l -> l.getId().toString(), //
                                false, "");
                Map<Link, Map<Link, Integer>> flowSolution = parkingLP.returnSolution();

                /** compute command map */
                return RedistributionProblemHelper.getSolutionCommands(taxisToGo, flowSolution);
            }
        }
        return new HashMap<>();
    }

    @Override
    public Map<RoboTaxi, Link> keepFree(Collection<RoboTaxi> stayingRobotaxis, //
            Collection<RoboTaxi> rebalancingRobotaxis, long now) {
        Objects.requireNonNull(distanceFunction);
        Objects.requireNonNull(parkingLPHelper);
        Map<Link, Set<RoboTaxi>> linkStayTaxi = StaticHelper.getOccupiedLinks(stayingRobotaxis);
        Map<Link, Set<RoboTaxi>> taxisToGo = parkingLPHelper.getTaxisToGo(linkStayTaxi);
        /** if there are ongoing parking violations, resolve, otherwise skip */
        if (!taxisToGo.isEmpty()) {
            Map<Link, Integer> freeSpacesToGo = parkingLPHelper.getFreeSpacesToGo(linkStayTaxi, //
                    StaticHelper.getDestinationCount(rebalancingRobotaxis));
            /** skip any action if no free spaces */
            if (!freeSpacesToGo.isEmpty()) {
                /** at this point the parking repositioning problem is solved */
                /** creating unitsToMove map */
                Map<Link, Integer> unitsToMove = RedistributionProblemHelper.getFlow(taxisToGo);

                /** set up the flow problem and solve */
                RedistributionProblemSolver<Link> parkingLP = //
                        new RedistributionProblemSolver<Link>(unitsToMove, freeSpacesToGo, //
                                (l1, l2) -> distanceFunction.getDistance(l1, l2), l -> l.getId().toString(), //
                                false, "");
                Map<Link, Map<Link, Integer>> flowSolution = parkingLP.returnSolution();

                /** compute command map */
                return RedistributionProblemHelper.getSolutionCommands(taxisToGo, flowSolution);
            }
        }
        return new HashMap<>();
    }

Replace Generic With Diamond RedistributionProblemSolver<Link> with RedistributionProblemSolver<> in method public keepFree(stayingRobotaxis Collection<RoboTaxi>, rebalancingRobotaxis Collection<RoboTaxi>, now long) : Map<RoboTaxi,Link> from class ch.ethz.idsc.amodeus.parking.strategies.ParkingFlow


    private static Map<String, Map<String, Double>> localSolverLP(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, l1);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, l2);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Double>> solution = redistributionLP.returnDoubleSolution();
        return solution;
    }

    private static Map<String, Map<String, Double>> localSolverLP(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, l1);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, l2);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<String>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Double>> solution = redistributionLP.returnDoubleSolution();
        return solution;
    }

Replace Generic With Diamond RedistributionProblemSolver<String> with RedistributionProblemSolver<> in method private localSolverLP(n1 int, n2 int) : Map<String,Map<String,Double>> from class ch.ethz.idsc.amodeus.lp.RedistributionIntegralityTests


    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, l1);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, l2);
        }

        /** solve it */
        RedistributionProblemSolverMILP<String> redistributionLP = //
                new RedistributionProblemSolverMILP<>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, l1);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, l2);
        }

        /** solve it */
        RedistributionProblemSolverMILP<String> redistributionLP = //
                new RedistributionProblemSolverMILP<String>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

Replace Generic With Diamond RedistributionProblemSolverMILP<String> with RedistributionProblemSolverMILP<> in method private localSolver(n1 int, n2 int) : Map<String,Map<String,Integer>> from class ch.ethz.idsc.amodeus.lp.RedistributionIntegralityTests


    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, 2);
        }

        for (String string : agentsToGo.keySet()) {
            System.out.println("string: " + string);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, 5);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, 2);
        }

        for (String string : agentsToGo.keySet()) {
            System.out.println("string: " + string);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, 5);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<String>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

Replace Generic With Diamond RedistributionProblemSolver<String> with RedistributionProblemSolver<> in method private localSolver(n1 int, n2 int) : Map<String,Map<String,Integer>> from class ch.ethz.idsc.amodeus.lp.RedistributionTests1


    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, 1);
        }

        for (String string : agentsToGo.keySet()) {
            System.out.println("string: " + string);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, i + 1);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

    private static Map<String, Map<String, Integer>> localSolver(int n1, int n2) {
        /** roboTaxi must leave link 1 */
        Map<String, Integer> agentsToGo = new HashMap<>();
        for (int i = 1; i <= n1; ++i) {
            agentsToGo.put("o" + i, 1);
        }

        for (String string : agentsToGo.keySet()) {
            System.out.println("string: " + string);
        }

        /** free spots available on link 2 */
        Map<String, Integer> freeSpaces = new HashMap<>();
        for (int i = 1; i <= n2; ++i) {
            freeSpaces.put("d" + i, i + 1);
        }

        /** solve it */
        RedistributionProblemSolver<String> redistributionLP = //
                new RedistributionProblemSolver<String>(agentsToGo, freeSpaces, //
                        (i1, i2) -> distance(i1, i2), s -> s, false, "");
        Map<String, Map<String, Integer>> solution = redistributionLP.returnSolution();
        return solution;
    }

Replace Generic With Diamond RedistributionProblemSolver<String> with RedistributionProblemSolver<> in method private localSolver(n1 int, n2 int) : Map<String,Map<String,Integer>> from class ch.ethz.idsc.amodeus.lp.RedistributionTests2


    @Test
    public void test() {
        DistanceFunction distanceFunction = EuclideanDistanceFunction.INSTANCE;
        /** roboTaxi must leave link 1 */
        Map<Link, Set<RoboTaxi>> taxisToGo = new HashMap<>();
        HashSet<RoboTaxi> taxis = new HashSet<>();
        taxis.add(roboTaxi);
        taxisToGo.put(link1, taxis);

        /** free spots available on link 2 */
        Map<Link, Integer> freeSpaces = new HashMap<>();
        freeSpaces.put(link2, 10);

        /** solve it */
        Map<RoboTaxi, Link> solution = //
                flowLayerSolution(taxisToGo, freeSpaces, distanceFunction);

        System.out.println("size: " + solution.size());
        System.out.println(solution.get(roboTaxi).getId());

        /** solution should send roboTaxi to linkup */
        Assert.assertTrue(solution.size() == 1);
        Assert.assertTrue(solution.get(roboTaxi).getId().toString().equals("linkUp"));
    }

    @Test
    public void test() {
        DistanceFunction distanceFunction = EuclideanDistanceFunction.INSTANCE;
        /** roboTaxi must leave link 1 */
        Map<Link, Set<RoboTaxi>> taxisToGo = new HashMap<Link, Set<RoboTaxi>>();
        HashSet<RoboTaxi> taxis = new HashSet<>();
        taxis.add(roboTaxi);
        taxisToGo.put(link1, taxis);

        /** free spots available on link 2 */
        Map<Link, Integer> freeSpaces = new HashMap<>();
        freeSpaces.put(link2, 10);

        /** solve it */
        Map<RoboTaxi, Link> solution = //
                flowLayerSolution(taxisToGo, freeSpaces, distanceFunction);

        System.out.println("size: " + solution.size());
        System.out.println(solution.get(roboTaxi).getId());

        /** solution should send roboTaxi to linkup */
        Assert.assertTrue(solution.size() == 1);
        Assert.assertTrue(solution.get(roboTaxi).getId().toString().equals("linkUp"));
    }

Replace Generic With Diamond HashMap<Link,Set<RoboTaxi>> with HashMap<> in method public test() : void from class ch.ethz.idsc.amodeus.lp.RedistributionTestsVerySimple


    /** Randomly choses @param numberSpots from the @param network out of all links
     * that have parking spaces marked with @param capacityIdentifier, random selection
     * done using the {@link Random} @param random */
    public ParkingCapacityFromNetworkDistribution(Network network, String capacityIdentifier, //
            Random random, long desiredTotalSpots) {

        List<Link> linksWithParking = new ArrayList<>();
        network.getLinks().values().stream()//
                .forEach(l -> {
                    try {
                        Map<String, Object> attrMap = l.getAttributes().getAsMap();
                        if (attrMap.containsKey(capacityIdentifier)) {
                            Object attribute = attrMap.get(capacityIdentifier);
                            Long capacity = Long.parseLong(attribute.toString());
                            if (capacity > 0)
                                linksWithParking.add(l);
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                        // TODO solve more elegantly
                    }
                });

        System.out.println("Number of links with Parking: " + linksWithParking.size());
        if (linksWithParking.size() < 1) {
            System.err.println("The network does not contain any parkings for identifier:");
            System.err.println(capacityIdentifier);
            System.err.println("Aborting.");
            GlobalAssert.that(false);
        }

        /** shuffle to have random selection of streets */
        Collections.shuffle(linksWithParking, random);
        long assignedSpots = 0;
        for (Link link : linksWithParking) {
            if (desiredTotalSpots == assignedSpots)
                break;
            Long streetCapacity = Long.parseLong(link.getAttributes().getAttribute(capacityIdentifier).toString());
            long putSpots = Math.min(streetCapacity, desiredTotalSpots - assignedSpots);
            assignedSpots += putSpots;
            capacities.put(link.getId(), putSpots);
        }
        System.out.println("Number of desired parking spots: " + desiredTotalSpots);
        System.out.println("Number of assigned parking spots: " + assignedSpots);
    }

    /** Randomly choses @param numberSpots from the @param network out of all links
     * that have parking spaces marked with @param capacityIdentifier, random selection
     * done using the {@link Random} @param random */
    public ParkingCapacityFromNetworkDistribution(Network network, String capacityIdentifier, //
            Random random, long desiredTotalSpots) {

        List<Link> linksWithParking = new ArrayList<Link>();
        network.getLinks().values().stream()//
                .forEach(l -> {
                    try {
                        Map<String, Object> attrMap = l.getAttributes().getAsMap();
                        if (attrMap.containsKey(capacityIdentifier)) {
                            Object attribute = attrMap.get(capacityIdentifier);
                            Long capacity = Long.parseLong(attribute.toString());
                            if (capacity > 0)
                                linksWithParking.add(l);
                        }
                    } catch (Exception ex) {
                        ex.printStackTrace();
                        // TODO solve more elegantly
                    }
                });

        System.out.println("Number of links with Parking: " + linksWithParking.size());
        if (linksWithParking.size() < 1) {
            System.err.println("The network does not contain any parkings for identifier:");
            System.err.println(capacityIdentifier);
            System.err.println("Aborting.");
            GlobalAssert.that(false);
        }

        /** shuffle to have random selection of streets */
        Collections.shuffle(linksWithParking, random);
        long assignedSpots = 0;
        for (Link link : linksWithParking) {
            if (desiredTotalSpots == assignedSpots)
                break;
            Long streetCapacity = Long.parseLong(link.getAttributes().getAttribute(capacityIdentifier).toString());
            long putSpots = Math.min(streetCapacity, desiredTotalSpots - assignedSpots);
            assignedSpots += putSpots;
            capacities.put(link.getId(), putSpots);
        }
        System.out.println("Number of desired parking spots: " + desiredTotalSpots);
        System.out.println("Number of assigned parking spots: " + assignedSpots);
    }

Replace Generic With Diamond ArrayList<Link> with ArrayList<> in method public ParkingCapacityFromNetworkDistribution(network Network, capacityIdentifier String, random Random, desiredTotalSpots long) from class ch.ethz.idsc.amodeus.parking.capacities.ParkingCapacityFromNetworkDistribution


    /** A {@link CashedNetworkTimeDistance} stores all the calculated travel times
     * which were calculated no longer ago than @param maxLag. The underlying logic is that in this manner
     * the expensive routing computation has to be done fewer times for identical pairs
     * of {@link Link}s.For the routing, different {@link LeastCostPathCalculator}s can be used,
     * e.g., to minimize traveltime or network distance. If the boolean @param cachePath is set to
     * true, then the computed Pathes are stored as well (memory intensive!) */
    public CashedNetworkTimeDistance(LeastCostPathCalculator calculator, Double maxLag, NetworkPropertyInterface<Tensor> pathInterface) {
        this.cachedPathComputation = new CashedNetworkPropertyComputation<>(calculator, maxLag, pathInterface);
    }

    /** A {@link CashedNetworkTimeDistance} stores all the calculated travel times
     * which were calculated no longer ago than @param maxLag. The underlying logic is that in this manner
     * the expensive routing computation has to be done fewer times for identical pairs
     * of {@link Link}s.For the routing, different {@link LeastCostPathCalculator}s can be used,
     * e.g., to minimize traveltime or network distance. If the boolean @param cachePath is set to
     * true, then the computed Pathes are stored as well (memory intensive!) */
    public CashedNetworkTimeDistance(LeastCostPathCalculator calculator, Double maxLag, NetworkPropertyInterface<Tensor> pathInterface) {
        this.cachedPathComputation = new CashedNetworkPropertyComputation<Tensor>(calculator, maxLag, pathInterface);
    }

Replace Generic With Diamond CashedNetworkPropertyComputation<Tensor> with CashedNetworkPropertyComputation<> in method public CashedNetworkTimeDistance(calculator LeastCostPathCalculator, maxLag Double, pathInterface NetworkPropertyInterface<Tensor>) from class ch.ethz.idsc.amodeus.routing.CashedNetworkTimeDistance


    public static ViewerConfig from(MatsimAmodeusDatabase db, File workingDirectory) throws IOException {
        File settingsFile = new File(workingDirectory, DEFAULT_FILENAME);
        try (ObjectInputStream objectInputStream = new ObjectInputStream(new FileInputStream(settingsFile))) {
            ViewerSettings settings = (ViewerSettings) objectInputStream.readObject();
            return new ViewerConfig(db, settings);
        } catch (FileNotFoundException e) {
            System.out.println(String.format("Unable to find file: %s! Continue with default setting.", //
                    settingsFile.getAbsolutePath()));
            return ViewerConfig.fromDefaults(db);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }

    public static ViewerConfig from(MatsimAmodeusDatabase db, File workingDirectory) throws IOException {
        File settingsFile = new File(workingDirectory, defaultFileName);
        try {
            ObjectInputStream stream = new ObjectInputStream(new FileInputStream(settingsFile));
            ViewerSettings settings = (ViewerSettings) stream.readObject();
            stream.close();
            return new ViewerConfig(db, settings);
        } catch (FileNotFoundException e) {
            System.out.println(String.format("Unable to find file: %s! Continue with default setting.", //
                    settingsFile.getAbsolutePath()));
            return ViewerConfig.fromDefaults(db);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            return null;
        }
    }

Try With Resources try(ObjectInputStream objectInputStream=new ObjectInputStream(new FileInputStream(settingsFile))) in method public from(db MatsimAmodeusDatabase, workingDirectory File) : ViewerConfig from class ch.ethz.idsc.amodeus.gfx.ViewerConfig


    public void save(AmodeusComponent amodeusComponent, File workingDirectory) throws IOException {
        File settingsFile = new File(workingDirectory, DEFAULT_FILENAME);
        try (ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(settingsFile))) {
            objectOutputStream.writeObject(update(amodeusComponent).settings);
            System.out.println("exporting viewer settings to " + settingsFile.getAbsolutePath());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void save(AmodeusComponent amodeusComponent, File workingDirectory) throws IOException {
        File settingsFile = new File(workingDirectory, defaultFileName);
        try {
            ObjectOutputStream stream = new ObjectOutputStream(new FileOutputStream(settingsFile));
            stream.writeObject(update(amodeusComponent).settings);
            stream.close();
            System.out.println("exporting viewer settings to " + settingsFile.getAbsolutePath());
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

Try With Resources try(ObjectOutputStream objectOutputStream=new ObjectOutputStream(new FileOutputStream(settingsFile))) in method public save(amodeusComponent AmodeusComponent, workingDirectory File) : void from class ch.ethz.idsc.amodeus.gfx.ViewerConfig


	public WindowsShortcut(final File file) throws IOException, ParseException {
		try (InputStream in = new FileInputStream(file)) {
			parseLink(getBytes(in));
		}
	}

	public WindowsShortcut(final File file) throws IOException, ParseException {
		final InputStream in = new FileInputStream(file);
		try {
			parseLink(getBytes(in));
		} finally {
			in.close();
		}
	}

Try With Resources try(InputStream in=new FileInputStream(file)) in method public WindowsShortcut(file File) from class com.goxr3plus.xr3player.utils.io.WindowsShortcut


	/**
	 * This method starts the Animation of the marquee
	 */
	private final void startAnimation() {

		// KeyFrame
		KeyFrame updateFrame = new KeyFrame(Duration.millis(35), new EventHandler<>() {

			private boolean rightMovement;

			@Override
			public void handle(ActionEvent event) {
				double textWidth = label.getLayoutBounds().getWidth();
				double paneWidth = getWidth();
				double layoutX = label.getLayoutX();

				if (2 * OFFSET + textWidth <= paneWidth && layoutX >= OFFSET) {
					// stop, if the pane is large enough and the position is
					// correct
					label.setLayoutX(OFFSET);
					timeline.stop();
				} else {
					if ((rightMovement && layoutX >= OFFSET)
							|| (!rightMovement && layoutX + textWidth + OFFSET <= paneWidth)) {
						// invert movement, if bounds are reached
						rightMovement = !rightMovement;
					}

					// update position
					if (rightMovement) {
						layoutX += 1;
					} else {
						layoutX -= 1;
					}
					label.setLayoutX(layoutX);
				}
			}
		});
		timeline.getKeyFrames().add(updateFrame);
		timeline.setCycleCount(Animation.INDEFINITE);

		// listen to bound changes of the elements to start/stop the
		// animation
		InvalidationListener listener = o -> checkAnimationValidity(animationAllowed);

		label.layoutBoundsProperty().addListener(listener);
		widthProperty().addListener(listener);

	}

	/**
	 * This method starts the Animation of the marquee
	 */
	private final void startAnimation() {

		// KeyFrame
		KeyFrame updateFrame = new KeyFrame(Duration.millis(35), new EventHandler<ActionEvent>() {

			private boolean rightMovement;

			@Override
			public void handle(ActionEvent event) {
				double textWidth = label.getLayoutBounds().getWidth();
				double paneWidth = getWidth();
				double layoutX = label.getLayoutX();

				if (2 * OFFSET + textWidth <= paneWidth && layoutX >= OFFSET) {
					// stop, if the pane is large enough and the position is
					// correct
					label.setLayoutX(OFFSET);
					timeline.stop();
				} else {
					if ((rightMovement && layoutX >= OFFSET)
							|| (!rightMovement && layoutX + textWidth + OFFSET <= paneWidth)) {
						// invert movement, if bounds are reached
						rightMovement = !rightMovement;
					}

					// update position
					if (rightMovement) {
						layoutX += 1;
					} else {
						layoutX -= 1;
					}
					label.setLayoutX(layoutX);
				}
			}
		});
		timeline.getKeyFrames().add(updateFrame);
		timeline.setCycleCount(Animation.INDEFINITE);

		// listen to bound changes of the elements to start/stop the
		// animation
		InvalidationListener listener = o -> checkAnimationValidity(animationAllowed);

		label.layoutBoundsProperty().addListener(listener);
		widthProperty().addListener(listener);

	}

Replace Generic With Diamond KeyFrame with KeyFrame in method private startAnimation() : void from class com.goxr3plus.xr3player.controllers.custom.Marquee


		@Override
		protected Task<Void> createTask() {
			return new Task<>() {

				@Override
				protected Void call() throws Exception {

					// Loop
					while (run) {

						// Monitor the CPU
						if (monitor == Monitor.CPU) {
							CpuTimes cpu;

							cpu = javaSysMon.cpuTimes();
							Thread.sleep(999);
							usageDouble = javaSysMon.cpuTimes().getCpuUsage(cpu); // * 100.00;
							usage = (int) usageDouble;
							Platform.runLater(() -> progressBar.setProgress(usageDouble));

							// System.out.println("CPU Update Service Exited");
						}
						// Monitor the RAM
						else if (monitor == Monitor.RAM) {

							Thread.sleep(999);
							MemoryStats memory = javaSysMon.physical();
							// System.out.println("Total: "+memory.getTotalBytes()+" ,Free:
							// "+memory.getFreeBytes())
							// usage = 100 - (int) (((memory.getFreeBytes() * 100.00) /
							// memory.getTotalBytes()));
							usageDouble = 1.00 - ((memory.getFreeBytes() * 100.00) / memory.getTotalBytes()) / 100;
							// System.out.println(usageDouble);
							Platform.runLater(() -> progressBar.setProgress(usageDouble));
						}

					}

					System.out.println("Update Service Exited");
					Platform.runLater(() -> progressBar.setProgress(0));

					return null;
				}
			};
		}

		@Override
		protected Task<Void> createTask() {
			return new Task<Void>() {

				@Override
				protected Void call() throws Exception {

					// Loop
					while (run) {

						// Monitor the CPU
						if (monitor == Monitor.CPU) {
							CpuTimes cpu;

							cpu = javaSysMon.cpuTimes();
							Thread.sleep(999);
							usageDouble = javaSysMon.cpuTimes().getCpuUsage(cpu); // * 100.00;
							usage = (int) usageDouble;
							Platform.runLater(() -> progressBar.setProgress(usageDouble));

							// System.out.println("CPU Update Service Exited");
						}
						// Monitor the RAM
						else if (monitor == Monitor.RAM) {

							Thread.sleep(999);
							MemoryStats memory = javaSysMon.physical();
							// System.out.println("Total: "+memory.getTotalBytes()+" ,Free:
							// "+memory.getFreeBytes())
							// usage = 100 - (int) (((memory.getFreeBytes() * 100.00) /
							// memory.getTotalBytes()));
							usageDouble = 1.00 - ((memory.getFreeBytes() * 100.00) / memory.getTotalBytes()) / 100;
							// System.out.println(usageDouble);
							Platform.runLater(() -> progressBar.setProgress(usageDouble));
						}

					}

					System.out.println("Update Service Exited");
					Platform.runLater(() -> progressBar.setProgress(0));

					return null;
				}
			};
		}

Replace Generic With Diamond Task<Void> with Task<> in method protected createTask() : Task<Void> from class com.goxr3plus.xr3player.controllers.custom.SystemMonitor.UpdateService