Jump to content
  • 0

Hallo Guys Someone Can Help Me Please!


Rydar

Question

Hallo guys someone can help me please, i add the phoenix event engine in my server so when i save the file, in 3 java files i take this error:

I need your help guys, thanks in advance a lot
PS:Sorry for my English :)

IMG_07042016_141658.png

Link to comment
Share on other sites

Recommended Posts

  • 0

whats the difference between

 

if (activeChar instanceof L2Monster)

{

 

}

else if (activeChar.getClass() == L2Monster.getClass())

{

 

}

 

is it wrong? Is there any difference? 

You cannot do L2Monster.getClass() , but you can do L2Monster.class

The difference is that instanceof might also return true if monster is raid boss (e.g. L2RaidBoss) which extends L2Monster

Also instanceof allows null, wouldn't throw NullPointerException if activeChar is null

 

p.s. getClass() is not static method, requires instance of Object in order to access

Edited by UnAfraid
Link to comment
Share on other sites

  • 0

You cannot do L2Monster.getClass() , you can do L2Monster.class

The difference is that instanceof might also return true if monster is raid boss (e.g. L2RaidBoss) which extends L2Monster.

 

p.s. getClass() is not static method, requires instance of Object in order to access

 

yeah thats why I wrote .class in the first place, the typo () confused me, when elfo tried to correct me

 

One could use class comparing if he wants only a specific class, thats right. Its also much faster than instanceof if you know what you're doing.

Edited by xxdem
Link to comment
Share on other sites

  • 0

yeah thats why I wrote .class in the first place, the typo () confused me, when elfo tried to correct me

 

One could use class comparing if he wants only a specific class, thats right. Its also much faster than instanceof if you know what you're doing.

You shouldn't worry about which one is faster, the difference is probably in nano seconds, its mostly matter of personal choise, in L2J we decided to make methods like isPlayer(), isPet(), isMonster() not because they're faster, but mostly because it shortens the code, avoids imports, and looks better.

 

Anyway back on topic, @antoskasas123.

Show us screenshot of this exact method, more important, what type it returns, or gist / pastebin your L2Skill class.

(You can click on the method and press F3 and eclipse will lead you to the declaration, thats what i want to see)

Edited by UnAfraid
Link to comment
Share on other sites

  • 0

Teach us UnAfraid <3 especially xdem.. he is still in highschool. He never passed history. He is still an ape :3

 

[GR] "Σαγαπησα, μαγαπησες, ημασταν 1-1. μα πηρες τ ______ μου κερδισες 3-1" για παρτη σοu Xdem [GR]

Edited by AccessDenied
Link to comment
Share on other sites

  • 0

yeah thats why I wrote .class in the first place, the typo () confused me, when elfo tried to correct me

 

One could use class comparing if he wants only a specific class, thats right. Its also much faster than instanceof if you know what you're doing.

I tried to correct the fact that from .class() it should be .class not .getClass()

You got confused there.

Link to comment
Share on other sites

  • 0

Oute kan katalaves ti eipe, kai an tou arxiseis na tou milas agglika gia na katalavenei poso ili9ios eisai 9a se midenisei kai aftos

φαε μια μπανανα, φαε και 1 μηλο και ψοφα <3

Link to comment
Share on other sites

  • 0

stis 5 plateia viktorias sta everest, na se kerasw ena giouf

Σοβαρα τωρα θα πας εκει στα everest? αμα ειναι να ερθω. 20 λεπτα αποσταση

αλλα σε κοβω να τρολλαρις. Εχεις και το nigga photo δυσκολα σε πιστευω ακομη κ αν πεις οτι ξερεις coding

βγαλε το nigga το κερατο σου μεσα... ΒΓΑΛΤΟΝ

Link to comment
Share on other sites

  • 0

Σοβαρα τωρα θα πας εκει στα everest? αμα ειναι να ερθω. 20 λεπτα αποσταση

αλλα σε κοβω να τρολλαρις. Εχεις και το nigga photo δυσκολα σε πιστευω ακομη κ αν πεις οτι ξερεις coding

βγαλε το nigga το κερατο σου μεσα... ΒΓΑΛΤΟΝ

 

technically, Im the black hitlah

Link to comment
Share on other sites

  • 0

technically, Im the black hitlah

παναθεμα σε περιμενω να μ πεις 2 ωρες αν θα πας π β στα everest να ερχομουν και πηγε 4 20 πφφ

 

Nigga niggaaa

Link to comment
Share on other sites

  • 0

παναθεμα σε περιμενω να μ πεις 2 ωρες αν θα πας π β στα everest να ερχομουν και πηγε 4 20 πφφ

Nigga niggaaa

 

exei car meeting sef psakse gia honda civic me full alpine

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...