1. Welcome to the Brawl website! Feel free to look around our forums. Join our growing community by typing /register in-game!

Technology Brawl should add this

Discussion in 'Off Topic' started by BeastyBoo, Aug 2, 2017.

Thread Status:
Not open for further replies.
Please be aware that this thread is more than 30 days old. Do not post unless the topic can still be discussed. Read more...
  1. BeastyBoo

    BeastyBoo Insert custom title here

    Joined:
    May 10, 2015
    Messages:
    349
    Ratings:
    +21
    Code:
    package com.beastcraft3.brawlidek;
    
    import java.util.HashSet;
    import java.util.UUID;
    
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerQuitEvent;
    
    public class Brawl implements Listener{
        
        private boolean isBrawlPlayable;
        private HashSet<UUID> players = new HashSet<UUID>();
        private Main main;
        
        
        @EventHandler
        public void onjoin(PlayerJoinEvent e){
            
            Player p = e.getPlayer();
            
            if(!players.contains(p.getUniqueId())){
                players.add(p.getUniqueId());
                
                p.sendMessage("Added... There is now: " + String.valueOf(players.size()) + " players online.");
                int players_online = Integer.valueOf(main.getConfig().getInt("players_online"));
                main.getConfig().set("players_online", players_online + 1);
                main.saveConfig();
                
                brawlIsPlayable(p);
                
            } else {
                
                p.sendMessage("Already inside. ***** wut?");
                
            }
            
        }
        
        @EventHandler
        public void onLeave(PlayerQuitEvent e){
            Player p = e.getPlayer();
            
            if(players.contains(p.getUniqueId())) {
                players.remove(p.getUniqueId());
                int players_online = Integer.valueOf(main.getConfig().getInt("players_online"));
                main.getConfig().set("players_online", players_online - 1);
                main.saveConfig();
            }
            
        }
        
        public void brawlIsPlayable(Player p){
            if(players.size() >= 250){
                
                setBrawlPlayable(true);
                p.sendMessage("Brawl is playable atm");
                
            } else {
                
                setBrawlPlayable(false);
                p.sendMessage("Brawl is not playable atm");
                
            }
        }
        
    
    
        public boolean isBrawlPlayable() {
            return isBrawlPlayable;
        }
    
    
        public void setBrawlPlayable(boolean isBrawlPlayable) {
            this.isBrawlPlayable = isBrawlPlayable;
        }
        
    }
    
     
    • Agree Agree x 1
    • Funny Funny x 1
  2. Jeenss

    Jeenss Ex-Raid Mod

    Joined:
    May 30, 2017
    Messages:
    383
    Ratings:
    +106
    What's this?
     
  3. Versions

    Versions CTF Moderator

    Joined:
    May 27, 2015
    Messages:
    651
    Ratings:
    +392
    Discord:
    Matt | Versions#5719
    elaborate
     
  4. charlottethegirl

    charlottethegirl Ex- Party JMOD

    Joined:
    Apr 6, 2016
    Messages:
    783
    Ratings:
    +540
    @Mario what are we looking at?
     
    • Agree Agree x 1
  5. featherpaw

    featherpaw Your friendly neighborhood kitten! :3

    Joined:
    Aug 16, 2015
    Messages:
    2,548
    Ratings:
    +1,424
    There's literally no point of adding this. The only way you'd get the message is if you're logged on, which means you'd always get the "Brawl is playable right now" message. If you can't connect you won't get a message, resulting in an error in the console. :/
     
  6. RyGuy

    RyGuy developer man

    Joined:
    Aug 8, 2013
    Messages:
    1,960
    Ratings:
    +1,067
    and here i thought you where good at coding :open_mouth::wideyed::smile:
     
    • Winner Winner x 1
  7. Phanta

    Phanta Well-Known Member

    Joined:
    Jan 1, 2014
    Messages:
    2,555
    Ratings:
    +997
    yeah that's useful
     
  8. 19kss

    19kss 18kss

    Joined:
    Jul 30, 2014
    Messages:
    1,850
    Ratings:
    +736
    scam
     
  9. BeastyBoo

    BeastyBoo Insert custom title here

    Joined:
    May 10, 2015
    Messages:
    349
    Ratings:
    +21
    Jesus I made this ages ago when I was active as a joke torwards brawl. Calm this isnt a real idea. Or the way it should be made if it was. Gain some IQ before talking like an idiot.
     
    • Friendly Friendly x 1
  10. 19kss

    19kss 18kss

    Joined:
    Jul 30, 2014
    Messages:
    1,850
    Ratings:
    +736
    who are you speaking to? if you had any iq you would've put a name
     
    • Funny Funny x 1
  11. Phanta

    Phanta Well-Known Member

    Joined:
    Jan 1, 2014
    Messages:
    2,555
    Ratings:
    +997
    me: *posts stupid thing*
    other people: *call out thing for being stupid*
    me: it's a joke and you're an idiot
     
    • Like Like x 2
  12. Jeenss

    Jeenss Ex-Raid Mod

    Joined:
    May 30, 2017
    Messages:
    383
    Ratings:
    +106
    Smooth save :wink:
     
  13. RyGuy

    RyGuy developer man

    Joined:
    Aug 8, 2013
    Messages:
    1,960
    Ratings:
    +1,067
    Chill outttt
     
    • Agree Agree x 2
    • Funny Funny x 1
  14. BeastyBoo

    BeastyBoo Insert custom title here

    Joined:
    May 10, 2015
    Messages:
    349
    Ratings:
    +21
    I made another post at the same time posted in the warz ideas forum. You'll see that I said it was a joke back when I first uploaded it as well. Please dont take it seriously, and dont use this source for any programming as it was made for fun.

    jokez it was real.
     
  15. Industrious

    Industrious Staff Manager
    Retired Staff

    Joined:
    Feb 24, 2018
    Messages:
    109
    Ratings:
    +17
    Discord:
    Industrious #1423
    Please don't gravedig old threads.

    Locked.
     
Loading...
Thread Status:
Not open for further replies.
Please be aware that this thread is more than 30 days old. Do not post unless the topic can still be discussed. Read more...