Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package br.com.mineland.bungee.redis.communication.actions;
- import br.com.mineland.bungee.stuff.Proxy;
- import br.com.mineland.bungee.user.ProxiedUser;
- import br.com.mineland.core.permissions.Permissions;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Set;
- import net.md_5.bungee.api.chat.BaseComponent;
- import net.md_5.bungee.api.config.ServerInfo;
- import net.md_5.bungee.chat.ComponentSerializer;
- /**
- *
- * @author LucaAzalim
- */
- public class RemoteMsg {
- private List<String> messages = new ArrayList<>();
- private Set<Permissions> groups = new HashSet<>();
- private Set<Integer> players = new HashSet<>();
- private Set<String> servers = new HashSet<>();
- private Set<Integer> proxies = new HashSet<>();
- public RemoteMsg(String... messages) {
- this.messages.addAll(Arrays.asList(messages));
- }
- public RemoteMsg(BaseComponent... messages) {
- for (BaseComponent bc : messages) {
- this.messages.add(ComponentSerializer.toString(bc));
- }
- }
- /**
- * @param groups Grupos para os quais esta mensagem sera enviada.
- * @return Objeto modificado.
- */
- public RemoteMsg specifyGroups(Permissions... groups) {
- this.groups.addAll(Arrays.asList(groups));
- return this;
- }
- /**
- * @param users Especificar usuarios.
- * @return Objeto modificado.
- */
- public RemoteMsg specifyPlayers(ProxiedUser... users) {
- for (ProxiedUser user : users) {
- this.players.add(user.getId());
- }
- return this;
- }
- /**
- * @param servers Especificar servidores.
- * @return Objeto modificado.
- */
- public RemoteMsg specifyServers(ServerInfo... servers) {
- for (ServerInfo si : servers) {
- this.servers.add(si.getName());
- }
- return this;
- }
- /**
- * @param proxies Especificar proxies.
- * @return Objeto modificado.
- */
- public RemoteMsg specifyProxy(Proxy... proxies) {
- for (Proxy p : proxies) {
- this.proxies.add(p.getId());
- }
- return this;
- }
- public void sendRequisition() {
- }
- public void handle() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement