Skip to content

Commit aae80d3

Browse files
committed
fix crash if modules disabled when swinging 💀
1 parent 3421d02 commit aae80d3

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

common/src/main/java/com/lambda/mixin/entity/ClientPlayerEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private void adjustSwing(AbstractClientPlayerEntity instance, Hand hand) {
159159
ViewModel viewModel = ViewModel.INSTANCE;
160160

161161
if (!viewModel.isEnabled()) {
162-
instance.swingHand(hand);
162+
instance.swingHand(hand, false);
163163
return;
164164
}
165165

common/src/main/kotlin/com/lambda/module/modules/render/ViewModel.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,8 @@ object ViewModel : Module(
214214
when (swingMode) {
215215
SwingMode.Standard -> swingHand(hand, player)
216216
SwingMode.Opposites -> {
217-
if (hand == Hand.MAIN_HAND)
218-
swingHand(Hand.OFF_HAND, player)
219-
else
220-
swingHand(Hand.MAIN_HAND, player)
217+
if (hand == Hand.MAIN_HAND) swingHand(Hand.OFF_HAND, player)
218+
else swingHand(Hand.MAIN_HAND, player)
221219
}
222220
SwingMode.MainHand -> swingHand(Hand.MAIN_HAND, player)
223221
SwingMode.OffHand -> swingHand(Hand.OFF_HAND, player)

0 commit comments

Comments
 (0)