Skip to content

Commit

Permalink
Move itemStack into variable
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasebtw committed Oct 11, 2024
1 parent 5b10dc9 commit 32160f1
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ public MixinSwordItem(ToolMaterial material, Settings settings) {
@Override
public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
if (ProtocolTranslator.getTargetVersion().betweenInclusive(LegacyProtocolVersion.b1_8tob1_8_1, ProtocolVersion.v1_8)) {
ItemStack itemStack = user.getStackInHand(hand);
user.setCurrentHand(hand);
return TypedActionResult.success(user.getStackInHand(hand));
return TypedActionResult.success(itemStack);
} else {
return super.use(world, user, hand);
}
Expand Down

0 comments on commit 32160f1

Please sign in to comment.