Skip to content

Commit

Permalink
Merge pull request #31 from beholderface/main
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
miyucomics authored Nov 5, 2024
2 parents 0ce699e + d3bafa8 commit 409c4c0
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 409c4c0

Please sign in to comment.