From 4d8799019e826b33d913660619fadb687ef7b194 Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Sat, 20 Jul 2013 18:45:58 -0700 Subject: [PATCH] Simplify trigger registration --- common/buildcraft/api/gates/ActionManager.java | 8 ++++---- common/buildcraft/core/triggers/BCAction.java | 2 +- common/buildcraft/core/triggers/BCTrigger.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/buildcraft/api/gates/ActionManager.java b/common/buildcraft/api/gates/ActionManager.java index 65a806ce..26cfd2c7 100644 --- a/common/buildcraft/api/gates/ActionManager.java +++ b/common/buildcraft/api/gates/ActionManager.java @@ -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 getNeighborTriggers(Block block, TileEntity entity) { diff --git a/common/buildcraft/core/triggers/BCAction.java b/common/buildcraft/core/triggers/BCAction.java index 46bbb7a6..a407fef6 100644 --- a/common/buildcraft/core/triggers/BCAction.java +++ b/common/buildcraft/core/triggers/BCAction.java @@ -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 diff --git a/common/buildcraft/core/triggers/BCTrigger.java b/common/buildcraft/core/triggers/BCTrigger.java index 6af811f9..ecaec208 100644 --- a/common/buildcraft/core/triggers/BCTrigger.java +++ b/common/buildcraft/core/triggers/BCTrigger.java @@ -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