project: add missing api components (#2935)

* api: add missing api components

api: add missing api components

* oops

* .
This commit is contained in:
Kyle
2021-02-22 23:59:40 +00:00
committed by GitHub
parent 0d33d3d356
commit b58482938e
10 changed files with 949 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMap;
import com.openosrs.client.game.ItemReclaimCost;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.IOException;
@@ -349,6 +350,41 @@ public class ItemManager
return price;
}
public int getAlchValue(ItemComposition composition)
{
if (composition.getId() == COINS_995)
{
return 1;
}
if (composition.getId() == PLATINUM_TOKEN)
{
return 1000;
}
return Math.max(1, composition.getHaPrice());
}
public int getRepairValue(int itemId)
{
return getRepairValue(itemId, false);
}
private int getRepairValue(int itemId, boolean fullValue)
{
final ItemReclaimCost b = ItemReclaimCost.of(itemId);
if (b != null)
{
if (fullValue || b.getItemID() == GRANITE_MAUL_24225 || b.getItemID() == GRANITE_MAUL_24227)
{
return b.getValue();
}
return (int) (b.getValue() * (75.0f / 100.0f));
}
return 0;
}
/**
* Look up an item's stats
* @param itemId item id

View File

@@ -369,4 +369,9 @@ public enum ItemMapping
return mapping;
}
public static boolean isMapped(int itemId)
{
return MAPPINGS.containsValue(itemId);
}
}