Thread: 2error, please help.

Results 1 to 3 of 3
  1. #1 2error, please help. 
    Registered Member
    Join Date
    May 2009
    Posts
    741
    Thanks given
    6
    Thanks received
    22
    Rep Power
    30
    2 errors (pi source)

    was copying a warrior snip and got this error/
    Code:
    src\server\Server.java:68: cannot find symbol
    symbol  : constructor WarriorsGuild()
    location: class server.model.minigames.WarriorsGuild
            public static WarriorsGuild warriorsGuild = new WarriorsGuild();
                                                        ^
    src\server\Server.java:158: cannot find symbol
    symbol  : method process()
    location: class server.model.minigames.WarriorsGuild
                                    warriorsGuild.process();
                                                 ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    How do u fix
    thanks


    Edit - i have impoorted it in my server.java still got the error.
    -Removed, advertising is not allowed
    Reply With Quote  
     

  2. #2  
    Registered Member Richie's Avatar
    Join Date
    Sep 2009
    Age
    28
    Posts
    791
    Thanks given
    81
    Thanks received
    18
    Rep Power
    6
    In your warriorsguild class add package. the directory here
    Example:
    package server.model.minigames;
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    May 2009
    Posts
    741
    Thanks given
    6
    Thanks received
    22
    Rep Power
    30
    Thankd for the reply but i already got that,
    This is my WarriorGuide.java
    Code:
    package server.model.minigames;
    
    import server.model.players.Client;
    import server.Server;
    
    /**
     * @author Brandyn
     */
    public class WarriorsGuild {
    	
    	public WarriorsGuild(Client c) {
    		this.c = c;
    	}
    	
    	private Client c;
    	
    	private int xCoord;
    	private int yCoord;
    	
    	private boolean spawned;
    	
    	public void setSpawned(boolean spawned) {
    		this.spawned = spawned;
    	}
    
            private final int[][] ARMORREQUIRED = {{1075, 1117, 1155}, {1067, 1115, 1153}, {1069, 1119, 1157}, 
    									{1071, 1121, 1159}, {1091, 1123, 1161}, {1079, 1127, 1163}};
    	
    	public int[] Armor = new int[3];
    	public final int TOKEN = 8851;
    	public int tokens;
    
            /**
             * Handles which armor through ItemOnObject
             * @param itemId The item id used
             * @param X The object X-Coordinate
             * @param Y The object Y-Coordinate
             */
    	public void handleArmor(int itemId, int X, int Y) {
    		if(!spawned) {
    			this.xCoord = X;
    			this.yCoord = Y;
    			for(int f = 0; f < 5; f++) {
    				for(int i = 0; i < 3; i++) {
    					if(itemId == ARMORREQUIRED[f][i]) {
    						if(hasItem(ARMORREQUIRED[f][0], true) && hasItem(ARMORREQUIRED[f][1], true) && hasItem(ARMORREQUIRED[f][2], true)) {
    							animateArmor(ARMORREQUIRED[f], 4278, 20, 5, 30, 100, 10);
    						}
    					}
    				}
    			}
    		} else {
    			c.sendMessage("You already have armor spawned!");
    		}
    	}
    	
    	private boolean hasItem(int itemId, boolean invent) {
    		if(!invent)
                   		return (c.getItems().playerHasItem(itemId) || c.playerEquipment[5] == itemId);
    		else
    			return c.getItems().playerHasItem(itemId);
    	}
    	
    	public void animateArmor(int[] Armor, int npcId, int hitPoints, int maxHit, int attack, int defence, int tokens) {
    		//c.getPA().walkTo2(xCoord, yCoord + 5); Didn't actually work. (Should walk 5 spaces above the animator)
    		this.tokens = tokens;
    		this.Armor = Armor;
    		for(int i = 0; i < 3; i++) {
    			c.getItems().deleteItem(Armor[i], 1);
    		}
    		spawned = true;
    		Server.npcHandler.spawnNpc(c, npcId, xCoord, yCoord, 0, 0, hitPoints, maxHit, attack, defence, true, true);
    	}
    	
            /**
             * Item ids of all defenders
             */
    	private final int BRONZEDEF = 8844, IRONDEF = 8845, STEELDEF = 8846, MITHRILDEF = 8848, 
    					ADAMANTDEF = 8849, RUNEDEF = 8850;
    	
            /**
             * @return Returns the item drop for the Cyclops
             */
    	public int handleCyclops() {
    		if(hasItem(RUNEDEF, false))
    			return RUNEDEF;
    		else if(hasItem(ADAMANTDEF, false))
    			return RUNEDEF;
    		else if(hasItem(MITHRILDEF, false))
    			return ADAMANTDEF;
    		else if(hasItem(STEELDEF, false))
    			return MITHRILDEF;
    		else if(hasItem(IRONDEF, false))
    			return STEELDEF;
    		else if(hasItem(BRONZEDEF, false))
    			return IRONDEF;
    		else
    			return BRONZEDEF;
    	}
    }
    -Removed, advertising is not allowed
    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
  •