- Added new action bar API in Core
- Some fixes
This commit is contained in:
@@ -8,12 +8,15 @@ import java.sql.ResultSet;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import net.minecraft.server.v1_8_R3.IChatBaseComponent;
|
||||||
|
import net.minecraft.server.v1_8_R3.PacketPlayOutChat;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
@@ -309,4 +312,11 @@ public class Core {
|
|||||||
public static void toSpawn(Player P) {
|
public static void toSpawn(Player P) {
|
||||||
P.teleport(getServerSpawn());
|
P.teleport(getServerSpawn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendActionBar(Player P, String msg) {
|
||||||
|
CraftPlayer pl = (CraftPlayer) P;
|
||||||
|
IChatBaseComponent cbc = IChatBaseComponent.ChatSerializer.a("{\"text\":\"" + msg + "\"}");
|
||||||
|
PacketPlayOutChat ppoc = new PacketPlayOutChat(cbc, (byte) 2);
|
||||||
|
pl.getHandle().playerConnection.sendPacket(ppoc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
356
src/de/anura/core/API/Inventories_NEW.java
Normal file
356
src/de/anura/core/API/Inventories_NEW.java
Normal file
@@ -0,0 +1,356 @@
|
|||||||
|
package de.anura.core.API;
|
||||||
|
|
||||||
|
import de.anura.core.AnuraCore;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.AbstractMap;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
public class Inventories_NEW implements Listener {
|
||||||
|
|
||||||
|
private final boolean multilang;
|
||||||
|
private final HashMap<String, Inventory> invs = new HashMap<>();
|
||||||
|
private final HashMap<Integer, InvItem> items = new HashMap<>();
|
||||||
|
private final HashSet<String> invNames = new HashSet<>();
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private ChatColor color;
|
||||||
|
private int size;
|
||||||
|
private String lang = null;
|
||||||
|
|
||||||
|
public Inventories_NEW(boolean multilang, String title, ChatColor color, int size) {
|
||||||
|
assert(size % 9 == 0);
|
||||||
|
this.multilang = multilang;
|
||||||
|
this.title = title;
|
||||||
|
this.color = color;
|
||||||
|
this.size = size;
|
||||||
|
inventories.add(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW(String lang, String title, ChatColor color, int size) {
|
||||||
|
this(true, title, color, size);
|
||||||
|
this.lang = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW(boolean multilang, String title, ChatColor color) {
|
||||||
|
this(true, title, color, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW(String lang, String title, ChatColor color) {
|
||||||
|
this(lang, title, color, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW settings(String name, ChatColor color, int size) {
|
||||||
|
title = name;
|
||||||
|
this.color = color;
|
||||||
|
this.size = size;
|
||||||
|
for (String inv : invs.keySet()) {
|
||||||
|
createInventory(inv);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW putItem(int slot, InvItem item) {
|
||||||
|
items.put(slot, item);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inventories_NEW open(Player P) {
|
||||||
|
if (multilang) P.openInventory(invs.get("global"));
|
||||||
|
else P.openInventory(invs.get(Core.getPlayerLang(P)));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean checkInvClick(String invName, int slot, Player P) {
|
||||||
|
if (!invNames.contains(invName)) return false;
|
||||||
|
if (!items.containsKey(slot)) return true;
|
||||||
|
items.get(slot).click(P);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createInventory(String inv) {
|
||||||
|
String l = inv;
|
||||||
|
if (l.equals("global")) {
|
||||||
|
l = lang;
|
||||||
|
}
|
||||||
|
String name = color + Core.getl(title, l);
|
||||||
|
Inventory i = Bukkit.createInventory(null, size, name);
|
||||||
|
invNames.add(name);
|
||||||
|
invs.put(inv, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupInvs() {
|
||||||
|
if (multilang) createInventory("global");
|
||||||
|
else {
|
||||||
|
for (String l : Core.getAvailLangs()) {
|
||||||
|
createInventory(l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InvItem {
|
||||||
|
|
||||||
|
private final ItemStack stack;
|
||||||
|
private final String name;
|
||||||
|
private final ChatColor color;
|
||||||
|
private final ChatColor loreColor;
|
||||||
|
private final String[] lores;
|
||||||
|
private final HashSet<ActionData> actions = new HashSet<>();
|
||||||
|
|
||||||
|
public InvItem(ItemStack stack, String name, ChatColor nameColor, ChatColor loreColor, String... lores) {
|
||||||
|
this.stack = stack;
|
||||||
|
this.name = name;
|
||||||
|
this.color = nameColor;
|
||||||
|
this.loreColor = loreColor;
|
||||||
|
this.lores = lores;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InvItem addAction(ActionData data) {
|
||||||
|
actions.add(data);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemStack getItem(String lang) {
|
||||||
|
ItemStack item = stack.clone();
|
||||||
|
ItemMeta meta = item.getItemMeta();
|
||||||
|
meta.setDisplayName(color + Core.getl(name, lang));
|
||||||
|
if (lores.length != 0) {
|
||||||
|
List<String> lore = new ArrayList<>();
|
||||||
|
for (String l : lores) {
|
||||||
|
lore.add(loreColor + Core.getl(l, lang));
|
||||||
|
}
|
||||||
|
meta.setLore(lore);
|
||||||
|
}
|
||||||
|
item.setItemMeta(meta);
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void click(Player P) {
|
||||||
|
for (ActionData action : actions) {
|
||||||
|
Object data = action.getData();
|
||||||
|
switch (action.getAction()) {
|
||||||
|
case OPEN_INV:
|
||||||
|
if (data instanceof Inventories_NEW) {
|
||||||
|
((Inventories_NEW)data).open(P);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case TELEPORT:
|
||||||
|
if (data instanceof Location) {
|
||||||
|
P.teleport((Location) data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MESSAGE:
|
||||||
|
if (data instanceof String) {
|
||||||
|
P.sendMessage((String) data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SERVER:
|
||||||
|
if (data instanceof String) {
|
||||||
|
try {
|
||||||
|
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream out = new DataOutputStream(b);
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF((String) data);
|
||||||
|
P.sendPluginMessage(AnuraCore.getInstance(), "BungeeCord", b.toByteArray());
|
||||||
|
} catch (IOException ex) {}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case COMMAND:
|
||||||
|
if (data instanceof String) {
|
||||||
|
Bukkit.getServer().dispatchCommand(P, (String) data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LANGUAGE:
|
||||||
|
if (data instanceof String) {
|
||||||
|
String lang = (String) data;
|
||||||
|
Core.cachedPlayerLanguage.put(P, lang);
|
||||||
|
Bukkit.getScheduler().runTaskAsynchronously(Core.getMainClass(), () -> {
|
||||||
|
Core.getMySql().queryUpdate("UPDATE players SET lang = '" + lang + "' WHERE uuid = '" + P.getUniqueId().toString() + "'");
|
||||||
|
});
|
||||||
|
setInvItems(P);
|
||||||
|
Core.statusMsg(P, "lang_changed", true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ActionData {
|
||||||
|
|
||||||
|
private final Action action;
|
||||||
|
private final Object data;
|
||||||
|
|
||||||
|
public ActionData(Action a, Object d) {
|
||||||
|
action = a;
|
||||||
|
data = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static enum Action {
|
||||||
|
OPEN_INV,
|
||||||
|
TELEPORT,
|
||||||
|
MESSAGE,
|
||||||
|
SERVER,
|
||||||
|
COMMAND,
|
||||||
|
LANGUAGE
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static final HashMap<String, HashMap<String, ItemStack>> oldItems = new HashMap<>();
|
||||||
|
private static final HashMap<String, String> itemNames = new HashMap<>();
|
||||||
|
private static final HashMap<String, Entry<Action, Object>> itemActions = new HashMap<>();
|
||||||
|
private static final HashMap<String, Integer> itemPositions = new HashMap<>();
|
||||||
|
|
||||||
|
private static final HashSet<Inventories_NEW> inventories = new HashSet<>();
|
||||||
|
public static final HashMap<Player, Boolean> checkInteracts = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
public static void buildInvItem(String type, Material m, String name, ChatColor nameColor, ChatColor loreColor, String... lores) { //INV!!
|
||||||
|
HashMap<String, ItemStack> stacks = new HashMap<>();
|
||||||
|
for (String lang : Core.getAvailLangs()) {
|
||||||
|
ItemStack stack = new ItemStack(m);
|
||||||
|
ItemMeta meta = stack.getItemMeta();
|
||||||
|
String display = nameColor + Core.getl(name, lang);
|
||||||
|
meta.setDisplayName(display);
|
||||||
|
if (loreColor != null) {
|
||||||
|
for (int i = 0; i < lores.length; i++) {
|
||||||
|
lores[i] = loreColor + Core.getl(lores[i], lang);
|
||||||
|
}
|
||||||
|
meta.setLore(Arrays.asList(lores));
|
||||||
|
}
|
||||||
|
itemNames.put(display, type);
|
||||||
|
stack.setItemMeta(meta);
|
||||||
|
stacks.put(lang, stack);
|
||||||
|
}
|
||||||
|
oldItems.put(type, stacks);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void buildInvItem(String type, Material m, String name, ChatColor nameColor) {
|
||||||
|
buildInvItem(type, m, name, nameColor, null, "none");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HashMap<String, ItemStack> buildItems(Material m, String name, ChatColor nameColor, ChatColor loreColor, String... lores) {
|
||||||
|
HashMap<String, ItemStack> stacks = new HashMap<>();
|
||||||
|
for (String lang : Core.getAvailLangs()) {
|
||||||
|
ItemStack stack = new ItemStack(m);
|
||||||
|
ItemMeta meta = stack.getItemMeta();
|
||||||
|
meta.setDisplayName(nameColor + Core.getl(name, lang));
|
||||||
|
if (loreColor != null) {
|
||||||
|
for (int i = 0; i < lores.length; i++) {
|
||||||
|
lores[i] = loreColor + Core.getl(lores[i], lang);
|
||||||
|
}
|
||||||
|
meta.setLore(Arrays.asList(lores));
|
||||||
|
}
|
||||||
|
stack.setItemMeta(meta);
|
||||||
|
stacks.put(lang, stack);
|
||||||
|
}
|
||||||
|
return stacks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getItem(String type, Player P) {
|
||||||
|
return oldItems.get(type).get(Core.getPlayerLang(P));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setItemInPlayerInv(String type, Integer position) {
|
||||||
|
itemPositions.put(type, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerItemAction(String type, Action action, Object data) {
|
||||||
|
if ((action == Action.TELEPORT && !(data instanceof Location)) || (action != Action.TELEPORT && !(data instanceof String))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
itemActions.put(type, new AbstractMap.SimpleEntry<>(action, data));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setInvItems(Player P) {
|
||||||
|
if (!itemPositions.isEmpty()) {
|
||||||
|
P.getInventory().clear();
|
||||||
|
}
|
||||||
|
for (Entry<String, Integer> item : itemPositions.entrySet()) {
|
||||||
|
P.getInventory().setItem(item.getValue(), getItem(item.getKey(), P));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class InvEvents implements Listener {
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onInvClick(InventoryClickEvent event) {
|
||||||
|
try {
|
||||||
|
final Player P = (Player) event.getWhoClicked();
|
||||||
|
if (checkInteracts.containsKey(P) && !checkInteracts.get(P)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Inventory inventory = event.getClickedInventory();
|
||||||
|
if (inventory == null) return;
|
||||||
|
for (Inventories_NEW i : inventories) {
|
||||||
|
if (i.checkInvClick(inventory.getName(), event.getSlot(), P)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(AnuraCore.getInstance(), () -> {
|
||||||
|
P.setItemOnCursor(new ItemStack(Material.AIR));
|
||||||
|
P.updateInventory();
|
||||||
|
}, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(Throwable e) {
|
||||||
|
Errors.reportException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
try {
|
||||||
|
if (checkInteracts.containsKey(event.getPlayer()) && !checkInteracts.get(event.getPlayer())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.hasItem()) {
|
||||||
|
if (event.getAction().equals(org.bukkit.event.block.Action.RIGHT_CLICK_AIR) || event.getAction().equals(org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK)) {
|
||||||
|
final Player P = event.getPlayer();
|
||||||
|
String type = itemNames.get(P.getItemInHand().getItemMeta().getDisplayName());
|
||||||
|
if (itemActions.containsKey(type)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
//executeAction(P, itemActions.get(type).getKey(), itemActions.get(type).getValue());
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(AnuraCore.getInstance(), P::updateInventory, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(Throwable e) {
|
||||||
|
Errors.reportException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority=EventPriority.LOW)
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
setInvItems(event.getPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import de.anura.core.FlowerPots;
|
|||||||
import de.anura.core.util.Data;
|
import de.anura.core.util.Data;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -43,7 +44,7 @@ public class TeamCommands implements CommandExecutor {
|
|||||||
Core.statusMsg(sender, "wrong_args_count", false);
|
Core.statusMsg(sender, "wrong_args_count", false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
HashSet<Material> transparent = new HashSet<>();
|
Set<Material> transparent = new HashSet<>();
|
||||||
transparent.add(Material.AIR);
|
transparent.add(Material.AIR);
|
||||||
Block b = P.getTargetBlock(transparent, 100);
|
Block b = P.getTargetBlock(transparent, 100);
|
||||||
if (b.getType().equals(Material.COMMAND)) {
|
if (b.getType().equals(Material.COMMAND)) {
|
||||||
@@ -72,7 +73,7 @@ public class TeamCommands implements CommandExecutor {
|
|||||||
Core.statusMsg(sender, "wrong_args_count", false);
|
Core.statusMsg(sender, "wrong_args_count", false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
HashSet<Material> transparent = new HashSet<>();
|
Set<Material> transparent = new HashSet<>();
|
||||||
transparent.add(Material.AIR);
|
transparent.add(Material.AIR);
|
||||||
Block b = P.getTargetBlock(transparent, 100);
|
Block b = P.getTargetBlock(transparent, 100);
|
||||||
if (b.getType().equals(Material.COMMAND)) {
|
if (b.getType().equals(Material.COMMAND)) {
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ public class PlayerJoin implements Listener {
|
|||||||
}
|
}
|
||||||
rs.last();
|
rs.last();
|
||||||
if (rs.getRow() != 1) {
|
if (rs.getRow() != 1) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
/*Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
AnuraCore.getSql().queryUpdate("INSERT INTO players(`uuid`,`game`,`waiting`,`gameName`) VALUES('" + uuid.toString() + "','none','none','')");
|
AnuraCore.getSql().queryUpdate("INSERT INTO players(`uuid`,`game`,`waiting`,`gameName`) VALUES('" + uuid.toString() + "','none','none','')");
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
event.setJoinMessage(null);
|
event.setJoinMessage(null);
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
package de.anura.core.events;
|
package de.anura.core.events;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
|
||||||
import com.vexsoftware.votifier.model.Vote;
|
import com.vexsoftware.votifier.model.Vote;
|
||||||
import com.vexsoftware.votifier.model.VotifierEvent;
|
import com.vexsoftware.votifier.model.VotifierEvent;
|
||||||
import de.anura.core.API.Core;
|
import de.anura.core.API.Core;
|
||||||
import de.anura.core.API.Errors;
|
import de.anura.core.API.Errors;
|
||||||
import de.anura.core.API.Money;
|
import de.anura.core.API.Money;
|
||||||
import de.anura.core.AnuraCore;
|
import de.anura.core.AnuraCore;
|
||||||
import java.io.BufferedWriter;
|
import java.io.*;
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.OutputStreamWriter;
|
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -91,7 +83,7 @@ public class VotifierListener implements Listener, PluginMessageListener {
|
|||||||
out.writeUTF("money");
|
out.writeUTF("money");
|
||||||
out.writeUTF(vote.getUsername());
|
out.writeUTF(vote.getUsername());
|
||||||
out.writeInt(money);
|
out.writeInt(money);
|
||||||
Player p = Iterables.get(AnuraCore.getInstance().getServer().getOnlinePlayers(), 0);
|
Player p = Bukkit.getOnlinePlayers().iterator().next();
|
||||||
p.sendPluginMessage(AnuraCore.getInstance(), "BungeeCord", stream.toByteArray());
|
p.sendPluginMessage(AnuraCore.getInstance(), "BungeeCord", stream.toByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user