Skip to content

Commit

Permalink
Actually use the booleans associated with the Sliding enums
Browse files Browse the repository at this point in the history
  • Loading branch information
floral-qua-floral committed Oct 19, 2024
1 parent c78fb7f commit 9b8c03a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/floralquafloral/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ private void preventGettingSneakPose(CallbackInfoReturnable<EntityPose> cir) {
private void preventStepSounds(BlockPos pos, BlockState state, CallbackInfo ci) {
if(((Entity) (Object) this) instanceof PlayerEntity player) {
MarioData data = MarioDataManager.getMarioData(player);
ActionDefinition.IsSlidingOption isSliding = data.getAction().isSliding(data);
if(isSliding != NOT_SLIDING && isSliding != NOT_SLIDING_SMOOTH)
if(!data.getAction().isSliding(data).doFootsteps())
ci.cancel();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public abstract class GameOptionsMixin {
@Inject(method = "getBobView", at = @At("HEAD"), cancellable = true)
public void preventViewBobbing(CallbackInfoReturnable<SimpleOption<Boolean>> cir) {
MarioClientData data = MarioClientData.getInstance();
if(data != null && data.getAction().isSliding(data) != ActionDefinition.IsSlidingOption.NOT_SLIDING)
if(data != null && !data.getAction().isSliding(data).doViewBobbing())
cir.setReturnValue(MarioQuaMarioClient.ALWAYS_FALSE);
}
}

0 comments on commit 9b8c03a

Please sign in to comment.