forked from mrkubax10/industrialtest
Add simple item fluid storage API
This commit is contained in:
@@ -96,10 +96,11 @@ local function onGlobalStep(player,inv,itemstack,index,def)
|
||||
end
|
||||
|
||||
jetpack.tryFly=function(itemstack)
|
||||
if itemstack:get_wear()>=65533 then
|
||||
local meta=itemstack:get_meta()
|
||||
if meta:get_int("industrialtest.fluidAmount")==0 then
|
||||
return false
|
||||
end
|
||||
itemstack:set_wear(itemstack:get_wear()+2)
|
||||
industrialtest.api.addFluidToItem(itemstack,-1)
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -109,9 +110,12 @@ registerJetpack({
|
||||
displayName=S("Jetpack"),
|
||||
groups={
|
||||
_industrialtest_fueled=1,
|
||||
_industrialtest_emptyOnConstruct=1
|
||||
_industrialtest_fluidStorage=1
|
||||
},
|
||||
tryFly=jetpack.tryFly
|
||||
tryFly=jetpack.tryFly,
|
||||
customKeys={
|
||||
_industrialtest_fluidCapacity=5000
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
type="shaped",
|
||||
|
||||
Reference in New Issue
Block a user