Ir ao conteúdo
  • Cadastre-se
racream

Compilar .Java para .Class

Recommended Posts

Primeiramente um Bom dia , uma boa tarde ou uma boa noite.

Eo seguinte e estou querendo copilar um arquivo mais so q da dando varios erros se alquem poder copilar ele do .java para . class ou me ensinar a copilar tudo beim...

Ja usei o net beans, eclipse, entre outros...

Eu quero adicionar as seguinte nos arquivos .java

if (activeChar.getPvpKills()>= 50)

{

activeChar.getAppearance().setNameColor(0066CC);

}

if (activeChar.getPvpKills()>= 100)

{

activeChar.getAppearance().setNameColor(660099);

}

if (activeChar.getPvpKills()>= 200)

{

activeChar.getAppearance().setNameColor(99CC99);

}

if (activeChar.getPvpKills()>= 350)

{

activeChar.getAppearance().setNameColor(CCFF33);

}

if (activeChar.getPvpKills()>= 500)

{

activeChar.getAppearance().setNameColor(FF33CC);

}

if (activeChar.getPvpKills()>= 750)

{

activeChar.getAppearance().setNameColor(CC6600);

}

if (activeChar.getPvpKills()>= 1000)

{

activeChar.getAppearance().setNameColor(33FFCC);

}

if (activeChar.getPvpKills()>= 2500)

{

activeChar.getAppearance().setNameColor(000000);

}

if (activeChar.getPvpKills()>= 5000)

{

activeChar.getAppearance().setNameColor(FF00FF);

}

O arquivo e esse awe

// Decompiled by DJ v3.10.10.93 Copyright 2007 Atanas Neshkov Date: 30/7/2008 10:29:50

// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!

// Decompiler options: packimports(3)

// Source File Name: EnterWorld.java

package net.sf.l2j.gameserver.clientpackets;

import java.io.File;

import java.io.UnsupportedEncodingException;

import java.util.*;

import javolution.util.FastList;

import javolution.util.FastMap;

import net.sf.l2j.Config;

import net.sf.l2j.gameserver.*;

import net.sf.l2j.gameserver.communitybbs.Manager.RegionBBSManager;

import net.sf.l2j.gameserver.datatables.GmListTable;

import net.sf.l2j.gameserver.handler.AdminCommandHandler;

import net.sf.l2j.gameserver.instancemanager.*;

import net.sf.l2j.gameserver.model.*;

import net.sf.l2j.gameserver.model.actor.appearance.PcAppearance;

import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

import net.sf.l2j.gameserver.model.actor.knownlist.CharKnownList;

import net.sf.l2j.gameserver.model.base.ClassId;

import net.sf.l2j.gameserver.model.entity.*;

import net.sf.l2j.gameserver.model.entity.events.*;

import net.sf.l2j.gameserver.model.mapregion.TeleportWhereType;

import net.sf.l2j.gameserver.model.quest.Quest;

import net.sf.l2j.gameserver.network.L2GameClient;

import net.sf.l2j.gameserver.network.SystemMessageId;

import net.sf.l2j.gameserver.serverpackets.*;

import net.sf.l2j.gameserver.util.FloodProtector;

import net.sf.l2j.tools.L2Registry;

import net.sf.l2j.tools.codec.Base64;

import net.sf.l2j.tools.versionning.model.Version;

import net.sf.l2j.tools.versionning.service.VersionningService;

import org.apache.commons.logging.Log;

import org.apache.commons.logging.LogFactory;

// Referenced classes of package net.sf.l2j.gameserver.clientpackets:

// L2GameClientPacket

public class EnterWorld extends L2GameClientPacket

{

public EnterWorld()

{

}

public TaskPriority getPriority()

{

return TaskPriority.PR_URGENT;

}

protected void readImpl()

{

}

protected void runImpl()

{

L2PcInstance activeChar = ((L2GameClient)getClient()).getActiveChar();

if(activeChar == null)

{

_log.warn("EnterWorld failed! activeChar is null...");

((L2GameClient)getClient()).closeNow();

return;

}

FloodProtector.getInstance().registerNewPlayer(activeChar.getObjectId());

if(activeChar.isGM())

{

if(Config.SHOW_GM_LOGIN)

{

String gmname = activeChar.getName();

String text = (new StringBuilder()).append("GM ").append(gmname).append(" has logged on.").toString();

Announcements.getInstance().announceToAll(text);

} else

{

if(Config.GM_STARTUP_INVISIBLE && (!Config.ALT_PRIVILEGES_ADMIN && activeChar.getAccessLevel() >= Config.GM_GODMODE || Config.ALT_PRIVILEGES_ADMIN && AdminCommandHandler.getInstance().checkPrivileges(activeChar, "admin_invisible")))

activeChar.getAppearance().setInvisible();

if(Config.GM_STARTUP_SILENCE && (!Config.ALT_PRIVILEGES_ADMIN && activeChar.getAccessLevel() >= Config.GM_MENU || Config.ALT_PRIVILEGES_ADMIN && AdminCommandHandler.getInstance().checkPrivileges(activeChar, "admin_silence")))

activeChar.setMessageRefusal(true);

}

if(Config.GM_STARTUP_INVULNERABLE && (!Config.ALT_PRIVILEGES_ADMIN && activeChar.getAccessLevel() >= Config.GM_GODMODE || Config.ALT_PRIVILEGES_ADMIN && AdminCommandHandler.getInstance().checkPrivileges(activeChar, "admin_invul")))

activeChar.setIsInvul(true);

if(Config.GM_NAME_COLOR_ENABLED)

if(activeChar.getAccessLevel() >= 100)

activeChar.getAppearance().setNameColor(Config.ADMIN_NAME_COLOR);

else

if(activeChar.getAccessLevel() >= 75)

activeChar.getAppearance().setNameColor(Config.GM_NAME_COLOR);

if(Config.GM_STARTUP_AUTO_LIST)

GmListTable.getInstance().addGm(activeChar, false);

else

GmListTable.getInstance().addGm(activeChar, true);

}

if(activeChar.getClan() != null && activeChar.isClanLeader() && Config.CLAN_LEADER_COLOR_ENABLED && activeChar.getClan().getLevel() >= Config.CLAN_LEADER_COLOR_CLAN_LEVEL)

if(Config.CLAN_LEADER_COLORED == net.sf.l2j.Config.ClanLeaderColored.name)

activeChar.getAppearance().setNameColor(Config.CLAN_LEADER_COLOR);

else

activeChar.getAppearance().setTitleColor(Config.CLAN_LEADER_COLOR);

if(activeChar.isCharViP() && Config.CHAR_VIP_COLOR_ENABLED)

activeChar.getAppearance().setNameColor(Config.CHAR_VIP_COLOR);

if(Config.PLAYER_SPAWN_PROTECTION > 0)

activeChar.setProtection(true);

activeChar.spawnMe(activeChar.getX(), activeChar.getY(), activeChar.getZ());

ThreadPoolManager.getInstance().executeTask(new net.sf.l2j.gameserver.model.actor.knownlist.CharKnownList.KnownListAsynchronousUpdateTask(activeChar));

if(L2Event.active && L2Event.connectionLossData.containsKey(activeChar.getName()) && L2Event.isOnEvent(activeChar))

L2Event.restoreChar(activeChar);

else

if(L2Event.connectionLossData.containsKey(activeChar.getName()))

L2Event.restoreAndTeleChar(activeChar);

if(SevenSigns.getInstance().isSealValidationPeriod())

sendPacket(new SignsSky());

if(Config.STORE_SKILL_COOLTIME)

activeChar.restoreEffects();

activeChar.sendPacket(new EtcStatusUpdate(activeChar));

L2ItemInstance arr$[];

int len$;

if(activeChar.getAllEffects() != null)

{

arr$ = activeChar.getAllEffects();

len$ = arr$.length;

for(int i$ = 0; i$ < len$; i$++)

{

L2Effect e = arr$[i$];

if(e.getEffectType() == net.sf.l2j.gameserver.model.L2Effect.EffectType.HEAL_OVER_TIME)

{

activeChar.stopEffects(net.sf.l2j.gameserver.model.L2Effect.EffectType.HEAL_OVER_TIME);

activeChar.removeEffect(e);

}

if(e.getEffectType() == net.sf.l2j.gameserver.model.L2Effect.EffectType.COMBAT_POINT_HEAL_OVER_TIME)

{

activeChar.stopEffects(net.sf.l2j.gameserver.model.L2Effect.EffectType.COMBAT_POINT_HEAL_OVER_TIME);

activeChar.removeEffect(e);

}

}

}

arr$ = activeChar.getInventory().getAugmentedItems();

len$ = arr$.length;

for(int i$ = 0; i$ < len$; i$++)

{

L2ItemInstance temp = arr$[i$];

if(temp != null && temp.isEquipped())

temp.getAugmentation().applyBoni(activeChar);

}

ExStorageMaxCount esmc = new ExStorageMaxCount(activeChar);

activeChar.sendPacket(esmc);

activeChar.getMacroses().sendUpdate();

UserInfo ui = new UserInfo(activeChar);

sendPacket(ui);

HennaInfo hi = new HennaInfo(activeChar);

sendPacket(hi);

FriendList fl = new FriendList(activeChar);

sendPacket(fl);

ItemList il = new ItemList(activeChar, false);

sendPacket(il);

ShortCutInit sci = new ShortCutInit(activeChar);

sendPacket(sci);

ClientSetTime cst = new ClientSetTime();

sendPacket(cst);

SystemMessage sm = new SystemMessage(SystemMessageId.WELCOME_TO_LINEAGE);

sendPacket(sm);

if(Config.SHOW_L2J_LICENSE)

{

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString(getText("VGhpcyBTZXJ2ZXIgaXMgcnVubmluZyBMMko="));

sm.addString(getText("IHZlcnNpb24gNiBkZXYvdW5zdGFibGU="));

sendPacket(sm);

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString(getText("Y3JlYXRlZCBieSBMMkNoZWYgYW5kIHRoZQ=="));

sm.addString(getText("IEwySiB0ZWFtLg=="));

sendPacket(sm);

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString(getText("dmlzaXQgbDJqc2VydmVyLmNvbQ=="));

sm.addString(getText("ICBmb3Igc3VwcG9ydC4="));

sendPacket(sm);

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString(getText("V2VsY29tZSB0byA="));

sm.addString(LoginServerThread.getInstance().getServerName());

sendPacket(sm);

VersionningService versionningService = (VersionningService)L2Registry.getBean("VersionningService");

Version version = versionningService.getVersion();

if(version != null)

{

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString((new StringBuilder()).append(getText("TDJKIFNlcnZlciBWZXJzaW9uOg==")).append(" ").append(version.getRevisionNumber()).toString());

sendPacket(sm);

sm = new SystemMessage(SystemMessageId.S1_S2);

sm.addString((new StringBuilder()).append(getText("TDJKIFNlcnZlciBCdWlsZCBEYXRlOg==")).append(" ").append(version.getBuildDate()).toString());

sendPacket(sm);

}

}

if(Config.SHOW_HTML_WELCOME)

{

String Welcome_Path = "data/html/welcome.htm";

File mainText = new File(Config.DATAPACK_ROOT, Welcome_Path);

if(mainText.exists())

{

NpcHtmlMessage html = new NpcHtmlMessage(1);

html.setFile(Welcome_Path);

sendPacket(html);

}

}

if(Config.SHOW_HTML_NEWBIE && activeChar.getLevel() < Config.LEVEL_HTML_NEWBIE)

{

String Newbie_Path = "data/html/iniciante.htm";

File mainText = new File(Config.DATAPACK_ROOT, Newbie_Path);

if(mainText.exists())

{

NpcHtmlMessage html = new NpcHtmlMessage(1);

html.setFile(Newbie_Path);

sendPacket(html);

}

}

if(Hero.getInstance().getHeroes() != null && Hero.getInstance().getHeroes().containsKey(Integer.valueOf(activeChar.getObjectId())))

activeChar.setHero(true);

if(Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)

activeChar.checkAllowedSkills();

activeChar.academyCheck(activeChar.getClassId().getId());

CrownManager.getInstance().checkCrowns(activeChar);

SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);

Announcements.getInstance().showAnnouncements(activeChar);

if(Config.ONLINE_PLAYERS_AT_STARTUP)

{

sm = new SystemMessage(SystemMessageId.S1_S2);

if(L2World.getInstance().getAllPlayers().size() == 1)

sm.addString("Player online: ");

else

sm.addString("Players online: ");

sm.addNumber(L2World.getInstance().getAllPlayers().size());

sendPacket(sm);

}

Quest.playerEnter(activeChar);

PetitionManager.getInstance().checkPetitionMessages(activeChar);

if(activeChar.getClanId() != 0 && activeChar.getClan() != null)

{

PledgeShowMemberListAll psmla = new PledgeShowMemberListAll(activeChar.getClan(), activeChar);

sendPacket(psmla);

PledgeStatusChanged psc = new PledgeStatusChanged(activeChar.getClan());

sendPacket(psc);

}

if(activeChar.isAlikeDead())

{

Die d = new Die(activeChar);

sendPacket(d);

}

if(Config.ALLOW_WATER)

activeChar.checkWaterState();

activeChar.setOnlineStatus(true);

if(Config.ALLOW_WEDDING)

{

engage(activeChar);

notifyPartner(activeChar);

if(!activeChar.isMaried())

{

L2ItemInstance item = activeChar.getInventory().getItemByItemId(9140);

if(item != null)

{

activeChar.destroyItem("Removing Cupid's Bow", item, activeChar, true);

activeChar.getInventory().updateDatabase();

_log.info((new StringBuilder()).append("Character ").append(activeChar.getName()).append(" of account ").append(activeChar.getAccountName()).append(" got Cupid's Bow removed.").toString());

}

}

}

notifyFriends(activeChar);

notifyClanMembers(activeChar);

notifySponsorOrApprentice(activeChar);

showPledgeSkillList(activeChar);

activeChar.onPlayerEnter();

if(Olympiad.getInstance().playerInStadia(activeChar))

{

activeChar.teleToLocation(TeleportWhereType.Town);

activeChar.sendMessage("You have been teleported to the nearest town due to you being in an Olympiad Stadia");

}

if(DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))

activeChar.teleToLocation(DimensionalRiftManager.getInstance().getWaitingRoomTeleport(), true);

if(activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())

{

sm = new SystemMessage(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED);

activeChar.sendPacket(sm);

}

if(activeChar.getClan() != null)

{

try

{

activeChar.setPledgeClass(L2ClanMember.getCurrentPledgeClass(activeChar));

activeChar.getClan().addSkillEffects(activeChar, false);

}

catch(Throwable t) { }

PledgeSkillList psl = new PledgeSkillList(activeChar.getClan());

activeChar.sendPacket(psl);

Iterator i$ = CastleManager.getInstance().getCastles().values().iterator();

do

{

if(!i$.hasNext())

break;

Castle castle = (Castle)i$.next();

Siege siege = castle.getSiege();

if(siege.getIsInProgress())

if(siege.checkIsAttacker(activeChar.getClan()))

activeChar.setSiegeState((byte)1);

else

if(siege.checkIsDefender(activeChar.getClan()))

activeChar.setSiegeState((byte)2);

} while(true);

ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan());

if(clanHall != null && !clanHall.getPaid())

activeChar.sendPacket(new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW));

}

if(!activeChar.isGM() && activeChar.getSiegeState() < 2 && SiegeManager.getInstance().checkIfInZone(activeChar))

{

activeChar.teleToLocation(TeleportWhereType.Town);

activeChar.sendMessage("You have been teleported to the nearest town due to you being in siege zone");

}

RegionBBSManager.getInstance().changeCommunityBoard();

if(Config.GAMEGUARD_ENFORCE)

{

GameGuardQuery ggq = new GameGuardQuery();

activeChar.sendPacket(ggq);

}

if(TvT._savePlayers.contains(activeChar.getName()))

TvT.addDisconnectedPlayer(activeChar);

if(FortressSiege._savePlayers.contains(activeChar.getName()))

FortressSiege.addDisconnectedPlayer(activeChar);

if(CTF._savePlayers.contains(activeChar.getName()))

CTF.addDisconnectedPlayer(activeChar);

if(DM._savePlayers.contains(activeChar.getName()))

DM.addDisconnectedPlayer(activeChar);

QuestList ql = new QuestList();

activeChar.sendPacket(ql);

}

private void engage(L2PcInstance cha)

{

int _chaid = cha.getObjectId();

Iterator i$ = CoupleManager.getInstance().getCouples().iterator();

do

{

if(!i$.hasNext())

break;

Couple cl = (Couple)i$.next();

if(cl.getPlayer1Id() == _chaid || cl.getPlayer2Id() == _chaid)

{

if(cl.getMaried())

cha.setMaried(true);

cha.setCoupleId(cl.getId());

if(cl.getPlayer1Id() == _chaid)

cha.setPartnerId(cl.getPlayer2Id());

else

cha.setPartnerId(cl.getPlayer1Id());

}

} while(true);

}

private void notifyPartner(L2PcInstance cha)

{

if(cha.getPartnerId() != 0)

{

net.sf.l2j.gameserver.model.L2Object obj = L2World.getInstance().findObject(cha.getPartnerId());

if(obj == null || !(obj instanceof L2PcInstance))

return;

L2PcInstance partner = (L2PcInstance)obj;

partner.sendMessage("Your Partner has logged in");

partner = null;

}

}

private void notifyFriends(L2PcInstance cha)

{

SystemMessage sm = new SystemMessage(SystemMessageId.FRIEND_S1_HAS_LOGGED_IN);

sm.addString(cha.getName());

String arr$[] = L2FriendList.getFriendListNames(cha);

int len$ = arr$.length;

for(int i$ = 0; i$ < len$; i$++)

{

String friendName = arr$[i$];

L2PcInstance friend = L2World.getInstance().getPlayer(friendName);

if(friend != null)

{

friend.sendPacket(new FriendList(friend));

friend.sendPacket(sm);

}

}

sm = null;

}

private void notifyClanMembers(L2PcInstance activeChar)

{

L2Clan clan = activeChar.getClan();

if(clan != null)

{

L2ClanMember clanmember = clan.getClanMember(activeChar.getName());

if(clanmember != null)

{

clanmember.setPlayerInstance(activeChar);

SystemMessage msg = new SystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN);

msg.addString(activeChar.getName());

clan.broadcastToOtherOnlineMembers(msg, activeChar);

msg = null;

clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar);

}

}

}

private void notifySponsorOrApprentice(L2PcInstance activeChar)

{

if(activeChar.getSponsor() != 0)

{

L2PcInstance sponsor = (L2PcInstance)L2World.getInstance().findObject(activeChar.getSponsor());

if(sponsor != null)

{

SystemMessage msg = new SystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN);

msg.addString(activeChar.getName());

sponsor.sendPacket(msg);

}

} else

if(activeChar.getApprentice() != 0)

{

L2PcInstance apprentice = (L2PcInstance)L2World.getInstance().findObject(activeChar.getApprentice());

if(apprentice != null)

{

SystemMessage msg = new SystemMessage(SystemMessageId.YOUR_SPONSOR_S1_HAS_LOGGED_IN);

msg.addString(activeChar.getName());

apprentice.sendPacket(msg);

}

}

}

private void showPledgeSkillList(L2PcInstance activeChar)

{

L2Clan clan = activeChar.getClan();

if(clan != null && clan.getReputationScore() >= 0)

{

PledgeSkillList response = new PledgeSkillList(clan);

L2Skill skills[] = clan.getAllSkills();

L2Skill arr$[] = skills;

int len$ = arr$.length;

for(int i$ = 0; i$ < len$; i$++)

{

L2Skill s = arr$[i$];

if(s != null)

response.addSkill(s.getId(), s.getLevel());

}

sendPacket(response);

}

}

private String getText(String string)

{

try

{

String result = new String(Base64.decode(string), "UTF-8");

return result;

}

catch(UnsupportedEncodingException e)

{

return null;

}

}

public String getType()

{

return "[C] 03 EnterWorld";

}

private static final String _C__03_ENTERWORLD = "[C] 03 EnterWorld";

private static final Log _log = LogFactory.getLog(net/sf/l2j/gameserver/clientpackets/EnterWorld.getName());

}

Se akquem poder me ajudar eu Agradeço...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Olá,

Só uma observação: Por favor, coloque os códigos entre as "tags" CODE, para tanto, basta selecionar o texto e clicar no ícone "#".

Ex:

if (activeChar.getPvpKills()>= 50) {
activeChar.getAppearance().setNameColor(0066CC);
}
if (activeChar.getPvpKills()>= 100) {
activeChar.getAppearance().setNameColor(660099);
}

Falou

Compartilhar este post


Link para o post
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora





Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas publicações sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×