Question Why cast again?

Discussion in 'Plugin Help/Development/Requests' started by Side8StarLite, Dec 18, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Side8StarLite

    Hi there!
    So I've seen this only once in a post before, and I don't quite understand why some people do this...
    He casted EntityDamageByEntityEvent when it was already an EntityDamageByEntityEvent. I know he explained later that it was to diffrentiate between natural and unnatural lightning strikes, but how does casting solve that problem? I'd like to understand this, and hopefully it'll make me a better programmer.
    Thanks in advance!
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Side8StarLite There is no need at all to cast when the target and source are the same type already.
     
  3. Offline

    Side8StarLite

    But why did he do it then? Is it considered outdated to use this method?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @Side8StarLite I don't know why he did it, but he did some things that he shouldn't do.
     
  5. Offline

    Side8StarLite

    Ok thanks for the explanation!
     
Thread Status:
Not open for further replies.

Share This Page