Steadfast Permission (EZ Permission)

Discussion in 'Archived: Plugin Requests' started by xXSilverswordXx, Jul 22, 2014.

  1. Offline

    xXSilverswordXx

    Suggested name: Steadfast
    Suggested category: fun

    Request: If a player has the permission defined below, they are 100% immune to knockback.

    Permissions: Player.Steadfast
     
  2. Offline

    wesley009

  3. wesley009 EntityDamageEvent (now) has a getFinalDamage() method which would eliminate the need for your getDamageReduced() method - you should also look into switch statements, by the way. They're quite nice :)

    And your code would result in a ClassCastException anytime that a Player is damaged by a non-player - since the OP didn't state that he wanted to just stop Player-induced knockback, I would leave out the cast altogether.
     
    DoctorDark likes this.
  4. Offline

    wesley009

    AdamQpzm
    Damnt I forgot to make my code obstuctive :p
    Also I just made this in 10 min and I got the function for getDamageReduced() from the bukkit forums

    Also entitydamagedbyentity doesn't have the finaldamage function yet :(
     
  5. wesley009 Why and how would you make your code obstructive? 0.o
     
  6. Online

    timtower Administrator Administrator Moderator

    Why: so it is hard to read and steal code. And programs. Bukkit devs and moderators don't really like it though when you do it.
     
  7. timtower Granted, but I didn't think that anyone would really feel the need to protect a simple thing such as this from theft, especially given the above flaws that I mentioned (no offense) :p In my mind, it would probably be more inconvenient to find, download, decompile & then steal this than to create it yourself, and the latter has the advantage of not being someone else's code, but maybe that's just me ^^
     
  8. Online

    timtower Administrator Administrator Moderator

    AdamQpzm I also think he was trying to make a joke
     
  9. Offline

    wesley009

    AdamQpzm
    Lol "flaws"
    The getFinalDamage isn't even available in the event I use + it is an early alpha
    So instead of judging others make the plugin yourself and prove you can do it better

    Also timtower is kinda right, I was joking because I don't care about obstructing such small things. Also most of my made stuff will be open source sometime
     
  10. Offline

    wesley009

    AdamQpzm
    Oke I don't take any offense then, also I just started coding Java/Bukkit again so I didn't know that bukkit added this function. Anyhow I get this error thing with your function.[​IMG]
     
  11. wesley009 Ah right, you'll need to use a more recent version of Bukkit :) It was only added a couple of version back, I believe
     
  12. Offline

    xXSilverswordXx

    wesley009 wait so the upload at the top of the page works? thanks :) ill try when i get home
     
  13. Offline

    wesley009

    xXSilverswordXx
    It works, it only doesn't keep enchantment resistance in mind. But it will work with 1.7.9

    When there is a beta for 1.7.10 then I can make a better one (due too the getFinalDamage not yet being implemented into the latest beta only in development versions)
     
  14. Offline

    xXSilverswordXx

Share This Page