Skip to content

Commit

Permalink
fix: wands not breaking when out of durability
Browse files Browse the repository at this point in the history
  • Loading branch information
Theta-Dev committed Feb 12, 2023
1 parent 91c6901 commit c53845c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/thetadev/constructionwand/wand/WandJob.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package thetadev.constructionwand.wand;

import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
Expand Down Expand Up @@ -99,7 +99,7 @@ public boolean doIt() {
// If the item cant be taken, undo the placement
if(wandSupplier.takeItemStack(snapshot.getRequiredItems()) == 0) {
executed.add(snapshot);
wand.hurt(1, player.getRandom(), (ServerPlayer) player);
wand.hurtAndBreak(1, player, e -> e.broadcastBreakEvent(InteractionHand.MAIN_HAND));
}
else {
ConstructionWand.LOGGER.info("Item could not be taken. Remove block: " +
Expand Down

0 comments on commit c53845c

Please sign in to comment.