Ir para conteúdo

F_Almas + FeatherBoard [Variavel]


gh0st

Posts Recomendados

Vf1CRbA.png

 

 

Função: Eu queria um addon que fizesse aparecer as almas do f_almas no featherboard
 
Versão do servidor:
 
[  ] 1.5.2
[  ] 1.7.x

[ x ] 1.8.x

[  ] 1.9.x
[  ] Outro:
 
Uso de MySQL:
 
[  ] Sim
[  ] Não
 
Deverá gerar log:
 
[  ] Sim
[  ] Não
 
Comandos:
 
[  ] Nenhum
[  ] Outro:
 
Versão do Java:
 
[  ] Java 7
[ x ] Java 8
[  ] Outro:
 
Dependencia/Compatibilidade:
 
[  ] WorldGuard
[  ] LegenChat
[  ] Vault
[  ] Nenhum
[  ] Outro

Link para o comentário
Compartilhar em outros sites

Ta ofuscado, o método é esse

int almas = Main.const(Player var0);

O intellij decompilou e veio com esse "const" .. não dá.

Eu podia pegar direto das db

    public static Integer const(Player var0) {
        if(Main.const.getConfig().getBoolean("Configuracao.Usar_MySQL")) {
            if(!const.const()) {
                const.const();
            }

            try {
                ResultSet var2;
                if(!(var2 = const.getConnection().createStatement().executeQuery("SELECT * FROM almas WHERE `UUID`=\'" + var0.getUniqueId().toString() + "\';")).next()) {
                    return Integer.valueOf(-1);
                }

                return Integer.valueOf(var2.getInt("Quantia"));
            } catch (SQLException var4) {
                ;
            }
        } else {
            File var1 = new File(Main.const.getDataFolder(), "Accounts.yml");
            YamlConfiguration var5 = new YamlConfiguration();

            try {
                var5.load(var1);
                if(var5.contains(var0.getUniqueId().toString())) {
                    return Integer.valueOf(var5.getInt(var0.getUniqueId().toString() + ".Quantia"));
                }
            } catch (InvalidConfigurationException | IOException var3) {
                ;
            }
        }

        return Integer.valueOf(-1);
    }

Mas hoje já não posso fazer.. e provavelmente só daqui a um tempo poderei fazer a não ser que o próprio leo faça ou desofusque.

 

O addon basta isso

package me.zath.featheralmas;
/*
 * MC 
 * Created by zAth
 */

import be.maximvdw.placeholderapi.PlaceholderAPI;
import me.devleo.almas.Main;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;

public class FeatherAlmas extends JavaPlugin {

    @Override
    public void onEnable() {
        Bukkit.getConsoleSender().sendMessage("§6" + getDescription().getName() + " §8v.§6" + getDescription().getVersion() + " §8de§6 "
            + getDescription().getAuthors() + " §2Ativado");
        PlaceholderAPI.registerPlaceholder(this, "falmas", e -> "" + Main.const(e.getPlayer()));
    }
    
    @Override
    public void onDisable() {
        Bukkit.getConsoleSender().sendMessage("§6" + getDescription().getName() + " §8v.§6" + getDescription().getVersion() + " §8de§6 "
            + getDescription().getAuthors() + " §4Desativado");
        HandlerList.unregisterAll();
    }

}

O @LeoDev bondoso que é provavelmente faz :kk: só dar isso pra ele e dae ele usa a dependência sem tar ofuscado.

Editado por zAth
Link para o comentário
Compartilhar em outros sites

Ta ofuscado, o método é esse

int almas = Main.const(Player var0);

O intellij decompilou e veio com esse "const" .. não dá.

Eu podia pegar direto das db

    public static Integer const(Player var0) {
        if(Main.const.getConfig().getBoolean("Configuracao.Usar_MySQL")) {
            if(!const.const()) {
                const.const();
            }

            try {
                ResultSet var2;
                if(!(var2 = const.getConnection().createStatement().executeQuery("SELECT * FROM almas WHERE `UUID`=\'" + var0.getUniqueId().toString() + "\';")).next()) {
                    return Integer.valueOf(-1);
                }

                return Integer.valueOf(var2.getInt("Quantia"));
            } catch (SQLException var4) {
                ;
            }
        } else {
            File var1 = new File(Main.const.getDataFolder(), "Accounts.yml");
            YamlConfiguration var5 = new YamlConfiguration();

            try {
                var5.load(var1);
                if(var5.contains(var0.getUniqueId().toString())) {
                    return Integer.valueOf(var5.getInt(var0.getUniqueId().toString() + ".Quantia"));
                }
            } catch (InvalidConfigurationException | IOException var3) {
                ;
            }
        }

        return Integer.valueOf(-1);
    }

Mas hoje já não posso fazer.. e provavelmente só daqui a um tempo poderei fazer a não ser que o próprio leo faça ou desofusque.

 

O addon basta isso

package me.zath.featheralmas;
/*
 * MC 
 * Created by zAth
 */

import be.maximvdw.placeholderapi.PlaceholderAPI;
import me.devleo.almas.Main;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;

public class FeatherAlmas extends JavaPlugin {

    @Override
    public void onEnable() {
        Bukkit.getConsoleSender().sendMessage("§6" + getDescription().getName() + " §8v.§6" + getDescription().getVersion() + " §8de§6 "
            + getDescription().getAuthors() + " §2Ativado");
        PlaceholderAPI.registerPlaceholder(this, "falmas", e -> "" + Main.const(e.getPlayer()));
    }
    
    @Override
    public void onDisable() {
        Bukkit.getConsoleSender().sendMessage("§6" + getDescription().getName() + " §8v.§6" + getDescription().getVersion() + " §8de§6 "
            + getDescription().getAuthors() + " §4Desativado");
        HandlerList.unregisterAll();
    }

}

O @LeoDev bondoso que é provavelmente faz :kk: só dar isso pra ele e dae ele usa a dependência sem tar ofuscado.

Vou esperar o leo aparecer...

Link para o comentário
Compartilhar em outros sites

Me chama no discord que passo o .Jar com a API do feather!

Placeholder só precisa mesmo isso para o featherboard


        PlaceholderAPI.registerPlaceholder(this, "falmas", e -> "" + Main.const(e.getPlayer()));

Poderia colocar em muitos plugins seus já que tem bastante gente que usa o feather :D

 

@On

Entregue?

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...