

LuizB
Membros-
Total de itens
759 -
Registro em
-
Última visita
Tudo que LuizB postou
-
resolvido [Dúvida] Dar replace em todos os chars de uma palavra.
uma questão postou LuizB Dúvidas resolvidas
Bem, o título do tópico já diz tudo. Tipo, eu tenho a String a = "Banana é uma ótima fruta.", como faço pra dar replace nos chars da palvra "Banana" ? Eu queria que o replace ficasse, "****** é uma ótima fruta.". -
Vlw, consegui resolver com sua resposta.
-
ainda n entendi, estou querendo pegar todos os jogadores de todos os servidor do bungeecord
-
Entendi nada '-' @EDIT Sò a parte que n tem mais coisa pra ler
-
Ta, e o servidor é ALL, que é só o lobby, quando eu uso o comando ele retorna o número, já em uma thread ou runnable da esse erro. @EDIT È só o ALL, que é pra pegar todos os jogadores conectado.
-
Bem, toda vez que eu tenho pegar o número de jogadores de todos os servidores, do bungeecord da java.io.EOFException Stacktrace completo: java.io.EOFException [15:59:32] [Server thread/WARN]: at java.io.DataInputStream.readUnsignedShort(Unknown Source) [15:59:32] [Server thread/WARN]: at java.io.DataInputStream.readUTF(Unknown Source) [15:59:32] [Server thread/WARN]: at java.io.DataInputStream.readUTF(Unknown Source) [15:59:32] [Server thread/WARN]: at me.cuthmf.lobbyl.Lobby.onPluginMessageReceived(Lobby.java:43) [15:59:32] [Server thread/WARN]: at org.bukkit.plugin.messaging.StandardMessenger.dispatchIncomingMessage(StandardMessenger.java:427) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:2114) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.PacketPlayInCustomPayload.a(SourceFile:55) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.PacketPlayInCustomPayload.a(SourceFile:8) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [15:59:32] [Server thread/WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [15:59:32] [Server thread/WARN]: at java.util.concurrent.FutureTask.run(Unknown Source) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [15:59:32] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [15:59:32] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source) Isso só acontece quando eu uso thread ou Runnable Se eu colocar por comando, funciona normal. Código: private static Map<String, Integer> players = new HashMap<>(); @Override public void onPluginMessageReceived(String channel, Player player, byte[] message) { if (!channel.equals("BungeeCord")) return; try { DataInputStream in = new DataInputStream(new ByteArrayInputStream(message)); String command = in.readUTF(); if (command.equals("PlayerCount")) { String server = in.readUTF().toString(); int playerCount = in.readInt(); players.clear(); players.put(server, playerCount); } } catch (Exception e) { e.printStackTrace(); } } public static String getNumberofplays(String server) { try { ByteArrayOutputStream b = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(b); out.writeUTF("PlayerCount"); out.writeUTF(server); Bukkit.getServer().sendPluginMessage(Lobby.getPlugin(Lobby.class), "BungeeCord", b.toByteArray()); return Integer.toString(players.get(server)); } catch (Exception e) { return "0"; } }
-
Olá, fiz um plugin que ele não está gerando a pasta, ele não tem config, mas tem um arquivo .dat que salva os objetos, como o plugin não gera pasta, acaba lançando uma exeção Classe que tem os métodos: import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; public class SaveWitheList implements Serializable{ private static final long serialVersionUID = -3655167486073504826L; public static ArrayList<String> withelist = new ArrayList<>(); public static void save() { File f = new File(Main.getPlugin(Main.class).getDataFolder(), "seila.dat"); if (!(f.exists())) try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f)); oos.writeObject(withelist); oos.close(); } catch (Exception e) { e.printStackTrace(); } } @SuppressWarnings("unchecked") public static void load() { File f = new File(Main.getPlugin(Main.class).getDataFolder(), "seila.dat"); if (f.exists()) { try { ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f)); withelist = (ArrayList<String>) ois.readObject(); ois.close(); } catch (Exception e) { e.printStackTrace(); } } } } O método save é chamado no onEnable, mas quando chama o load (NO ONDISABLE), lança a exeção. stacktrace: [16:17:20] [Server thread/WARN]: java.io.IOException: O sistema não pode encontrar o caminho especificado [16:17:20] [Server thread/WARN]: at java.io.WinNTFileSystem.createFileExclusively(Native Method) [16:17:20] [Server thread/WARN]: at java.io.File.createNewFile(Unknown Source) [16:17:20] [Server thread/WARN]: at me.cuthmf.mywithelist.SaveWitheList.save(SaveWitheList.java:21) [16:17:20] [Server thread/WARN]: at me.cuthmf.mywithelist.Main.onDisable(Main.java:30) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:323) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:364) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:424) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:417) [16:17:20] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.disablePlugins(CraftServer.java:336) [16:17:20] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.stop(MinecraftServer.java:460) [16:17:20] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:593) [16:17:20] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source) [16:17:20] [Server thread/WARN]: java.io.FileNotFoundException: plugins\MinhaWithelist\seila.dat (O sistema não pode encontrar o caminho especificado) [16:17:20] [Server thread/WARN]: at java.io.FileOutputStream.open0(Native Method) [16:17:20] [Server thread/WARN]: at java.io.FileOutputStream.open(Unknown Source) [16:17:20] [Server thread/WARN]: at java.io.FileOutputStream.<init>(Unknown Source) [16:17:20] [Server thread/WARN]: at java.io.FileOutputStream.<init>(Unknown Source) [16:17:20] [Server thread/WARN]: at me.cuthmf.mywithelist.SaveWitheList.save(SaveWitheList.java:26) [16:17:20] [Server thread/WARN]: at me.cuthmf.mywithelist.Main.onDisable(Main.java:30) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:323) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:364) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:424) [16:17:20] [Server thread/WARN]: at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:417) [16:17:20] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_8_R3.CraftServer.disablePlugins(CraftServer.java:336) [16:17:20] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.stop(MinecraftServer.java:460) [16:17:20] [Server thread/WARN]: at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:593) [16:17:20] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)
-
HAUSHUSAHUHASUAHSUHUS Erro 404
-
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Sim, o problema era no meu código, não no seu :V -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
precisa colocar o clone, antes do add ? @EDIT Coloquei o clone, e ainda ta criando um L Lembrando que estou usando cuboid -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Não não, olha essa foto: http://prntscr.com/dxfmgn Iria quebrar os 3 blocos, só que com 3 de profundidade Primeira camada . Segunda camada. Terceira camada. -
negada [Shoutbox] Permissão editar e excluir!
tópico respondeu ao Hiitmarqes de LuizB em Sugestões recusadas
Não apoio -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Igual o //sp Se eu quebrar um bloco em uma parede, vai quebrar uma area 3x3x3 3 de profundidade 3 de altura 3 de largura -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Tem como pegar só o da frente ?, o cara mudou de ideia, não precisa mais de um radius :V -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
È, pensei errado IGUAL ao //sp -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Funcionou, só que está quebrando pra baixo, queria quebrar pra frente q.q -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Não funcionou, não aconteceu NADA, nem quebrou. Código: @EventHandler public void picaretaa(BlockBreakEvent e) { Player p = e.getPlayer(); Location playerPos = p.getLocation(); int radius = 15; int halfRadius = radius / 2; RegionManager wgCurrWorldRM = WGBukkit.getRegionManager(p.getWorld()); Location l1 = playerPos.add(halfRadius, halfRadius, halfRadius); Location l2 = playerPos.add(-halfRadius, -halfRadius, -halfRadius); Cuboid cb = new Cuboid(l1, l2); for (Block b : cb){ ApplicableRegionSet arSet = wgCurrWorldRM.getApplicableRegions(b.getLocation()); if (arSet.size() > 0) { Bukkit.getServer().broadcastMessage("Ok"); continue; }else { b.breakNaturally(); org.bukkit.inventory.ItemStack is = new org.bukkit.inventory.ItemStack(b.getType()); org.bukkit.inventory.ItemStack toadd = new org.bukkit.inventory.ItemStack(b.getType(), getDropCount(p.getItemInHand().getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS), e.getBlock())); e.getBlock().getDrops(is); e.getBlock().getDrops().add(toadd); } } } Cuboid: https://hastebin.com/morifibupu.java -
resolvido [Dúvida] Pegar blocos ao redor do player
pergunta respondeu ao LuizB de LuizB em Dúvidas resolvidas
Não é bem isso, é tipo pegar as ponta, formar um cubo 5 x 5 e quebrar tudo que tem nele. @EDIT Mas acho que vou pegar as pontas, criar um cuboid e fazer um loop nos blocos e quebrar q.q -
Olá, como faço pra pegar os blocos ao redor do player ? Estou tentando criar um comando igual ao //sp do worldedit. Por exemplo: eu digito o comando /quebrar 5, 5 vai ser o radius, ai vai gerar tipo um cubo id, com 1 bloco na ponta de cima, e outro bloco na ponta de baixo, que daria uma area de 5 blocos.
-
Exatamente nada, antes eu gostava pra caramba de brincar com meu cachorro, nas horas livre, só que ele veio a óbito.
-
Me passa esse seu xray pfvv, tou a um tempao procurando um assim. @TOPIC Foda, agora eu sei como faz pra setar o player no cavalo :V
-
Fiz isso, mas ainda continua