Thread: [delta] [REQ] Writing methods in you itemhandler class[/REQ] [/delta]

Results 1 to 2 of 2
  1. #1 [delta] [REQ] Writing methods in you itemhandler class[/REQ] [/delta] 
    Registered Member Cyradis's Avatar
    Join Date
    Aug 2009
    Posts
    70
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    First up, this guide is for Dustscapex.
    Open up your server folder and find itemhandler.java. open this file. scroll around untill you see somehting like "public static void"

    you should see a few like this one (the one dustscapex needs)

    Code:
    	public static void spawnItem(int itemID, int itemX, int itemY,
    			int itemAmount, int playerFor) {
    		client person = (client) PlayerHandler.players[playerFor];
    		person.createGroundItem(itemID, itemX, itemY, itemAmount);
    	}
    in this case, with the particular error that Dustscapex had, he would have to write a 2nd one just like this. with the name he referred to in his client.java file, or he would be telling client.java to read a non existant method. SO. here we go.

    Code:
    	public static void groundItem(int itemID, int itemX, int itemY,
    			int itemAmount, int playerFor) {
    		client person = (client) PlayerHandler.players[playerFor];
    		person.createGroundItem(itemID, itemX, itemY,);
    	}
    OMG that was so hard!!!! i cant beleive it. this creates a new method for ground items so you dont need to edit the code you put into client.java.
    it now has a method to read. (i'm guessing this is so you can have pvp drops, in wich player.java would also be involved.)

    in that code i wrote i only changed two words!!! AMAZING!!!!

    so thats it, and if it comes up with an error saying something about

    Code:
    (int, int,int,int,int boolean) grounditem. absX absY
    just change this bit so it suits
    Code:
    		person.createGroundItem(itemID, itemX, itemY,);


    FAQ

    Yes this was a poorly written and incorrect tut and the coding is probably wrong, the main objective was to tell Dustscapex that he needs a method in itemhandler.java.

    - dont flame or call me a noob coder and shit, this tut was not for you, see the [req]? well if you do and you still flame, fuck off

    good luck mate
    Reply With Quote  
     

  2. #2  
    //

    Join Date
    Jun 2007
    Posts
    45
    Thanks given
    2
    Thanks received
    14
    Rep Power
    654
    :-)
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •