Compare commits

...

2 commits

Author SHA1 Message Date
ae1e7a404f bump version to 2.9 2023-02-12 17:56:35 +01:00
83a9b9fdaf fix: wands not breaking when out of durability 2023-02-12 17:49:17 +01:00
2 changed files with 3 additions and 3 deletions

View file

@ -15,4 +15,4 @@ botania=1.18.2-430-SNAPSHOT
jei_version=jei-1.18.2:9.5.0.132
version_major=2
version_minor=7
version_minor=9

View file

@ -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;
@ -99,7 +99,7 @@ public class WandJob
// 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: " +