Consume item when putting ores onto a block.

fixes #1049
This commit is contained in:
IntegratedQuantum 2025-02-16 10:32:07 +01:00
parent c1a882c163
commit a28188de93

View File

@ -965,6 +965,15 @@ pub const RotationModes = struct {
block.typ = newBlockType;
return true;
}
pub fn canBeChangedInto(oldBlock: Block, newBlock: Block, item: main.items.ItemStack) RotationMode.CanBeChangedInto {
if(RotationMode.DefaultFunctions.canBeChangedInto(oldBlock, newBlock, item) == .no) return .no;
if(oldBlock.transparent() or oldBlock.viewThrough()) return .no;
if(!main.models.models.items[main.blocks.meshes.modelIndexStart(oldBlock)].allNeighborsOccluded) return .no;
if(oldBlock.data != 0) return .no;
if(newBlock.data != oldBlock.typ) return .no;
return .{.yes_costsItems = 1};
}
};
};