Added Spring set, added awkward bunny morph, added items to menus

This commit is contained in:
LCastr0 2017-03-22 14:37:42 -03:00
parent 4cd25ad921
commit 47b88b7734
4 changed files with 103 additions and 0 deletions

View File

@ -55,6 +55,7 @@ import mineplex.core.gadget.gadgets.arrowtrail.howlingwinds.ArrowTrailStorm;
import mineplex.core.gadget.gadgets.arrowtrail.music.ArrowTrailMusic;
import mineplex.core.gadget.gadgets.arrowtrail.party.ArrowTrailConfetti;
import mineplex.core.gadget.gadgets.arrowtrail.shadow.ArrowTrailShadow;
import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring;
import mineplex.core.gadget.gadgets.arrowtrail.titan.ArrowTrailTitan;
import mineplex.core.gadget.gadgets.arrowtrail.vampire.ArrowTrailBlood;
import mineplex.core.gadget.gadgets.arrowtrail.wisdom.ArrowTrailEnchant;
@ -70,6 +71,7 @@ import mineplex.core.gadget.gadgets.death.howlingwinds.DeathStorm;
import mineplex.core.gadget.gadgets.death.music.DeathMusic;
import mineplex.core.gadget.gadgets.death.party.DeathPinataBurst;
import mineplex.core.gadget.gadgets.death.shadow.DeathShadow;
import mineplex.core.gadget.gadgets.death.spring.DeathSpring;
import mineplex.core.gadget.gadgets.death.titan.DeathTitan;
import mineplex.core.gadget.gadgets.death.vampire.DeathBlood;
import mineplex.core.gadget.gadgets.death.wisdom.DeathEnchant;
@ -83,6 +85,7 @@ import mineplex.core.gadget.gadgets.doublejump.howlingwinds.DoubleJumpStorm;
import mineplex.core.gadget.gadgets.doublejump.music.DoubleJumpMusic;
import mineplex.core.gadget.gadgets.doublejump.party.DoubleJumpFirecracker;
import mineplex.core.gadget.gadgets.doublejump.shadow.DoubleJumpShadow;
import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring;
import mineplex.core.gadget.gadgets.doublejump.titan.DoubleJumpTitan;
import mineplex.core.gadget.gadgets.doublejump.vampire.DoubleJumpBlood;
import mineplex.core.gadget.gadgets.doublejump.wisdom.DoubleJumpEnchant;
@ -113,6 +116,7 @@ import mineplex.core.gadget.gadgets.item.ItemPaintbrush;
import mineplex.core.gadget.gadgets.item.ItemPartyPopper;
import mineplex.core.gadget.gadgets.item.ItemSnowball;
import mineplex.core.gadget.gadgets.item.ItemTNT;
import mineplex.core.gadget.gadgets.morph.MorphAwkwardRabbit;
import mineplex.core.gadget.gadgets.morph.MorphBat;
import mineplex.core.gadget.gadgets.morph.MorphBlaze;
import mineplex.core.gadget.gadgets.morph.MorphBlock;
@ -207,6 +211,7 @@ import mineplex.core.gadget.set.SetHowlingWinds;
import mineplex.core.gadget.set.SetMusic;
import mineplex.core.gadget.set.SetParty;
import mineplex.core.gadget.set.SetShadow;
import mineplex.core.gadget.set.SetSpring;
import mineplex.core.gadget.set.SetTitan;
import mineplex.core.gadget.set.SetVampire;
import mineplex.core.gadget.set.SetWisdom;
@ -338,6 +343,7 @@ public class GadgetManager extends MiniPlugin
addSet(new SetVampire(this));
addSet(new SetMusic(this));
addSet(new SetFreedom(this));
addSet(new SetSpring(this));
}
private void createGadgets()
@ -424,6 +430,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new MorphDinnerbone(this));
addGadget(new MorphLoveDoctor(this));
addGadget(new MorphGoldPot(this));
addGadget(new MorphAwkwardRabbit(this));
// Particles
addGadget(new ParticleFoot(this));
@ -465,6 +472,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new ArrowTrailMusic(this));
addGadget(new ArrowTrailFreedom(this));
addGadget(new ArrowTrailHalloween(this));
addGadget(new ArrowTrailSpring(this));
// Death Effect
addGadget(new DeathFrostLord(this));
@ -480,6 +488,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new DeathMusic(this));
addGadget(new DeathFreedom(this));
addGadget(new DeathPresentDanger(this));
addGadget(new DeathSpring(this));
// Double Jump
addGadget(new DoubleJumpFrostLord(this));
@ -495,6 +504,7 @@ public class GadgetManager extends MiniPlugin
addGadget(new DoubleJumpMusic(this));
addGadget(new DoubleJumpFreedom(this));
addGadget(new DoubleJumpHalloween(this));
addGadget(new DoubleJumpSpring(this));
// Hat
for (HatType hatType : HatType.values())

