File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
Common/src/main/kotlin/gay/object/hexdebug
Core/Common/src/main/java/gay/object/hexdebug/core/api Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import java.util.*
1111object DebugAdapterManager {
1212 private val debugAdapters = mutableMapOf<UUID , DebugAdapter >()
1313
14+ operator fun get (playerUUID : UUID ) = debugAdapters[playerUUID]
15+
1416 operator fun get (player : Player ) = debugAdapters[player.uuid]
1517
1618 operator fun get (env : CastingEnvironment ) = env.castingEntity?.let { it as ? Player }?.let { get(it) }
Original file line number Diff line number Diff line change @@ -19,12 +19,12 @@ class HexDebugCoreAPIImpl : HexDebugCoreAPI {
1919 return (env as IDebugEnvAccessor ).`debugEnv$hexdebug`
2020 }
2121
22- override fun getDebugEnv (caster : ServerPlayer , sessionId : UUID ): DebugEnvironment ? {
23- return DebugAdapterManager [caster ]?.debugger(sessionId)?.debugEnv
22+ override fun getDebugEnv (casterId : UUID , sessionId : UUID ): DebugEnvironment ? {
23+ return DebugAdapterManager [casterId ]?.debugger(sessionId)?.debugEnv
2424 }
2525
26- override fun getDebugEnv (caster : ServerPlayer , threadId : Int ): DebugEnvironment ? {
27- return DebugAdapterManager [caster ]?.debugger(threadId)?.debugEnv
26+ override fun getDebugEnv (casterId : UUID , threadId : Int ): DebugEnvironment ? {
27+ return DebugAdapterManager [casterId ]?.debugger(threadId)?.debugEnv
2828 }
2929
3030 override fun createDebugThread (debugEnv : DebugEnvironment , threadId : Int? ) {
Original file line number Diff line number Diff line change @@ -34,13 +34,13 @@ default DebugEnvironment getDebugEnv(@NotNull CastingEnvironment env) {
3434
3535 @ Contract (pure = true )
3636 @ Nullable
37- default DebugEnvironment getDebugEnv (@ NotNull ServerPlayer caster , @ NotNull UUID sessionId ) {
37+ default DebugEnvironment getDebugEnv (@ NotNull UUID casterId , @ NotNull UUID sessionId ) {
3838 return null ;
3939 }
4040
4141 @ Contract (pure = true )
4242 @ Nullable
43- default DebugEnvironment getDebugEnv (@ NotNull ServerPlayer caster , int threadId ) {
43+ default DebugEnvironment getDebugEnv (@ NotNull UUID casterId , int threadId ) {
4444 return null ;
4545 }
4646
@@ -89,6 +89,18 @@ default void printDebugMessage(
8989
9090 // implemented methods
9191
92+ @ Contract (pure = true )
93+ @ Nullable
94+ default DebugEnvironment getDebugEnv (@ NotNull ServerPlayer caster , @ NotNull UUID sessionId ) {
95+ return getDebugEnv (caster .getUUID (), sessionId );
96+ }
97+
98+ @ Contract (pure = true )
99+ @ Nullable
100+ default DebugEnvironment getDebugEnv (@ NotNull ServerPlayer caster , int threadId ) {
101+ return getDebugEnv (caster .getUUID (), threadId );
102+ }
103+
92104 @ Contract (pure = true )
93105 default boolean isSessionDebugging (@ NotNull DebugEnvironment debugEnv ) {
94106 return getDebugEnv (debugEnv .getCaster (), debugEnv .getSessionId ()) != null ;
You can’t perform that action at this time.
0 commit comments