Advertisement
Guest User

Untitled

a guest
Apr 16th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.02 KB | None | 0 0
  1. Location chestlocation = loc.clone().add(0, -2, 0);
  2.                                 Block chest = chestlocation.getBlock();
  3.                                 Chest ch = (Chest) chest.getState();
  4.                                 ItemStack skullair2 = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
  5.                                 SkullMeta skullMeta2 = (SkullMeta) skullair2.getItemMeta();
  6.                                 skullMeta2.setOwner("SkidzPlays");
  7.                                 skullMeta2.setDisplayName(ChatColor.BLUE + "AIR TANK");
  8.                                 skullMeta2.setLore(Arrays.asList(ChatColor.DARK_BLUE + "FILLED WITH AIR"));
  9.                                 skullair2.setItemMeta(skullMeta2);
  10.  
  11.                                 ItemStack skullfuel = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
  12.                                 SkullMeta skullMeta = (SkullMeta) skullfuel.getItemMeta();
  13.                                 skullMeta.setOwner("Mikano");
  14.                                 skullMeta.setDisplayName(ChatColor.YELLOW + "FUEL CELL");
  15.                                 skullMeta.setLore(Arrays.asList(ChatColor.GOLD + "FILLED WITH FUEL"));
  16.                                 skullfuel.setItemMeta(skullMeta);
  17.  
  18.                                 if (inventoryContainsItem(ch.getInventory(), skullair2)) {
  19.  
  20.                                     File customYml = new File(plugin.getDataFolder() + "/userdata.yml");
  21.                                     FileConfiguration customConfig = YamlConfiguration.loadConfiguration(customYml);
  22.                                     customConfig.set(p.getUniqueId() + ".air.remaining", 105);
  23.                                     plugin.saveCustomYml(customConfig, customYml);
  24.                                     p.sendMessage(ChatColor.BLUE + "Space Suit Filled With air!");
  25.  
  26.                                 } else {
  27.                                     p.sendMessage(ChatColor.RED + "Not Enough Air Tanks");
  28.                                 }
  29.                                 p.sendMessage(ChatColor.GREEN + "Trying to fill suit with fuel!");
  30.                                 if (inventoryContainsItem(ch.getInventory(), skullfuel)) {
  31.  
  32.                                     File customYml = new File(plugin.getDataFolder() + "/userdata.yml");
  33.                                     FileConfiguration customConfig = YamlConfiguration.loadConfiguration(customYml);
  34.                                     customConfig.set(p.getUniqueId() + ".fuel.remaining", 100);
  35.                                     plugin.saveCustomYml(customConfig, customYml);
  36.                                     p.sendMessage(ChatColor.GOLD + "Space Suit Filled With FUEL!");
  37.  
  38.                                 } else {
  39.                                     p.sendMessage(ChatColor.RED + "Not Enough FUEL Tanks");
  40.                                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement