Change getValue to use generics so I don't have to cast

This commit is contained in:
libraryaddict 2014-07-14 12:22:06 +12:00
parent 7d0175c563
commit 696f952c4e

View File

@ -177,10 +177,10 @@ public class FlagWatcher {
return getItemStack(slot.getSlot());
}
protected Object getValue(int no, Object backup) {
protected <T extends Object> T getValue(int no, Object backup) {
if (entityValues.containsKey(no))
return entityValues.get(no);
return backup;
return (T) entityValues.get(no);
return (T) backup;
}
public List<WrappedWatchableObject> getWatchableObjects() {