BT silicon

Add BT silicon stuff
master
minermoder27 2014-08-26 11:46:39 +12:00
parent 24da42981b
commit f6cc195a4f
8 changed files with 47 additions and 4 deletions

27
bt silicon/chipsets.lua Normal file
View File

@ -0,0 +1,27 @@
for name, val in pairs({
mesecon = {
},
steel = {
mat = {name="default:steel_ingot", count=1},
},
gold = {
mat = {name="default:gold_ingot", count=1},
},
diamond = {
mat = {name="default:diamond", count=1},
},
}) do
minetest.register_craftitem("buildtest:chipset_"..name, {
description = name.." chipset",
inventory_image = "buildtest_chipset_"..name..".png",
})
buildtest.assembly.register_craft({
from={
{name = "mesecons:wire_00000000_off", count=1},
val.mat,
},
energy = 100,
output = {name="buildtest:gear_"..name, count=1},
})
end

1
bt silicon/init.lua Normal file
View File

@ -0,0 +1 @@
dofile(minetest.get_modpath("buildtest").."/bt silicon/chipsets.lua")

View File

@ -46,6 +46,7 @@ dofile(minetest.get_modpath("buildtest").."/support/entity.lua")
dofile(minetest.get_modpath("buildtest").."/support/liquid.lua")
dofile(minetest.get_modpath("buildtest").."/misc/init.lua")
dofile(minetest.get_modpath("buildtest").."/bt factory/init.lua")
dofile(minetest.get_modpath("buildtest").."/bt silicon/init.lua")
dofile(minetest.get_modpath("buildtest").."/crafts.lua")

View File

@ -28,6 +28,9 @@ buildtest.assembly = {
energy = 15,
},
},
register_craft = function(def)
buildtest.assembly.recipies[#buildtest.assembly.recipies+1]=def
end,
remove_items = function(inv, id)
if id==0 then return end
local rec = buildtest.assembly.recipies[buildtest.assembly.lookupId(inv, id)]
@ -71,6 +74,17 @@ buildtest.assembly = {
end
return recipies
end,
get_ids = function(inv)
local ids = {}
for i=1, #buildtest.assembly.recipies do
ids[i]=0
if buildtest.assembly.can_make(inv, i) then
local rec = buildtest.assembly.recipies[i]
ids[#ids + 1] = {id=i, rec=rec, output = rec.output}
end
end
return ids
end,
check_config = function(meta)
if buildtest.assembly.can_make_rel(meta:get_inventory(), meta:get_int("selected"))==false then
meta:set_int("selected", 0)
@ -84,7 +98,7 @@ buildtest.assembly = {
local selId = meta:get_int("selected")
if selId~=0 then
local sel = buildtest.assembly.get_recipies(inv)[selId]
local sel = buildtest.assembly.recipies[selId]--buildtest.assembly.get_recipies(inv)[selId]
if sel~=nil and sel.rec~=nil and sel.rec.energy~=nil and sel.output~=nil then
local h = 4.0 * meta:get_int("power") / sel.rec.energy
formspec = formspec .. "box[4,"..(4-h)..";0.25,"..h..";#FF0000FF]" .. "box[4,0;0.25,"..(4-h)..";#000000FF]" .. "label[4,4;"..(h*100/4).."%]"
@ -116,7 +130,7 @@ buildtest.assembly = {
local inv = meta:get_inventory()
local selId = meta:get_int("selected")
if selId~=0 then
local sel = buildtest.assembly.get_recipies(inv)[selId]
local sel = buildtest.assembly.recipies[selId]
if sel~=nil and sel.rec~=nil and sel.rec.energy~=nil and sel.output~=nil then
if meta:get_int("power") > sel.rec.energy then
local count = math.floor(meta:get_int("power") / sel.rec.energy)

View File

@ -43,7 +43,7 @@ buildtest.autocraft = {
minetest.register_node("buildtest:autocraft", {
--tiles = {"buildtest_pump_mesecon.png"},
tiles = {"buildtest_autocraft.png"},
description = "Buildtest Automatic Crafting Table",
groups = {choppy=1, oddly_breakable_by_hand=3},
paramtype = "light",

View File

@ -121,7 +121,7 @@ buildtest.pumps.send_power = function(pipepos, speed, movecount)
end
end
elseif buildtest.pumps.pumpible[minetest.get_node(pipepos).name]~=nil then
buildtest.pumps.pumpible[minetest.get_node(pipepos).name].power(pipepos, speed)
buildtest.pumps.pumpible[minetest.get_node(pipepos).name].power(pipepos, movecount, speed)
elseif strs:starts(minetest.get_node(pipepos).name, "buildtest:pipe_stripe_") then
local itemName = minetest.get_node(chestpos).name
if itemName~="air" and itemName~="ignore" then

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B