Thread: [PI]woodcutting.java error

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 [PI]woodcutting.java error 
    Donator


    Join Date
    Jun 2011
    Posts
    2,549
    Thanks given
    539
    Thanks received
    402
    Rep Power
    683
    I don't know, I couldn't find it because i'm just using plain notepad since I got my new computer a while ago and haven't downloaded an IDE, etc and I just can't seem to find it even if it's to small.

    The error:

    View 3lbTYJ.png on ScreenSnapr

    Code:
    package server.model.players.skills;
    
    import server.model.players.*;
    import server.Config;
    import server.util.Misc;
    import server.event.*;
    import server.model.objects.Object;
    import server.Server;
    
    /**
    * @Author Null++
    * Edited by Valid
    */
    
    public class Woodcutting {
    	
    	private Client c;
    	
    	public final int[][] Axe_Settings = {
    		{1351, 1, 1, 879}, //Bronze
    		{1349, 1, 2, 877}, //Iron
    		{1353, 6, 3, 875}, //Steel
    		{1361, 6, 4, 873}, //Black
    		{1355, 21, 5, 871}, //Mithril
    		{1357, 31, 6, 869}, //Addy
    		{1359, 41, 7, 867}, //Rune
    		{6739, 61, 8, 2846}, //Dragon
    		{13661, 41, 8, 10251} //Adze
    	};
    
    	public final int[][] Tree_Settings = {
    		{1276, 1342, 1, 25, 1511, 45, 100}, //Tree
    		{1278, 1342, 1, 25, 1511, 45, 100}, //Tree
    		{1286, 1342, 1, 25, 1511, 45, 100}, //Dead Tree
    		{1281, 1356, 15, 38, 1521, 11, 20}, //Oak
    		{1308, 7399, 30, 68, 1519, 11, 8}, //Willow
    		{5552, 7399, 30, 68, 1519, 11, 8}, //Willow
    		{1307, 1343, 45, 100, 1517, 48, 8}, //Maple
    		{1309, 7402, 60, 175, 1515, 79, 5}, //Yew
    		{1306, 7401, 75, 250, 1513, 150, 3}, //Magic
    		{5551, 7399, 30, 68, 1519, 11, 8}, //Willow
    		{5553, 7399, 30, 68, 1519, 11, 8} //Willow
    	};
    
    	int a = -1;
    
    	public Woodcutting(Client c) {
    		this.c = c;
    	}
    	
    	public void startWoodcutting(final int j, final int x, final int y, final int type) {
    		if (c.isWc)
    			return;
    		if (c.wcing)
    			return;
    		int wcLevel = c.playerLevel[8];
    		a = -1;
    		c.turnPlayerTo(x, y);
    		if (Tree_Settings[j][2] > wcLevel) {
    			c.sendMessage("You need a Woodcutting level of " + Tree_Settings[j][2] + " to cut this tree.");
    			return;
    		}
    		for (int i = 0; i < Axe_Settings.length; i++) {
    			if (c.getItems().playerHasItem(Axe_Settings[i][0]) || c.playerEquipment[c.playerWeapon] == Axe_Settings[i][0]) {
    				if (Axe_Settings[i][1] <= wcLevel) {
    					a = i;
    				}
    			}
    		}
    		if (a == -1) {
    			c.sendMessage("You need an axe to cut this tree.");
    			return;
    		}
    		if (c.getItems().freeSlots() < 1) {
    			c.sendMessage("You do not have enough inventory slots to do that.");
    			return;
    		}
    		c.startAnimation(Axe_Settings[a][3]);
    		c.isWc = true;
    		c.treeX = x;
    		c.treeY = y;
    		c.wcing = true;
    		CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    			@Override
    			public void execute(CycleEventContainer container) {
    				if (!c.isWc) {
    					container.stop();
    					return;
    				}
    				if (c.isWc)
    					c.startAnimation(Axe_Settings[a][3]);
    				if (c.getItems().freeSlots() < 1) {
    					c.sendMessage("You have ran out of inventory slots.");
    					container.stop();
    				}
    				int xp = Tree_Settings[j][3];
    				if (c.getItems().playerHasEquipped(10933)) {
    					xp = (int)(xp * 1.002);
    				}
    				if (c.getItems().playerHasEquipped(10939)) {
    					xp = (int)(xp * 1.008);
    				}
    				if (c.getItems().playerHasEquipped(10940)) {
    					xp = (int)(xp * 1.006);
    				}
    				if (c.getItems().playerHasEquipped(10941)) {
    					xp = (int)(xp * 1.004);
    				}
    				if (c.isWc) {
    					c.getItems().addItem(Tree_Settings[j][4], 1);
    					c.getPA().addSkillXP(xp, 8);
    				}
    				if (c.getItems().freeSlots() < 1) {
    					c.sendMessage("You have ran out of inventory slots.");
    					container.stop();
    				}
    				if (c.isWc)
    					birdNests();
    				if (c.getItems().freeSlots() < 1) {
    					c.sendMessage("You have ran out of inventory slots.");
    					container.stop();
    				}
    				if (Misc.random(100) <= Tree_Settings[j][6]) {
    					cutDownTree(Tree_Settings[j][5], x, y, type, Tree_Settings[j][1], Tree_Settings[j][0]);
    					container.stop();
    				}
    			}
    			@Override
    			public void stop() {
    				c.getPA().removeInterfaces();
    				c.startAnimation(65535);
    				c.isWc = false;
    				c.treeX = 0;
    				c.treeY = 0;
    				c.wcing = false;
    				return;
    			}
    		}, getTimer(j, a, wcLevel));
    	}
    
    	public int getTimer(int b, int c, int level) {
    		double timer = (int)((Tree_Settings[b][2]  * 2) + 20 + Misc.random(20))-((Axe_Settings[c][2] * (Axe_Settings[c][2] * 0.75)) + level);
    		if (timer < 3.0) {
    			return 3;
    		} else {
    			return (int)timer;
    		}
    	}
    	
    	public void birdNests() {
    		if (Misc.random(100) < 5) {
    			c.getItems().addItem(5070, 1);
    		}
    	}
    	
    	public void cutDownTree(int respawnTime, int x, int y, int type, int i, int j) {
    		new Object(i, x, y, 0, type, 10, j, respawnTime);
    		for (int t = 0; t < Server.playerHandler.players.length; t++) {
    			if (Server.playerHandler.players[t] != null) {
    				if (Server.playerHandler.players[t].treeX == x && Server.playerHandler.players[t].treeY == y) {
    					Server.playerHandler.players[t].isWc = false;
    					Server.playerHandler.players[t].startAnimation(65535);
    					Server.playerHandler.players[t].treeX = 0;
    					Server.playerHandler.players[t].treeY = 0;
    				}
    			}
    		}
    	}
    }
    }
    All the best,
    Nirvana

    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2011
    Posts
    82
    Thanks given
    7
    Thanks received
    9
    Rep Power
    55
    you have an extra bracket at the end delete the vary last bracket reply what u get.

    selling runescape account heres the link its a good one.
    http://www.rune-server.org/market/ru...ml#post2925517
    Reply With Quote  
     

  3. #3  
    supa fly guy


    Join Date
    Feb 2011
    Age
    28
    Posts
    2,201
    Thanks given
    488
    Thanks received
    988
    Rep Power
    992
    Use eclipse
    /end
    Reply With Quote  
     

  4. #4  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    You have an extra brace on the very end.


    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Jun 2011
    Posts
    2,549
    Thanks given
    539
    Thanks received
    402
    Rep Power
    683
    Deleted it and I got several more errors.
    All the best,
    Nirvana

    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Post the errors here.
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Jun 2011
    Posts
    2,549
    Thanks given
    539
    Thanks received
    402
    Rep Power
    683
    Hold on Null, i'm going to have to re implement it.

    Strange, now i'm getting even more errors then I did before the first time I implemented it?

    Code:
    src\server\model\players\Client.java:293: error: cannot find symbol
                            getWoodcutting().cutWood();
                                            ^
      symbol:   method cutWood()
      location: class Woodcutting
    src\server\model\players\ActionHandler.java:487: error: duplicate case label
                    case 1276:
                    ^
    src\server\model\players\ActionHandler.java:488: error: duplicate case label
                    case 1278://trees
                    ^
    src\server\model\players\ActionHandler.java:500: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\ActionHandler.java:503: error: duplicate case label
                    case 1281: //oak
                    ^
    src\server\model\players\ActionHandler.java:507: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\ActionHandler.java:510: error: duplicate case label
                    case 1308: //willow
                    ^
    src\server\model\players\ActionHandler.java:514: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\ActionHandler.java:517: error: duplicate case label
                    case 1307: //maple
                    ^
    src\server\model\players\ActionHandler.java:521: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\ActionHandler.java:524: error: duplicate case label
                    case 1309: //yew
                    ^
    src\server\model\players\ActionHandler.java:528: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\ActionHandler.java:531: error: duplicate case label
                    case 1306: //yew
                    ^
    src\server\model\players\ActionHandler.java:535: error: method startWoodcutting
    in class Woodcutting cannot be applied to given types;
                            c.getWoodcutting().startWoodcutting(c.woodcut[0], c.wood
    cut[1], c.woodcut[2]);
                                              ^
      required: int,int,int,int
      found: int,int,int
      reason: actual and formal argument lists differ in length
    src\server\model\players\skills\Woodcutting.java:82: error: cannot find symbol
                    CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
                                                                     ^
      symbol:   class CycleEvent
      location: class Woodcutting
    src\server\model\players\skills\Woodcutting.java:82: error: cannot find symbol
                    CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
                    ^
      symbol:   variable CycleEventHandler
      location: class Woodcutting
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    16 errors
    Press any key to continue . . .
    Most of it just looks like declaring, etc, but what am I doing wrong here?
    Last edited by Scu11; 10-19-2011 at 05:11 PM.
    All the best,
    Nirvana

    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Oct 2011
    Posts
    191
    Thanks given
    21
    Thanks received
    10
    Rep Power
    13
    in your actionhandler.java you have more than 1 of the cases, find the duplicate cases and delete one

    and I think
    Code:
    CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    in your woodcutting.java

    should be
    Code:
    EventManager.getSingleton().addEvent(new Event() {
    and you don't have
    Code:
    	public void cutWood() {
    in woodcutting.java
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Quote Originally Posted by sum hope View Post
    in your actionhandler.java you have more than 1 of the cases, find the duplicate cases and delete one

    and I think
    Code:
    CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
    in your woodcutting.java

    should be
    Code:
    EventManager.getSingleton().addEvent(new Event() {
    No, it shouldn't. I used a cycle event handler.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Oct 2011
    Posts
    191
    Thanks given
    21
    Thanks received
    10
    Rep Power
    13
    Quote Originally Posted by Null++ View Post
    No, it shouldn't. I used a cycle event handler.
    ahh ok wasn't to sure if that was the problem or not
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [pi] Error with woodcutting :/
    By Snow Cat123 in forum Help
    Replies: 5
    Last Post: 10-27-2010, 06:12 PM
  2. woodcutting error rep++
    By Awak333 in forum Help
    Replies: 3
    Last Post: 12-31-2009, 05:07 PM
  3. Replies: 116
    Last Post: 10-15-2008, 08:13 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •