Jump to content

Help
Latest News Article

[1.2.5][API] Player API


430 replies to this topic

#1

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 24 October 2011 - 05:16 PM

Player API gives third party mods managed access to the main player class

Player API is an API which provides access to
  • the client class "EntityPlayerSP" aka "vq" or
  • the server class "EntityPlayerMP" aka "gi" or
  • the bukkit class "EntityPlayer"
while minimizing conflicts between mods.



Current Versions:

Client 1.1 (for Minecraft 1.2.5)
Added hooks "getSpeedModifier" and "knockBack": Download from Mediafire or Dropbox

Server 1.2 (for Minecraft 1.2.5)
Added hook "canHarvestBlock": Download from Mediafire or Dropbox

Bukkit 1.4 (for CraftBukkit 1.2.5-R2.0)
Updated Player API for CraftBukkit 1.2.5-R2.0: Download from Mediafire or Dropbox




Installation:

For installation instructions:
  • make sure you download the right file:
    • Client for client side mods that require Player API client
    • Server for server side mods that require Player API server
    • Bukkit for bukkit mods that require Player API bukkit
  • read the "installation" section of your download's readme files
Incompatibilities
  • Player API server is compatible with Minecraft Forge server, just install Player API server after Minecraft Forge server.


FAQs:

Spoiler



Developing:

If you require more hooks or access methods to make your mod work with Player API, you can either send me a private message or post here.

The additional code should then be in the next release.

Step by Step: Mod Adaption

Spoiler

Step by Step: Mod Creation

Spoiler

Example: Mod Structure

Spoiler




Usage:

This API is currently used by the following mods:


Previous Versions:

Previous Versions (for Minecraft 1.2.5)

Client 1.0
Upgraded to Minecraft 1.2.5: Download from Mediafire or Dropbox

Server 1.1
Added hooks "attackTargetEntityWithCurrentItem", "canPlayerEdit" and "damageEntity": Download from Mediafire or Dropbox

Server 1.0
Upgraded to Minecraft 1.2.5: Download from Mediafire or Dropbox

Bukkit 1.3
Added support for attaching and detaching Player Bases on the fly: Download from Mediafire or Dropbox

Bukkit 1.2
Added hook "canHarvestBlock": Download from Mediafire or Dropbox

Bukkit 1.1
Added hooks "attackTargetEntityWithCurrentItem", "canPlayerEdit" and "damageEntity": Download from Mediafire or Dropbox

Bukkit 1.0
Created Player API for CraftBukkit 1.2.5-R1.0: Download from Mediafire or Dropbox


Previous Versions (for Minecraft 1.2.4)

Spoiler



Previous Versions (for Minecraft 1.2.3)

Spoiler



Previous Versions (for Minecraft 1.1)

Spoiler



Previous Versions (for Minecraft 1.0.0)

Spoiler



Previous Versions (for Minecraft Beta 1.8.1)

Spoiler



Previous Versions (for Minecraft Beta 1.7.3)

Spoiler



Register or log in to remove.

#2

    Delta565

    Nether Resident

  • Members
  • 2077 posts
  • Location: Trapped with AZilla2498 in a world that does not exist.
  • Minecraft: delta565

Posted 24 October 2011 - 05:18 PM

Yey!
Thank you for that :)
Here :Diamond:
Posted Image

#3

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 24 October 2011 - 06:45 PM

Released client version 1.3 - Improved null handling of hook "rayTrace".

#4

  • Minecraft: kaimarohero

Posted 24 October 2011 - 06:52 PM

So, with this.. it's possible to control a connected client with the mod class installed, if you have the plugin installed on the server? :P
Posted Image

#5

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 24 October 2011 - 08:58 PM

View Postkaimarohero, on 24 October 2011 - 06:52 PM, said:

So, with this.. it's possible to control a connected client with the mod class installed, if you have the plugin installed on the server? :P
No, it's just a class access API.

Client and server part are strictly seperated. They are two different APIs that somehow happen to do the same thing - one at the client, the other one at the server.

#6

Posted 26 October 2011 - 09:53 AM

It's The Best mod ;)

#7

  • Location: Hyrule (wel not raelly but AH I SPELD RELLY RONG GOD DANG IT)
  • Minecraft: Blueboy2001

Posted 28 October 2011 - 04:09 AM

I get a black screen after Mojang appears. I have Flan's Planes, Vehicles, and Guns on, and I'm trying to get the Aether mod. This is my second to last requirement (AudioMod). :VV:
Posted Image

#8

  • Location: ಠ_ಠ McF ಠ_ಠ
  • Minecraft: pwnedgod

Posted 30 October 2011 - 10:34 AM

View PostBlueCreeper, on 28 October 2011 - 04:09 AM, said:

I get a black screen after Mojang appears. I have Flan's Planes, Vehicles, and Guns on, and I'm trying to get the Aether mod. This is my second to last requirement (AudioMod). :VV:

Use this to get a error report and paste it here.
Private Signature

#9

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 30 October 2011 - 02:59 PM

View PostBlueCreeper, on 28 October 2011 - 04:09 AM, said:

I get a black screen after Mojang appears. I have Flan's Planes, Vehicles, and Guns on, and I'm trying to get the Aether mod. This is my second to last requirement (AudioMod). :VV:
Can you give me some more information?

Like:
  • your Minecraft version
  • your Player API version
  • the mod versions of all these mods
  • the complete startup output from the client's terminal window
  • the complete error message including it's stack trace


#10

  • Location: Hyrule (wel not raelly but AH I SPELD RELLY RONG GOD DANG IT)
  • Minecraft: Blueboy2001

Posted 02 November 2011 - 02:07 AM

View PostDivisor, on 30 October 2011 - 02:59 PM, said:

Can you give me some more information?

Like:
  • your Minecraft version
  • your Player API version
  • the mod versions of all these mods
  • the complete startup output from the client's terminal window
  • the complete error message including it's stack trace

-MineCraft 1.8.1.
-Client 1.3.
-Planes v16, Vehicles v4, WW2 Guns v3.
I'll look at the other ones. Thanks pwnedgod, now I know what they mean with the error log thing. Just got to reinstall, lost my .jar file. :,,,,:
Posted Image

#11

Posted 02 November 2011 - 02:39 AM

what does it actually do?
Posted Image

#12

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 02 November 2011 - 07:43 AM

View PostBseagullMC, on 02 November 2011 - 02:39 AM, said:

what does it actually do?
It solves parallel file overwriting incompatibility issues between mods for the client file qs.class and the server file ek.class. Of course the corresponding mods need to actively outsource their file overwriting functionality to the Player API and therefore depend on it to make it work.

#13

  • Location: 〔 文 _ 文 〕
  • Minecraft: runee

Posted 02 November 2011 - 07:52 AM

View PostDivisor, on 24 October 2011 - 08:58 PM, said:

No, it's just a class access API.

Client and server part are strictly seperated. They are two different APIs that somehow happen to do the same thing - one at the client, the other one at the server.

Well... If it is managed to work with Player Model API (click signature)
then it would be sooo awesome :) But - I am not really fit in entity thing :'(

So, can you explain me how to use your api?
Posted Image

#14

  • Location: ಠ_ಠ McF ಠ_ಠ
  • Minecraft: pwnedgod

Posted 02 November 2011 - 08:11 AM

View PostBinkan Salaryman, on 02 November 2011 - 07:52 AM, said:

Well... If it is managed to work with Player Model API (click signature)
then it would be sooo awesome :) But - I am not really fit in entity thing :'(

So, can you explain me how to use your api?

Actually. Player Model API should use Player API instead.
Private Signature

#15

  • Location: 〔 文 _ 文 〕
  • Minecraft: runee

Posted 02 November 2011 - 08:18 AM

View Postpwnedgod, on 02 November 2011 - 08:11 AM, said:

Actually. Player Model API should use Player API instead.

See it as you like... My mod has its root in the render files and doesn't modify entity files.
That makes it very compatible. But of course I can't fulfill the wishes of the thread posters
spamming "DON'T MAKE ONLY THE MODEL OMG!!" with that. If you are all in all a good modder we
should really work together and make a mod for switching to all possible mobs...
Posted Image

#16

    Divisor

    Redstone Miner

  • Members
  • 658 posts

Posted 02 November 2011 - 09:35 PM

View PostBinkan Salaryman, on 02 November 2011 - 07:52 AM, said:

... So, can you explain me how to use your api?
I had a look at your Player Model API mod. It does not override qs.class so it currently has no use for the Player API mod.

If you are planning to continue developing your mod so that it has to overwrite qs.class to function correctly, you might find the Player API mod very useful to outsource this critical code.

To do so:
  • decompile the latest version of the Player API client mod into your programming environment
  • create a new class extending the class PlayerBase
  • put all your code from EntityPlayerSP into this class
  • make sure to register your class using PlayerAPI.RegisterPlayerBase before the first player entity is created (doing this in a ModLoader mod class constructor is normally a good choice)
  • make your class work
    • make sure you are overwriting the right method
    • make sure calling the right methods of the new EntityPlayerSP class
    • if you are missing methods or functionality send me a private message describing the additionaly needs of your mod
  • recompile your code as usual
  • make sure to exclude qs.class and all Player API classes from your own mod package

View PostBinkan Salaryman, on 02 November 2011 - 08:18 AM, said:

See it as you like... My mod has its root in the render files and doesn't modify entity files.
That makes it very compatible. But of course I can't fulfill the wishes of the thread posters
spamming "DON'T MAKE ONLY THE MODEL OMG!!" with that. If you are all in all a good modder we
should really work together and make a mod for switching to all possible mobs...
What specifically do those posters want you to add to your mod?

#17

  • Location: 〔 文 _ 文 〕
  • Minecraft: runee

Posted 04 November 2011 - 03:53 AM

View PostDivisor, on 02 November 2011 - 09:35 PM, said:

What specifically do those posters want you to add to your mod?

Well.. they have MANY ideas... Look here:

Spoiler


That would require a total change, don't it?
For every player a render, model and entity extended class + a way to put them together...
Posted Image

#18

Posted 07 November 2011 - 12:48 AM

View Postpwnedgod, on 30 October 2011 - 10:34 AM, said:

Use this to get a error report and paste it here.

i am gonna sound like a nube but how do you copy? :P
I'd rahter try and fail than not try at all.
- Travis Pastrana

#19

  • Location: ಠ_ಠ McF ಠ_ಠ
  • Minecraft: pwnedgod

Posted 07 November 2011 - 01:19 PM

Can you make a Better than wolves compatibility patch? After a recent update BTW edits the qs.class.

_______________________________________________________________________________________

View Postdirtbikerty99, on 07 November 2011 - 12:48 AM, said:

i am gonna sound like a nube but how do you copy? :P

Nevermind use this instead and if the error window appears copy and paste it here:
http://www.mediafire...s2t39voa4nala6r
Private Signature

#20

Posted 07 November 2011 - 05:56 PM

View Postpwnedgod, on 07 November 2011 - 01:19 PM, said:

Can you make a Better than wolves compatibility patch? After a recent update BTW edits the qs.class.

_______________________________________________________________________________________



Nevermind use this instead and if the error window appears copy and paste it here:
http://www.mediafire...s2t39voa4nala6r
how do you copy the error report???
I'd rahter try and fail than not try at all.
- Travis Pastrana