Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- /* */ public void onEven(PlayerInteractEvent e)
- /* */ throws IOException
- /* */ {
- /* 34 */ Player p = e.getPlayer();
- /* 35 */ String Playername = p.getName();
- /* 36 */ File file = new File("plugins//Gun-Game//SpielerMapList//" + Playername);
- /* 37 */ new YamlConfiguration();FileConfiguration cfg = YamlConfiguration.loadConfiguration(file);
- /* */
- /* 39 */ if (e.getAction() == Action.RIGHT_CLICK_BLOCK)
- /* */ {
- /* 41 */ Block b = e.getClickedBlock();
- /* 42 */ BlockState bs = b.getState();
- /* 43 */ if ((bs instanceof Sign)) {
- /* 44 */ Sign s = (Sign)bs;
- /* */
- /* 46 */ if ((s.getLine(0).equalsIgnoreCase("§c> §1SkyPvP §c<")) && (s.getLine(3).equalsIgnoreCase("§a§oOffen"))) {
- /* 47 */ if (!Main.insign.contains(p.getName()))
- /* */ {
- /* 49 */ String name = s.getLine(1);
- /* */
- /* 51 */ File file1 = new File("plugins//Gun-Game//MapAnzahlList//" + name);
- /* 52 */ new YamlConfiguration();FileConfiguration cfg1 = YamlConfiguration.loadConfiguration(file1);
- /* 53 */ int anzahl = cfg1.getInt("Map." + name);
- /* */
- /* 55 */ File file2 = new File("plugins//Gun-Game//MapMaxPlayer//" + name);
- /* 56 */ new YamlConfiguration();FileConfiguration cfg2 = YamlConfiguration.loadConfiguration(file2);
- /* 57 */ int maxplayer = cfg2.getInt("MaxPlayer." + name);
- /* 58 */ if (anzahl != maxplayer)
- /* */ {
- /* 60 */ cfg.set("Sign.name", name);
- /* */
- /* 62 */ cfg.save(file);
- /* 63 */ cfg1.set("Map." + name, Integer.valueOf(anzahl + 1));
- /* 64 */ cfg1.save(file1);
- /* 65 */ Main.insign.add(p.getName());
- /* */
- /* 67 */ String world = this.plugin.getConfig().getString("Map." + name + ".world");
- /* 68 */ double x = this.plugin.getConfig().getDouble("Map." + name + ".x");
- /* 69 */ double y = this.plugin.getConfig().getDouble("Map." + name + ".y");
- /* 70 */ double z = this.plugin.getConfig().getDouble("Map." + name + ".z");
- /* 71 */ double yaw = this.plugin.getConfig().getDouble("Map." + name + ".yaw");
- /* 72 */ double pitch = this.plugin.getConfig().getDouble("Map." + name + ".pitch");
- /* 73 */ Location loc = new Location(Bukkit.getWorld(world), x, y, z);
- /* 74 */ loc.setYaw((float)yaw);
- /* 75 */ loc.setPitch((float)pitch);
- /* */
- /* 77 */ p.teleport(loc);
- /* 78 */ anzahl++;
- /* */
- /* 80 */ this.plugin.saveConfig();
- /* 81 */ p.sendMessage(Main.prefix + "§1SkyPvP §cMap: §f§l" + name);
- /* 82 */ p.sendMessage(Main.prefix + "§f" + anzahl + " §5Spieler sind(ist) in dieser Map!");
- /* */
- /* 84 */ s.setLine(2, "§5" + anzahl + " §fInGame");
- /* 85 */ s.update();
- /* 86 */ if (maxplayer == anzahl) {
- /* 87 */ s.setLine(3, "§4§lVoll");
- /* 88 */ s.update();
- /* 89 */ } else if (maxplayer != anzahl) {
- /* 90 */ s.setLine(3, "§a§oOffen");
- /* 91 */ s.update();
- /* */ }
- /* */ }
- /* */ else {
- /* 95 */ p.sendMessage(Main.prefix + "§cEs sind bereits §6§l" + anzahl + " §cvon §6§l" + maxplayer + " in dieser Map! Du kannst nicht beitreten!");
- /* */ }
- /* */ }
- /* */ else {
- /* 99 */ String name = s.getLine(1);
- /* 100 */ p.sendMessage(Main.prefix + "§cFehler: Du bist bereits in einer Map");
- /* */ }
- /* 102 */ } else if ((s.getLine(0).equalsIgnoreCase("§c> §1SkyPvP §c<")) && (s.getLine(3).equalsIgnoreCase("§c§oGeschlossen"))) {
- /* 103 */ String name = s.getLine(1);
- /* 104 */ p.sendMessage(Main.prefix + "§cDie Map §6§l" + name + " §cist geschlossen!");
- /* */ }
- /* */ }
- /* */ }
- /* */ }
- /* */ }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement