forked from mrkubax10/industrialtest
Refactor Mining Laser
This commit is contained in:
@@ -46,6 +46,13 @@ end
|
||||
function industrialtest.ElectricTool.onUse(self,itemstack,user,pointed)
|
||||
self:prepare(itemstack)
|
||||
|
||||
if user:is_player() then
|
||||
local controls=user:get_player_control()
|
||||
if controls.sneak and self:changeMode(itemstack) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local meta=itemstack:get_meta()
|
||||
local opPower=self:getOpPower(itemstack)
|
||||
if meta:get_int("industrialtest.powerAmount")<opPower then
|
||||
@@ -58,6 +65,11 @@ function industrialtest.ElectricTool.onUse(self,itemstack,user,pointed)
|
||||
return true
|
||||
end
|
||||
|
||||
function industrialtest.ElectricTool.changeMode(self,itemstack)
|
||||
-- dummy function
|
||||
return false
|
||||
end
|
||||
|
||||
function industrialtest.ElectricTool.getOpPower(self,itemstack)
|
||||
-- dummy function
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user