Simplify trigger registration
This commit is contained in:
parent
66bc9914ae
commit
4d8799019e
3 changed files with 6 additions and 6 deletions
|
@ -20,12 +20,12 @@ public class ActionManager {
|
|||
}
|
||||
}
|
||||
|
||||
public static void registerTrigger(String uniqueTag, ITrigger trigger){
|
||||
triggers.put(uniqueTag, trigger);
|
||||
public static void registerTrigger(ITrigger trigger){
|
||||
triggers.put(trigger.getUniqueTag(), trigger);
|
||||
}
|
||||
|
||||
public static void registerAction(String uniqueTag, IAction action){
|
||||
actions.put(uniqueTag, action);
|
||||
public static void registerAction(IAction action){
|
||||
actions.put(action.getUniqueTag(), action);
|
||||
}
|
||||
|
||||
public static LinkedList<ITrigger> getNeighborTriggers(Block block, TileEntity entity) {
|
||||
|
|
|
@ -22,7 +22,7 @@ public abstract class BCAction implements IAction {
|
|||
public BCAction(int legacyId, String uniqueTag) {
|
||||
this.legacyId = legacyId;
|
||||
this.uniqueTag = uniqueTag;
|
||||
ActionManager.registerAction(uniqueTag, this);
|
||||
ActionManager.registerAction(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -31,7 +31,7 @@ public abstract class BCTrigger implements ITrigger {
|
|||
public BCTrigger(int legacyId, String uniqueTag) {
|
||||
this.legacyId = legacyId;
|
||||
this.uniqueTag = uniqueTag;
|
||||
ActionManager.registerTrigger(uniqueTag, this);
|
||||
ActionManager.registerTrigger(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue