Skip to content

Commit

Permalink
feat: Play item pickup sound when shift r-click conduit with yeta
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 committed Oct 29, 2024
1 parent 6257e42 commit 370ba25
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,12 @@ public static void handleShiftYeta(PlayerInteractEvent.RightClickBlock event) {
if (event.getLevel() instanceof ServerLevel serverLevel) {
Inventory inventory = event.getEntity().getInventory();
inventory.placeItemBackInInventory(new ItemStack(type.getConduitItem()));

ServerPlayer player = (ServerPlayer) event.getEntity();
event.getLevel().playSound(null, event.getPos(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, 0.2f,
((player.getRandom().nextFloat() - player.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F);
}

event.setCanceled(true);
}
}
Expand Down

0 comments on commit 370ba25

Please sign in to comment.