Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerInteract5(PlayerInteractEvent ev)
- {
- if (ev.getAction() == Action.RIGHT_CLICK_BLOCK) {
- Block b = ev.getClickedBlock();
- if ((b.getType() == Material.SIGN_POST) || (b.getType() == Material.WALL_SIGN)) {
- Sign s = (Sign) ev.getClickedBlock().getState();
- Player p = ev.getPlayer();
- if(s.getLine(0).equalsIgnoreCase("§4Rank Upgrades")) {
- PlayerFile yaml = Main.getPlayerYaml(p.getName());
- if (s.getLine(1).equalsIgnoreCase("§5Slinger")) {
- int amount = 50000;
- if (Main.econ.getBalance(p.getName()) == amount) {
- p.sendMessage(plugin.getConfig().getString("Not_enough_money").replaceAll("(&([a-f0-9]))", "\u00A7$2"));
- } else {
- if(s.getLine(0).equalsIgnoreCase("§4Rank Upgrades") && s.getLine(1).equalsIgnoreCase("§5Slinger")) {
- Main.econ.withdrawPlayer(p.getName(), amount);
- yaml.set("Rank", "Slinger");
- yaml.save();
- Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "exec u:" + p.getName() + " a:setgroup v:Slinger w:CrimeRing");
- //0 57 5 180.456 -8.1
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment