Skip to content

Commit

Permalink
made crowbars put covers directly into the player's inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 19, 2023
1 parent 920310c commit 4faa0cd
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ public boolean removeCover(Player player, Direction side, boolean onlyRemove) {
return false;
if (get(side).isEmpty() || !set(side, ICover.empty, !onlyRemove))
return false;
if (!onlyRemove && !player.isCreative())
player.drop(oldCover.getDroppedStack(), false);
if (!onlyRemove && !player.isCreative()) {
ItemStack dropped = oldCover.getDroppedStack();
if (!player.addItem(dropped)) {
player.drop(dropped, false);
}
}
if (Utils.getToolType(player) != WRENCH && Utils.getToolType(player) != ELECTRIC_WRENCH) {
player.getLevel().playSound(null, tile.getBlockPos(), SoundEvents.ITEM_BREAK, SoundSource.BLOCKS, 1.0f, 1.0f);
} else {
Expand Down

0 comments on commit 4faa0cd

Please sign in to comment.