Always break the tool if it doesn't have enough durability anymore.

hot fix the all annoying tool not fully breaking problem.
While durability per swing will go away soon, this is just future proofing the implementation if we get some durability per block system (see https://github.com/PixelGuys/Cubyz/issues/1661#issuecomment-3152116782)
This commit is contained in:
IntegratedQuantum 2025-08-12 21:07:12 +02:00
parent d183c0dc25
commit c6bb2108cf

View File

@ -1718,7 +1718,7 @@ pub const Command = struct { // MARK: Command
if(!switch(costOfChange) {
.no => false,
.yes => true,
.yes_costsDurability => |durability| stack.item != null and stack.item.? == .tool and stack.item.?.tool.durability >= durability,
.yes_costsDurability => |_| stack.item != null and stack.item.? == .tool,
.yes_costsItems => |amount| stack.amount >= amount,
.yes_dropsItems => true,
}) {