Ir para conteúdo
  • Cadastre-se

Como Adicionar Um Properties no seu Projeto


Dirty

Posts recomendados

Galera Vim trazer esse tutorial para vocês pois não achei no fórum ,

E vamos ao Tutorial !

cgwxi.gif

1º ) Adicione o mod normalmente ( Estou usando a l2jserver ) ...

2º) Mude os nomes das properties ( Tudo que tiver Custom Coloque com o nome que você quiser Ex : l2jbrasil.properties )

3º ) Dps que add Para add os mods eh simples nessa parte : Voçê coloca o uma parte do mod siga o Exemplo .

+ // --------------------------------------------------

+ // Custom Settings - Start

+ // --------------------------------------------------

EX:

public static boolean SPAWN_CHAR;

public static int SPAWN_X;

public static int SPAWN_Y;
public static int SPAWN_Z;

+ // --------------------------------------------------

+ // Custom Settings - End

+ // --------------------------------------------------

5º ) Depois de Colocado Você Ira add a outra parte do mod nessa Parte (Siga o exemplo )...

L2Properties CustomSettings = new L2Properties();

CustomSettings.load(is);

EX :

SPAWN_CHAR = Boolean.parseBoolean(CustomSettings.getProperty("CustomSpawn", "false"));

SPAWN_X = Integer.parseInt(CustomSettings.getProperty("SpawnX", ""));

SPAWN_Y = Integer.parseInt(CustomSettings.getProperty("SpawnY", ""));

SPAWN_Z = Integer.parseInt(CustomSettings.getProperty("SpawnZ", ""));

}

catch (Exception e)

{

6º ) Depois so add no custom.properties o resto do mod se tiver Mais adicione pois dara erro o mod(Siga o Exemplo ) :

# Set true for custom spawn location.

CustomSpawn = false

SpawnX = x

SpawnY = y

SpawnZ = z

cgwxi.gif

Mod :

O conteúdo está oculto, favor efetuar login ou se cadastrar!

[/xml]

 

cgwxi.gif

Créditos :

-->OuTSide<--

Editado por -->OutSide<--

Eu não respondo dúvidas e nem pedidos por MP e nem por nenhum outro meio de contato !


Link para o comentário
Compartilhar em outros sites


me desculpe mas eu nao entendi nada, eu queria muito saber como CRIAR um mod, e como coloca-lo no meu servidor, estou usando esta REV aqui L2JServer_BETA_GS4627_DP8014_20-05-2011, é um servidor sem custom, se alguem puder me ajudar

algumas revs minhas te, svn e outras mão prucre bastante como add mod dps tente fazer issso eh so para quem tem projeto trabalhe + o java q vc entenderá

Eu não respondo dúvidas e nem pedidos por MP e nem por nenhum outro meio de contato !


Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...

Belo tutorial, lembrando que como cada cabeça uma sentença é cada projeto de uma forma pra quem usa l2jfrozen a linha que adiciona a nova properties é FService.java não sei como tá o pack agora mais quando eu andava acompanhando pouco era lá.

Nos de mais packs a maioria é tudo direto no config.java já.

Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...

aew mano eu fiz um parecido e talz deu tudo ceritin so que o mods não pega, usei o (new charbuffs ) add tudo certin so q eu add o mod na properties q eu criei CustomsMods.properties e quando eu crio um novo char não aprece o buffs. bem o mod original e esse aki

Original

 

--- head-src/com/l2jfrozen/Config.java (revision 939)

+++ head-src/com/l2jfrozen/Config.java (working copy)

@@ -2121,8 +2121,11 @@

public static String PM_TEXT1;

public static String PM_TEXT2;

public static boolean NEW_PLAYER_EFFECT;

-

+ public static boolean NEW_PLAYER_BUFFS;

+ public static Map FIGHTER_BUFF_LIST;

+ public static Map MAGE_BUFF_LIST;

 

+

//============================================================

public static void loadFrozenConfig()

{

@@ -2143,7 +2146,59 @@

PM_TEXT1 = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on");

PM_TEXT2 = frozenSettings.getProperty("PMText2", "Vote for us every 24h");

NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));

+ NEW_PLAYER_BUFFS = Boolean.parseBoolean(frozenSettings.getProperty("AltNewCharBuffs", "False"));

+ if(NEW_PLAYER_BUFFS)

+ {

+ String[] fighterBuffSplit = frozenSettings.getProperty("FighterBuffList", "").split(";");

+ FIGHTER_BUFF_LIST = new FastMap(fighterBuffSplit.length);

+ for(String skill : fighterBuffSplit)

+ {

+ String[] skillSplit = skill.split(",");

+ if(skillSplit.length != 2)

+ {

+ System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skill + "\"");

+ }

+ else

+ {

+ try

+ {

+ FIGHTER_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));

+ }

+ catch(NumberFormatException nfe)

+ {

+ if(!skill.equals(""))

+ {

+ System.out.println("invalid config property in " + Frozen + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);

+ }

+ }

+ }

+ }

 

+ String[] mageBuffSplit = frozenSettings.getProperty("MageBuffList", "").split(";");

+ MAGE_BUFF_LIST = new FastMap(mageBuffSplit.length);

+ for(String skill : mageBuffSplit)

+ {

+ String[] skillSplit = skill.split(",");

+ if(skillSplit.length != 2)

+ {

+ System.out.println("invalid config property in " + Frozen + " -> MageBuffList \"" + skill + "\"");

+ }

+ else

+ {

+ try

+ {

+ MAGE_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));

+ }

+ catch(NumberFormatException nfe)

+ {

+ if(!skill.equals(""))

+ {

+ System.out.println("invalid config property in" + Frozen + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);

+ }

+ }

+ }

+ }

+ }

}

catch(Exception e)

{

 

 

e o editado estar assim

Editado

 

//============================================================

public static boolean NEW_PLAYER_BUFFS;

public static Map FIGHTER_BUFF_LIST;

public static Map MAGE_BUFF_LIST;

 

 

//============================================================

public static void loadCustomsConfig()

{

String Customs = "./config/functions/CustomsMods.properties";

try

{

Properties CustomsSettings = new Properties();

InputStream is = new FileInputStream(new File("./config/functions/CustomsMods.properties"));

CustomsSettings.load(is);

is.close();

NEW_PLAYER_BUFFS = Boolean.parseBoolean(CustomsSettings.getProperty("AltNewCharBuffs", "False"));

if(NEW_PLAYER_BUFFS)

{

String[] fighterBuffSplit = CustomsSettings.getProperty("FighterBuffList", "").split(";");

FIGHTER_BUFF_LIST = new FastMap(fighterBuffSplit.length);

for(String skill : fighterBuffSplit)

{

String[] skillSplit = skill.split(",");

if(skillSplit.length != 2)

{

System.out.println("invalid config property in " + Customs + " -> FighterBuffList \"" + skill + "\"");

}

else

{

try

{

FIGHTER_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));

}

catch(NumberFormatException nfe)

{

if(!skill.equals(""))

{

System.out.println("invalid config property in " + Customs + " -> FighterBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);

}

}

}

}

 

String[] mageBuffSplit = CustomsSettings.getProperty("MageBuffList", "").split(";");

MAGE_BUFF_LIST = new FastMap(mageBuffSplit.length);

for(String skill : mageBuffSplit)

{

String[] skillSplit = skill.split(",");

if(skillSplit.length != 2)

{

System.out.println("invalid config property in " + Customs + " -> MageBuffList \"" + skill + "\"");

}

else

{

try

{

MAGE_BUFF_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));

}

catch(NumberFormatException nfe)

{

if(!skill.equals(""))

{

System.out.println("invalid config property in" + Customs + " -> MageBuffList \"" + skillSplit[0] + "\"" + skillSplit[1]);

}

}

}

}

}

}

catch(Exception e)

{

e.printStackTrace();

throw new Error((new StringBuilder()).append("Failed to Load ").append(Customs).append(" File.").toString());

 

}

}

 

 

espero poder me ajudar obrigado....

Link para o comentário
Compartilhar em outros sites

  • 9 months later...




×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.