Skip to content

Commit

Permalink
Update CastingUtils.kt
Browse files Browse the repository at this point in the history
Make special casting things cast from the off hand if it is empty and the main hand is not
  • Loading branch information
beholderface committed Nov 5, 2024
1 parent 0ce699e commit d3bafa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/miyucomics/hexical/utils/CastingUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ object CastingUtils {

@JvmStatic
fun castSpecial(world: ServerWorld, user: ServerPlayerEntity, hex: List<Iota>, source: SpecializedSource, finale: Boolean): CastingHarness {
val harness = IXplatAbstractions.INSTANCE.getHarness(user, Hand.MAIN_HAND)
val hand = if(!user.getStackInHand(Hand.MAIN_HAND).isEmpty && user.getStackInHand(Hand.OFF_HAND).isEmpty){
Hand.OFF_HAND
} else {
Hand.MAIN_HAND
}
val harness = IXplatAbstractions.INSTANCE.getHarness(user, hand)
(harness.ctx as CastingContextMinterface).setSpecializedSource(source)
(harness.ctx as CastingContextMinterface).setFinale(finale)
harness.stack = mutableListOf()
Expand Down

0 comments on commit d3bafa8

Please sign in to comment.