-
Total de itens
389 -
Registro em
-
Última visita
Respostas na Comunidade
-
Pica-Pau's postagem in Método para.. Fixar inventário was marked as the answer
Cria um mapa com as opções que o player tem uai
public final static Map<UUID, Map<String, Object>> options = new HashMap<>(); public static Map<String, Object> setup(UUID uuid) { if(options.containsKey(uuid)) return options.get(uuid); else { options.put(uuid, new HashMap<>()); return options.get(uuid); } } public Inventory open(UUID uuid) { Inventory i = Bukkit.createInventory(null, 54, "Inventário qualquer"); Map<String, Object> o = setup(uuid); if(o.containsKey("pao") && o.get("pao") == true) { i.addItem(new ItemStack(Material.BREAD, 5)); } return i; } -
Pica-Pau's postagem in Retirar money was marked as the answer
https://dev.bukkit.org/projects/vault/
public class Main extends JavaPlugin { private static Economy economia; @Override public void onEnable() { setupVault(); Bukkit.getPluginManager().registerEvents(new Eventos(), this); } private boolean setupVault() { RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); if (economyProvider != null) { economia = economyProvider.getProvider(); } return (economia != null); } public static Economy getEconomia() [ return economia; } } public class Eventos implements Listener { @EventHandler public void onPlayerCommand(PlayerCommandPreprocessEvent e) { Player p = e.getPlayer(); if(e.getMessage().equalsIgnoreCase("/meucomando")) { double i = 50.0d; Main.getEconomia().withdrawPlayer(p, i); p.sendMessage("Removido R$ " + i + " da sua conta."); } } } -
Pica-Pau's postagem in Sistema de licença was marked as the answer
1.
Faça uma conexão da sua aplicação com um Website, com parametros POST.
Você pode usar minha classe auxiliar de Request para isto clicando aqui. Ex.:
verifica,
plugin = MeuPlugin <- raw -> "verifica&plugin=MeuPlugin"
2. Nesse website, verifique se os parametros pedido de acordo com a ação vão retornar tal valor.
<?php if(isset($_POST['verifica']) && isset($_POST['plugin']) && !empty($_POST['plugin'])) { echo 'true'; } ?> 3. Receberá a respota na aplicação. No caso:
true 4.
Obfusque o máximo possível sua apicação.
Use URLClassLoader para carregamento das classes.
Sempre feche a conexão após uma resposta do servidor.
-
Pica-Pau's postagem in MySQL & List was marked as the answer
public List<String> getLista() {
List<String> list = new ArrayList<>();
try {
PreparedStatement ps = ...;
ResultSet rs = ...;
while(rs.next()) {
list.add("MEGA ROLUDO");
}
rs.close();
ps.close();
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
Arrays.toString(getLista().toArray(new String[0)).replace("[", "").replace("[", "");
-
Pica-Pau's postagem in WYSUWYG??? was marked as the answer
Usa o Quill ele é customizavel e dá pra serializar imagem, html e qualquer coisa do form em base64 ou em json, além de ser 100% customizavel, tem como tu escolher o template dele que se não me engano são 4.
Site do Quill:
https://quilljs.com/
-
Pica-Pau's postagem in pocentagem ao morrer? was marked as the answer
@EventHandler
public void onPlayerDeathEvent(PlayerDeathEvent e) {
Player p = e.getEntity();
Player k = p.getKiller();
int pct = 30;
// CÓDIGO DO JETA
if(new Random().nextInt(100) + 1 < pct) {
ItemStack is = new ItemStack(Material.DIAMOND, 5);
ItemMeta im = is.getItemMeta();
im.setDisplayName("Você matou " + p.getName());
is.setItemMeta(im);
k.getInventory().addItem(is);
k.sendMessage("Você ganhou uma recompensa por matar " + p.getName());
}
}
-
Pica-Pau's postagem in Dúvida HTML was marked as the answer
<a href="site">..</a>
<!-- EXEMPLO -->
<a href="http://gamersboard.com.br">Site da GB</a>
-
Pica-Pau's postagem in [Pedido] Plugin de RANKUP was marked as the answer
Tenta o NyRankUPLite tem todas as funções que tu pediu, só que o NPC só vai sair na v2.0
-
Pica-Pau's postagem in [MySQL] Erro /money top [ was marked as the answer
Recomendo usar um "Map<String, Double>" pra guardar o dinheiro dos players já que são apenas dois valores...
E Pra fazer o "top" tenta usar um Comparator '-'
-
Pica-Pau's postagem in api authme was marked as the answer
Cara isso ai não tem nada haver com o authme.. Você deve ter posto um @EventHandler incorretamente. Manda o code pra "noix"
-
Pica-Pau's postagem in PlayersPoints API was marked as the answer
como é de setar se é "int" tá loco '-'
"look" = "ver"
-
Pica-Pau's postagem in Como criar um item com isso: :1 Ex: (322:1) was marked as the answer
Tu tem q criar um byte chamado "data" adicionado da classe "ItemStack"
Ex: new ItemStack(Material.STAINED_GLASS_PANE, 1, (byte) 4);