fix the beds
|
@ -1 +1,2 @@
|
|||
core
|
||||
farming
|
||||
|
|
|
@ -74,57 +74,297 @@ atvomat.logger_control["cherry"] = {"core:cherry_log", "core:cherry_leaves", "co
|
|||
|
||||
-- sorting control card for sorting blocks, format: "name:ingot", "etc", "etc", "etc"
|
||||
|
||||
atvomat.ingot_sort = {
|
||||
-- will migrate these to a format which can be paired over instead of ipairs.
|
||||
|
||||
"core:iron_ingot",
|
||||
"core:copper_ingot",
|
||||
"core:ironze_ingot",
|
||||
"core:gold_ingot",
|
||||
"core:silver_ingot",
|
||||
"core:mese_crystal",
|
||||
"core:diamond"
|
||||
-- actually, consider the following
|
||||
|
||||
}
|
||||
-- atvomat.itemtype_sort["item:name"] = ""
|
||||
|
||||
atvomat.ingot_block_sort = {
|
||||
atvomat.ingot_sort = {} -- register ingots and gems
|
||||
|
||||
"core:iron_block",
|
||||
"core:copper_block",
|
||||
"core:ironze_block",
|
||||
"core:gold_block",
|
||||
"core:silver_block",
|
||||
"core:mese",
|
||||
"core:diamond_block",
|
||||
atvomat.ingot_sort["core:iron_ingot"] = ""
|
||||
atvomat.ingot_sort["core:copper_ingot"] = ""
|
||||
atvomat.ingot_sort["core:ironze_ingot"] = ""
|
||||
atvomat.ingot_sort["core:gold_ingot"] = ""
|
||||
atvomat.ingot_sort["core:silver_ingot"] = ""
|
||||
atvomat.ingot_sort["core:mese_crystal"] = ""
|
||||
atvomat.ingot_sort["core:diamond"] = ""
|
||||
|
||||
}
|
||||
atvomat.ingot_block_sort = {} -- register ingot and gem blocks
|
||||
|
||||
atvomat.ore_sort = {
|
||||
atvomat.ingot_block_sort["core:iron_block"] = ""
|
||||
atvomat.ingot_block_sort["core:copper_block"] = ""
|
||||
atvomat.ingot_block_sort["core:ironze_block"] = ""
|
||||
atvomat.ingot_block_sort["core:gold_block"] = ""
|
||||
atvomat.ingot_block_sort["core:silver_block"] = ""
|
||||
atvomat.ingot_block_sort["core:mese"] = ""
|
||||
atvomat.ingot_block_sort["core:diamond_block"] = ""
|
||||
|
||||
"core:iron_ore",
|
||||
"core:copper_ore",
|
||||
"core:gold_ore",
|
||||
"core:silver_ore",
|
||||
"core:mese_ore",
|
||||
"core:diamond_ore",
|
||||
atvomat.ore_sort = {} -- register ores
|
||||
|
||||
}
|
||||
atvomat.ore_sort["core:iron_ore"] = ""
|
||||
atvomat.ore_sort["core:copper_ore"] = ""
|
||||
atvomat.ore_sort["core:gold_ore"] = ""
|
||||
atvomat.ore_sort["core:silver_ore"] = ""
|
||||
atvomat.ore_sort["core:mese_ore"] = ""
|
||||
atvomat.ore_sort["core:diamond_ore"] = ""
|
||||
atvomat.ore_sort["core:coal_ore"] = ""
|
||||
|
||||
atvomat.dye_sort = {
|
||||
atvomat.dye_sort = {} -- register dyes
|
||||
|
||||
"dye:red",
|
||||
"dye:orange",
|
||||
"dye:yellow",
|
||||
"dye:lime",
|
||||
"dye:green",
|
||||
"dye:dark_green",
|
||||
"dye:cyan",
|
||||
"dye:blue",
|
||||
"dye:magenta",
|
||||
"dye:purple",
|
||||
"dye:violet",
|
||||
"dye:white",
|
||||
"dye:light_grey",
|
||||
"dye:grey",
|
||||
"dye:black",
|
||||
atvomat.dye_sort["dye:red"] = ""
|
||||
atvomat.dye_sort["dye:orange"] = ""
|
||||
atvomat.dye_sort["dye:yellow"] = ""
|
||||
atvomat.dye_sort["dye:lime"] = ""
|
||||
atvomat.dye_sort["dye:green"] = ""
|
||||
atvomat.dye_sort["dye:dark_green"] = ""
|
||||
atvomat.dye_sort["dye:cyan"] = ""
|
||||
atvomat.dye_sort["dye:blue"] = ""
|
||||
atvomat.dye_sort["dye:brown"] = ""
|
||||
atvomat.dye_sort["dye:magenta"] = ""
|
||||
atvomat.dye_sort["dye:purple"] = ""
|
||||
atvomat.dye_sort["dye:violet"] = ""
|
||||
atvomat.dye_sort["dye:white"] = ""
|
||||
atvomat.dye_sort["dye:light_grey"] = ""
|
||||
atvomat.dye_sort["dye:grey"] = ""
|
||||
atvomat.dye_sort["dye:black"] = ""
|
||||
|
||||
}
|
||||
atvomat.wood_sort = {} -- register logs, planks, leaves and saplings
|
||||
|
||||
atvomat.wood_sort["core:oak_log"] = ""
|
||||
atvomat.wood_sort["core:oak_log_grassy"] = ""
|
||||
atvomat.wood_sort["core:oak_leaves"] = ""
|
||||
atvomat.wood_sort["core:oak_planks"] = ""
|
||||
atvomat.wood_sort["core:oak_sapling"] = ""
|
||||
|
||||
atvomat.wood_sort["core:pine_log"] = ""
|
||||
atvomat.wood_sort["core:pine_log_grassy"] = ""
|
||||
atvomat.wood_sort["core:pine_needles"] = ""
|
||||
atvomat.wood_sort["core:pine_needles_snowy"] = ""
|
||||
atvomat.wood_sort["core:pine_planks"] = ""
|
||||
atvomat.wood_sort["core:pine_sapling"] = ""
|
||||
|
||||
atvomat.wood_sort["core:cherry_log"] = ""
|
||||
atvomat.wood_sort["core:cherry_log_grassy"] = ""
|
||||
atvomat.wood_sort["core:cherry_leaves"] = ""
|
||||
atvomat.wood_sort["core:cherry_planks"] = ""
|
||||
atvomat.wood_sort["core:cherry_sapling"] = ""
|
||||
atvomat.wood_sort["core:fallen_cherry_leaves"] = ""
|
||||
|
||||
atvomat.wood_sort["core:birch_log"] = ""
|
||||
atvomat.wood_sort["core:birch_log_grassy"] = ""
|
||||
atvomat.wood_sort["core:birch_leaves"] = ""
|
||||
atvomat.wood_sort["core:birch_sapling"] = ""
|
||||
atvomat.wood_sort["core:birch_planks"] = ""
|
||||
|
||||
atvomat.farm_sort = {} -- register food, seeds, and plant matter
|
||||
|
||||
atvomat.farm_sort["farming:cocoa_beans"] = ""
|
||||
atvomat.farm_sort["farming:cookie"] = ""
|
||||
atvomat.farm_sort["farming:chocolate_dark"] = ""
|
||||
atvomat.farm_sort["farming:coffee_beans"] = ""
|
||||
atvomat.farm_sort["farming:drinking_cup"] = ""
|
||||
atvomat.farm_sort["farming:coffee_cup"] = ""
|
||||
atvomat.farm_sort["farming:coffee_cup_hot"] = ""
|
||||
atvomat.farm_sort["farming:corn"] = ""
|
||||
atvomat.farm_sort["farming:corn_cob"] = ""
|
||||
atvomat.farm_sort["farming:bottle_ethanol"] = ""
|
||||
atvomat.farm_sort["farming:seed_cotton"] = ""
|
||||
atvomat.farm_sort["farming:cotton"] = ""
|
||||
atvomat.farm_sort["farming:string"] = ""
|
||||
atvomat.farm_sort["farming:cucumber"] = ""
|
||||
atvomat.farm_sort["farming:donut"] = ""
|
||||
atvomat.farm_sort["farming:donut_chocolate"] = ""
|
||||
atvomat.farm_sort["farming:donut_apple"] = ""
|
||||
atvomat.farm_sort["farming:grapes"] = ""
|
||||
atvomat.farm_sort["farming:trellis"] = ""
|
||||
atvomat.farm_sort["farming:melon_slice"] = ""
|
||||
atvomat.farm_sort["farming:melon_8"] = ""
|
||||
atvomat.farm_sort["farming:potato"] = ""
|
||||
atvomat.farm_sort["farming:baked_potato"] = ""
|
||||
atvomat.farm_sort["farming:pumpkin"] = ""
|
||||
atvomat.farm_sort["farming:pumpkin_slice"] = ""
|
||||
atvomat.farm_sort["farming:jackolantern"] = ""
|
||||
atvomat.farm_sort["farming:pumpkin_bread"] = ""
|
||||
atvomat.farm_sort["farming:pumpkin_dough"] = ""
|
||||
atvomat.farm_sort["farming:raspberries"] = ""
|
||||
atvomat.farm_sort["farming:smoothie_raspberry"] = ""
|
||||
atvomat.farm_sort["farming:rhubarb"] = ""
|
||||
atvomat.farm_sort["farming:rhubarb_pie"] = ""
|
||||
atvomat.farm_sort["farming:sugar"] = ""
|
||||
atvomat.farm_sort["core:papyrus"] = ""
|
||||
atvomat.farm_sort["core:cactus"] = ""
|
||||
atvomat.farm_sort["farming:carrot"] = ""
|
||||
atvomat.farm_sort["farming:carrot_gold"] = ""
|
||||
atvomat.farm_sort["farming:blueberries"] = ""
|
||||
atvomat.farm_sort["farming:muffin_blueberry"] = ""
|
||||
atvomat.farm_sort["farming:beans"] = ""
|
||||
atvomat.farm_sort["farming:beanpole"] = ""
|
||||
atvomat.farm_sort["farming:seed_barley"] = ""
|
||||
atvomat.farm_sort["farming:barley"] = ""
|
||||
atvomat.farm_sort["farming:flour"] = ""
|
||||
atvomat.farm_sort["farming:seed_wheat"] = ""
|
||||
atvomat.farm_sort["farming:wheat"] = ""
|
||||
atvomat.farm_sort["farming:straw"] = ""
|
||||
atvomat.farm_sort["farming:flour"] = ""
|
||||
atvomat.farm_sort["farming:bread"] = ""
|
||||
atvomat.farm_sort["farming:toast"] = ""
|
||||
atvomat.farm_sort["farming:tomato"] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
-- atvomat.farm_sort[""] = ""
|
||||
|
||||
atvomat.tool_sort = {} -- todo, write a function that gets all registered tools except hands.
|
||||
|
||||
atvomat.fuel_sort = {} -- todo, write a small function worth a million dollars to add burntime items to the list.
|
||||
|
||||
-- functions to fill tool_sort and fuel_sort:
|
||||
|
||||
local function find_fuel_items()
|
||||
|
||||
for k, v in pairs(minetest.registered_items) do
|
||||
|
||||
local burntime = minetest.get_craft_result({method = "fuel", width = 1, items = {ItemStack(k)}}).time
|
||||
|
||||
if burntime == 0 then
|
||||
|
||||
-- do shit all, we want the name of the item and making sure it has a goddamn burntime that isn't 0.
|
||||
|
||||
else
|
||||
|
||||
atvomat.fuel_sort[k] = ""
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.after(1, find_fuel_items)
|
||||
|
||||
local function find_tools()
|
||||
|
||||
for k, v in pairs(minetest.registered_items) do
|
||||
|
||||
local itemtype = minetest.registered_items[k].type
|
||||
|
||||
if itemtype == "tool" then
|
||||
|
||||
atvomat.tool_sort[k] = ""
|
||||
|
||||
else
|
||||
|
||||
--bugger off, type returns item or node for anything else.
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
minetest.after(1.2, find_tools)
|
||||
|
||||
-- register craftitems as sorter cards
|
||||
|
||||
--[[
|
||||
|
||||
Order of preference of sorting cards:
|
||||
|
||||
Wood
|
||||
Ore
|
||||
Ingot
|
||||
Block
|
||||
Tools
|
||||
Dye
|
||||
Farm
|
||||
Fuel
|
||||
Eject
|
||||
|
||||
]]--
|
||||
|
||||
minetest.register_craftitem("atvomat:ore_sorter_card", {
|
||||
|
||||
description = "Sorts Ores",
|
||||
inventory_image = "atvomat_card_ore.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:ingot_sorter_card", {
|
||||
|
||||
description = "Sorts Ingots and Gems (Not Ingot and Gem Blocks)",
|
||||
inventory_image = "atvomat_card_ingot.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:block_sorter_card", {
|
||||
|
||||
description = "Sorts Ingot and Gem Blocks (Not Ingots and Gems)",
|
||||
inventory_image = "atvomat_card_block.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:dye_sorter_card", {
|
||||
|
||||
description = "Sorts Dyes",
|
||||
inventory_image = "atvomat_card_dye.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:wood_sorter_card", {
|
||||
|
||||
description = "Sorts Planks, Logs, Leaves and Saplings",
|
||||
inventory_image = "atvomat_card_wood.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:fuel_sorter_card", {
|
||||
|
||||
description = "Sorts Fuels",
|
||||
inventory_image = "atvomat_card_fuel.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:farm_sorter_card", {
|
||||
|
||||
description = "Sorts Seeds, Food and Farming Resources",
|
||||
inventory_image = "atvomat_card_farm.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:tool_sorter_card", {
|
||||
|
||||
description = "Sorts Tools and Hoes.",
|
||||
inventory_image = "atvomat_card_tool.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:eject_card", {
|
||||
|
||||
description = "Ejects extra items to the selected face.",
|
||||
inventory_image = "atvomat_card_eject.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
|
@ -1,20 +1,8 @@
|
|||
-- avtomat - (automatico, automation)
|
||||
-- part of solar plains, by jordach
|
||||
|
||||
--like the mover, the format for adding items into the list of sorting cards is: atvomat.ingot_sort["item:name"] = ""
|
||||
|
||||
atvomat.ingot_sort = {}
|
||||
|
||||
atvomat.ingot_block_sort = {}
|
||||
|
||||
atvomat.ore_sort = {}
|
||||
|
||||
atvomat.dye_sort = {}
|
||||
|
||||
-- register ingots for sorting:
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
|
||||
list of item inventories for the sorter
|
||||
|
@ -48,7 +36,179 @@ local atsorter =
|
|||
"listring[current_player;main]" ..
|
||||
"background[-0.45,-0.5;8.9,10;atvomat_sorter_interface.png]"..
|
||||
"listcolors[#3a4466;#8b9bb4;#ffffff;#4e5765;#ffffff]"
|
||||
|
||||
local function reboot_mover(pos)
|
||||
|
||||
if minetest.get_node_timer(pos):is_started() == false then
|
||||
|
||||
minetest.get_node_timer(pos):start(1)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local function insert_into_mover(inv, inputstack, inputname, mover_inv)
|
||||
|
||||
if mover_inv:room_for_item("main", inputstack) then
|
||||
|
||||
inputstack:take_item()
|
||||
mover_inv:add_item("main", inputname)
|
||||
inv:set_stack("main", 1, inputstack)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local function sort_by_item(inv, inputstack, inputname, mover_inv, face_pos)
|
||||
|
||||
local node = minetest.get_node_or_nil(face_pos)
|
||||
|
||||
if node.name == "atvomat:mover" and node.name ~= nil then
|
||||
|
||||
-- push item into mover :^)
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
reboot_mover(face_pos)
|
||||
|
||||
insert_into_mover(inv, inputstack, inputname, mover_inv)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local function sorting_card(inv, inputstack, inputname, sort_table, face_pos)
|
||||
|
||||
for k, v in pairs(sort_table) do -- check through the list of items to sort based on this card
|
||||
|
||||
-- todo, make k the node/item name like how the mover operates;
|
||||
|
||||
if inputname ~= "" then
|
||||
|
||||
if k == inputname then
|
||||
|
||||
local node = minetest.get_node_or_nil(face_pos)
|
||||
|
||||
if node.name == "atvomat:mover" and node.name ~= nil then
|
||||
|
||||
-- push item into mover :^)
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
reboot_mover(face_pos)
|
||||
|
||||
insert_into_mover(inv, inputstack, inputname, mover_inv)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local function sort(pos, elapsed)
|
||||
|
||||
local inv = minetest.get_meta(pos):get_inventory() -- sorter storage
|
||||
|
||||
local inputstack = inv:get_stack("main", 1) -- the stack contained in the input slot
|
||||
local inputname = inputstack:get_name()
|
||||
|
||||
local face_pos = table.copy(pos)
|
||||
|
||||
-- check the top sorting face first;
|
||||
|
||||
face_pos.y = face_pos.y + 1
|
||||
|
||||
for i=1, 3 do
|
||||
|
||||
local stack = inv:get_stack("up", i) -- the stack contained in the sorting slots
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if inputname == stackname then
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
sort_by_item(inv, inputstack, inputname, mover_inv, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:wood_sorter_card" then -- detect sorter cards! see init.lua:174 for the ordering of sorter cards.
|
||||
|
||||
sorting_card(inv, inputstack, inputname, atvomat.wood_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:ore_sorter_card" then
|
||||
|
||||
sorting_card(inv, inputstack, inputname, atvomat.ore_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:ingot_sorter_card" then
|
||||
|
||||
sorting_card(inv, inputstack, inputname, atvomat.ingot_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:block_sorter_card" then
|
||||
|
||||
sorting_card(inv, inputstack, inputname, atvomat.ingot_block_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:tool_sorter_card" then
|
||||
|
||||
--sorting_card(inv, inputstack, inputname, atvomat.tool_sort, face_pos)
|
||||
|
||||
elseif stackname == "atvomat:dye_sorter_card" then
|
||||
|
||||
sorting_card(inv, inputstack, inputname, atvomat.dye_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:farm_sorter_card" then
|
||||
|
||||
--sorting_card(inv, inputstack, inputname, atvomat.farm_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:fuel_sorter_card" then
|
||||
|
||||
--sorting_card(inv, inputstack, inputname, atvomat.fuel_sort, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
elseif stackname == "atvomat:eject_card" then
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
sort_by_item(inv, inputstack, inputname, mover_inv, face_pos)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- check the bottom sorting face;
|
||||
|
||||
-- check the left sorting face;
|
||||
|
||||
-- check the right sorting face;
|
||||
|
||||
-- check the front sorting face;
|
||||
|
||||
-- check the rear sorting face;
|
||||
|
||||
-- if i can't sort it, or move it with the eject card, stop sorting, then, return true
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
minetest.register_node("atvomat:sorter", {
|
||||
|
||||
description = "Sorter (Sorts things based on items inside of it.)",
|
||||
|
@ -72,5 +232,13 @@ minetest.register_node("atvomat:sorter", {
|
|||
inv:set_size("back", 3)
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
end,
|
||||
|
||||
on_punch = function(pos)
|
||||
|
||||
sort(pos)
|
||||
|
||||
end,
|
||||
|
||||
on_timer = sort,
|
||||
|
||||
})
|
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 573 B |
After Width: | Height: | Size: 643 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
|
@ -211,7 +211,9 @@ function beds.wake_players() -- only to be used within a globalstep!!!
|
|||
|
||||
pl:set_pos(pos)
|
||||
pl:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||
|
||||
|
||||
pl:set_animation({x=0, y=79}, 30, 0)
|
||||
|
||||
wardrobe.apply_to_player(pl)
|
||||
|
||||
beds.play_jingle(pl)
|
||||
|
@ -225,28 +227,34 @@ end
|
|||
|
||||
function beds.wake_specific_player(player) -- for those sleepy people (or leaving the formspec early!)
|
||||
|
||||
local pos = minetest.string_to_pos(player:get_attribute("beds_spawn"))
|
||||
|
||||
if pos == nil then return end -- unlikely, but this is Minetest
|
||||
|
||||
if player_bed_swap[pname] == nil then return end
|
||||
|
||||
if player_bed_param[pname] == nil then return end
|
||||
|
||||
local pname = player:get_player_name()
|
||||
|
||||
if player_sleeping[pname] == true then -- look for players who are actually sleeping
|
||||
|
||||
local pos2 = player:get_pos()
|
||||
|
||||
player_sleeping[pname] = false
|
||||
|
||||
local pos2 = player:get_pos()
|
||||
|
||||
minetest.set_node(pos2, {name=player_bed_swap[pname], param1=0, param2=player_bed_param[pname]})
|
||||
player:hud_set_flags({crosshair = true, hotbar = true, healthbar = false, wielditem = true, breathbar = false})
|
||||
player:set_pos(pos)
|
||||
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||
--local hud_f = player:hud_get_flags()
|
||||
--hud_f.wielditem = true
|
||||
wardrobe.apply_to_player(player)
|
||||
minetest.close_formspec(pname, "beds_ui")
|
||||
minetest.set_node(pos2, {name=player_bed_swap[pname], param1=0, param2=player_bed_param[pname]})
|
||||
|
||||
local pos = minetest.string_to_pos(player:get_attribute("beds_spawn"))
|
||||
|
||||
if pos == nil then return end -- unlikely, but this is Minetest
|
||||
|
||||
player:hud_set_flags({crosshair = true, hotbar = true, healthbar = false, wielditem = true, breathbar = false})
|
||||
|
||||
player_sleeping[pname] = false
|
||||
|
||||
player:set_pos(pos)
|
||||
player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0})
|
||||
|
||||
player:set_animation({x=0, y=79}, 30, 0)
|
||||
|
||||
wardrobe.apply_to_player(player)
|
||||
|
||||
beds.play_jingle(player)
|
||||
|
||||
minetest.close_formspec(player:get_player_name(), "beds_ui")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function beds.set_respawn_point(pos, player, param)
|
||||
|
@ -479,20 +487,17 @@ end)
|
|||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
|
||||
if formname ~= "beds_ui" and player_sleeping[player:get_player_name()] == true then return true end
|
||||
if formname ~= "beds_ui" and player_sleeping[player:get_player_name()] == false then return false end
|
||||
|
||||
if fields.key_enter_field or fields.beds_chat_snd then
|
||||
|
||||
local pname = player:get_player_name()
|
||||
|
||||
minetest.chat_send_all("<"..pname.."> ".. fields.beds_chat)
|
||||
minetest.close_formspec(pname, "beds_ui")
|
||||
minetest.after(0.01, minetest.show_formspec, pname, "beds_ui", beds_formspec(player))
|
||||
|
||||
fields.beds_chat = ""
|
||||
|
||||
minetest.after(0.05, minetest.show_formspec, pname, "beds_ui", beds_formspec(player))
|
||||
|
||||
return
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
if fields.beds_ui_jingle then
|
||||
|
@ -508,17 +513,19 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
player:set_attribute("beds_enable_jingle", "false")
|
||||
minetest.chat_send_player(pname, "Morning jingle is disabled.")
|
||||
end
|
||||
minetest.close_formspec(pname, "beds_ui")
|
||||
minetest.after(0.01, minetest.show_formspec, pname, "beds_ui", beds_formspec(player))
|
||||
|
||||
minetest.after(0.05, minetest.show_formspec, pname, "beds_ui", beds_formspec(player))
|
||||
return true
|
||||
|
||||
return
|
||||
|
||||
end
|
||||
|
||||
if fields.quit or fields.beds_exit then
|
||||
|
||||
beds.wake_specific_player(player)
|
||||
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
end)
|
||||
|
|
|
@ -898,6 +898,51 @@ minetest.register_node("core:diamond_ore", {
|
|||
sounds = mcore.sound_stone,
|
||||
})
|
||||
|
||||
-- register ingot and gem blocks except MESE
|
||||
|
||||
minetest.register_node("core:copper_block", {
|
||||
description = "Block of Copper",
|
||||
tiles = {"core_copper_block.png"},
|
||||
groups = {cracky=3, solid=1},
|
||||
sounds = mcore.sound_metallic,
|
||||
})
|
||||
|
||||
minetest.register_node("core:iron_block", {
|
||||
description = "Block of Iron",
|
||||
tiles = {"core_iron_block.png"},
|
||||
groups = {cracky=2, solid=1},
|
||||
sounds = mcore.sound_metallic,
|
||||
})
|
||||
|
||||
minetest.register_node("core:silver_block", {
|
||||
description = "Block of Silver",
|
||||
tiles = {"core_silver_block.png"},
|
||||
groups = {cracky=2, solid=1},
|
||||
sounds = mcore.sound_metallic,
|
||||
})
|
||||
|
||||
minetest.register_node("core:gold_block", {
|
||||
description = "Block of Gold",
|
||||
tiles = {"core_gold_block.png"},
|
||||
groups = {cracky=1, solid=1},
|
||||
sounds = mcore.sound_metallic,
|
||||
})
|
||||
|
||||
minetest.register_node("core:ironze_block", {
|
||||
description = "Block of Ironze?!",
|
||||
tiles = {"core_ironze_block.png"},
|
||||
groups = {cracky=1, solid=1},
|
||||
sounds = mcore.sound_metallic,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("core:diamond_block", {
|
||||
description = "Block of Diamond",
|
||||
tiles = {"core_diamond_block.png"},
|
||||
groups = {cracky=1, solid=1},
|
||||
sounds = mcore.sound_stone,
|
||||
})
|
||||
|
||||
-- torches and light sources
|
||||
|
||||
minetest.register_node("core:torch", {
|
||||
|
|
|
@ -582,6 +582,152 @@ minetest.register_craftitem("core:diamond", {
|
|||
groups = {cooking_multiplier=1}, -- note: used for cooking ore in furnace, not crafting!
|
||||
})
|
||||
|
||||
-- register crafting for ingot blocks and gems
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:copper_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:copper_ingot", "core:copper_ingot", "core:copper_ingot"},
|
||||
{"core:copper_ingot", "core:copper_ingot", "core:copper_ingot"},
|
||||
{"core:copper_ingot", "core:copper_ingot", "core:copper_ingot"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:iron_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:iron_ingot", "core:iron_ingot", "core:iron_ingot"},
|
||||
{"core:iron_ingot", "core:iron_ingot", "core:iron_ingot"},
|
||||
{"core:iron_ingot", "core:iron_ingot", "core:iron_ingot"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:ironze_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:ironze_ingot", "core:ironze_ingot", "core:ironze_ingot"},
|
||||
{"core:ironze_ingot", "core:ironze_ingot", "core:ironze_ingot"},
|
||||
{"core:ironze_ingot", "core:ironze_ingot", "core:ironze_ingot"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:silver_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:silver_ingot", "core:silver_ingot", "core:silver_ingot"},
|
||||
{"core:silver_ingot", "core:silver_ingot", "core:silver_ingot"},
|
||||
{"core:silver_ingot", "core:silver_ingot", "core:silver_ingot"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:gold_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:gold_ingot", "core:gold_ingot", "core:gold_ingot"},
|
||||
{"core:gold_ingot", "core:gold_ingot", "core:gold_ingot"},
|
||||
{"core:gold_ingot", "core:gold_ingot", "core:gold_ingot"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:mese",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:mese_crystal", "core:mese_crystal", "core:mese_crystal"},
|
||||
{"core:mese_crystal", "core:mese_crystal", "core:mese_crystal"},
|
||||
{"core:mese_crystal", "core:mese_crystal", "core:mese_crystal"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "core:diamond_block",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"core:diamond", "core:diamond", "core:diamond"},
|
||||
{"core:diamond", "core:diamond", "core:diamond"},
|
||||
{"core:diamond", "core:diamond", "core:diamond"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- make storage blocks return their gems and ingots;
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:copper_ingot 9",
|
||||
recipe = {"core:copper_block"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:iron_ingot 9",
|
||||
recipe = {"core:iron_block"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:ironze_ingot 9",
|
||||
recipe = {"core:ironze_block"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:silver_ingot 9",
|
||||
recipe = {"core:silver_block"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:gold_ingot 9",
|
||||
recipe = {"core:gold_block"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:mese_crystal 9",
|
||||
recipe = {"core:mese"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "core:diamond 9",
|
||||
recipe = {"core:diamond_block"},
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- fuels
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -157,6 +157,22 @@ function mcore.facedir_stripper(node)
|
|||
|
||||
end
|
||||
|
||||
minetest.register_node("core:model_tester", {
|
||||
|
||||
description = "Hax",
|
||||
tiles = {"core_stone.png"},
|
||||
groups = {dig_immediate = 1},
|
||||
drawtype = "mesh",
|
||||
|
||||
mesh = "chest_unlocked.b3d",
|
||||
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
|
||||
on_place = minetest.rotate_and_place,
|
||||
|
||||
})
|
||||
|
||||
function mcore.get_node_from_front(pos)
|
||||
--pos is the standard pos table provided by minetest, eg: pos = {x=int, y=int, z=int}
|
||||
|
||||
|
|
After Width: | Height: | Size: 445 B |
After Width: | Height: | Size: 500 B |
After Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 291 B |
After Width: | Height: | Size: 325 B |
After Width: | Height: | Size: 371 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 265 B |
|
@ -111,8 +111,8 @@ minetest.register_craft({
|
|||
output = "farming:beanpole",
|
||||
recipe = {
|
||||
{'', '', ''},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
{'core:stick', '', 'core:stick'},
|
||||
{'core:stick', '', 'core:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ minetest.register_craft({
|
|||
output = "farming:jackolantern",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"", "default:torch", ""},
|
||||
{"", "core:torch", ""},
|
||||
{"", "farming:pumpkin", ""},
|
||||
}
|
||||
})
|
||||
|
|
|
@ -69,6 +69,21 @@ minetest.register_craftitem("farming:bread", {
|
|||
on_use = hud.item_eat(5),
|
||||
})
|
||||
|
||||
-- TOAAAAAAAAAAAAST
|
||||
|
||||
minetest.register_craftitem("farming:toast", {
|
||||
description = S("Toast (Not Suitable for making Reactors from.)"),
|
||||
inventory_image = "farming_bread.png",
|
||||
on_use = hud.item_eat(7),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 15,
|
||||
output = "farming:toast",
|
||||
recipe = "farming:bread"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 15,
|
||||
|
|