aboutsummaryrefslogtreecommitdiff
path: root/featureClass/class.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 14:14:06 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-29 14:14:06 +0800
commitf3d0044dfe720e5e52d338ffc7f4efec7e780cb2 (patch)
tree4cecb863df5e703ca58cd943f3c54c0544b1498a /featureClass/class.js
parentde27cdebfec9fafae6f686090039758d892196d7 (diff)
parent9ec9aa2d495df5a6c48b8edbd5fe31052d20b37b (diff)
downloadSoopyV2-f3d0044dfe720e5e52d338ffc7f4efec7e780cb2.tar.gz
SoopyV2-f3d0044dfe720e5e52d338ffc7f4efec7e780cb2.tar.bz2
SoopyV2-f3d0044dfe720e5e52d338ffc7f4efec7e780cb2.zip
Merge branch 'master' of https://github.com/Soopyboo32/SoopyV2
Diffstat (limited to 'featureClass/class.js')
-rw-r--r--featureClass/class.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/featureClass/class.js b/featureClass/class.js
index d595e4b..b8a17d9 100644
--- a/featureClass/class.js
+++ b/featureClass/class.js
@@ -79,17 +79,16 @@ class Feature {
delete this.soopyEvents[event.id]
}
- registerForge(event, func, messageIfError) {
+ registerForge(event, func, priority) {
let theEvent
try {
- theEvent = this.FeatureManager.registerForge(event, func, this)
- } catch (e) { //TODO: option to disable this chat message + fallback register for some that support (eg fallback of RenderWorldLastEvent to ct 'renderWorld')
- if (!messageIfError) messageIfError = "An error occured while registering the event " + event.class.toString().split(".").pop() + ", this may cause " + this.constructor.name + " to not work properly."
- ChatLib.chat(this.FeatureManager.messagePrefix + messageIfError)
+ theEvent = this.FeatureManager.registerForge(event, func, priority, this)
+ } catch (e) {
+ ChatLib.chat(this.FeatureManager.messagePrefix + "An error occured while registering the event " + event.class.toString().split(".").pop() + ", this may cause " + this.constructor.name + " to not work properly.")
}
if (theEvent) this.forgeEvents[theEvent.id] = theEvent
- return new ForgeEvent(theEvent, theEvent.trigger, [event, func, messageIfError], this)
+ return new ForgeEvent(theEvent, theEvent.trigger, [event, func, priority], this)
}
unregisterForge(event) {