View File

@ -0,0 +1,68 @@
package mineplex.core.gadget.gadgets.morph;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.EventHandler;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.disguise.disguises.DisguiseSkeleton;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
public class MorphAwkwardRabbit extends MorphGadget
{
private Map<Player, Entity> _skeletons = new HashMap<>();
public MorphAwkwardRabbit(GadgetManager manager)
{
super(manager, "Awkward Rabbit Morph", UtilText.splitLinesToArray(new String[]{C.cGray + "Dale was the most awkward of Rabbits"}, LineFormat.LORE),
-19, Material.GLASS, (byte) 0);
}
@Override
public void enableCustom(Player player, boolean message)
{
applyArmor(player, message);
Skeleton dinnerbone = player.getWorld().spawn(player.getLocation(), Skeleton.class);
dinnerbone.setCustomName("Dinnerbone");
dinnerbone.setCustomNameVisible(false);
_skeletons.put(player, dinnerbone);
DisguiseSkeleton disguiseSkeleton = new DisguiseSkeleton(player);
UtilMorph.disguise(player, disguiseSkeleton, Manager);
}
@Override
public void disableCustom(Player player, boolean message)
{
removeArmor(player);
UtilMorph.undisguise(player, Manager.getDisguiseManager());
}
@EventHandler
public void teleportSkeletons(UpdateEvent event)
{
if (event.getType() != UpdateType.TICK)
return;
for (Map.Entry<Player, Entity> entry : _skeletons.entrySet())
{
Player player = entry.getKey();
Entity entity = entry.getValue();
entity.teleport(player.getLocation().clone().add(0, 0.3, 0));
}
}
}

View File

@ -0,0 +1,23 @@
package mineplex.core.gadget.set;
import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.arrowtrail.spring.ArrowTrailSpring;
import mineplex.core.gadget.gadgets.death.spring.DeathSpring;
import mineplex.core.gadget.gadgets.doublejump.spring.DoubleJumpSpring;
import mineplex.core.gadget.gadgets.particle.spring.ParticleSpringHalo;
import mineplex.core.gadget.types.GadgetSet;
public class SetSpring extends GadgetSet
{
public SetSpring(GadgetManager manager)
{
// TODO LORE
super(manager, "Spring", "Double Holiday Points while active",
manager.getGadget(ArrowTrailSpring.class),
manager.getGadget(DeathSpring.class),
manager.getGadget(DoubleJumpSpring.class),
manager.getGadget(ParticleSpringHalo.class));
}
}

View File

@ -22,6 +22,7 @@ import mineplex.core.gadget.gadgets.item.ItemSnowball;
import mineplex.core.gadget.set.SetCupidsLove;
import mineplex.core.gadget.set.SetFreedom;
import mineplex.core.gadget.set.SetFrostLord;
import mineplex.core.gadget.set.SetSpring;
import mineplex.core.gadget.types.Gadget;
import mineplex.core.gadget.types.GadgetSet;
import mineplex.core.titles.tracks.Track;
@ -56,6 +57,7 @@ public class HolidayCheerTrack extends Track
HOLIDAY_SETS.add(SetFreedom.class);
HOLIDAY_SETS.add(SetCupidsLove.class);
HOLIDAY_SETS.add(SetFrostLord.class);
HOLIDAY_SETS.add(SetSpring.class);
}
private final GadgetManager _gadgetManager = Managers.require(GadgetManager.class);