Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.Jan2808.navigator;
- import java.io.File;
- import javax.crypto.Mac;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.Sound;
- import org.bukkit.configuration.file.YamlConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.inventory.InventoryClickEvent;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.meta.ItemMeta;
- ;
- public class compass_item implements Listener{
- @EventHandler
- public void onInteract(PlayerInteractEvent e) {
- Player p = e.getPlayer();
- try {
- if(e.getItem().getItemMeta().getDisplayName().equals("§6Navigator")) {
- Inventory inv = Bukkit.createInventory(null, 9, "§6Navigator");
- p.playSound(p.getLocation(), Sound.NOTE_BASS_DRUM, 1, 1);
- ItemStack ffa = new ItemStack(Material.BED);
- ItemMeta ffameta = ffa.getItemMeta();
- ffameta.setDisplayName("cBedWars");
- ffa.setItemMeta(ffameta);
- ItemStack ffa1 = new ItemStack(Material.STONE_SWORD);
- ItemMeta ffameta1 = ffa1.getItemMeta();
- ffameta1.setDisplayName("c1v1");
- ffa1.setItemMeta(ffameta1);
- ItemStack ffa2 = new ItemStack(Material.GRASS);
- ItemMeta ffameta2 = ffa2.getItemMeta();
- ffameta2.setDisplayName("cSkyWars");
- ffa2.setItemMeta(ffameta2);
- ItemStack ffa21 = new ItemStack(Material.STICK);
- ItemMeta ffameta21 = ffa21.getItemMeta();
- ffameta21.setDisplayName("cKBFFA");
- ffa21.setItemMeta(ffameta21);
- ItemStack ffa22 = new ItemStack(Material.TNT);
- ItemMeta ffameta22 = ffa22.getItemMeta();
- ffameta22.setDisplayName("cTnT Run");
- ffa22.setItemMeta(ffameta22);
- inv.setItem(0, ffa);
- inv.setItem(1, ffa1);
- inv.setItem(4, ffa21);
- inv.setItem(7, ffa2);
- inv.setItem(8, ffa22);
- p.openInventory(inv);
- }
- }catch(Exception e1) {
- }
- }
- @EventHandler
- public void onClick(InventoryClickEvent e) {
- Player p = (Player)e.getWhoClicked();
- if(e.getInventory().getName().equalsIgnoreCase("§6Navigator"));
- e.setCancelled(true);
- if(e.getCurrentItem().getType() == Material.BED) {
- File file = new File("plugin//LobbySystem//spawns.yml");
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String w = cfg.getString("Spawn21.WeltName");
- double x = cfg.getDouble("Spawn21.X");
- double Y = cfg.getDouble("Spawn21.Y");
- double Z = cfg.getDouble("Spawn21.Z");
- double yaw = cfg.getDouble("sSpawn21Yaw");
- double pitch = cfg.getDouble("Spawn21.Pitch");
- org.bukkit.Location loc = new org.bukkit.Location(Bukkit.getWorld(w), x, Y, Z);
- loc.setY((float)yaw);
- loc.setPitch((float)pitch);
- p.teleport(loc);
- p.sendMessage(Main.Prefix + "§aDu hast dich zu SkyWars teleportiert!");
- p.closeInventory();
- }else if (e.getCurrentItem().getType() == Material.IRON_SWORD) {
- if(e.getCurrentItem().getType() == Material.STONE_SWORD) {
- File file = new File("plugin//LobbySystem//spawns.yml");
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String w = cfg.getString("Spawn2.WeltName");
- double x = cfg.getDouble("Spawn2.X");
- double Y = cfg.getDouble("Spawn2.Y");
- double Z = cfg.getDouble("Spawn2.Z");
- double yaw = cfg.getDouble("sSpawn1Yaw");
- double pitch = cfg.getDouble("Spawn1.Pitch");
- org.bukkit.Location loc = new org.bukkit.Location(Bukkit.getWorld(w), x, Y, Z);
- loc.setY((float)yaw);
- loc.setPitch((float)pitch);
- p.teleport(loc);
- p.sendMessage(Main.Prefix + "§aDu hast dich zu 1v1 teleportiert!");
- p.closeInventory();
- } if(e.getCurrentItem().getType() == Material.BED) {
- File file = new File("plugin//LobbySystem//spawns.yml");
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String w = cfg.getString("Spawn1.WeltName");
- double x = cfg.getDouble("Spawn1.X");
- double Y = cfg.getDouble("Spawn1.Y");
- double Z = cfg.getDouble("Spawn1.Z");
- double yaw = cfg.getDouble("sSpawn1Yaw");
- double pitch = cfg.getDouble("Spawn1.Pitch");
- org.bukkit.Location loc = new org.bukkit.Location(Bukkit.getWorld(w), x, Y, Z);
- loc.setY((float)yaw);
- loc.setPitch((float)pitch);
- p.teleport(loc);
- p.sendMessage(Main.Prefix + "§aDu hast dich zu BedWars teleportiert!");
- p.closeInventory();
- }
- }else if(e.getCurrentItem().getType() == Material.FIREBALL) {
- if(e.getCurrentItem().getType() == Material.FIREBALL) {
- File file = new File("plugin//LobbySystem//spawns.yml");
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String w = cfg.getString("Spawn.WeltName");
- double x = cfg.getDouble("Spawn.X");
- double Y = cfg.getDouble("Spawn.Y");
- double Z = cfg.getDouble("Spawn.Z");
- double yaw = cfg.getDouble("sSpawn1Yaw");
- double pitch = cfg.getDouble("Spawn1.Pitch");
- org.bukkit.Location loc = new org.bukkit.Location(Bukkit.getWorld(w), x, Y, Z);
- loc.setY((float)yaw);
- loc.setPitch((float)pitch);
- p.teleport(loc);
- p.sendMessage(Main.Prefix + "§aDu hast dich zu Spawn teleportiert!");
- p.closeInventory();
- } if(e.getCurrentItem().getType() == Material.TNT) {
- File file = new File("plugin//LobbySystem//spawns.yml");
- YamlConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- String w = cfg.getString("Spawn22.WeltName");
- double x = cfg.getDouble("Spawn22.X");
- double Y = cfg.getDouble("Spawn22.Y");
- double Z = cfg.getDouble("Spawn22.Z");
- double yaw = cfg.getDouble("sSpawn1Yaw");
- double pitch = cfg.getDouble("Spawn1.Pitch");
- org.bukkit.Location loc = new org.bukkit.Location(Bukkit.getWorld(w), x, Y, Z);
- loc.setY((float)yaw);
- loc.setPitch((float)pitch);
- p.teleport(loc);
- p.sendMessage(Main.Prefix + "§aDu hast dich zu TnT Run teleportiert!");
- p.closeInventory();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement