Advertisement
Guest User

Untitled

a guest
May 24th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package br.com.mineland.bungee.redis.communication.actions;
  7.  
  8. import br.com.mineland.bungee.stuff.Proxy;
  9. import br.com.mineland.bungee.user.ProxiedUser;
  10. import br.com.mineland.core.permissions.Permissions;
  11. import java.util.ArrayList;
  12. import java.util.Arrays;
  13. import java.util.HashSet;
  14. import java.util.List;
  15. import java.util.Set;
  16. import net.md_5.bungee.api.chat.BaseComponent;
  17. import net.md_5.bungee.api.config.ServerInfo;
  18. import net.md_5.bungee.chat.ComponentSerializer;
  19.  
  20. /**
  21. *
  22. * @author LucaAzalim
  23. */
  24. public class RemoteMsg {
  25.  
  26. private List<String> messages = new ArrayList<>();
  27.  
  28. private Set<Permissions> groups = new HashSet<>();
  29. private Set<Integer> players = new HashSet<>();
  30. private Set<String> servers = new HashSet<>();
  31. private Set<Integer> proxies = new HashSet<>();
  32.  
  33. public RemoteMsg(String... messages) {
  34. this.messages.addAll(Arrays.asList(messages));
  35. }
  36.  
  37. public RemoteMsg(BaseComponent... messages) {
  38. for (BaseComponent bc : messages) {
  39. this.messages.add(ComponentSerializer.toString(bc));
  40. }
  41. }
  42.  
  43. /**
  44. * @param groups Grupos para os quais esta mensagem sera enviada.
  45. * @return Objeto modificado.
  46. */
  47. public RemoteMsg specifyGroups(Permissions... groups) {
  48. this.groups.addAll(Arrays.asList(groups));
  49. return this;
  50. }
  51.  
  52. /**
  53. * @param users Especificar usuarios.
  54. * @return Objeto modificado.
  55. */
  56. public RemoteMsg specifyPlayers(ProxiedUser... users) {
  57. for (ProxiedUser user : users) {
  58. this.players.add(user.getId());
  59. }
  60. return this;
  61. }
  62.  
  63. /**
  64. * @param servers Especificar servidores.
  65. * @return Objeto modificado.
  66. */
  67. public RemoteMsg specifyServers(ServerInfo... servers) {
  68. for (ServerInfo si : servers) {
  69. this.servers.add(si.getName());
  70. }
  71. return this;
  72. }
  73.  
  74. /**
  75. * @param proxies Especificar proxies.
  76. * @return Objeto modificado.
  77. */
  78. public RemoteMsg specifyProxy(Proxy... proxies) {
  79. for (Proxy p : proxies) {
  80. this.proxies.add(p.getId());
  81. }
  82. return this;
  83. }
  84.  
  85. public void sendRequisition() {
  86.  
  87. }
  88.  
  89. public void handle() {
  90.  
  91.  
  92.  
  93. }
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement