mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 02:14:32 +07:00
Added type-safe version of Item#getBase
This commit is contained in:
parent
e0f977f8a0
commit
82d08989d1
@ -238,6 +238,11 @@ public class Item {
|
||||
return (T) base;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends ItemEntry> T getBase(Class<T> clazz) {
|
||||
return (T) base;
|
||||
}
|
||||
|
||||
public boolean isBase(Class type) {
|
||||
return base.getClass().isAssignableFrom(type);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user