Ir para conteúdo
  • 0

[Resolvido] Incompatibilidade entre plugins? '-''-''-'''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-'&#


Pergunta

Postado

Tipo, criei 2 plugins, coloquei no mesmo servidor, os comandos de um funcionam, mas do outro não, WTF? '-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-'

13 respostass a esta questão

Posts Recomendados

Postado

Verifica como esta o package.
Por exemplo:
Plugin 1: me.trow.Plugin

Plugin 2: me.trow.Plugin

Se tiver assim, o 1° plugin que o console ler, fica como ativado e o 2° fala que já estava ativado. Pode ser isso!
 

Postado

Tipo, criei 2 plugins, coloquei no mesmo servidor, os comandos de um funcionam, mas do outro não, WTF? '-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-''-'

Registrou todos os comandos devidamente?

Postado

Não, os comandos são bem distintos uns dos outros, não tem nenhuma similaridade.

Sim, todos os comandos estão corretamente registrados, tanto na Class principal quanto na plugin.yml.

Postado (editado)

Plugin 1:

 

 

Código:

 

 

package me.plugin1;

import java.io.File;
import java.util.List;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class Plugin1 extends JavaPlugin{
	
	public Economy econ = null;
	boolean Vault = true;
	private Comandos cmds;
	private Eventos events;
	
	public void onEnable(){
		getServer().getConsoleSender().sendMessage("§3==========[§bPlugin 1§3]==========");
		getServer().getConsoleSender().sendMessage(" §3Status: §bAtivado");
		getServer().getConsoleSender().sendMessage(" §3By: §bDery");
		getServer().getConsoleSender().sendMessage(" §3Versao: §b" + getDescription().getVersion());
		if(Bukkit.getServer().getPluginManager().getPlugin("Vault") == null){
			getServer().getConsoleSender().sendMessage(" §3Vault: §bNao Encontrado");
			Vault = false;
			Bukkit.getPluginManager().disablePlugin(this);
			return;
		}else{
			getServer().getConsoleSender().sendMessage(" §3Vault: §bHooked (Economy)");
			if(!new File(getDataFolder(), "config.yml").exists()){
				saveDefaultConfig();
				getServer().getConsoleSender().sendMessage(" §3Config: §bCriada");
			}else{
				getServer().getConsoleSender().sendMessage(" §3Config: §bJa Existente");
			}
		}
		getServer().getConsoleSender().sendMessage("§3==========[§bPlugin 1§3]==========");
		Bukkit.getServer().getPluginManager().registerEvents(new Eventos(), this);
		getCommand("megasena").setExecutor(new Comandos());
		getCommand("apostar").setExecutor(new Comandos());
		setupEconomy();
	}
	
	public void onDisable(){
		getServer().getConsoleSender().sendMessage("§4==========[§cPlugin 1§4]==========");
		getServer().getConsoleSender().sendMessage(" §4Status: §cDesativado");
		getServer().getConsoleSender().sendMessage(" §4By: §cDery");
		getServer().getConsoleSender().sendMessage(" §4Versao: §c" + getDescription().getVersion());
		getServer().getConsoleSender().sendMessage("§4==========[§cPlugin 1§4]==========");
	}

	public boolean setupEconomy(){
		RegisteredServiceProvider<Economy> ec = getServer().getServicesManager().getRegistration(Economy.class);
		if(ec!=null){
			econ = (Economy)ec.getProvider();
		}
		return econ != null;
	}
	
	public static Plugin1 getBMS(){
		return (Plugin1) Bukkit.getServer().getPluginManager().getPlugin("Plugin1");
	}
	
	public Comandos getCmds(){
		return cmds;
	}
	
	public Eventos getEventos(){
		return events;
	}
	
	@SuppressWarnings({ "static-access", "unchecked" })
	protected List<String> getApostadores(){
		return (List<String>) getBMS().getCmds().aposta;
	}

}
 

 

 

Plugin.yml:

 

 

name: Plugin1
version: 1.0
main: me.plugin1.Plugin1

commands:
    megasena:
    apostar: 

 

 

 

 

 

Plugin 2:

 

 

Código:

 

 

package me.plugin2;

import java.io.File;

import net.milkbowl.vault.economy.Economy;

