From ae2768d35486a2aa6c75de58e209d7ba71896141 Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Mon, 27 Mar 2017 23:58:01 -0300 Subject: [PATCH] Changed name, lore, icon and cooldown --- .../gadgets/morph/MorphAwkwardRabbit.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphAwkwardRabbit.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphAwkwardRabbit.java index 65a5e3b02..dc2b7446b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphAwkwardRabbit.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphAwkwardRabbit.java @@ -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 _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 don’t ask questions,\n I just have fun", "Hey, just a minute you!\n Them’s 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(); }