Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » error on my compiler
error on my compiler [message #875830] Wed, 23 May 2012 11:55 Go to next message
Jack Zeller is currently offline Jack Zeller
Messages: 4
Registered: May 2012
Junior Member
src\server\model\players\packets\ClickItem.java:23 3: error: class, interface, or
enum expected
}
^
1 error
Press any key to continue . . .


clickitem.java when i compile it comes up with this


^thats the error^


and this is the code(clickitem.java)
package server.model.players.packets;

import server.model.players.Client;
import server.util.Misc;
import server.model.players.PacketType;


/**
 * Clicking an item, bury bone, eat food etc
 **/
public class ClickItem implements PacketType {

	@Override
	public void processPacket(Client c, int packetType, int packetSize) {
		int junk = c.getInStream().readSignedWordBigEndianA();
		int itemSlot = c.getInStream().readUnsignedWordA();
		int itemId = c.getInStream().readUnsignedWordBigEndian();
		if (c.usingCarpet) {
			return;
		}
		if (itemId != c.playerItems[itemSlot] - 1) {
			return;
		}
		if (itemId == 8007) {
			c.getPA().teleTab("varrock");
		}
		if (itemId == 8008) {
			c.getPA().teleTab("lumbridge");
		}
		if (itemId == 8009) {
			c.getPA().teleTab("falador");
		}
		if (itemId == 8010) {
			c.getPA().teleTab("camelot");
		}
		if (itemId == 8011) {
			c.getPA().teleTab("ardy");
		}
		//PvP artefacts.
		if(itemId == 14892) {
			c.getItems().deleteItem(14892, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14891) {
			c.getItems().deleteItem(14891, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14890) {
			c.getItems().deleteItem(14890, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14889) {
			c.getItems().deleteItem(14889, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14888) {
			c.getItems().deleteItem(14888, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14887) {
			c.getItems().deleteItem(14887, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14886) {
			c.getItems().deleteItem(14886, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14885) {
			c.getItems().deleteItem(14885, 1);
			c.pcPoints +=1;
			c.sendMessage("You activate the mysterious artefact and recieve 1 pk points.");
		}
		if(itemId == 14884) {
			c.getItems().deleteItem(14884, 1);
			c.pcPoints +=2;
			c.sendMessage("You activate the mysterious artefact and recieve 2 pk points.");
		}
		if(itemId == 14883) {
			c.getItems().deleteItem(14883, 1);
			c.pcPoints +=2;
			c.sendMessage("You activate the mysterious artefact and recieve 2 pk points.");
		}
		if(itemId == 14882) {
			c.getItems().deleteItem(14882, 1);
			c.pcPoints +=2;
			c.sendMessage("You activate the mysterious artefact and recieve 2 pk points.");
		}
		if(itemId == 14881) {
			c.getItems().deleteItem(14881, 1);
			c.pcPoints +=3;
			c.sendMessage("You activate the mysterious artefact and recieve 3 pk points.");
		}
		if(itemId == 14880) {
			c.getItems().deleteItem(14880, 1);
			c.pcPoints +=4;
			c.sendMessage("You activate the mysterious artefact and recieve 4 pk points.");
		}
		if(itemId == 14879) {
			c.getItems().deleteItem(14879, 1);
			c.pcPoints +=5;
			c.sendMessage("You activate the mysterious artefact and recieve 5 pk points.");
		}
		if(itemId == 14878) {
			c.getItems().deleteItem(14878, 1);
			c.pcPoints +=7;
			c.sendMessage("You activate the mysterious artefact and recieve 7 pk points.");
		}
		if(itemId == 14877) {
			c.getItems().deleteItem(14877, 1);
			c.pcPoints +=9;
			c.sendMessage("You activate the mysterious artefact and recieve 9 pk points.");
		}
		if(itemId == 14876) {
			c.getItems().deleteItem(14876, 1);
			c.pcPoints +=11;
			c.sendMessage("You activate the mysterious artefact and recieve 11 pk points.");
		}
		if (itemId == 4251) {
			c.getPA().movePlayer(3565, 3316, 0);
			c.sendMessage("You empty the ectophial.");
			c.getItems().deleteItem(4251,c.getItems().getItemSlot(4251), 1);
			c.getItems().addItem(4252, 1);
		}
		if (itemId >= 5509 && itemId <= 5514) {
			int pouch = -1;
			int a = itemId;
			if (a == 5509)
				pouch = 0;
			if (a == 5510)
				pouch = 1;
			if (a == 5512)
				pouch = 2;
			if (a == 5514)
				pouch = 3;
			c.getPA().fillPouch(pouch);
			return;
		}
		if (c.getHerblore().isUnidHerb(itemId))
			c.getHerblore().handleHerbClick(itemId);
		if (c.getFood().isFood(itemId))
			c.getFood().eat(itemId,itemSlot);
		//ScriptManager.callFunc("itemClick_"+itemId, c, itemId, itemSlot);
		if (c.getPotions().isPotion(itemId))
			c.getPotions().handlePotion(itemId,itemSlot);
		if (c.getPrayer().isBone(itemId))
			c.getPrayer().buryBone(itemId, itemSlot);
		if (itemId == 952) {
			if(c.inArea(3553, 3301, 3561, 3294)) {
				c.teleTimer = 3;
				c.newLocation = 1;
			} else if(c.inArea(3550, 3287, 3557, 3278)) {
				c.teleTimer = 3;
				c.newLocation = 2;
			} else if(c.inArea(3561, 3292, 3568, 3285)) {
				c.teleTimer = 3;
				c.newLocation = 3;
			} else if(c.inArea(3570, 3302, 3579, 3293)) {
				c.teleTimer = 3;
				c.newLocation = 4;
			} else if(c.inArea(3571, 3285, 3582, 3278)) {
				c.teleTimer = 3;
				c.newLocation = 5;
			} else if(c.inArea(3562, 3279, 3569, 3273)) {
				c.teleTimer = 3;
				c.newLocation = 6;

 		}
			
 		if (itemId == 6199) {
                int mysteryReward = Misc.random(10);
                if (mysteryReward == 1) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(454, Misc.random(30));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 2) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(452, Misc.random(3));
               		c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 3) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(140, Misc.random(8));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 4) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(392, Misc.random(20));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 5) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(995, Misc.random(35000));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 6) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(561, Misc.random(50));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 7) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(563, Misc.random(30));
               		c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 8) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(565, Misc.random(60));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 9) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(560, Misc.random(65));
                	c.sendMessage("You open the box.");
		}
		else if (mysteryReward == 10) {
                	c.getItems().deleteItem(6199, 1);
			c.getItems().addItem(556, Misc.random(300));
               		c.sendMessage("You open the box.");

		}
	}
}
		}
	}
}
Re: error on my compiler [message #875892 is a reply to message #875830] Wed, 23 May 2012 13:59 Go to previous messageGo to next message
Eclipse User
You are missing a closing brace;

On 5/23/2012 7:55 AM, Jack Zeller wrote:
> } else if(c.inArea(3562, 3279, 3569, 3273)) {
> c.teleTimer = 3;
> c.newLocation = 6;

>>>> } <-- Need this
>
> }

Plus you have too many } at the end.
Re: error on my compiler [message #875896 is a reply to message #875830] Wed, 23 May 2012 14:04 Go to previous message
Satyam Kandula is currently offline Satyam Kandula
Messages: 444
Registered: July 2009
Senior Member
Your braces are bad. Look at the brace for 154. Double click immediately after the brace and it will show the enclosing braces.
The error is coming because of the last extra brace.
Previous Topic:Ubuntu 12.04 LTS + Eclipse Indigo Java EE Platform (SOLVED)
Next Topic:Configure Server (Unix/Windows) for Java Program
Goto Forum:
  


Current Time: Wed Oct 01 16:22:08 GMT 2014

Powered by FUDForum. Page generated in 0.02459 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software