classpublicabstractPriority 3
ParameterStore
com.hypixel.hytale.server.npc.storage.ParameterStore
1
Methods
1
Public Methods
0
Fields
1
Constructors
Constructors
protected
ParameterStore()Methods
Public Methods (1)
public
Type get(Entity owner, String name)Inheritance
Parent
Current
Interface
Child
Use mouse wheel to zoom, drag to pan. Click nodes to navigate.
Related Classes
Used By
Source Code
package com.hypixel.hytale.server.npc.storage;
import com.hypixel.hytale.server.core.entity.Entity;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Nonnull;
public abstract class ParameterStore<Type extends PersistentParameter<?>> {
protected Map<String, Type> parameters = new HashMap<>();
protected ParameterStore() {
}
public Type get(@Nonnull Entity owner, String name) {
Type parameter = this.parameters.get(name);
if (parameter == null) {
parameter = this.createParameter();
this.parameters.put(name, parameter);
owner.markNeedsSave();
}
return parameter;
}
protected abstract Type createParameter();
}