forked from mrkubax10/industrialtest
Make it possible to make stripped trunks with chainsaw
This commit is contained in:
11
tools.lua
11
tools.lua
@@ -216,6 +216,17 @@ local function registerElectricChainsaw(config)
|
||||
definition.groups={
|
||||
dig_speed_class=config.digSpeedClass,
|
||||
}
|
||||
definition.on_place=function(itemstack,user,pointed)
|
||||
local meta=itemstack:get_meta()
|
||||
if meta:get_int("industrialtest.powerAmount")>=20 then
|
||||
local itemstackCopy=itemstack
|
||||
if itemstack:get_wear()~=industrialtest.internal.mclMakeStrippedTrunk(itemstackCopy,user,pointed,true):get_wear() then
|
||||
industrialtest.api.addPowerToItem(itemstack,-20)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
definition.after_use=function(itemstack)
|
||||
-- Hack to make sure that chainsaw won't be destroyed when has 0 EU in MCL
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user