Skip to content

Commit

Permalink
fix: NoClassDefError and ClassNotFoundException when Velocitab is not…
Browse files Browse the repository at this point in the history
… installed
  • Loading branch information
Syrent committed Feb 8, 2024
1 parent a9fcce5 commit b80de9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class VelocityVanish @Inject constructor(
lateinit var bridgeManager: VelocityBridgeManager
private set

var velocitabHook: VelocitabHook? = null

/*
* Note: This is not the best way to do this, but for time being it's fine.
* TODO: Create a VanishedPlayer object with serializer and deserializer.
Expand All @@ -51,9 +49,9 @@ class VelocityVanish @Inject constructor(
instance = this

try {
velocitabHook = VelocitabHook()
VelocitabAPI.getInstance().vanishIntegration = velocitabHook
VelocitabAPI.getInstance().vanishIntegration = VelocitabHook()
} catch (_: ClassNotFoundException) { }
catch (_: NoClassDefFoundError) { }

initializeMessagingChannels()
initializeListeners()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class VelocityBridgeManager(
try {
VelocitabAPI.getInstance().vanishPlayer(player)
VelocitabAPI.getInstance().tabList.updateDisplayNames()
} catch (_: NoClassDefFoundError) {}
} catch (_: ClassNotFoundException) {}
catch (_: NoClassDefFoundError) { }
}
VRuom.getServer().eventManager.fire(VelocityVanishEvent(player, name))
} else {
Expand All @@ -76,7 +77,8 @@ class VelocityBridgeManager(
if (player != null) {
try {
VelocitabAPI.getInstance().unVanishPlayer(player)
} catch (_: NoClassDefFoundError) {}
} catch (_: ClassNotFoundException) {}
catch (_: NoClassDefFoundError) { }
}
VRuom.getServer().eventManager.fire(VelocityUnVanishEvent(player, name))
}
Expand Down

0 comments on commit b80de9a

Please sign in to comment.