Skip to content

Commit

Permalink
[Fabric] Fix left click air firing on wrong hand
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Jul 6, 2020
1 parent 9b4bfbe commit f4c4406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private ActionResult onLeftClickBlock(PlayerEntity playerEntity, World world, Ha
return ActionResult.PASS;
}

public void onLeftClickAir(PlayerEntity playerEntity, World world, Hand hand) {
public void onLeftClickAir(PlayerEntity playerEntity) {
WorldEdit we = WorldEdit.getInstance();
FabricPlayer player = adaptPlayer((ServerPlayerEntity) playerEntity);
we.handleArmSwing(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public MixinServerPlayerEntity(World world, BlockPos blockPos, GameProfile gameP

@Inject(method = "swingHand", at = @At(value = "HEAD"))
public void onSwing(Hand hand, @SuppressWarnings("unused") CallbackInfo callbackInfo) {
FabricWorldEdit.inst.onLeftClickAir(this, this.world, hand);
if (hand == Hand.MAIN_HAND) {
FabricWorldEdit.inst.onLeftClickAir(this);
}
}

@Inject(method = "setClientSettings", at = @At(value = "HEAD"))
Expand Down

0 comments on commit f4c4406

Please sign in to comment.