Changed name, lore, icon and cooldown

This commit is contained in:
LCastr0 2017-03-27 23:58:01 -03:00
parent 8da2431415
commit ae2768d354

View File

@ -22,6 +22,7 @@ import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.morph.managers.UtilMorph;
import mineplex.core.gadget.types.MorphGadget;
import mineplex.core.hologram.Hologram;
import mineplex.core.recharge.Recharge;
import mineplex.core.utils.UtilGameProfile;
public class MorphAwkwardRabbit extends MorphGadget
@ -29,9 +30,13 @@ public class MorphAwkwardRabbit extends MorphGadget
private List<String> _quotes = new ArrayList<>();
private static final long COOLDOWN = 10000;
private static final long HOLOGRAM_TIME = 3000;
public MorphAwkwardRabbit(GadgetManager manager)
{
super(manager, "Awkward Rabbit Morph", UtilText.splitLinesToArray(new String[]{C.cGray + "Dale was the most awkward of Rabbits."}, LineFormat.LORE),
super(manager, "Wascally Wabbit Morph",
UtilText.splitLinesToArray(new String[]{C.cGray + "Be absolutely silent my friends we are searching for rabbits currently!"}, LineFormat.LORE),
-19, Material.SKULL_ITEM, (byte) 0);
_quotes.addAll(Arrays.asList(
"Eh, what's up, doc?",
@ -41,6 +46,7 @@ public class MorphAwkwardRabbit extends MorphGadget
"I know this defies the\n law of gravity,\n but I never studied law!",
"I dont ask questions,\n I just have fun",
"Hey, just a minute you!\n Thems fightin words!"));
setDisplayItem(SkinData.BUGS_BUNNY.getSkull());
}
@Override
@ -73,6 +79,9 @@ public class MorphAwkwardRabbit extends MorphGadget
if (event.isSneaking())
return;
if (!Recharge.Instance.use(event.getPlayer(), getName(), COOLDOWN, true, false, "Cosmetics"))
return;
Location randomLoc = event.getPlayer().getLocation().clone();
int[] rPos = new int[]{-2, -1, 0, 1, 2};
int rX = rPos[UtilMath.random.nextInt(rPos.length)], rZ = rPos[UtilMath.random.nextInt(rPos.length)];
@ -81,14 +90,14 @@ public class MorphAwkwardRabbit extends MorphGadget
String quote = _quotes.get(UtilMath.random.nextInt(_quotes.size()));
Hologram hologram;
if (quote.contains("*nl*"))
if (quote.contains("\n"))
{
String[] lines = quote.split("\n");
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, 2000, lines);
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, HOLOGRAM_TIME, lines);
}
else
{
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, 2000, quote);
hologram = new Hologram(Manager.getHologramManager(), randomLoc, true, HOLOGRAM_TIME, quote);
}
hologram.start();
}