Skip to content

Commit

Permalink
Feat: spirit GUIs can be opened while holding item
Browse files Browse the repository at this point in the history
(klikli-dev#1155, Item 5)
  • Loading branch information
ThePixelatedCat committed Feb 6, 2025
1 parent ad4a204 commit cdec2ab
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,11 @@ public void remove(RemovalReason reason) {

@Override
public InteractionResult interactAt(Player player, Vec3 vec, InteractionHand hand) {
ItemStack itemStack = player.getItemInHand(hand);

if (itemStack.isEmpty()) {
if (this.isTame() && player.isShiftKeyDown()) {
this.openScreen(player);
return InteractionResult.SUCCESS;
}
if (this.isTame() && player.isShiftKeyDown()) {
this.openScreen(player);
return InteractionResult.SUCCESS;
}

return super.interactAt(player, vec, hand);
}

Expand Down

0 comments on commit cdec2ab

Please sign in to comment.