Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.quakecraftmoney.main;
- import java.util.Arrays;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.DyeColor;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.entity.PlayerDeathEvent;
- import org.bukkit.event.inventory.InventoryClickEvent;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.event.player.PlayerJoinEvent;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.scoreboard.DisplaySlot;
- import org.bukkit.scoreboard.Objective;
- import org.bukkit.scoreboard.Score;
- import org.bukkit.scoreboard.ScoreboardManager;
- public class Coins extends JavaPlugin implements Listener {
- int spaceman = 1800;
- public SQLConnection sql;
- public void onEnable(){
- sql = new SQLConnection("jdbc:mysql://","localhost","minecraft","root","narut5");
- sql.connection();
- getCommand("money").setExecutor(new CmdCoins(sql));
- getConfig().options().copyDefaults(true);
- saveConfig();
- Bukkit.getServer().getPluginManager().registerEvents(this, this);
- }
- public void onDisable(){
- sql.disconnect();
- }
- @EventHandler
- public void join(PlayerJoinEvent e) {
- Player p = e.getPlayer();
- sql.createAccount(p);
- }
- //------------------------------------------------------------------------------------------------------
- // Scoreboard
- //------------------------------------------------------------------------------------------------------
- @EventHandler
- public void scoreboardJoin(PlayerJoinEvent e) {
- Player p = e.getPlayer();
- int balance = sql.getBalance(p);
- int kill = sql.getKills(p);
- int win = sql.getWins(p);
- ScoreboardManager sb = Bukkit.getScoreboardManager();
- org.bukkit.scoreboard.Scoreboard board = sb.getNewScoreboard();
- Objective obj = board.registerNewObjective("Stats", "dummy");
- obj.setDisplaySlot(DisplaySlot.SIDEBAR);
- obj.setDisplayName("Stats");
- Score coins = obj.getScore("Coins:");
- coins.setScore(balance);
- Score kills = obj.getScore("Kills:");
- kills.setScore(kill);
- Score wins = obj.getScore("Wins:");
- wins.setScore(win);
- p.setScoreboard(board);
- }
- //------------------------------------------------------------------------------------------------------
- // Coin Gain
- //------------------------------------------------------------------------------------------------------
- @SuppressWarnings("deprecation")
- @EventHandler
- public void onQuakeDeath(PlayerDeathEvent e) {
- Player p = e.getEntity().getPlayer().getKiller();
- sql.addKills(p, 1);
- sql.addMoney(p, 1);
- getServer().getScheduler().scheduleAsyncDelayedTask(this, new Runnable() {
- public void run() {
- p.sendMessage(ChatColor.GOLD + "+1 coins!");
- }
- }, 1L);
- }
- //------------------------------------------------------------------------------------------------------
- // Main Shop Page
- //------------------------------------------------------------------------------------------------------
- public void openGUI3(Player player) {
- Inventory invShop = Bukkit.createInventory(null, 54, "Quake Shop");
- ItemStack quakeHA = new ItemStack(Material.REDSTONE, 1);
- ItemMeta quakeHAMeta = quakeHA.getItemMeta();
- quakeHAMeta.setDisplayName(ChatColor.RED + "Disable");
- quakeHAMeta.setLore(Arrays.asList(ChatColor.GRAY + "Instant Respawn"));
- quakeHA.setItemMeta(quakeHAMeta);
- invShop.setItem(48, quakeHA);
- ItemStack quakeHB = new ItemStack(Material.EMERALD, 1);
- ItemMeta quakeHBMeta = quakeHB.getItemMeta();
- int balance = sql.getBalance(player);
- quakeHBMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- quakeHBMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- quakeHB.setItemMeta(quakeHBMeta);
- invShop.setItem(49, quakeHB);
- ItemStack quakeHC = new ItemStack(Material.WOOD_HOE, 1);
- ItemMeta quakeHCMeta = quakeHC.getItemMeta();
- quakeHCMeta.setDisplayName(ChatColor.GREEN + "Current Railgun");
- quakeHCMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Name: " + ChatColor.GREEN + "Basic Railgun", ChatColor.GRAY + "Case: " + ChatColor.GREEN + "Wooden Case", ChatColor.GRAY + "Sight: " + ChatColor.GREEN + "Yellow Laser", ChatColor.GRAY + "Barrel: " + ChatColor.GREEN + "Small Barrel", ChatColor.GRAY + "Muzzle: " + ChatColor.GREEN + "No Muzzle", ChatColor.GRAY + "Reload Time: " + ChatColor.GREEN + "1.5s"));
- quakeHC.setItemMeta(quakeHCMeta);
- invShop.setItem(50, quakeHC);
- ItemStack quakeH2 = new ItemStack(Material.LEATHER_HELMET, 1);
- ItemMeta quakeH2Meta = quakeH2.getItemMeta();
- quakeH2Meta.setDisplayName(ChatColor.GREEN + "Hats");
- quakeH2.setItemMeta(quakeH2Meta);
- invShop.setItem(10, quakeH2);
- ItemStack quakeH3 = new ItemStack(Material.IRON_HOE, 1);
- ItemMeta quakeH3Meta = quakeH3.getItemMeta();
- quakeH3Meta.setDisplayName(ChatColor.GREEN + "Cases");
- quakeH3.setItemMeta(quakeH3Meta);
- invShop.setItem(19, quakeH3);
- ItemStack quakeH4 = new ItemStack(Material.IRON_CHESTPLATE, 1);
- ItemMeta quakeH4Meta = quakeH4.getItemMeta();
- quakeH4Meta.setDisplayName(ChatColor.GREEN + "Kits");
- quakeH4.setItemMeta(quakeH4Meta);
- invShop.setItem(12, quakeH4);
- @SuppressWarnings("deprecation")
- ItemStack quakeH5 = new ItemStack(Material.INK_SACK, 1, (short)0, DyeColor.ORANGE.getData());
- ItemMeta quakeH5Meta = quakeH5.getItemMeta();
- quakeH5Meta.setDisplayName(ChatColor.GREEN + "Lasers");
- quakeH5.setItemMeta(quakeH5Meta);
- invShop.setItem(21, quakeH5);
- ItemStack quakeH7 = new ItemStack(Material.PAPER, 1);
- ItemMeta quakeH7Meta = quakeH7.getItemMeta();
- quakeH7Meta.setDisplayName(ChatColor.GREEN + "Odds and Ends");
- quakeH7.setItemMeta(quakeH7Meta);
- invShop.setItem(14, quakeH7);
- ItemStack quakeH8 = new ItemStack(Material.WOOD, 1);
- ItemMeta quakeH8Meta = quakeH8.getItemMeta();
- quakeH8Meta.setDisplayName(ChatColor.GREEN + "Muzzles");
- quakeH8.setItemMeta(quakeH8Meta);
- invShop.setItem(23, quakeH8);
- ItemStack quakeH9 = new ItemStack(Material.FIREBALL, 1);
- ItemMeta quakeH9Meta = quakeH9.getItemMeta();
- quakeH9Meta.setDisplayName(ChatColor.GREEN + "Barrels");
- quakeH9.setItemMeta(quakeH9Meta);
- invShop.setItem(16, quakeH9);
- ItemStack quakeH10 = new ItemStack(Material.STONE_BUTTON, 1);
- ItemMeta quakeH10Meta = quakeH10.getItemMeta();
- quakeH10Meta.setDisplayName(ChatColor.GREEN + "Triggers");
- quakeH10.setItemMeta(quakeH10Meta);
- invShop.setItem(25, quakeH10);
- player.openInventory(invShop);
- }
- @EventHandler
- public void onPlayerInteract3(PlayerInteractEvent event) {
- Action a = event.getAction();
- ItemStack is = event.getItem();
- if (a == Action.PHYSICAL || is == null || is.getType() == Material.AIR)
- return;
- if (is.getType() == Material.EMERALD)
- openGUI3(event.getPlayer());
- }
- //------------------------------------------------------------------------------------------------------
- // Catégories du shop
- //------------------------------------------------------------------------------------------------------
- @SuppressWarnings("deprecation")
- @EventHandler
- public void onInventoryClick(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Quake Shop")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.LEATHER_HELMET
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopHats = Bukkit.createInventory(null, 54, "Hats");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopHats.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopHats.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopHats.setItem(50, back);
- ItemStack h1 = new ItemStack(Material.GLASS, 1);
- ItemMeta h1Meta = h1.getItemMeta();
- h1Meta.setDisplayName(ChatColor.GREEN + "Spaceman Hat");
- h1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Collect all the hats!", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + spaceman));
- h1.setItemMeta(h1Meta);
- shopHats.setItem(10, h1);
- p.openInventory(shopHats);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.IRON_CHESTPLATE
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopKits = Bukkit.createInventory(null, 54, "Kits");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopKits.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopKits.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopKits.setItem(50, back);
- ItemStack k1 = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
- ItemMeta k1Meta = k1.getItemMeta();
- k1Meta.setDisplayName(ChatColor.GREEN + "Soldier Kit");
- k1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Cosmetic armor.", ChatColor.GRAY + " ", ChatColor.GRAY + "Click to equip!"));
- k1.setItemMeta(k1Meta);
- shopKits.setItem(10, k1);
- p.openInventory(shopKits);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.WOOD
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopMuzzles = Bukkit.createInventory(null, 54, "Muzzles");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopMuzzles.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopMuzzles.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopMuzzles.setItem(50, back);
- ItemStack m1 = new ItemStack(Material.GLASS, 1);
- ItemMeta m1Meta = m1.getItemMeta();
- m1Meta.setDisplayName(ChatColor.GREEN + "No Muzzle");
- m1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a particle effect!", ChatColor.WHITE + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Basic Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Superior Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Hyper Beam Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Creeper Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "BFG", ChatColor.WHITE + " ", ChatColor.GREEN + "Equipped!"));
- m1.setItemMeta(m1Meta);
- shopMuzzles.setItem(10, m1);
- p.openInventory(shopMuzzles);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.PAPER
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopOther = Bukkit.createInventory(null, 54, "Odds and Ends");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopOther.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopOther.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopOther.setItem(50, back);
- ItemStack o1 = new ItemStack(Material.COMPASS, 1);
- ItemMeta o1Meta = o1.getItemMeta();
- o1Meta.setDisplayName(ChatColor.GREEN + "Tracking Device");
- o1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Aims toward the closest player!"));
- o1.setItemMeta(o1Meta);
- shopOther.setItem(10, o1);
- p.openInventory(shopOther);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.FIREBALL
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopBarrel = Bukkit.createInventory(null, 54, "Barrels");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopBarrel.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopBarrel.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopBarrel.setItem(50, back);
- ItemStack b1 = new ItemStack(Material.FIREWORK, 1);
- ItemMeta b1Meta = b1.getItemMeta();
- b1Meta.setDisplayName(ChatColor.GREEN + "Small Barrel");
- b1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firework shape!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Basic Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Budder Slapper", ChatColor.GRAY + " ", ChatColor.GREEN + "Equipped!"));
- b1.setItemMeta(b1Meta);
- shopBarrel.setItem(10, b1);
- p.openInventory(shopBarrel);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.IRON_HOE
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopCase = Bukkit.createInventory(null, 54, "Cases");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopCase.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopCase.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopCase.setItem(50, back);
- ItemStack h1 = new ItemStack(Material.WOOD_HOE, 1);
- ItemMeta h1Meta = h1.getItemMeta();
- h1Meta.setDisplayName(ChatColor.GREEN + "Wooden Case");
- h1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose an appearance!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Basic Railgun", ChatColor.GRAY + " ", ChatColor.GREEN + "Equipped!"));
- h1.setItemMeta(h1Meta);
- shopCase.setItem(10, h1);
- p.openInventory(shopCase);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.INK_SACK
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopLaser = Bukkit.createInventory(null, 54, "Lasers");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopLaser.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopLaser.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopLaser.setItem(50, back);
- ItemStack l1 = new ItemStack(Material.INK_SACK, 1, (short)0, DyeColor.ORANGE.getData());
- ItemMeta l1Meta = l1.getItemMeta();
- l1Meta.setDisplayName(ChatColor.GREEN + "Small Laser");
- l1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firework color!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Basic Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Hyper Beam Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Budder Slapper", ChatColor.GRAY + " ", ChatColor.GREEN + "Equipped!"));
- l1.setItemMeta(l1Meta);
- shopLaser.setItem(10, l1);
- p.openInventory(shopLaser);
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.STONE_BUTTON
- || !e.getCurrentItem().hasItemMeta()) {
- Inventory shopTriggers = Bukkit.createInventory(null, 54, "Triggers");
- ItemStack coins = new ItemStack(Material.EMERALD, 1);
- ItemMeta coinsMeta = coins.getItemMeta();
- int balance = sql.getBalance(p);
- coinsMeta.setDisplayName(ChatColor.GRAY + "Total Coins: " + ChatColor.GOLD + balance);
- coinsMeta.setLore(Arrays.asList(ChatColor.WHITE + " ", ChatColor.GRAY + "Kill: 1 coin", ChatColor.GRAY + "Win: 10 coins", ChatColor.WHITE + " ", ChatColor.GOLD + "http://mc.hypixel.net"));
- coins.setItemMeta(coinsMeta);
- shopTriggers.setItem(48, coins);
- ItemStack reset = new ItemStack(Material.GLASS, 1);
- ItemMeta resetMeta = reset.getItemMeta();
- resetMeta.setDisplayName(ChatColor.RED + "Reset Hat");
- reset.setItemMeta(resetMeta);
- shopTriggers.setItem(49, reset);
- ItemStack back = new ItemStack(Material.ARROW, 1);
- ItemMeta backMeta= back.getItemMeta();
- backMeta.setDisplayName(ChatColor.GREEN + "Go Back");
- back.setItemMeta(backMeta);
- shopTriggers.setItem(50, back);
- ItemStack t1 = new ItemStack(Material.STONE_BUTTON, 15);
- ItemMeta t1Meta = t1.getItemMeta();
- t1Meta.setDisplayName(ChatColor.GREEN + "1.5s");
- t1Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Basic Railgun", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Budder Slapper", ChatColor.GRAY + " ", ChatColor.GREEN + "Equipped!"));
- t1.setItemMeta(t1Meta);
- shopTriggers.setItem(10, t1);
- ItemStack t2 = new ItemStack(Material.STONE_BUTTON, 14);
- ItemMeta t2Meta = t2.getItemMeta();
- t2Meta.setDisplayName(ChatColor.GREEN + "1.4s");
- t2Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Superior Railgun", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + "1800"));
- t2.setItemMeta(t2Meta);
- shopTriggers.setItem(11, t2);
- ItemStack t3 = new ItemStack(Material.STONE_BUTTON, 13);
- ItemMeta t3Meta = t3.getItemMeta();
- t3Meta.setDisplayName(ChatColor.GREEN + "1.3s");
- t3Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Hyper Beam Railgun", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + "3500"));
- t3.setItemMeta(t3Meta);
- shopTriggers.setItem(12, t3);
- ItemStack t4 = new ItemStack(Material.STONE_BUTTON, 12);
- ItemMeta t4Meta = t4.getItemMeta();
- t4Meta.setDisplayName(ChatColor.GREEN + "1.2s");
- t4Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Creeper Railgun", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + "8500"));
- t4.setItemMeta(t4Meta);
- shopTriggers.setItem(13, t4);
- ItemStack t5 = new ItemStack(Material.STONE_BUTTON, 11);
- ItemMeta t5Meta = t5.getItemMeta();
- t5Meta.setDisplayName(ChatColor.GREEN + "1.1s");
- t5Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "BFG", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + "17000"));
- t5.setItemMeta(t5Meta);
- shopTriggers.setItem(14, t5);
- ItemStack t6 = new ItemStack(Material.STONE_BUTTON, 10);
- ItemMeta t6Meta = t6.getItemMeta();
- t6Meta.setDisplayName(ChatColor.GREEN + "1.0s");
- t6Meta.setLore(Arrays.asList(ChatColor.GRAY + "Choose a firing speed!", ChatColor.GRAY + " ", ChatColor.GRAY + ChatColor.ITALIC.toString() + "Used to make " + ChatColor.GREEN + ChatColor.ITALIC.toString() + "Bling Bling Thing", ChatColor.GRAY + " ", ChatColor.GRAY + "Cost: " + ChatColor.GOLD + "100000"));
- t6.setItemMeta(t6Meta);
- shopTriggers.setItem(15, t6);
- p.openInventory(shopTriggers);
- }
- }
- //------------------------------------------------------------------------------------------------------
- // Actions sur les objets
- //------------------------------------------------------------------------------------------------------
- @EventHandler
- public void onInventoryClick4(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Hats")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- if (e.getCurrentItem().getItemMeta().getDisplayName().contains(ChatColor.GREEN + "Lantern Hat"));
- int balance = sql.getBalance(p);
- if(balance == 0);
- p.sendMessage(ChatColor.RED + "You don't have coins!");
- }
- @EventHandler
- public void onInventoryClick5(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Kits")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick6(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Odds and Ends")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick7(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Barrels")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick8(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Cases")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick9(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Lasers")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick10(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Muzzles")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- @EventHandler
- public void onInventoryClick11(InventoryClickEvent e) {
- if (!(ChatColor.stripColor(e.getInventory().getName())
- .equalsIgnoreCase("Triggers")))
- return;
- Player p = (Player) e.getWhoClicked();
- e.setCancelled(true);
- if (e.getCurrentItem() == null ||
- e.getCurrentItem().getType() == Material.AIR ||
- !e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- return;
- }
- if(e.getCurrentItem() == null
- || e.getCurrentItem().getType() == Material.ARROW
- || !e.getCurrentItem().hasItemMeta()) {
- openGUI3(p);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement