Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private List<WrappedGameProfile> message = new ArrayList<WrappedGameProfile>();
- @Override
- public void onEnable() {
- if(!new File(getDataFolder(), "RESET.FILE").exists()){
- try{
- getConfig().set("PlayerCountMessage", Arrays.asList("NewAaronCraft"));
- new File(getDataFolder(), "RESET.FILE").createNewFile();
- }catch(IOException e){
- e.printStackTrace();
- }
- }
- saveConfig();
- for(String str : getConfig().getStringList("PlayerCountMessage")){
- message.add(new WrappedGameProfile("1", str));
- }
- ProtocolLibrary.getProtocolManager().addPacketListener(
- new PacketAdapter(this, ListenerPriority.NORMAL, Arrays.asList(new PacketType[] {
- PacketType.Status.Server.OUT_SERVER_INFO
- }), new ListenerOptions[]{
- ListenerOptions.ASYNC
- }){
- public void onPacketSending(PacketEvent e){
- e.getPacket().getServerPings().read(0).setMotD("Hi");
- e.getPacket().getServerPings().read(0).setPlayers(Main.this.message);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement