Arrow Barage

Discussion in 'Plugin Requests' started by XdarkbeastX, Oct 25, 2014.

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

    XdarkbeastX

    Name : Arrow Barrage
    Version : 1.7.2 R0-2
    Category : Others

    Needed : I need a plugin that when you charge a custom bow with the name "Barrage Bow" you an shoot 5 arrows {like in mineplex}

    Idea for Commands : /arrowbarrage

    Idea for Permissions : arrowbarrageget.permission

    When i'd like it : 1 Week 1 day or anything works
     
  2. Offline

    MordorKing78

    Please use a format. ;)
     
  3. Offline

    XdarkbeastX

    what do you mean ?
     
  4. Offline

    XdarkbeastX

  5. Offline

    RockyMan13

  6. Online

    timtower Administrator Administrator Moderator

    Did you also see the edit?
     
  7. Offline

    CraftCreeper6

    XdarkbeastX
    I'll do this. Be done in about 10 mins :)

    Sorry for the delay, went for my Dinner. <Edit by Moderator: Redacted mediafire url>

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 31, 2016
  8. Offline

    RockyMan13

    timtower

    No I did not, Buts its done now so :p
     
  9. Offline

    MordorKing78

    RockyMan13 Nope, But he changed it! So he got that going for him witch is nice.
     
  10. Offline

    XdarkbeastX

    CraftCreeper6
    does it have the command ?

    CraftCreeper6
    sorry but it doesnt look like it work for 1.7.2 R0-2

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  11. Offline

    XgXXSnipz

  12. Offline

    CraftCreeper6

  13. Offline

    XdarkbeastX

  14. Offline

    CraftCreeper6

    XdarkbeastX
    No, I am coding for 1.7.9, if you wanted it for 1.7.2 why did you not put it in your OP?
     
    ZodiacTheories and timtower like this.
  15. Offline

    XdarkbeastX

  16. Offline

    CraftCreeper6

    XdarkbeastX
    Yes, but that doesn't mean I am going to re-code it to fit something you didn't mention earlier.
     
    ChipDev likes this.
  17. Offline

    ChipDev

    list everything that you want which we can't read your mind with.
     
  18. Offline

    Deleted user

    XdarkbeastX CraftCreeper6

    Ok, so when OP talked about how your plugin doesn't work with 1.7.2... I just had to take a look as to why. There's no reason that you would need to access anything other than the Bukkit API for this.

    What I saw was... well... horrifying.

    For the faint of heart, don't click on the spoiler below.

    Warning. Do not click if you have a heart condition (open)

    • Why are there onEnable/onDisable messages?
    • Why do you make a new Shoot every time someone runs a command???
    • Why are you using System.out.print??? It's not even println so the formatting will be messed up
    • Why are you using a default displayname with no ChatColor, or any identifying feature? Anyone can rename their bow with an arrow
    • Why are you making a new Random every time someone shoots an arrow?
    • Why is there that random ArrayList called 'a'? It serves no purpose other than wasting RAM because of you creating the Shoot object every time the command is ran
    • (EDIT) You don't own http://craftcreeper6.me, don't use that as your package name please. It's against Java convention. Use your email or something

    On one hand, at least you're not abusing static, but honestly, you should just recode this to
    • Fix whatever bug is not letting it load on 1.7.2
    • Fix those horrible issues. Please.
     
    fromgate likes this.
  19. Offline

    CraftCreeper6

    zombiekiller753
    My ArrayList is called "a" for a short way of "arrow", now I know this breaks Java Naming Conventions but I was really, really tired when I did this and I did say I would have it finished in ten minutes.
    Default display name: Did he ask for a colour?
    Random: Look at my first point.
    My package name: Bad habit picked up from YouTube videos when I just started out ;p

    New Shoot...? I don't I simply give them an ItemStack...

    System.out.print(): I'll have you know it doesn't mess the formatting up. It automatically creates a new line. Why not test before you have a go at me?
     
  20. Offline

    Deleted user

    CraftCreeper6
    Just to make sure, I went and downloaded the latest version of your ArrowBarrage plugin.
    Although you're right on the print thing, it turns out Apache's log4j takes care of that, you're still scarily misinformed about everything else.

    There are three classes in your plugin. I think we can analyse them all here with little problems.

    First, there's Main.java.
    [​IMG]

    Nothing too bad here. Just the onenable/disable spam. Let's take a look at Commands.java

    [​IMG]

    Oh, what's this? new Shoot().getBow() ?
    No permissions check. Creates a new shoot every time. Easily abusable.

    Finally, over at Shoot.java
    [​IMG]

    Whatever that List 'a' is supposed to be for, it's not used. Just created. You also just compare the two itemstacks together, which will maybe possibly check for displaynames? I'm not sure. However, I am sure that because there's no ChatColor, any bow renamed will work. That's not a case of oh the customer didn't ask for a bag for his groceries, it's I should just have given him a bag.

    Oh, and that Random. The player has a 1/4 chance of shooting no arrows. Great.

    I just realized you edited 5 times. What did you change?

    CraftCreeper6

    Overrides are removed on compile, I think.
    Just the 1/4 chance that I could possibly not shoot any arrows.
    And the permission, depending on whether OP wanted it. I can't tell if he just put it there as a placeholder.

    Then I'll <3 you :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 4, 2022
    fromgate likes this.
  21. Offline

    CraftCreeper6

    zombiekiller753
    It will always shoot at least one ;) As it is ProjectileLaunchEvent, it will always fire at least once. A permission for what?
    EDIT: Nvm, blank moment xD

    EDIT 2: <Edit by Moderator: Redacted mediafire url>

    EDIT 3:
    * Command: /arrowbarrage
    * Permission: arrowbarrage.get
     
    Last edited by a moderator: Oct 31, 2016
  22. Offline

    Deleted user

    CraftCreeper6
    Random#nextInt(int) will return a number between 0 (inclusive) and the specified number (exclusive). This means that you can get any of the following numbers:

    0, 1, 2, 3

    As you can see, one of those numbers is 0, so the player has a 1/4 chance of shooting 0 arrows.

    That's all for bugs :D

    CraftCreeper6
    Ahh. I see. Brainfart on my end.

    Grats :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 4, 2022
  23. Online

    timtower Administrator Administrator Moderator

    Removed on decompile would make more sense.
     
  24. Offline

    Deleted user

    timtower
    That might also be the case. I was thinking of how Java removes certain components on compile, like generic types.
     
  25. Offline

    XdarkbeastX

  26. Offline

    CraftCreeper6

    XdarkbeastX
    I don't know, as I said, I am not going to re-code it just because you want it for 1.7.2
     
  27. Offline

    XdarkbeastX

  28. Offline

    XdarkbeastX

  29. Offline

    XdarkbeastX

  30. Offline

    XdarkbeastX

Thread Status:
Not open for further replies.

Share This Page