Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

[1.7.2][API] Player API


  • Please log in to reply
1607 replies to this topic

#61

pwnedgod
    pwnedgod

    Void Walker

  • Members
  • 1843 posts
  • Location: ಠ_ಠ McF ಠ_ಠ
  • Minecraft: pwnedgod

Posted 02 December 2011 - 07:02 AM

View PostLevy, on 02 December 2011 - 07:00 AM, said:

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...
Posted Image

Register or log in to remove.

#62

anLouisCh

Posted 02 December 2011 - 05:50 PM

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

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 02 December 2011 - 07:37 PM

View PostanLouisCh, on 02 December 2011 - 05:50 PM, said:

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.

Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#64

anLouisCh

Posted 02 December 2011 - 09:10 PM

View PostDivisor, on 02 December 2011 - 07:37 PM, said:

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. :D

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!

#65

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 02 December 2011 - 09:20 PM

View PostanLouisCh, on 02 December 2011 - 09:10 PM, said:

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. :D
Google said: http://www.javaworld.com/javaworld/jw-01-2002/jw-0111-hotspotgc.html
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#66

blackdrazonQL3XX

Posted 02 December 2011 - 10:22 PM

I always get the error

Invalid or corrupt jarfile minecraft_server.jar

Please Help, because i want to use mods on my server.
Posted Image

#67

blackdrazonQL3XX

Posted 02 December 2011 - 10:30 PM

View PostanLouisCh, on 02 December 2011 - 09:10 PM, said:

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. :D

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.
Posted Image

#68

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 02 December 2011 - 11:30 PM

View PostblackdrazonQL3XX, on 02 December 2011 - 10:30 PM, said:

What is the "M" flag ...
Type jar<enter> in your command console and read the output.


View PostblackdrazonQL3XX, on 02 December 2011 - 10:30 PM, said:

... 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 ;)
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#69

anLouisCh

Posted 03 December 2011 - 11:49 AM

View PostblackdrazonQL3XX, on 02 December 2011 - 10:30 PM, said:

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.minecraft...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

Paraknight
  • Minecraft: Paraknight

Posted 03 December 2011 - 06:20 PM

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

LaastManStandin
  • Minecraft: LaastManStandin

Posted 03 December 2011 - 07:50 PM

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

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 03 December 2011 - 08:08 PM

View PostLaastManStandin, on 03 December 2011 - 07:50 PM, said:

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.
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#73

LaastManStandin
  • Minecraft: LaastManStandin

Posted 04 December 2011 - 12:11 AM

View PostDivisor, on 03 December 2011 - 08:08 PM, said:

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

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 04 December 2011 - 08:43 AM

View PostLaastManStandin, on 04 December 2011 - 12:11 AM, said:

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.
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#75

anLouisCh

Posted 05 December 2011 - 07:02 PM

View PostLaastManStandin, on 04 December 2011 - 12:11 AM, said:

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

Razer1103

Posted 05 December 2011 - 11:00 PM

Is it compatible with Single Player Commands?
Posted ImageYeah...sorry if the quality is bad..I had to scale it.

#77

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 06 December 2011 - 07:18 AM

View PostRazer1103, on 05 December 2011 - 11:00 PM, said:

Is it compatible with Single Player Commands?
No, that's why I wrote a patch for it.
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#78

MSTrus
    MSTrus

    Out of the Water

  • Members
  • 7 posts
  • Minecraft: MSTrus

Posted 10 December 2011 - 01:46 PM

Why this dont work with Bukkit?
not strong enough to stay away

#79

Divisor
    Divisor

    Void Walker

  • Members
  • 1540 posts

Posted 10 December 2011 - 04:52 PM

View PostMSTrus, on 10 December 2011 - 01:46 PM, said:

Why this dont work with Bukkit?
Because it was not written for it.
Posted Image
Not Minecraft-related, I know - but the author wants more readers - and to be honest, he deserves them!

#80

nubeees
    nubeees

    Coal Miner

  • Members
  • 144 posts

Posted 11 December 2011 - 07:37 AM

any servers running this? I would like to join one