Fix objective ordering
This commit is contained in:
parent
e11a9379b9
commit
0a39b7b756
@ -8,7 +8,6 @@ import java.util.Map;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftZombie;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Zombie;
|
||||
@ -40,7 +39,7 @@ import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.LoadCannonGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.MountCannonGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.StealEnemyPotatoesGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan.ClanInfoGoal;
|
||||
import mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy.ClanInfoGoal;
|
||||
|
||||
public class AttackEnemyObjective extends OrderedObjective<ClansMainTutorial>
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.clan;
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy;
|
||||
|
||||
|
||||
import mineplex.core.common.util.F;
|
@ -1,58 +0,0 @@
|
||||
package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.fields;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
|
||||
import mineplex.core.common.DefaultHashMap;
|
||||
import mineplex.game.clans.tutorial.objective.Objective;
|
||||
import mineplex.game.clans.tutorial.objective.ObjectiveGoal;
|
||||
|
||||
public class KillZombiesGoal extends ObjectiveGoal
|
||||
{
|
||||
private DefaultHashMap<UUID, Integer> _kills = new DefaultHashMap<>(uuid -> 0);
|
||||
|
||||
public KillZombiesGoal(Objective objective)
|
||||
{
|
||||
super(objective, "Kill Zombies", "Kill a few zombies in the Fields.");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customStart(Player player)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void customFinish(Player player)
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void entityKilled(EntityDeathEvent event)
|
||||
{
|
||||
if (event.getEntityType() != EntityType.ZOMBIE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getEntity().getKiller() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!contains(event.getEntity().getKiller()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_kills.put(event.getEntity().getKiller().getUniqueId(), Integer.valueOf(_kills.get(event.getEntity().getKiller().getUniqueId()).intValue() + 1));
|
||||
|
||||
if (_kills.get(event.getEntity().getKiller().getUniqueId()).intValue() >= 2)
|
||||
{
|
||||
finish(event.getEntity().getKiller());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user