Disallow eternal taunt disguising an already disguised player
This commit is contained in:
parent
5387d3b580
commit
ea8c7be5f0
@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Color;
|
import org.bukkit.Color;
|
||||||
import org.bukkit.FireworkEffect;
|
import org.bukkit.FireworkEffect;
|
||||||
@ -41,7 +42,8 @@ public class EternalTaunt extends TauntGadget
|
|||||||
private static final int COOLDOWN = 30000;
|
private static final int COOLDOWN = 30000;
|
||||||
private static final int PVP_COOLDOWN = 10000;
|
private static final int PVP_COOLDOWN = 10000;
|
||||||
|
|
||||||
private Map<UUID, List<Item>> _clocks = new HashMap<>();
|
private final Map<UUID, List<Item>> _clocks = new HashMap<>();
|
||||||
|
private final Map<UUID, DisguiseBase> _disguises = new HashMap<>();
|
||||||
|
|
||||||
public EternalTaunt(GadgetManager manager)
|
public EternalTaunt(GadgetManager manager)
|
||||||
{
|
{
|
||||||
@ -68,8 +70,12 @@ public class EternalTaunt extends TauntGadget
|
|||||||
|
|
||||||
Bukkit.broadcastMessage(F.main("Taunt", F.name(player.getName()) + " waited so long they turned to bones."));
|
Bukkit.broadcastMessage(F.main("Taunt", F.name(player.getName()) + " waited so long they turned to bones."));
|
||||||
|
|
||||||
DisguiseSkeleton disguiseSkeleton = new DisguiseSkeleton(player);
|
if (!Manager.getDisguiseManager().isDisguised(player))
|
||||||
UtilMorph.disguise(player, disguiseSkeleton, Manager);
|
{
|
||||||
|
DisguiseSkeleton disguiseSkeleton = new DisguiseSkeleton(player);
|
||||||
|
UtilMorph.disguise(player, disguiseSkeleton, Manager);
|
||||||
|
_disguises.put(player.getUniqueId(), disguiseSkeleton);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -114,7 +120,11 @@ public class EternalTaunt extends TauntGadget
|
|||||||
@Override
|
@Override
|
||||||
public void onFinish(Player player)
|
public void onFinish(Player player)
|
||||||
{
|
{
|
||||||
UtilMorph.undisguise(player, Manager.getDisguiseManager());
|
if (_disguises.containsKey(player.getUniqueId()))
|
||||||
|
{
|
||||||
|
Manager.getDisguiseManager().undisguise(_disguises.remove(player.getUniqueId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (_clocks.containsKey(player.getUniqueId()))
|
if (_clocks.containsKey(player.getUniqueId()))
|
||||||
{
|
{
|
||||||
_clocks.get(player.getUniqueId()).forEach(c -> c.remove());
|
_clocks.get(player.getUniqueId()).forEach(c -> c.remove());
|
||||||
|
Loading…
Reference in New Issue
Block a user