Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Location chestlocation = loc.clone().add(0, -2, 0);
- Block chest = chestlocation.getBlock();
- Chest ch = (Chest) chest.getState();
- ItemStack skullair2 = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
- SkullMeta skullMeta2 = (SkullMeta) skullair2.getItemMeta();
- skullMeta2.setOwner("SkidzPlays");
- skullMeta2.setDisplayName(ChatColor.BLUE + "AIR TANK");
- skullMeta2.setLore(Arrays.asList(ChatColor.DARK_BLUE + "FILLED WITH AIR"));
- skullair2.setItemMeta(skullMeta2);
- ItemStack skullfuel = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
- SkullMeta skullMeta = (SkullMeta) skullfuel.getItemMeta();
- skullMeta.setOwner("Mikano");
- skullMeta.setDisplayName(ChatColor.YELLOW + "FUEL CELL");
- skullMeta.setLore(Arrays.asList(ChatColor.GOLD + "FILLED WITH FUEL"));
- skullfuel.setItemMeta(skullMeta);
- if (inventoryContainsItem(ch.getInventory(), skullair2)) {
- File customYml = new File(plugin.getDataFolder() + "/userdata.yml");
- FileConfiguration customConfig = YamlConfiguration.loadConfiguration(customYml);
- customConfig.set(p.getUniqueId() + ".air.remaining", 105);
- plugin.saveCustomYml(customConfig, customYml);
- p.sendMessage(ChatColor.BLUE + "Space Suit Filled With air!");
- } else {
- p.sendMessage(ChatColor.RED + "Not Enough Air Tanks");
- }
- p.sendMessage(ChatColor.GREEN + "Trying to fill suit with fuel!");
- if (inventoryContainsItem(ch.getInventory(), skullfuel)) {
- File customYml = new File(plugin.getDataFolder() + "/userdata.yml");
- FileConfiguration customConfig = YamlConfiguration.loadConfiguration(customYml);
- customConfig.set(p.getUniqueId() + ".fuel.remaining", 100);
- plugin.saveCustomYml(customConfig, customYml);
- p.sendMessage(ChatColor.GOLD + "Space Suit Filled With FUEL!");
- } else {
- p.sendMessage(ChatColor.RED + "Not Enough FUEL Tanks");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement