Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class ManagerBase<T>
- {
- protected HashMap<EntityPlayer, T> values = new HashMap<EntityPlayer, T>();
- public void setToPlayer(EntityPlayer p, T value)
- {
- values.put(p, value);
- }
- public T getFromPlayer(EntityPlayer p)
- {
- if(!values.containsKey(p))
- {
- setToPlayer(p, getDefoultValue());
- }
- return values.get(p);
- }
- protected abstract T getDefoultValue();
- }
Advertisement
Add Comment
Please, Sign In to add comment