Jump to content
  • 0

Hallo Guys Someone Can Help Me Please!


Question

Posted

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

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted (edited)

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
  • 0
Posted (edited)

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
  • 0
Posted (edited)

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
  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted

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

  • 0
Posted

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

 

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

  • 0
Posted

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

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

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

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

  • 0
Posted

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

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

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

 

technically, Im the black hitlah

  • 0
Posted

technically, Im the black hitlah

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

 

Nigga niggaaa

  • 0
Posted

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

Nigga niggaaa

 

exei car meeting sef psakse gia honda civic me full alpine

Guest
This topic is now closed to further replies.



×
×
  • Create New...