[1.7.10][API] Player API

  • #61
    Quote from Levy

    W00t! Thanks! Got it workin like a charm!


    Don't credit me. Credit Divisor for the patch.
    I'm just giving you the link for it
    Too addicted with Counter-Strike: Source for some reason...
  • #62
    I am getting a 'NullPointerException'.
    I'm compiling Player API 1.3 Server on a Minecraft 1.0 server, with nothing else on it, then running the script for the commands needed to run the java (java -Xm... etc.).
    I installed by extracting the files from the minecraft_server.jar (using 'jar -xvf minecraft_server.jar'), then copying just the class files from the provided zip file into it, then, without deleting META-INF or anything, archiving the whole lot again (using 'jar -cvf minecraft_server.jar *').
    I believe this is equivalent to the usual method of just dragging and dropping the files into WinRAR/7-zip or whatever.

    I have tried it on two of my systems:

    On a Linux computer, I get this error:
    Exception in thread "main" java.lang.NullPointerException
            at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
            at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)


    On a Mac computer, I get this error:
    Failed to load Main-Class manifest attribute from
    minecraft_server.jar


    In both cases, that's all the output I get before it crashes. If there's some program that I can run that will provide more output, then I'll be happy to use it. Also, I'm getting this error with just ModloaderMp Server as well, but I can't tell in either case what the problem is.
  • #63
    Quote from anLouisCh

    I am getting a 'NullPointerException'.
    I'm compiling Player API 1.3 Server on a Minecraft 1.0 server, with nothing else on it, then running the script for the commands needed to run the java (java -Xm... etc.).
    I installed by extracting the files from the minecraft_server.jar (using 'jar -xvf minecraft_server.jar'), then copying just the class files from the provided zip file into it, then, without deleting META-INF or anything, archiving the whole lot again (using 'jar -cvf minecraft_server.jar *').
    I believe this is equivalent to the usual method of just dragging and dropping the files into WinRAR/7-zip or whatever.

    I have tried it on two of my systems:

    On a Linux computer, I get this error:
    Exception in thread "main" java.lang.NullPointerException
            at sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:399)
            at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:463)


    On a Mac computer, I get this error:
    Failed to load Main-Class manifest attribute from
    minecraft_server.jar


    In both cases, that's all the output I get before it crashes. If there's some program that I can run that will provide more output, then I'll be happy to use it. Also, I'm getting this error with just ModloaderMp Server as well, but I can't tell in either case what the problem is.

    That has nothing to do with Player API. Your sun java launcher simply can't find the main class net.minecraft.server.MinecraftServer to execute.

    • Check whether the file <jar>/META-INF/MANIFEST.MF is really where it is supposed to be (and contains what it is supposed to contain) by reextracting the files in your generated jar file somewhere else.

    • Check whether you use a command like:
    • java -Xincgc -Xms1024M -Xmx1024M -classpath minecraft_server.jar net.minecraft.server.MinecraftServer
      (doesn't require <jar>/META-INF/MANIFEST.MF)

      or a command like:
      java -Xincgc -Xms1024M -Xmx1024M -jar minecraft_server.jar
      (does require <jar>/META-INF/MANIFEST.MF)


    • Try updating the vanilla minecraft_server.jar using the command:
    • jar uvfM minecraft_server.jar *.class
      instead on extracting and rearchiving.
    Last edited by Divisor: 12/2/2011 1:44:36 PM

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #64
    Quote from Divisor

    That has nothing to do with Player API. Your sun java launcher simply can't find the main class net.minecraft.server.MinecraftServer to execute.

    • Check whether the file <jar>/META-INF/MANIFEST.MF is really where it is supposed to be (and contains what it is supposed to contain) by reextracting the files in your generated jar file somewhere else.

    • Check whether you use a command like:
    • java -Xincgc -Xms1024M -Xmx1024M -classpath minecraft_server.jar net.minecraft.server.MinecraftServer
      (doesn't require <jar>/META-INF/MANIFEST.MF)

      or a command like:
      java -Xincgc -Xms1024M -Xmx1024M -jar minecraft_server.jar
      (does require <jar>/META-INF/MANIFEST.MF)


    • Try updating the vanilla minecraft_server.jar using the command:
    • jar uvfM minecraft_server.jar *.class
      instead on extracting and rearchiving.


    Thanks for the reply! MANIFEST.MF is inside META-INF, which is in the root of the minecraft_server.jar, which I believe is its normal position. It reads:
    Manifest-Version: 1.0
    Created-By: 1.6.0
    Main-Class: net.minecraft.server.MinecraftServer

    Don't know much about java, but there is a series of folders (I think you call them packages?) in the root of the minecraft_server.jar that is net/minecraft/server and inside there is a MinecraftServer.class file.

    I use
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

    which is given on the download page of minecraft.net.
    This means that I need META-INF/MANIFEST.MF right? Except I have it already...
    Also, what does the '-Xincgc' flag do? The other two limit the amount of memory available to the server right? Sorry, I'm just curious. :biggrin.gif:

    I will try using that command to update the server jar file.
    UPDATE: Okay, I tried the command, and it outputted 'Invalid or corrupt jarfile minecraft_server.jar'
    I took a look inside it with my archiver program, and it was completely missing a META-INF folder (The original server jarfile had a META-INF folder - this was after the update). Looked at what the flags you gave me meant, found out that the 'M' flag made it not create a manifest file, so I just removed that flag, and hey presto, it worked!
    Thank you very much for suggesting this to me!
    Last edited by anLouisCh: 12/2/2011 3:20:25 PM
  • #65
    Quote from anLouisCh

    Also, what does the '-Xincgc' flag do? The other two limit the amount of memory available to the server right? Sorry, I'm just curious. :biggrin.gif:

    Google said: http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #66
    I always get the error

    Invalid or corrupt jarfile minecraft_server.jar

    Please Help, because i want to use mods on my server.
  • #67
    Quote from anLouisCh

    Thanks for the reply! MANIFEST.MF is inside META-INF, which is in the root of the minecraft_server.jar, which I believe is its normal position. It reads:
    Manifest-Version: 1.0
    Created-By: 1.6.0
    Main-Class: net.minecraft.server.MinecraftServer

    Don't know much about java, but there is a series of folders (I think you call them packages?) in the root of the minecraft_server.jar that is net/minecraft/server and inside there is a MinecraftServer.class file.

    I use
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

    which is given on the download page of minecraft.net.
    This means that I need META-INF/MANIFEST.MF right? Except I have it already...
    Also, what does the '-Xincgc' flag do? The other two limit the amount of memory available to the server right? Sorry, I'm just curious. :biggrin.gif:

    I will try using that command to update the server jar file.
    UPDATE: Okay, I tried the command, and it outputted 'Invalid or corrupt jarfile minecraft_server.jar'
    I took a look inside it with my archiver program, and it was completely missing a META-INF folder (The original server jarfile had a META-INF folder - this was after the update). Looked at what the flags you gave me meant, found out that the 'M' flag made it not create a manifest file, so I just removed that flag, and hey presto, it worked!
    Thank you very much for suggesting this to me!

    What is the "M" flag and how do I delete it?
    PLEASE help me.
  • #68
    Quote from blackdrazonQL3XX

    What is the "M" flag ...

    Type jar<enter> in your command console and read the output.


    Quote from blackdrazonQL3XX

    ... and how do I delete it?

    Hmmm ...

    ... pressing backspace on your keyboard while the cursor is after the M could delete it ...

    ... or you could try pressing delete while the cursor is before the M :wink.gif:

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #69
    Quote from blackdrazonQL3XX

    What is the "M" flag and how do I delete it?
    PLEASE help me.


    These are commands that you type into the terminal/command prompt/console. I can help you if you are on Linux or Mac, but I'm not sure if these commands work on Windows - Divisor probably knows.
    Basically, you just type those commands in, and press enter.
    For an example command:
    jar -uvfM minecraft_server.jar *

    The command consists of several parts - a program that is the first word in the sequence, which in this case is 'jar'. I believe this is the program for making those minecraft and minecraft server jarfiles out of compiled java code.
    'jar' takes several options, which we call 'flags'. Those are the letters after the minus sign. Each letter alters a different option, and it is similar to setting preferences inside any other normal graphical program that you use every day. You don't need to know what each option does, though you can google about the command prompt or the terminal if you want to know more details, or PM me.

    Essentially, when I said delete the 'M flag', I just meant instead of typing in
    jar -uvfM minecraft_server.jar *

    and pressing enter, I would type in
    jar -uvf minecraft_server.jar *

    This bottom one has the 'M' flag taken out of the sequence of letters.

    This command only works if you are working in a folder that contains the minecraft_server.jar file that you want to mod, and you have extracted all the files from inside the zipfile for the Player API.

    To be honest, you need to know the basics of how to use the command prompt/terminal or whatever, so I suggest you stick to the normal methods they advise here; http://www.minecraftwiki.net/wiki/Mods/Installing_Mods

    If you really want to know how to do it this way, then PM me, because I don't want to crowd this thread.
  • #70
    You have no idea how much hassle you're saving me. I only wish I knew about this earlier. Thanks a ton!
    Do NOT click here now.
    I hide Easter eggs in my mods. I bet you won't find them.
  • #71
    Ok, I really like using this mod and I'm trying to get it in my server but I can't for the life of me find "Their corresponding locations". I've looked all over the server jar (both official and Bukkit) and can't find where to put the class files. I would suggest better installation instructions or a tutorial of some sort.
    If anything is possible... is it possible for something to be impossible?
  • #72
    Quote from LaastManStandin

    Ok, I really like using this mod and I'm trying to get it in my server but I can't for the life of me find "Their corresponding locations". I've looked all over the server jar (both official and Bukkit) and can't find where to put the class files. I would suggest better installation instructions or a tutorial of some sort.

    You are the first one posting about having problems with that phrase.

    Just copy everything from the zip file to the jar file.
    What is in the root of the zip file goes in the root of the jar file.

    Besides, there is no Player API for Bukkit.
    Last edited by Divisor: 12/3/2011 2:09:22 PM

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #73
    Quote from Divisor

    You are the first one posting about having problems with that phrase.

    Just copy everything from the zip file to the jar file.
    What is in the root of the zip file goes in the root of the jar file.

    Besides, there is no Player API for Bukkit.

    I hate to bother you further but I had tried that before. I tried it again just now and I still glitch. I can crawl and everything works fine in single player, but whenever I'm on my server and have a height of one block to attempt to pass through one block I glitch and suffocate in a wall (Both Prone and Swimming). All the files have been placed in the first section of the regular server jar without entering folders.
    If anything is possible... is it possible for something to be impossible?
  • #74
    Quote from LaastManStandin

    I hate to bother you further but I had tried that before. I tried it again just now and I still glitch. I can crawl and everything works fine in single player, but whenever I'm on my server and have a height of one block to attempt to pass through one block I glitch and suffocate in a wall (Both Prone and Swimming). All the files have been placed in the first section of the regular server jar without entering folders.

    That definitely does not belong to this thread.

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #75
    Quote from LaastManStandin

    I hate to bother you further but I had tried that before. I tried it again just now and I still glitch. I can crawl and everything works fine in single player, but whenever I'm on my server and have a height of one block to attempt to pass through one block I glitch and suffocate in a wall (Both Prone and Swimming). All the files have been placed in the first section of the regular server jar without entering folders.


    If you want to complain about Smart Moving, do it in the Smart Moving thread.
  • #76
    Is it compatible with Single Player Commands?
    Yeah...sorry if the quality is bad..I had to scale it.
  • #77
    Quote from Razer1103

    Is it compatible with Single Player Commands?

    No, that's why I wrote a patch for it.

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #78
    Why this dont work with Bukkit?
    not strong enough to stay away
  • #79
    Quote from MSTrus

    Why this dont work with Bukkit?

    Because it was not written for it.

    Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!
  • #80
    any servers running this? I would like to join one
  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes