Common Mistakes

Discussion in 'Plugin Development' started by mbaxter, Sep 12, 2012.

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

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Perhaps your discussion of Java versions would best occur in a new topic ;)
     
  2. Offline

    vimpvamp

    Do you know what the problem could be?
     
  3. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    I have removed a conversation which quickly took a turn for the worse once the poster clear his intentions were to troll rather than contribute to positive discussion. This is not a place for personal attacks.
     
  4. Does putting mcstats.org plugin metrics class violates the "Putting other plugins classes (or entire plugins) in your jar" point?
     
  5. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    No, as you have author permission to include that code.

    Make sure you change the package it's in to avoid version conflicts! :)
     
  6. What do you mean by change package? Shuld i put it in my plugin's package or their package?
     
  7. Offline

    Beeperdp

    Totally is - I did that when I first started.
     
  8. Yeah, seasoned developers like me never forget this. Ever. Like, really ever.

    *shuffles feet*
     
    jacklin213 and Skyost like this.
  9. Offline

    Beeperdp

    haha
     
  10. Reading your common mistakes at the start of this thread, the 1 section is incorrect, 2% of uses are now on java 6 , 5% are already on Java 8. You can't even get Java 6 from oracle anymore unless you have a business contract or you request a copy. Its nearly 9 years old, and now un supported and no security patches. Personal what Mojang are doing on it still i will never know, no excuses, ps3 and xbox managed to both build the entire game from scratch. Understand buy bukkit is still using java 67 to ensure compatibility, but personally don't see any reason to advise people to use java 6, when only 2% are using it. The stats are direct of the mcstats global stats.
     
  11. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    Which?
    Bukkit builds for Java 6, as does Mojang.
    I describe mistakes in Java 8 here?
    Java 6 direct from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html
     
    garbagemule, jacklin213 and Skyost like this.
  12. While you might of found that page your still required to create an account to download it,and have you missed the huge red message in the middle., warning not to use it and its is advisable to up grade. The only servers left on it are lazy hosts.


    Are you really going to argue the advantages of using unsupported for the general public, 9 yeas old technology. ??

    You are recommending Java 6 on the OP as lots of users still use it that's is the bit I was saying was incorrect. 2% use it, 98% use Java 7 or above.

    Why you are still locking these I will never know.
     
  13. Offline

    Necrodoom

    Aren't older macintosh computers unable to run Java 7 and above?
    And basically, this is for compatibility, if a server runs Java 7, then its all fine, you aren't losing anything from compiling against Java 6. Where are you getting these statistics from anyway? If you say mcstats, then at this point its not really that accurate any more.
     
  14. @Necrodoom, while I agree for quite a lot mcstats is not that reliable but getting the Java version number it has no problems with. What I am losing is the better performing concurrent class in 1.7. I am not going to let the tiny tiny few left let the rest suffer. How far back do you do ???? I think 9 years is pretty long enough to still be supporting it.

    Ok answer me this what version of minecraft do your plugins support. ??? Do you practice what you preach ?
     

  15. You might want to note that McStats themselves, despite seeing their own statistics about how many people use 1.6 now, still ensure that their code runs on older servers because they recognise that a small percent of a big number is still a big number and that there will not be excessive negative consequences for doing so.


    This is the most valid point. If you are going to do this though with your plugin, there is nothing wrong with it as long as you clearly state what version it is built for, otherwise you will most likely be surprised by the amount of users running 1.6 that will complain to you with the cryptic stack trace that shows that the Java classes are built for a newer version.


    In short, yes; I made a bash script to download all of Necrodoom 's plugins and extract them to a directory. It then iterated across all of the classes to get the Java version it was built for (not from). All of the classes in all of the plugins supported compatibility with 1.6.

    Before you ask the same question to me, I build all of my plugins with compatibility for 1.6, as I remember that when I was hosting a server for myself and a few mates on an older machine, it was annoying that I had to recompile plugins (often ones that didn't take advantage of 1.7's features anyway) to get them to work on my server.
     
  16. Hoolean . Everybody makes valid points,. My point really is where do you drawn the line and say enough is enough. Microsoft final ditch XP, which is still used in huge numbers as for general office staff it does exactly what they want.

    I have tried not to take some high moral ground that everybody should follow my way as , my way is well my way, and yours is yours, only differences in opinion. The problem I have is that all players will be on java 7 or 8 as they will have it set just to auto update. Windows based machines any how. Ask yourself this question and try to give an honest answer. If you were choosing any form or server to host minecraft on now would you opt for 1.6 or 1.7. The tiny % left on 1.6 in my opinion, are hosts in money try troubles as the cost of rolling out 1.7 for MC is not complicated nor requires serious risk assessment. Or there bedroom hosts. There isn't single respectable hosting company on 1.6, big and small. If its a dedicated box and the owner choices 1.6 that's their choice.

    My really issue is that while not reliable enough Java 1.8 when stable is a revolutionary update just like 1.5 when generics came out. I use it on my own pc and have not had any issues. But not recommending its in a release state. But for the last year I have been testing it and it blows all previous versions out the water. Having functional interfaces and lambadas combined with the streaming API in simple benchmark of just looping arrays / collections, using Predicates, Consumers. Unlike 1.7 which has pseudo Predicates and consumers, even goggle warn you not to over use them in guava as you impact performance. My results where showing 3-4 times increased performance in 1.8 due to the automated fork/join going on, without you having to do anything. So really what I should of said that mojang while re coding every class in minecraft could of made the step up to 1.7 at least. As in my eyes holding onto 1.6 is stopping progress towards 1.8.(When stable) Not sure how many of the young dev's have looked into 1.8 but it is not like going from 1.6-1.7 . Not blaming them or adult dev's but all the time people allow 1.6 to linger ppl won't spend the required time to learn, and this is pure opinion, in 6-9 months if your not fluent in 1.8 you struggle to find suitable work. That's based on nothing more than a hunch by the way.
     
    Hoolean and xTrollxDudex like this.
  17. Relicum

    D'oh god, the amount of run-on sentences and typo's.

    May the grammar Nazi's have mercy on your soul.
     
  18. *Typos (no apostrophe)
    *Nazis (no apostrophe)
     
    artish1 and Relicum like this.
  19. artish1 _LB

    Sorry artish1 I am dyslexic and normally tag that on the end of posts but forgot to this time.
     
  20. Relicum You should edit your signature so it's on every post for you ;)
     
  21. Offline

    Necrodoom

    I don't see what would you lose from compiling against Java 6. You can run the plugin on Java 7 or 8 and reap the benefits later. You may not be able to switch-case strings, or put multiple exceptions on the same catch, but its not a big tradeoff since many more servers can run this plugin. The amount of threads asking about outdated Java errors should explain.
     
  22. Just for this:

    Java 6
    Code:java
    1. Map<String, Map<String, List<String>>> map = new HashMap<String, Map<String, List<String>>>();


    Java 7
    Code:java
    1. Map<String, Map<String, List<String>>> map = new HashMap<>();


    I can't live without diamond notation, try-with-ressources, multi-catches, switch on Strings or Java NIO 2.

    Also according to MCStats, >=97.47 servers are using Java 7 or more. Hosts using Java 6 are shitty hosts, I hope that most of the remaining servers are running on Java 6 at home on unupdated PCs...
     
    Relicum likes this.
  23. Hey Relicum , sorry to reply to your logical and intelligent post with something so simple and less thought out (I agree thoroughly with the points you raise) but basically, I compile my plugins to the version that CraftBukkit builds to, so that they are always compatible with any server they may be run on.

    The only exception I have to this rule is if there is a significant feature of the Java version above that is awesome and efficient to the extent that it is worth upgrading at the sacrifice of (admittedly very little) compatibility. :)
     
    Relicum, Saladoc and Dragonphase like this.
  24. I fully understand, we all have our reasons. But surely their has to be a line at some point then its not the recommended build version to use. I presume when mojang update, which they can't until Java 7 runs properly on Macs.
    My main point is all based on progress to Java 8, as that IS a game changer. They had a massive update for Java 8 a few days ago, 1000's bugs fixed, still not trust worthy enough for me to use on releases yet.

    Necrodoom what you do lose is the Java 7 compiler itself is more efficient, producing a slightly better run time performance.
    I can assure you its not to be able to switch on Strings, the performance on that is well shockingly bad. As for switching on enum that's even slower. Gonna have to just disagree on your reasons for staying with 1.6. Its all a free country with both of us having valid reasons.
     
  25. Offline

    MBon29

    Wouldn't it be best to start working with Java 7? Dinnerbone would like to start using JFX and that required Java 7. If plugin developers compiled for Java 7 then it would push users/server owners to update their java version.
     
  26. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    MBon29 When Minecraft begins requiring Java 7, so will Bukkit.
     
    AdamQpzm, MBon29 and _LB like this.
  27. Server owners aren't players. Players Java version and Server Java version are never linked. You can't force a player to update its Java version, and nearly all of them have no idea how you do that. Just add the fact that some computers can't update to Java 7 and you have the complete reason list for why Minecraft is Java 6.
     
  28. Ribesg What's the point of a quote if you snip the whole quote?
     
  29. _LB Most forums don't have a tag option, so I would assume it's a habit formed from use of other forums, where the standard would be to snip the quote, thus replicated our tag :)
     
  30. You are correct that the java version used to run the client and the server can be different, but as I understand it, the Mojang client and server codebases are tightly blended together. I don't believe Mojang can compile the server for Java 7 without also compiling the client for Java 7.
     
Thread Status:
Not open for further replies.

Share This Page