import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class Plugin2 extends JavaPlugin{
	
	public static Economy econ = null;
	boolean Vault = true;
	private SpleefManager sm;
	private Comandos comandos;
	private Cuboid cuboid;
	
	public void onEnable(){
		getServer().getConsoleSender().sendMessage("§3==========[§bPlugin 2§3]==========");
		getServer().getConsoleSender().sendMessage(" §3Status: §bAtivado");
		getServer().getConsoleSender().sendMessage(" §3By: §bDery");
		getServer().getConsoleSender().sendMessage(" §3Versao: §b" + getDescription().getVersion());
		if(Bukkit.getServer().getPluginManager().getPlugin("Vault") == null){
			getServer().getConsoleSender().sendMessage(" §3Vault: §bNao Encontrado");
			Vault = false;
			Bukkit.getPluginManager().disablePlugin(this);
			return;
		}else{
			getServer().getConsoleSender().sendMessage(" §3Vault: §bHooked (Economy)");
			if(!new File(getDataFolder(), "config.yml").exists()){
				saveDefaultConfig();
				getServer().getConsoleSender().sendMessage(" §3Config: §bCriada");
			}else{
				getServer().getConsoleSender().sendMessage(" §3Config: §bJa Existente");
			}
		}
		getServer().getConsoleSender().sendMessage("§3==========[§bPlugin 2§3]==========");
		Bukkit.getServer().getPluginManager().registerEvents(new Eventos(), this);
		getCommand("spleef").setExecutor(new Comandos());
		setupEconomy();
	}
	
	public void onDisable(){
		getServer().getConsoleSender().sendMessage("§4==========[§cPlugin 2§4]==========");
		getServer().getConsoleSender().sendMessage(" §4Status: §cDesativado");
		getServer().getConsoleSender().sendMessage(" §4By: §cDery");
		getServer().getConsoleSender().sendMessage(" §4Versao: §c" + getDescription().getVersion());
		getServer().getConsoleSender().sendMessage("§4==========[§cPlugin 2§4]==========");
	}

	public boolean setupEconomy(){
		RegisteredServiceProvider<Economy> ec = getServer().getServicesManager().getRegistration(Economy.class);
		if(ec!=null){
			econ = (Economy)ec.getProvider();
		}
		return econ != null;
	}
	
	public static Plugin2 getPlugin2(){
		return (Plugin2) Bukkit.getServer().getPluginManager().getPlugin("Plugin2");
	}
	
	public SpleefManager getSpleefManager(){
		return sm;
	}
	
	public Comandos getComandos(){
		return comandos;
	}
	
	public Cuboid getCuboid(){
		return cuboid;
	}

}
 

 

 

Plugin.yml:

 

 

name: Plugin2
version: 1.0
main: me.plugin2.Plugin2

commands:
    spleef: 

 

 

 

 

 

@Edit: Quando tiro o plugin 2 o plugin 1 funciona normalmente...

Editado por Dery
Postado

É incompatibilidade mesmo (os plugins funcionam, mas não juntos), ou 1 funciona e o outro não?

Postado

É incompatibilidade mesmo (os plugins funcionam, mas não juntos), ou 1 funciona e o outro não?

Os 2 funcionam normalmente, quando um não está no mesmo servidor que o outro.

Exatamente isso, eles funcionam, mas não juntos...

Postado

Verifica como esta o package.

Por exemplo:

Plugin 1: me.trow.Plugin

Plugin 2: me.trow.Plugin

Se tiver assim, o 1° plugin que o console ler, fica como ativado e o 2° fala que já estava ativado. Pode ser isso!

 

Trow, quanto tempo ;-;

 

Acerto mizeravi, era a package mesmo, as duas tinham nome similares ;-;

As packages, não as Class principais, não sabia disso, affz '-'

Resolvido!

Postado

Trow, quanto tempo ;-;

 

Acerto mizeravi, era a package mesmo, as duas tinham nome similares ;-;

As packages, não as Class principais, não sabia disso, affz '-'

Resolvido!

hehe tempo msm :p

logo-forum.png

 

 

Sua dúvida foi marcada como [Resolvido] e movido à área de dúvidas resolvidas.

 

 

Atenciosamente,

Gamer's Board

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