Skip to content

Commit 5e967d5

Browse files
committed
Add type hint in mod-name to prevent reflection from loading client method on server (fix #2)
1 parent 9737367 commit 5e967d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/src/main/clojure/gay/object/caduceus/utils/continuation.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(at.petrak.hexcasting.api.casting.eval.vm SpellContinuation SpellContinuation$Done SpellContinuation$NotDone)
66
(at.petrak.hexcasting.api.casting.iota IotaType NullIota)
77
(at.petrak.hexcasting.common.lib.hex HexContinuationTypes HexIotaTypes)
8-
(dev.architectury.platform Platform)))
8+
(dev.architectury.platform Mod Platform)))
99

1010
(defn done? [cont]
1111
(instance? SpellContinuation$Done cont))
@@ -97,7 +97,7 @@
9797

9898
(defn- mod-name [id]
9999
(if-let [mod (-> id Platform/getOptionalMod (.orElse nil))]
100-
(.getName mod)
100+
(.getName ^Mod mod) ; type hint is required to prevent reflection from loading client method on server
101101
(as-> id v
102102
(str/split v #"_")
103103
(map str/capitalize v)

0 commit comments

Comments
 (0)