How to update sign every time something is changed in the config?

Discussion in 'Plugin Development' started by kayc01, Oct 4, 2015.

Thread Status:
Not open for further replies.
  1. Hey so i wanted to display a config value by using the popular sign displays.
    However i get an error.
    Here is my sign class:


    Code:
    package me.Ckay.gym;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.SignChangeEvent;
    
    public class SignListeners implements Listener {
    
    PixelGym plugin;  
      
        @EventHandler
        public void onSignChange(SignChangeEvent e) {
            if (e.getLine(0).equalsIgnoreCase("[GymStatus]")) {
                e.setLine(0, plugin.getConfig().getString("config."+e.getLine(1)+"colour")+ plugin.getConfig().getString("config."+e.getLine(1)) + " Gym");
                e.setLine(1, plugin.getConfig().getString("config."+e.getLine(1)+"stat"));
              
            }
            else if (e.getLine(0).equalsIgnoreCase("[GymLeaders]")) {
                e.setLine(0, plugin.getConfig().getString("config."+e.getLine(1)+"colour") + plugin.getConfig().getString("config."+e.getLine(1))+ "Leaders");
            for (Player staff : Bukkit.getOnlinePlayers()) {
             if (staff.hasPermission("pixelgym"+e.getLine(1)))
                e.setLine(1, staff.getName().toString());
                e.setLine(2, staff.getName().toString());
                e.setLine(3, staff.getName().toString());
              
            }
          }
        }
      }
    
    And here is where it implements into the main class:
    Code:
    Bukkit.getServer().getPluginManager().registerEvents(new SignListeners(), this);
    However when i place a sign and do type "[GymStatus]" or "[GymLeaders]", it throws an error:

    [​IMG]


    Code:
    [18:46:39 ERROR]: Could not pass event SignChangeEvent to PixelmonGym v4.1
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:1586) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.a(SourceFile:48) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.handle(SourceFile:9) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    Caused by: java.lang.NullPointerException
            at me.Ckay.gym.SignListeners.onSignChange(SignListeners.java:21) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            ... 13 more
    Any help is appreciated, if you could let me know what i am doing wrong and quickly help me resolve this. It would be great.

    Thanks!
     
  2. Offline

    mcdorli

    Hello again! I don't know, right now, what's the problem, but I give you a tip.

    You can easily debug a plugin by doing this:

    Read the stack-trace and seach for the line "Caused by...", like in this example:

    This way you can get, in wich row the error is. If you can't figure out, what the problem is in that row, just place as much enter, as needed, this way you can get the exact place, where the error is, like this:

    instead of
    Code:
    e.setLine(0, plugin.getConfig().getString("config."+e.getLine(1)+"colour") + plugin.getConfig().getString("config."+e.getLine(1))+ "Leaders");
    
    do
    Code:
    e.setLine(0,
    plugin.getConfig().getString("config."+e.getLine(1)+"colour")
     + plugin.getConfig().getString("config."+e.getLine(1))+ "Leaders");
    
    Do this and send me the stack trace and the final code too.
     

  3. Code:
    [20:48:24 ERROR]: Could not pass event SignChangeEvent to PixelmonGym v4.1
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:1586) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.a(SourceFile:48) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.handle(SourceFile:9) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    Caused by: java.lang.NullPointerException
            at me.Ckay.gym.SignListeners.onSignChange(SignListeners.java:16) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            ... 13 more
    The enters:


    Code:
    package me.Ckay.gym;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.SignChangeEvent;
    
    public class SignListeners implements Listener {
    
    PixelGym plugin;   
       
        @EventHandler
        public void onSignChange(SignChangeEvent e) {
            if (e.getLine(0).equalsIgnoreCase("[GymStatus]")) {
                e.setLine(0, plugin.getConfig().getString("config."+e.getLine(1)+"colour")+ plugin.getConfig().getString("config."+e.getLine(1)) + " Gym");
                e.setLine(1, plugin.getConfig().getString("config."+e.getLine(1)+"stat"));
               
            }
            else if (e.getLine(0).equalsIgnoreCase("[GymLeaders]")) {
                e.setLine(0,
                        plugin.getConfig().getString("config."+e.getLine(1)+"colour")
                        + plugin.getConfig().getString("config."+e.getLine(1))+ "Leaders");
            for (Player staff : Bukkit.getOnlinePlayers()) {
             if (staff.hasPermission("pixelgym"+e.getLine(1)))
                e.setLine(1, staff.getName().toString());
                e.setLine(2, staff.getName().toString());
                e.setLine(3, staff.getName().toString());
               
            }
          }
        }
      }
    

    That is what you were asking for right?
     
  4. Offline

    tkuiyeager1

    No @kayc01, @mcdorli means that he wants you to split line 16 and then you will see wich line got the error.
     
  5. I did, i split it three times like he told me too.
    I can do more if needed...
     
  6. Offline

    tkuiyeager1

    Ok after you split it check on the console wich line is the error line and then post this line here so i can help you fix it.
     
  7. @kayc01
    Something is null on line 16 in SignListeners

    The line:
    If you look around in your class and know what you are doing, you can see that you never initialize the plugin field. You need to pass the plugin instance through a constructor and set the field.
     
  8. Still have no idea, i have split up the code like this:

    Code:
    package me.Ckay.gym;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.SignChangeEvent;
    
    public class SignListeners implements Listener {
    
    PixelGym plugin;   
       
        @EventHandler
        public void onSignChange(SignChangeEvent e) {
            if (e.getLine(0).
                    equalsIgnoreCase("[GymStatus]")) {
                e.setLine(0,
                        plugin.getConfig().getString("config."+e.getLine(1)+"colour")
                        + plugin.getConfig().getString("config."+e.getLine(1))
                        + " Gym");
                e.setLine(1,
                        plugin.getConfig()
                        .getString("config."+e.getLine(1)
                        +"stat"));
               
            }
            else if (e.getLine(0).equalsIgnoreCase("[GymLeaders]")) {
                e.setLine(0,
                        plugin.getConfig().getString("config."+e.getLine(1)+"colour")
                        + plugin.getConfig().getString("config."+e.getLine(1))+ "Leaders");
            for (Player staff : Bukkit.getOnlinePlayers()) {
             if (staff.hasPermission("pixelgym"
            +e.getLine(1)))
                e.setLine(1,
                        staff.getName().toString());
                e.setLine(2,
                        staff.getName().toString());
                e.setLine(3,
                        staff.getName().toString());
               
            }
          }
        }
      }
    

    And this is the stack trace i get:


    Code:
    [21:18:49 ERROR]: Could not pass event SignChangeEvent to PixelmonGym v4.1
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:1586) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.a(SourceFile:48) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.PacketPlayInUpdateSign.handle(SourceFile:9) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
    Caused by: java.lang.NullPointerException
            at me.Ckay.gym.SignListeners.onSignChange(SignListeners.java:16) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[Craftbukkit.jar:git-Bukkit-1.7.9-R0.2-10-ge6cd8c0-b3096jnks]
            ... 13 more
     
  9. Offline

    mcdorli

    I didn't split it three times, because that's a magic number, and you need to split it to 3 lines, i split it to three lines because that was the best option, you must splut it in the optimal amount of lines, so every getter/setter is in a different line
     
  10. Offline

    tkuiyeager1

  11. Offline

    mcdorli

    Okay, it looks like the e.getLine(0) throws a null. Try to check if the lines are null and write a debug message on the console with a Logger if they are, if the message arrives, you will know whats the problem

    @tkuiyeager1 why not tag the thread as watched?
     
  12. I can't believe that noone has noticed this:
    The variable is null. You need to initialize it with the classes constructor or through a static way
     
    Lolmewn and mcdorli like this.
  13. Offline

    mcdorli

    Jesus christ, why didn't I noticed it, you sir are a genius.
     
  14. Could you let me know what i should write?

    Also not to be a noob about it guys, however i have never used a logger method before.
    So, if i was to do so. How would i?

    Also i don't know why e.getLine(0) would be null because i am writing on the top level of the sign.
    Therefore how can it be null?

    Thanks for your help so far, but if you can handfeed me what i should do (by coming up with example code) that would be great.

    I am still learning.

    Also as a side note, my other sub class has this:

    Code:
    public PixelGymAdmin(PixelGym passedPlugin){
            this.plugin = passedPlugin;
        }
    However when i made that for this class i swear it threw an error.
    Now i put it in below PixelGym plugin; there is no error.

    EDIT: After saving all, in my main class the listener is apparently un-defined.

    Code:
    Bukkit.getServer().getPluginManager().registerEvents(new SignListeners(), this);
    Okay so i managed to sort that, i found some example code that worked.
    Now, with displaying on a sign.

    How can i make the signs update everytime something is changed in the config from true to false?
    I assume i would have to make a SignUpdate method and then call it when i set whatever i am setting to true/false.

    However how would i make a sign update method? Thanks!

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 5, 2015
  15. Offline

    mcdorli

    Do something like if the player approaches it, it updates
     
  16. Is it even possible to do that?
    What would be the event and then how would i define the sign out of the OnSignChange event?
     
  17. Offline

    mcdorli

    I don't know, but you could create a Bukkittiner and store and update every sign in certain intervals (or simply if something happens to the config, update every sifn
     
  18. Offline

    boomboompower

    Test if the player is at a location and change it if they are.
     
  19. The second thing is what i want to do, i just have no idea how to write it. :S
    If you can help with that.

    Main problem is that 1) In a separate event handler or void, i don't know how to define the signs.
    The equivalent of Player p = e.getOnlinePlayers but for signs.

    And 2) sign.update(); does not seem to be defined either.
     
  20. Offline

    mcdorli

    Store all the signs in the config and with a bukkit timer run through them every 10 secs
     
    Last edited by a moderator: Oct 5, 2015
  21. Offline

    dlange

    @mcdorli It's probs less efficient to do a timer every 10secs, i think the idea of listening to PlayerMoveEvent and checking how far they are from a sign then updating it if they are in X blocks is a more efficient way to go about it
     
  22. Offline

    mcdorli

    Or simply update them, when the config changes
     
  23. Can any of you give me some example code please?
    I know these are possible ways to do it. I just have no idea how to go about doing any of it.

    The on config change would be the most ideal if you could mock up some code that WOULD work or even as specifically as you can so i can put it in. This has been racking my head for a while now :/

    Thanks
     
  24. Offline

    mcdorli

    I can give you steps, but I can't really give you real code, because I'm on phone, I'll try my best to explain it to you.

    1.: You have a class, which lsitens for every sign placement, if it is a "GymStatus",etc. Sign, store it's x,y and z coordinates in a List.

    2.: Create a blockdestroy event, and check, if the block destroyed is a "GymStatus",etc. Sign (by the stored x, y and z coordinates), and remove it from the List, if it got destroyed.

    3.: Store the sign x, y and z-s in the config file, and always update it, if the two method above (1. and 2. steps) runs.

    4.: Create a method, that goes trough the sign List and updates the signs.

    5.: Link the method described in step 4. to every config update.

    That's all I think...
     
  25. Offline

    mine-care

    @kayc01
    By reading the docs you can find the answer in a matter of minutes, whereas by asking for code it will take longer and it may not even help you understand. Spoonfeeding isnt the solution.
    anyway, look into FileConfiguration docs.

    @mcdorli
    You forgot "And because spoonfeeding will not help you". Or at least i want to belive you forgot that..
    As i said, spoonfeeding will not help. From my ecxperience on these forums most of the time, the code is copied directly, and without even being read!!! So it will just solve the issue temporary but not long term, generally, the next time the same question is asked more or less.
     
  26. Offline

    mcdorli

    You're right,I had 2 rules for myself, when i began java and bukkit.: Never use the ctrl+c, ctrl+v combinations while learning, and don't use API-s, try to do everything on my own. I basically learned the basics from the original "bukkit plugin tutorial" on the bukkit wiki, and not from videos, because videos s*cks most of the time (and/or outdated, for instance theBCBroz tutorials used a lot of resource, that was deprecated and not recommended the use at the time the video made too, or I could say millions and millions of tutorials too, but this is the most well-known), the first time I looked up a video was because I wanted to learn world generation. I can only say, never use the youtube for tutorials, and don't ask, because you stuck somewhere, there is a javadoc for everything, When i tried to learn bukkit (mid 2014) there wasn't even this source, it was taken down because of the DMCA.

    @kayc01 If I count right, this is the third thread you posted in this week about the same plugin, and I see, that you never uploaded a plugin. I think it's because: a.: You are smart, and you knkw, that you won't get any download with a teleport or a essentials plugin; b.: You never programmed a real plugin before. If the 2. answer is the correct one, then don't do a pokémon plugin first, it's just too big for you.
     
  27. Actually i learn better by seeing code that works and reading how it works.
    You can not expect someone to code something they don't know.
    Either way i just learn better a different way.

    I can't sit through documentation because it just means nothing to me.
    It goes in and goes straight out, where as getting working code that i can then apply for my own use later on has been a lot of my learning.

    But there are still things i have not done yet, quiet a lot honestly.

    Also, thanks @mcdorli,, however i just don't know how to write 90% of that code.
    I will have to go look at the documentation, but even then it is very over whelming.

    Looks like this is going to be a scrapped feature until someone can post a code example or fix that explains what i actually have to write. Because that's the part i don'r know.

    I have never created a list before and nor have i stored and saved co-ordinates before.

    Thanks for your help either way mcDorli!

    Not to sound rude, but actually: http://dev.bukkit.org/bukkit-plugins/pixelmongym/
    Is mine. and is this.

    Edit: RIP, just realized i tagged the wrong person some how.

    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 6, 2015
  28. Offline

    Zombie_Striker

    We can take this statement two ways; How can you write code if you never have seen the code or How can I write the code if I have never learned about the components. Both are not valid points.

    If you have to see the code in order to figure out how to do something, then it basically becomes a paradox. To figure out how to do something, you have to find out how using another method besides figuring it out. I see far too many people on the forums with this mentality.

    If its the other way, then you just need to learn Javas components. This can be achieved by actually learning java via the main tutorials or the Java docs. But it seems you cant to the latter because....

    Does coding mean nothing to you? Again, we can take this statement two ways; you do not understand what any of it means or you can't figure out how to use it. Again, both not valid points.

    The name of each method is in English and there is normally some information attached to each page all about what it does AND how to use it.

    Percent wise, I don't know how you can get 90% from 5 steps.

    This is all basic Bukkit and Java Information. If you don't know how to write code for this. CLICK MY SIGNATURE.

    Ha Ha, that's never going to happen here.

    Again, my Signature.
     
    mine-care likes this.
  29. Offline

    mcdorli

    Sorry, please link the accounts, it makes it easier to people on forum, to know, in wich programming levek you are.

    And a little step-by-step guide (Yes, I love to use steps), how to learn with the bukkit javadocs:

    1.: Learn basic plugin programming (a plugin, wich enables you to teleport to other player is enough), this way you can learn, how to handle entities.

    2.:Try to create a another plugin, not a real big one, just only something like a weapon plugin or a backpack plugin (like I did)

    3.: Repeat step 2, until you're confident enough, choose types, that are differs from each other, try to make first a command plugin, and only at the end try to make something big as a world generator (those are the evilest dark pitfalls for debuggers, I say it from experience), try to cover config management, lots of event handlers, weapon management, signs, books, map rendering, anything, that you can think of.

    4.: Choose your favourite category, and be real good at it, but never leave the others

    This way you can learn plugin developement, and even make some plugins, that you can upload here, getting some comments for motivation boost.
     
    Last edited: Oct 5, 2015
  30. Welp.
    You took all that time to write out this message, when it could of been spent on actually helping me.
    Ok fair enough, i have bits to learn (yes 90% that i mentioned in an earlier message is an over exaggeration) but all i want to do is get this final little feature done.

    Instead, i get told to look through documents where i can't seem to find what i need. Yet others claim i would find it in minutes. If it is that quick, why can't you just tell me in that time?

    Its like you all know exactly what i have to type, yet you decide to not tell me so that i waste time looking for it, and for what? To learn coding? If something passes me as i still don't understand what i need, then clearly i need it explaining better or with a given example.
    Which yes the docs have some.

    I really don't want to come off as a prick, however it is just annoying me that i see on the forums most of the time that people are just insulting others code, and then can't just give a little bit of working code and then you both move on with your day.
    Instead i am stuck on this after trying multiple things, and yes. After having a quick look through a few documentations i found some cool stuff, but nothing for what i need.
     
Thread Status:
Not open for further replies.

Share This Page