Finish ChickenTaunt
This commit is contained in:
parent
1a36305586
commit
0f8765d0c5
|
@ -13,6 +13,8 @@ import org.bukkit.Sound;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilItem;
|
||||
|
@ -20,7 +22,7 @@ import mineplex.core.common.util.UtilParticle;
|
|||
import mineplex.core.common.util.UtilParticle.ParticleType;
|
||||
import mineplex.core.common.util.UtilParticle.ViewDist;
|
||||
import mineplex.core.disguise.disguises.DisguiseBase;
|
||||
import mineplex.core.disguise.disguises.DisguiseChicken;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import mineplex.core.gadget.GadgetManager;
|
||||
import mineplex.core.gadget.types.TauntGadget;
|
||||
import mineplex.core.gadget.util.CostConstants;
|
||||
|
@ -32,24 +34,27 @@ import mineplex.core.updater.UpdateType;
|
|||
public class ChickenTaunt extends TauntGadget
|
||||
{
|
||||
|
||||
private static final int COOLDOWN = 3000, PVP_COOLDOWN = 10000;
|
||||
private static final int COOLDOWN = 30000, PVP_COOLDOWN = 10000;
|
||||
private static final String CHICKEN_SKIN = "MHF_Chicken";
|
||||
|
||||
private final Map<UUID, DisguiseBase> _disguises = new HashMap<>();
|
||||
|
||||
private GameProfile _cachedProfile;
|
||||
|
||||
public ChickenTaunt(GadgetManager manager)
|
||||
{
|
||||
super(manager, "Chicken Taunt", new String[]
|
||||
{
|
||||
C.cGray + "Baw Baw Bawk! It seems that",
|
||||
C.cGray + "everyone is too afraid to fight you",
|
||||
C.cGray + "what a shame.",
|
||||
"",
|
||||
C.cWhite + "Use /taunt in game to use this taunt.",
|
||||
C.cRed + "Cannot be used while in PvP!"
|
||||
}, CostConstants.POWERPLAY_BONUS, Material.GLASS, (byte) 0);
|
||||
{
|
||||
C.cGray + "Baw Baw Bawk! It seems that",
|
||||
C.cGray + "everyone is too afraid to fight you",
|
||||
C.cGray + "what a shame.",
|
||||
"",
|
||||
C.cWhite + "Use /taunt in game to use this taunt.",
|
||||
C.cRed + "Cannot be used while in PvP!"
|
||||
}, CostConstants.POWERPLAY_BONUS, Material.GLASS, (byte) 0);
|
||||
|
||||
setDisplayItem(new ItemBuilder(Material.SKULL_ITEM, (byte) 3)
|
||||
.setPlayerHead("MHF_Chicken")
|
||||
.setPlayerHead(CHICKEN_SKIN)
|
||||
.build());
|
||||
setPPCYearMonth(YearMonth.of(2018, Month.JUNE));
|
||||
setCanPlayWithPvp(false);
|
||||
|
@ -75,11 +80,26 @@ public class ChickenTaunt extends TauntGadget
|
|||
|
||||
if (!Manager.getDisguiseManager().isDisguised(player))
|
||||
{
|
||||
DisguiseChicken disguise = new DisguiseChicken(player);
|
||||
disguise.setName(player.getName());
|
||||
disguise.setCustomNameVisible(true);
|
||||
Manager.getDisguiseManager().disguise(disguise);
|
||||
_disguises.put(player.getUniqueId(), disguise);
|
||||
DisguisePlayer disguise;
|
||||
|
||||
if (_cachedProfile == null)
|
||||
{
|
||||
disguise = new DisguisePlayer(player, player.getName(), CHICKEN_SKIN);
|
||||
disguise.showInTabList(true, 0);
|
||||
disguise.initialize(() ->
|
||||
{
|
||||
_cachedProfile = disguise.getProfile();
|
||||
Manager.getDisguiseManager().disguise(disguise);
|
||||
_disguises.put(player.getUniqueId(), disguise);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
disguise = new DisguisePlayer(player, _cachedProfile);
|
||||
disguise.showInTabList(true, 0);
|
||||
Manager.getDisguiseManager().disguise(disguise);
|
||||
_disguises.put(player.getUniqueId(), disguise);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue