public void removeResource(Resource r, int count) {
		for(int i = 0; i < maxItems; i++) {
			if(items[i] != null && items[i] instanceof ResourceItem) {
				ResourceItem res = (ResourceItem)items[i];
				if(res.getResource() != r) continue;
				res.setCount(-count);
				if(res.getCount() == 0) {
					removeItem(i);
				}
			}
		}
	}