Thread: [718] Tool belt Problem [718]

Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1 [718] Tool belt Problem [718] 
    Registered Member
    Join Date
    Jul 2013
    Posts
    184
    Thanks given
    22
    Thanks received
    4
    Rep Power
    12
    Hello rune-server community

    how are you

    today i got a problem with toolbelt in my server

    its the tool belt


    its already works and the items on it

    but when i will craft or fletch or pickaxe or cut tree it say

    you dont have the required items to do this


    so i dont know from what


    thats my toolbelt.java


    Code:
    package com.rs.game.player.content;
    
    import java.io.Serializable;
    import java.util.HashMap;
    import java.util.Map;
    
    import com.rs.game.item.Item;
    import com.rs.game.player.Player;
    
    /**
     * Handles a {@link Player}'s toolbelt.
     * 
     * @author Thomas Le Godais
     * 
     */
    public class ToolBelt implements Serializable {
    
    	private static final long serialVersionUID = 7706200801855080675L;
    	private transient Player player;
    
    	private static final int[] TOOLBELT_ITEMS = new int[] { 946, 1735, 1595, 1755, 1599, 1597, 1733, 1592, 5523, 13431, 307, 309, 311, 301, 303, 1265, 2347, 1351, 590, -1, 8794, 4, 9434, 11065, 1785, 2976, 1594, 5343, 5325, 5341, 5329, 233, 952, 305, 975, 11323, 2575, 2576, 13153, 10150 };
    	private static final int[] CONFIG_IDS = new int[] { 2438, 2439 };
    
    	private Map<Integer, Boolean> items;
    
    	public ToolBelt(Player player) {
    		this.player = player;
    	}
    
    	public void refresh() {
    		if (items == null) {
    			items = new HashMap<Integer, Boolean>();
    			for (int itemId : TOOLBELT_ITEMS) {
    				items.put(itemId, false);
    			}
    		}
    		int[] configValue = new int[CONFIG_IDS.length];
    		for (int i = 0; i < TOOLBELT_ITEMS.length; i++) {
    			if (items.get(TOOLBELT_ITEMS[i]) == null) {
    				continue;
    			}
    			boolean inToolbelt = items.get(TOOLBELT_ITEMS[i]);
    			if (!inToolbelt) {
    				continue;
    			}
    			int index = (i / 20);
    			configValue[index] |= 1 << (i - (index * 20));
    		}
    		for (int i = 0; i < CONFIG_IDS.length; i++) {
    			if (configValue[i] == 0) {
    				continue;
    			}
    			player.getPackets().sendConfig(CONFIG_IDS[i], configValue[i]);
    		}
    	}
    
    	public boolean addItem(Item item) {
    		if (items.get(item.getId()) == null) {
    			return false;
    		}
    		if (items.get(item.getId())) {
    			player.sendMessage("This item is already in your toolbelt.");
    			return false;
    		}
    		items.put(item.getId(), true);
    		player.sendMessage("You add the " + item.getName() + " to your toolbelt.");
    		refresh();
    		return true;
    	}
    
    	public boolean contains(int itemId) {
    		if (items.get(itemId) == null) {
    			return false;
    		}
    		return items.get(itemId);
    	}
    
    	public void setPlayer(Player player) {
    		this.player = player;
    	}
    }

    i hope you help me !!
     

  2. #2  
    Donator
    Sake's Avatar
    Join Date
    Jan 2013
    Posts
    398
    Thanks given
    71
    Thanks received
    23
    Rep Power
    2
    if(ToolBelt.contains(ID of tinderbox)

    in checkAll method in Firemaking.java

    Code:
    public boolean checkAll(Player player) {
    		if (!player.getInventory().containsItem(590, 1) || !ToolBelt.contains(590)) {
    			player.getPackets().sendGameMessage(
    					"You do not have the required items to light this.");
    Something like that, if it doesn't work I might have made a mistake with the 'does not' part, haven't coded in a while.
     

  3. #3  
    Registered Member
    Join Date
    Jul 2013
    Posts
    184
    Thanks given
    22
    Thanks received
    4
    Rep Power
    12
    the tinderbox is working


    but fletching and smithing the the other materials

    ...
     

  4. #4  
    Registered Member Sjonsen's Avatar
    Join Date
    May 2012
    Posts
    321
    Thanks given
    15
    Thanks received
    44
    Rep Power
    20
    So do what revize said for the other classes that aren't working yet too.
     

  5. #5  
    Success is the worst teacher

    Santa Hat's Avatar
    Join Date
    Oct 2012
    Age
    27
    Posts
    3,334
    Thanks given
    807
    Thanks received
    1,185
    Rep Power
    190
    Quote Originally Posted by GR-Team View Post
    the tinderbox is working


    but fletching and smithing the the other materials

    ...
    Think of it logically, Okay so fletching doesn't work with the toolbelt, well look into the Fletching class, find where it sends the message and then do the same check as the firemaking one?


     

  6. #6  
    Registered Member
    Join Date
    Jul 2013
    Posts
    184
    Thanks given
    22
    Thanks received
    4
    Rep Power
    12
    i did that but it dosn't work
     

  7. #7  
    Registered Member
    Join Date
    Jul 2013
    Posts
    184
    Thanks given
    22
    Thanks received
    4
    Rep Power
    12
    bump
     

  8. #8  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    You said you've done, post the method where you added it
     

  9. #9  
    Registered Member
    Join Date
    Jul 2013
    Posts
    184
    Thanks given
    22
    Thanks received
    4
    Rep Power
    12
    Quote Originally Posted by Datbeastmayne View Post
    You said you've done, post the method where you added it

    the problem is with farming items and fletching and crafting i dont know how to fix them
     

  10. #10  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,409
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by GR-Team View Post
    the problem is with farming items and fletching and crafting i dont know how to fix them
    Well there is already a method to check if they have the chisel, rake and etc.
    Simply add onto that statement.
     

Page 1 of 3 123 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. 718 Eclipse IDE problem
    By legend 349 in forum Help
    Replies: 3
    Last Post: 12-09-2012, 11:13 PM
  2. 718/736 login problem
    By FRENCH TOAST in forum Help
    Replies: 0
    Last Post: 12-02-2012, 12:35 AM
  3. 718 Client Crash Problem
    By Sam' in forum Help
    Replies: 2
    Last Post: 10-29-2012, 12:54 PM
  4. 718 Grand Exchange problem
    By NOSDuco in forum Help
    Replies: 1
    Last Post: 10-18-2012, 07:57 AM
  5. Small slayer problem 718
    By Charlie' in forum Help
    Replies: 9
    Last Post: 10-14-2012, 11:14 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •