you have an extra bracket at the end delete the vary last bracket reply what u get.
|
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; } } } } } }
you have an extra bracket at the end delete the vary last bracket reply what u get.
Use eclipse
/end
You have an extra brace on the very end.
Deleted it and I got several more errors.
Post the errors here.
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?
Most of it just looks like declaring, etc, but what am I doing wrong here?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 . . .
Last edited by Scu11; 10-19-2011 at 05:11 PM.
in your actionhandler.java you have more than 1 of the cases, find the duplicate cases and delete one
and I think
in your woodcutting.javaCode:CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
should be
and you don't haveCode:EventManager.getSingleton().addEvent(new Event() {
in woodcutting.javaCode:public void cutWood() {
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |