Reflection

Discussion in 'Plugin Development' started by JanTuck, Jan 19, 2017.

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

    JanTuck

  2. Offline

    Zombie_Striker

    @JanTuck
    Do you have a problem with the class, or is this meant for others to use? If it is the latter, move this to Resources,

    There is a lot that can be improved on to reduce line count and general usability. Later, I will try to fix this.
     
  3. Offline

    JanTuck

    This is what i mean i was halfway through when i realised i should do it another way, i wasnt home. And only had eclipse to use it is lucky i even got this far... also.. please dont tell me some ideas you have.


    Did not even have minecraft to test it on.
    Sendt fra min ALE-L21 med Tapatalk
     
  4. Online

    timtower Administrator Administrator Moderator

    @JanTuck What exactly is the point of this thread?
    To get feedback on the code?
    To get better code?
    To show the code and tell already that it can be better?
     
  5. Offline

    JanTuck

    Feedback, tell me what i could do diff, improve etc.

    Sendt fra min ALE-L21 med Tapatalk
     
  6. Online

    timtower Administrator Administrator Moderator

    @JanTuck Then let me start with this:
    What would be the use of this?
    Do you need all those methods?
     
  7. Offline

    JanTuck

    It was actually just to learn more about reflection, and if others could use the code then why not.

    Edit: I had 2 hours to write this and no time to test it. Tomorrow i think ill rewrite it, and try to optimize it.
    Sendt fra min ALE-L21 med Tapatalk
     
  8. Online

    timtower Administrator Administrator Moderator

    @JanTuck Then I suggest that you mess with some different stuff, not with copy pasting the same thing over and over again.
     
    JanTuck likes this.
  9. Offline

    JanTuck

    Any ideas to what i could make?

    Sendt fra min ALE-L21 med Tapatalk
     
  10. Offline

    Zombie_Striker

    @JanTuck
    Here are some things you can fix
    1. To clean up the imports, you should use * for all the classes in the same package
    2. You should store the server version once, instead of creating it multiple times
    3. A lot of those methods are one from the base class. You should try getting methods specific to the CraftPlayerClass
    4. Instead of you throwing an exception, either make the method throw an Exception or return Objectives(? that should be what they're called)
     
    JanTuck likes this.
  11. Offline

    JanTuck

    I will do this when i get some time.

    These are all the functiond Almost. Found in the CraftPlayer.class. i left out some privates and some spawn particle functions

    Sendt fra min ALE-L21 med Tapatalk
     
  12. Online

    timtower Administrator Administrator Moderator

    @JanTuck Dynamic registering of commands.
     
  13. Offline

    JanTuck

    Uhh.

    Sendt fra min ALE-L21 med Tapatalk
     
  14. Offline

    mythbusterma

    @JanTuck

    He was responding to things you can make. One of the things that Bukkit doesn't allow you to do is register commands at run time, they must be in that file. Make a plugin that dynamically adds and removes commands.
     
  15. Offline

    JanTuck

    Last edited: Jan 20, 2017
Thread Status:
Not open for further replies.

Share This Page