Change getValue to use generics so I don't have to cast
This commit is contained in:
parent
7d0175c563
commit
696f952c4e
@ -177,10 +177,10 @@ public class FlagWatcher {
|
|||||||
return getItemStack(slot.getSlot());
|
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))
|
if (entityValues.containsKey(no))
|
||||||
return entityValues.get(no);
|
return (T) entityValues.get(no);
|
||||||
return backup;
|
return (T) backup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<WrappedWatchableObject> getWatchableObjects() {
|
public List<WrappedWatchableObject> getWatchableObjects() {
|
||||||
|
Loading…
Reference in New Issue
Block a user