aboutsummaryrefslogtreecommitdiff
path: root/featureClass
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
commitfe3449248bb556779fc1ef8ee216efeda43e8592 (patch)
treec96fe6a66e8f9ea7a519e1027572b3d8ae53e331 /featureClass
parenta0158cef8a59537145286ad96fd3daafc5238cf8 (diff)
downloadSoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.gz
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.bz2
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.zip
add error handling to registering forge event, and other fixes and cleanups
Diffstat (limited to 'featureClass')
-rw-r--r--featureClass/class.js10
-rw-r--r--featureClass/featureManager.js12
2 files changed, 9 insertions, 13 deletions
diff --git a/featureClass/class.js b/featureClass/class.js
index c796b28..13ddf81 100644
--- a/featureClass/class.js
+++ b/featureClass/class.js
@@ -72,10 +72,16 @@ class Feature {
delete this.soopyEvents[event.id]
}
- registerForge(event, func){
- let theEvent = this.FeatureManager.registerForge(event, func, this)
+ registerForge(event, func, messageIfError){
+ let theEvent
+ try{
+ theEvent = this.FeatureManager.registerForge(event, func, this)
this.forgeEvents[theEvent.id] = theEvent
+ }catch(e){
+ if(!messageIfError) messageIfError = "An error occured while registering the event " + event.toString() + ", this may cause " + this.constructor.name + " to not work properly."
+ ChatLib.chat(this.FeatureManager.messagePrefix + messageIfError)
+ }
return theEvent
}
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js
index 70c2cc6..2502b02 100644
--- a/featureClass/featureManager.js
+++ b/featureClass/featureManager.js
@@ -585,14 +585,4 @@ if(!global.soopyv2featuremanagerthing){
global.soopyv2featuremanagerthing = undefined
})
}
-export default global.soopyv2featuremanagerthing
-
-
-function getField(e, field){
-
- let field2 = e.class.getDeclaredField(field);
-
- field2.setAccessible(true)
-
- return field2.get(e)
-} \ No newline at end of file
+export default global.soopyv2featuremanagerthing \ No newline at end of file