Test Gem Booster Item

This commit is contained in:
md_5 2016-03-21 20:08:40 +11:00
parent 0f83e302dd
commit 55e64a09b9
2 changed files with 9 additions and 8 deletions

View File

@ -1,7 +1,11 @@
package mineplex.core.gadget.gadgets.item; package mineplex.core.gadget.gadgets.item;
import mineplex.core.common.util.C;
import mineplex.core.common.util.LineFormat;
import mineplex.core.common.util.UtilText;
import mineplex.core.cosmetic.event.ActivateGemBoosterEvent; import mineplex.core.cosmetic.event.ActivateGemBoosterEvent;
import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.GadgetManager;
import mineplex.core.gadget.gadgets.Ammo;
import mineplex.core.gadget.types.ItemGadget; import mineplex.core.gadget.types.ItemGadget;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -10,15 +14,12 @@ public class ItemGemBooster extends ItemGadget
{ {
public static final String NAME = "Gem Booster"; public static final String NAME = "Gem Booster";
private static final String[] LORE = UtilText.splitLineToArray(C.cGray + "Get triple gems in any game on this server!", LineFormat.LORE);
public ItemGemBooster(GadgetManager manager) public ItemGemBooster(GadgetManager manager)
{ {
super(manager, NAME, new String[] super(manager, NAME, LORE, 1, Material.EMERALD, (byte) -1, 0,
{ new Ammo(NAME, NAME, Material.EMERALD, (byte) 0, LORE, -1, 0));
"Get triple gems in any game on this server!"
}, 1, Material.EMERALD, 0, 0, new Ammo(NAME, new String[]
{
}, 1, Material.EMERALD, 0, 0));
} }
@Override @Override

View File

@ -1410,12 +1410,12 @@ public abstract class Game implements Listener
data.getBoostQueue().add(new BoosterData.BoostedGame(Manager.GetServerConfig().HostName, player.getName())); data.getBoostQueue().add(new BoosterData.BoostedGame(Manager.GetServerConfig().HostName, player.getName()));
_boosterRepository.addElement(data, 60 * 30); // 30 minutes _boosterRepository.addElement(data, 60 * 30); // 30 minutes
Manager.getInventoryManager().addItemToInventory(player, ItemGemBooster.NAME, -1); // Manager.getInventoryManager().addItemToInventory(player, ItemGemBooster.NAME, -1);
new GiveawayMessage("GemBooster", player.getName(), "%p has used a gem booster on " + Manager.getPlugin().getConfig().getString("serverstatus.name") new GiveawayMessage("GemBooster", player.getName(), "%p has used a gem booster on " + Manager.getPlugin().getConfig().getString("serverstatus.name")
+ " join now for " + F.elem("triple") + " coins!", "Gem Boosted Game!").publish(); + " join now for " + F.elem("triple") + " coins!", "Gem Boosted Game!").publish();
Bukkit.broadcastMessage("Gem boosters are now active on this server thanks to " + F.elem(player.getName()) + "! Use /tip " + player.getName() + " to give three shards as thanks!"); Bukkit.broadcastMessage(F.main("Game", "Gem boosters are now active on this server thanks to " + F.elem(player.getName()) + "! Use /tip " + player.getName() + " to give three shards as thanks!"));
GemBoosters.add(player.getName()); GemBoosters.add(player.getName());
} }