Ir para conteúdo

FilipeNock

Membros
  • Total de itens

    188
  • Registro em

  • Última visita

Tudo que FilipeNock postou

  1. como o tequila disse qualquer sistema assim é totalmente burlavel mas tem um topico aqui que pode te ajudar http://gamersboard.com.br/topic/44092-verificar-em-uma-pagina-html-usando-java/#entry373596
  2. faz um item Deserializer fiz um aqui rapidão pra vc ver public ItemStack deserializeItem(String item) { String[] split = item.split(" : "); ItemStack stack = new ItemStack(Material.AIR); if (split.length == 1) { stack = new ItemStack(Material.getMaterial(split[0])); } if (split.length == 2) { stack = new ItemStack(Material.getMaterial(split[0]), 1, (short)1, Byte.valueOf(split[1])); } if (split.length == 3) { stack = new ItemStack(Material.getMaterial(split[0]), 1, (short)1, Byte.valueOf(split[1])); ItemMeta meta = stack.getItemMeta(); meta.setDisplayName(split[2].replace("&", "§")); stack.setItemMeta(meta); } return stack; } Na Config: Items: #ITEM : DATA : NOME - 'DIAMOND_SWORD : 0 : &bEspada Foda' - 'DIAMOND : 0 : &6Meu Diamante' - 'WOOL : 5 : &9La Colorida' para dar os items para o player public void darItems(Player player) { for (String item : getConfig().getStringList("Items")) { ItemStack temp = deserializeItem(item); player.getInventory().addItem(temp); } } o seu método de deserializar os items pode conter tudo, Lore enchants então depende mt da sua capacidade de fazer fiz isso em uns 5 minutos EDIT: Fiz um mais complexo com lore e algumas coisas diferentes https://hastebin.com/nahawecoyo.vbs Config: Items: #ITEM : DATA : name=NOME : lore=LORE - '276 : 0 : name=&bEspada Foda : lore=&bLinha1, &6Linha2, &9Linha3' - 'DIAMOND : 0 : name=&6Meu Diamante' - '35 : 5 : name=&9La Colorida'
  3. Primeiramente vc deve aprender sobre a linguagem SQL dps usar, esse cara aqui fez um tutorial de coins é um bom exemplo pra vc começar https://www.youtube.com/watch?v=fLjNlftGcJg mas n vai ajudar em nada se voce não entender como o mysql funciona
  4. como os cara estão te dizendo é preciso do basico do java pra entender man, pesquisa um pouco sobre a linguagem antes de tentar algum plugin package me.nock.test; import java.util.HashMap; import java.util.concurrent.TimeUnit; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; public class Test implements Listener{ public HashMap<Player, Long> entrou = new HashMap<>();//RECOMENDO USAR CONFIG @EventHandler public void join(PlayerJoinEvent e) { Player p = e.getPlayer(); if (!entrou.containsKey(p)) { entrou.put(p, System.currentTimeMillis()); } } public void sendOnlinetime(Player player) { long value = System.currentTimeMillis() - entrou.get(player); long onlinesecs = TimeUnit.MILLISECONDS.toSeconds(value); player.sendMessage("Voce está a " + onlinesecs + " Segundos Online"); //BASICAMENTE ELE PEGA O TEMPO QUE O PLAYER ENTROU E DIMINUI PELO AGORA } }
  5. public void test() { for (int i = 0; i < 50; i++) { try { Bukkit.broadcastMessage("-- " + i); Thread.sleep(1000); //1000 ms = 1 s } catch (InterruptedException e) { e.printStackTrace(); } } } como ele falou ali em cima, isso faz o codigo esperar um tempo... mas acho que isso faz parar tudo '-
  6. só checa o nome do inventario e ve se é igual a Seleção de Kits
  7. isso não é um erro é uma informação só muda o private static pra public static
  8. Porque vc fez um scheduler pra colocar a poção? voce esqueceu de registrar o comando no onenable ta aqui https://hastebin.com/ohosivezuk.java e é preciso registrar no plugin.yml o seu comando
  9. public void Open(Player p) { Inventory inv = Bukkit.createInventory(p, 54, "Seu Menu"); ItemStack item = new ItemStack(Material.DIAMOND_SWORD); ItemMeta meta = item.getItemMeta(); meta.setDisplayName("NOME DO ITEM"); item.setItemMeta(meta); inv.addItem(item); p.openInventory(inv); } @EventHandler public void on(InventoryClickEvent e) { if (e.getCurrentItem() == null) return; if (e.getCurrentItem().getItemMeta().getDisplayName() == null) return; if (!(e.getWhoClicked() instanceof Player)) return; Player p = (Player) e.getWhoClicked(); if (e.getCurrentItem().getItemMeta().getDisplayName().equals("NOME DO SEU ITEM")) { e.setCancelled(true); p.chat("/comando"); } } lembra de checar o nome do inventario
  10. era isso que ia falar tipo um scheduler correndo é meio inutil pra quem quer fazer dias de countdown '-/
  11. Eae boys, to fazendo umas paradas, alguns minigames mas pra isso precisei pesquisar sobre criar uma entidade customizada, exemplo eu modificar a direção ou a visão dela! bom eu consegui com todos os mobs menos o enderdragon ele é o unico que não obedece a direção, esse codigo faz com que vc movimente o mob que vc esta em cima mas não funciona com o enderdragon, alguem tem alguma ideia de como fazer? public class CustomEnderdg extends EntityEnderDragon { protected Field FIELD_JUMP = null; public CustomEnderdg(World world) { super(world); if (FIELD_JUMP == null) { try { FIELD_JUMP = EntityLiving.class.getDeclaredField("aY"); FIELD_JUMP.setAccessible(true); } catch (NoSuchFieldException e) { e.printStackTrace(); } } } @Override public void g(float f, float f1) { if (this.passenger != null && this.passenger instanceof EntityHuman) { this.lastYaw = this.yaw = this.passenger.yaw; this.pitch = this.passenger.pitch * 0.5F; this.setYawPitch(this.yaw, this.pitch); this.aK = this.aI = this.yaw; f = ((EntityLiving) this.passenger).aZ * 0.5F; f1 = ((EntityLiving) this.passenger).ba; if (f1 <= 0.0F) { f1 *= 0.25F; } try { if (FIELD_JUMP.getBoolean(this.passenger) && this.onGround) { this.motY += 0.5F; this.ai = true; if (f1 > 0.0F) { float f2 = MathHelper.sin(this.yaw * 3.141593F / 180.0F); float f3 = MathHelper.cos(this.yaw * 3.141593F / 180.0F); this.motX += -0.4F * f2 * ((EntityInsentient) this).br(); this.motZ += 0.4F * f3 * ((EntityInsentient) this).br(); } } } catch (IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } this.S = 1.0F; this.aM = this.bI() * 0.1F; if (!this.world.isClientSide) { this.k((float) this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).getValue()); super.g(f, f1); } this.aA = this.aB; double d0 = this.locX - this.lastX; double d1 = this.locZ - this.lastZ; float f4 = MathHelper.sqrt(d0 * d0 + d1 * d1) * 4.0F; if (f4 > 1.0F) { f4 = 1.0F; } this.aB += (f4 - this.aB) * 0.4F; this.aC += this.aB; } else { this.S = 0.5F; this.aM = 0.02F; super.g(f, f1); } } public static EnderDragon spawn(Location location) { World mcWorld = ((CraftWorld) location.getWorld()).getHandle(); RidablePig customEntity = new RidablePig(mcWorld); customEntity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); ((CraftLivingEntity) customEntity.getBukkitEntity()).setRemoveWhenFarAway(false); mcWorld.addEntity(customEntity, SpawnReason.CUSTOM); customEntity.setCustomName(""); customEntity.setCustomNameVisible(false); return (EnderDragon) customEntity.getBukkitEntity(); } }
  12. o plugin é sua main, seria setup(this) eu fiz um Objeto pra config isso porque eu costumo criar vários tipos de arquivos separados https://pastebin.com/PVyYYg8J na sua Main
  13. public void onEnable() { if (!getServer().getIp().equals("192.168.0.0")) { Bukkit.getConsoleSender().sendMessage("§cVOCE NAO TEM A LICENÇA PARA USAR ESTE PLUGIN"); getPluginLoader().disablePlugin(this); } } '-- Coloca o ip do servidor ali! mas isso é fácil de burlar com qualquer bytecode editor vc pode modificar isso! voce pode usar um obfuscador que mude as strings, assim evita que o plugin seja alterado! eu uso um chamado Stringer Obfuscator exemplo:
  14. ele n pode ser teleportado quando morre, teleporta ele quando o player dar respawn PlayerRespawnEvent
  15. usa essa API, feita pelo meu amigo @GremoryDev https://pastebin.com/cVLgAjp2 public HashMap<Player, ScoreManager> scoreboard = new HashMap<>(); //invoca isso quando o player entrar no servidor public void AddPlayertoScoreboard(Player player) { ScoreManager board = new ScoreManager(player, "§E§LTITULO") { @Override public String placeHolders(String str) { return str.replace("%players%", Bukkit.getOnlinePlayers().size()+"").replace("%player%", player.getName()); } }; board.add("LINHA-1"); board.blank(); //ESPAÇO board.add("LINHA-2"); board.blank(); //ESPAÇO board.add("LINHA-3"); board.updateScoreboard(); if (scoreboard.containsKey(player)) { scoreboard.remove(player); } scoreboard.put(player, board); } public void onEnable() { Bukkit.getScheduler().runTaskTimer(this, new Runnable() { @Override public void run() { for (ScoreManager board : scoreboard.values()) { board.updateScoreboard(); } } }, 0, 20); } no onenable vc cria um scheduler para ele fazer update
  16. Primeiramente vc tem que aprender sobre o Java em si! Orientação de objetos, os construtores depois vc estuda a api do spigot/bukkit, com o tempo vc aprende '-- mas o importante é aprender sobre o java dps pensar em plugins
  17. porque vc tah usando config pra salvar o inventario? se vc não vai reiniciar o servidor usa HashMap
  18. Nao há download! você importa o próprio pex no seu source dps usa a api do link que ele te enviou public void test(Player p) { PermissionUser user = PermissionsEx.getUser(p); user.getPrefix(); user.getGroupNames(); user.addGroup("dono"); }
  19. File file = new File(Main.getInstance().getDataFolder() + "/livros/" + player + ".yml"); YamlConfiguration edit = YamlConfiguration.loadConfiguration(file); edit.set("Resposta.1", "teste"); try { edit.save(file); } catch (IOException e) { e.printStackTrace(); } eu uso esse método e funciona
  20. ele tenta fazer uma conexao com a internet, provavelmente ele tah tentando checar updates veja na config se tem como disabilitar o UpdateCheck
  21. Assim como ele falou! pra mim o lenght tbm da erro, e eu uso o size() Bukkit.getOnlinePlayers().size(); ou cria um construtor na main public static int PlayersCount() { int i = 0; for (Player p : Bukkit.getOnlinePlayers()) { i++; } return i; }
  22. eu resolvi de outro jeito aqui mas é uma boa ideia pra salvar a count e o id do scheduler vlw
  23. public void OpenReportsMenu(Player p) { Inventory inv = Bukkit.createInventory(p, 54, "§6Reports"); int i = 0; for (String players : getConfig().getConfigurationSection("Reportados").getKeys(false)) { ItemStack is = new ItemStack(Material.SKULL_ITEM, (byte)3); SkullMeta ism = (SkullMeta) is.getItemMeta(); ism.setOwner(players); ism.setDisplayName("§6Reportado: " + players); is.setItemMeta(ism); inv.setItem(i, is); i++; } p.openInventory(inv); não precisa ter mt experiencia em java pra fazer isso mas usa como exemplo! vc deve fazer uma limitação pra colocar uma nova pagina porque tenho certeza que vai ter mais que 54 reports que é o tamanho de um menu grande se n me engano
×
×
  • Criar Novo...