tidy code in places, add a special non-stack removing mover
This commit is contained in:
parent
e73ee00f75
commit
e34322c068
7
blends/cubicinfo.txt
Normal file
7
blends/cubicinfo.txt
Normal file
@ -0,0 +1,7 @@
|
||||
CharacterCubic information:
|
||||
|
||||
Frame rate is 30fps;
|
||||
Cubical arms and legs are
|
||||
|
||||
New anim frame ranges:
|
||||
|
@ -24,7 +24,6 @@ atvomat.breaker_blacklist["atvomat:placer"] = ""
|
||||
atvomat.breaker_blacklist["atvomat:mover"] = ""
|
||||
|
||||
local atbreaker =
|
||||
|
||||
"size[8,9]" ..
|
||||
"list[current_name;main;3.5,2;1,1]" ..
|
||||
"list[current_player;main;0,4.5;8,1;]" ..
|
||||
@ -35,18 +34,14 @@ local atbreaker =
|
||||
"listcolors[#3a4466;#8b9bb4;#ffffff;#4e5765;#ffffff]"
|
||||
|
||||
minetest.register_node("atvomat:breaker_1", {
|
||||
|
||||
description = "Automatic Block Breaker (Target is highlighted.)",
|
||||
tiles = {"atvomat_breaker_t1_body.png"},
|
||||
|
||||
drawtype = "mesh",
|
||||
mesh = "atvomat_breaker.b3d",
|
||||
paramtype2 = "facedir",
|
||||
|
||||
groups = {oddly_breakable_by_hand=2},
|
||||
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", atbreaker)
|
||||
local inv = meta:get_inventory()
|
||||
@ -54,83 +49,54 @@ minetest.register_node("atvomat:breaker_1", {
|
||||
meta:set_string("active", "false")
|
||||
meta:set_string("infotext", "Auto Block Breaker, Disabled.")
|
||||
end,
|
||||
|
||||
|
||||
on_place = mcore.rotate_axis,
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if meta:get_string("active") == "false" then
|
||||
|
||||
meta:set_string("active", "true")
|
||||
minetest.get_node_timer(pos):start(3)
|
||||
|
||||
meta:set_string("infotext", "Auto Block Breaker, Enabled.")
|
||||
|
||||
else
|
||||
|
||||
meta:set_string("active", "false")
|
||||
|
||||
meta:set_string("infotext", "Auto Block Breaker, Disabled.")
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end,
|
||||
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if meta:get_string("active") == "true" then
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
local fpos = mcore.get_node_from_front(table.copy(pos))
|
||||
|
||||
local front_node = minetest.get_node_or_nil(fpos)
|
||||
|
||||
for k, v in pairs(atvomat.breaker_blacklist) do
|
||||
|
||||
if front_node.name == k then return true end
|
||||
|
||||
end
|
||||
|
||||
|
||||
minetest.remove_node(fpos)
|
||||
|
||||
local drop = minetest.get_node_drops(front_node.name, "core:mese_pickaxe_5")
|
||||
|
||||
|
||||
for k, drop in ipairs(drop) do
|
||||
|
||||
inv:add_item("main", drop)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_node("atvomat:breaker_2", {
|
||||
|
||||
description = "Automatic Block Collector (Target is highlighted, gently collects blocks.)",
|
||||
tiles = {"atvomat_breaker_t2_body.png"},
|
||||
|
||||
drawtype = "mesh",
|
||||
mesh = "atvomat_breaker.b3d",
|
||||
paramtype2 = "facedir",
|
||||
|
||||
groups = {oddly_breakable_by_hand=2},
|
||||
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", atbreaker)
|
||||
local inv = meta:get_inventory()
|
||||
@ -140,96 +106,59 @@ minetest.register_node("atvomat:breaker_2", {
|
||||
end,
|
||||
|
||||
on_place = mcore.rotate_axis,
|
||||
|
||||
on_punch = function(pos, node, puncher)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if meta:get_string("active") == "false" then
|
||||
|
||||
meta:set_string("active", "true")
|
||||
minetest.get_node_timer(pos):start(3)
|
||||
|
||||
meta:set_string("infotext", "Auto Block Collector (Gently collects blocks), Enabled.")
|
||||
|
||||
else
|
||||
|
||||
meta:set_string("active", "false")
|
||||
|
||||
meta:set_string("infotext", "Auto Block Collector (Gently collects blocks), Disabled.")
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
||||
if meta:get_string("active") == "true" then
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
|
||||
local fpos = mcore.get_node_from_front(table.copy(pos))
|
||||
|
||||
local front_node = minetest.get_node_or_nil(fpos)
|
||||
|
||||
|
||||
for k, v in pairs(atvomat.breaker_blacklist) do
|
||||
|
||||
if front_node.name == k then return true end
|
||||
|
||||
end
|
||||
|
||||
|
||||
minetest.remove_node(fpos)
|
||||
|
||||
inv:add_item("main", front_node.name)
|
||||
|
||||
return true
|
||||
|
||||
else
|
||||
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:breaker_1",
|
||||
recipe = {
|
||||
|
||||
{"core:iron_ingot", "core:mese", "core:iron_ingot"},
|
||||
{"core:iron_ingot", "core:mese_pickaxe_3", "core:iron_ingot"},
|
||||
{"core:iron_ingot", "core:mese_pickaxe_3", "core:iron_ingot"},
|
||||
{"core:iron_ingot", "core:chest", "core:iron_ingot"}
|
||||
|
||||
},
|
||||
|
||||
replacements = {
|
||||
|
||||
{"core:mese_pickaxe_3", "core:mese_pickaxe_1"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:breaker_2",
|
||||
recipe = {
|
||||
|
||||
{"core:mese_crystal", "core:mese", "core:mese_crystal"},
|
||||
{"core:mese_crystal", "core:mese_pickaxe_5", "core:mese_crystal"},
|
||||
{"core:mese_crystal", "atvomat:breaker_1", "core:mese_crystal"}
|
||||
|
||||
},
|
||||
|
||||
replacements = {
|
||||
|
||||
{"core:mese_pickaxe_5", "core:mese_pickaxe_3"},
|
||||
|
||||
},
|
||||
|
||||
})
|
@ -3,15 +3,15 @@
|
||||
|
||||
atvomat = {} -- i like global namespaces for people who like making silly dependancies
|
||||
|
||||
--dofile(minetest.get_modpath("atvomat").."/autocrafter.lua") -- autocrafter
|
||||
dofile(minetest.get_modpath("atvomat").."/breaker.lua") -- automated block breaker
|
||||
dofile(minetest.get_modpath("atvomat").."/placer.lua") -- automated block breaker
|
||||
dofile(minetest.get_modpath("atvomat").."/compressor.lua") -- compresses ingots/gems into block form
|
||||
dofile(minetest.get_modpath("atvomat").."/crusher.lua") -- crushes ore blocks, and other blocks
|
||||
dofile(minetest.get_modpath("atvomat").."/logger.lua") -- automatically kills and plants trees
|
||||
dofile(minetest.get_modpath("atvomat").."/logger.lua") -- automatically chops trees
|
||||
dofile(minetest.get_modpath("atvomat").."/mover.lua") -- takes and inserts items into containers
|
||||
dofile(minetest.get_modpath("atvomat").."/scrapper.lua") -- destroys items every now and then
|
||||
dofile(minetest.get_modpath("atvomat").."/sorter.lua") -- sorts items all the time, everytime
|
||||
dofile(minetest.get_modpath("atvomat").."/switchsort.lua") -- sends items elsewhere if it cant put items into the container
|
||||
dofile(minetest.get_modpath("atvomat").."/tools.lua") -- engineers tools.
|
||||
|
||||
-- crafting recipes here, meatbag
|
||||
@ -66,14 +66,6 @@ atvomat.crusher_recipes["lightgrey"] = {"", 1, "dye:light_grey", 4}
|
||||
atvomat.crusher_recipes["darkgrey"] = {"", 1, "dye:dark_grey", 4}
|
||||
atvomat.crusher_recipes["black"] = {"", 1, "dye:black", 4}
|
||||
|
||||
-- logger control, register trees here, format: tree_log, leaves, sapling_name
|
||||
|
||||
-- note, evergreen trees are currently unsupported.
|
||||
|
||||
atvomat.logger_control["oak"] = {"core:oak_log", "core:oak_leaves", "core:oak_sapling"}
|
||||
atvomat.logger_control["birch"] = {"core:birch_log", "core:birch_leaves", "core:birch_sapling"}
|
||||
atvomat.logger_control["cherry"] = {"core:cherry_log", "core:cherry_leaves", "core:cherry_sapling"}
|
||||
|
||||
-- sorting control card for sorting blocks, format: "name:ingot", "etc", "etc", "etc"
|
||||
|
||||
-- will migrate these to a format which can be paired over instead of ipairs.
|
||||
@ -161,57 +153,6 @@ 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[""] = ""
|
||||
@ -222,52 +163,30 @@ atvomat.farm_sort["farming:tomato"] = ""
|
||||
-- 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
|
||||
|
||||
if burntime ~= 0 then
|
||||
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, find_tools)
|
||||
@ -290,83 +209,58 @@ Eject
|
||||
|
||||
]]--
|
||||
|
||||
minetest.register_craftitem("atvomat:ore_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_ore", {
|
||||
description = "Sorts Ores",
|
||||
inventory_image = "atvomat_card_ore.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:ingot_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_ingot", {
|
||||
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", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_block", {
|
||||
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", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_dye", {
|
||||
description = "Sorts Dyes",
|
||||
inventory_image = "atvomat_card_dye.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:wood_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_wood", {
|
||||
description = "Sorts Planks, Logs, Leaves and Saplings",
|
||||
inventory_image = "atvomat_card_wood.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:fuel_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_fuel", {
|
||||
description = "Sorts Fuels",
|
||||
inventory_image = "atvomat_card_fuel.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:farm_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_farm", {
|
||||
description = "Sorts Seeds, Food and Farming Resources",
|
||||
inventory_image = "atvomat_card_farm.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:tool_sorter_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_tool", {
|
||||
description = "Sorts Tools and Hoes.",
|
||||
inventory_image = "atvomat_card_tool.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craftitem("atvomat:eject_card", {
|
||||
|
||||
minetest.register_craftitem("atvomat:sorter_card_eject", {
|
||||
description = "Ejects extra items to the selected face.",
|
||||
inventory_image = "atvomat_card_eject.png",
|
||||
|
||||
groups = {sorter_card=1},
|
||||
|
||||
})
|
@ -52,31 +52,25 @@ atvomat.mover_burnable["core:coal_lump"] = ""
|
||||
-- registration of extractable containers:
|
||||
|
||||
atvomat.mover_input["core:chest"] = {
|
||||
|
||||
32,
|
||||
"main"
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_input["core:furnace"] = {
|
||||
|
||||
4,
|
||||
"dst"
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_input["core:furnace_active"] = {
|
||||
|
||||
4,
|
||||
"dst"
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_input["atvomat:breaker_1"] = {
|
||||
|
||||
1,
|
||||
"main"
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_input["atvomat:breaker_2"] = {
|
||||
@ -87,30 +81,25 @@ atvomat.mover_input["atvomat:breaker_2"] = {
|
||||
}
|
||||
|
||||
atvomat.mover_input["atvomat:logger"] = {
|
||||
|
||||
16,
|
||||
"main"
|
||||
|
||||
}
|
||||
|
||||
-- registration of insertable containers:
|
||||
|
||||
atvomat.mover_output["core:chest"] = {
|
||||
|
||||
"main",
|
||||
"main",
|
||||
false
|
||||
}
|
||||
|
||||
atvomat.mover_output["core:chest_locked"] = {
|
||||
|
||||
"main",
|
||||
"main",
|
||||
false
|
||||
}
|
||||
|
||||
atvomat.mover_output["core:furnace"] = {
|
||||
|
||||
"src",
|
||||
"fuel",
|
||||
true
|
||||
@ -118,7 +107,6 @@ atvomat.mover_output["core:furnace"] = {
|
||||
}
|
||||
|
||||
atvomat.mover_output["core:furnace_active"] = {
|
||||
|
||||
"src",
|
||||
"fuel",
|
||||
true
|
||||
@ -126,22 +114,18 @@ atvomat.mover_output["core:furnace_active"] = {
|
||||
}
|
||||
|
||||
atvomat.mover_output["atvomat:sorter"] = {
|
||||
|
||||
"main",
|
||||
"main",
|
||||
true
|
||||
|
||||
}
|
||||
|
||||
atvomat.mover_output["atvomat:logger"] = {
|
||||
|
||||
"main",
|
||||
"fuel",
|
||||
true
|
||||
}
|
||||
|
||||
atvomat.mover_output["atvomat:placer"] = {
|
||||
|
||||
"main",
|
||||
"main",
|
||||
true
|
||||
@ -161,7 +145,101 @@ local atmover =
|
||||
|
||||
-- local function show_status(pos, )
|
||||
|
||||
-- end
|
||||
local function atvomat_mover(pos, elapsed, mode)
|
||||
local fpos = mcore.get_node_from_front(table.copy(pos))
|
||||
local rpos = mcore.get_node_from_rear(table.copy(pos))
|
||||
|
||||
local front_node = minetest.get_node_or_nil(fpos)
|
||||
local rear_node = minetest.get_node_or_nil(rpos)
|
||||
|
||||
local mover_inv = minetest.get_meta(pos):get_inventory()
|
||||
|
||||
-- sanity checks to prevent crashes now.
|
||||
|
||||
if front_node == nil then return true end
|
||||
if rear_node == nil then return true end
|
||||
|
||||
-- take items from rear first;
|
||||
|
||||
for k, v in pairs(atvomat.mover_input) do
|
||||
if rear_node.name == k then
|
||||
local inv = minetest.get_meta(rpos):get_inventory()
|
||||
|
||||
for i=1, v[1] do
|
||||
local stack = inv:get_stack(v[2], i)
|
||||
local stackname = stack:get_name()
|
||||
local stacksize = stack:get_count()
|
||||
|
||||
if stackname ~= "" then
|
||||
if mode then -- we're allowed to take the whole stack
|
||||
if mover_inv:room_for_item("main", stackname) then
|
||||
stack:take_item(1)
|
||||
mover_inv:add_item("main", stackname)
|
||||
inv:set_stack(v[2], i, stack)
|
||||
|
||||
return true
|
||||
end
|
||||
elseif stacksize > 1 then -- we won't be moving singular items that aren't able to stack, but that's what sorters are for boi
|
||||
if mover_inv:room_for_item("main", stackname) then
|
||||
stack:take_item(1)
|
||||
mover_inv:add_item("main", stackname)
|
||||
inv:set_stack(v[2], i, stack)
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- push items out of the green side; pushing into other movers is considered last in the chain
|
||||
|
||||
local moverstack = mover_inv:get_stack("main", 1)
|
||||
local moverstackname = moverstack:get_name()
|
||||
|
||||
for k, v in pairs(atvomat.mover_output) do
|
||||
if front_node.name == k then
|
||||
local inv = minetest.get_meta(fpos):get_inventory()
|
||||
|
||||
if v[3] ~= false then
|
||||
minetest.get_node_timer(fpos):start(1.0)
|
||||
end
|
||||
|
||||
for k2, v2 in pairs(atvomat.fuel_sort) do -- let's see if the mover has a fuel item inside it and check if it will fit inside the fuel slot entirely.
|
||||
if inv:room_for_item(v[2], moverstackname) and moverstackname == k2 then
|
||||
moverstack:take_item()
|
||||
inv:add_item(v[2], moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if inv:room_for_item(v[1], moverstackname) then -- does it not fit or is the slot incapable of taking it in? fuel will be placed in the cooking or container slot instead.
|
||||
moverstack:take_item()
|
||||
inv:add_item(v[1], moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if front_node.name == "atvomat:mover" or front_node.name == "atvomat:mover_alt" then -- is the node in front of us a mover? then we'll insert it directly instead of the push pull configuration. this bypasses the pull from container, then push
|
||||
local inv = minetest.get_meta(fpos):get_inventory()
|
||||
|
||||
if minetest.get_node_timer(fpos):is_started() == false then
|
||||
minetest.get_node_timer(fpos):start(1.0)
|
||||
end
|
||||
|
||||
if inv:room_for_item("main", moverstackname) then
|
||||
moverstack:take_item()
|
||||
inv:add_item("main", moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("atvomat:mover",{
|
||||
description = "Mover",
|
||||
@ -170,12 +248,9 @@ minetest.register_node("atvomat:mover",{
|
||||
paramtype2 = "facedir",
|
||||
groups = {oddly_breakable_by_hand=3},
|
||||
paramtype = "light",
|
||||
|
||||
|
||||
tiles = {"atvomat_mover_mesh.png"},
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", atmover)
|
||||
local inv = meta:get_inventory()
|
||||
@ -184,142 +259,62 @@ minetest.register_node("atvomat:mover",{
|
||||
end,
|
||||
|
||||
on_punch = function(pos)
|
||||
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
|
||||
end,
|
||||
|
||||
on_place = mcore.rotate_axis,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
|
||||
local fpos = mcore.get_node_from_front(table.copy(pos))
|
||||
local rpos = mcore.get_node_from_rear(table.copy(pos))
|
||||
|
||||
local front_node = minetest.get_node_or_nil(fpos)
|
||||
local rear_node = minetest.get_node_or_nil(rpos)
|
||||
|
||||
local mover_inv = minetest.get_meta(pos):get_inventory()
|
||||
|
||||
-- sanity checks to prevent crashes now.
|
||||
|
||||
if front_node == nil then return true end
|
||||
|
||||
if rear_node == nil then return true end
|
||||
|
||||
-- take items from rear first;
|
||||
|
||||
for k, v in pairs(atvomat.mover_input) do
|
||||
|
||||
if rear_node.name == k then
|
||||
|
||||
local inv = minetest.get_meta(rpos):get_inventory()
|
||||
|
||||
for i=1, v[1] do
|
||||
|
||||
local stack = inv:get_stack(v[2], i)
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if stackname ~= "" then
|
||||
|
||||
if mover_inv:room_for_item("main", stackname) then
|
||||
|
||||
stack:take_item(1)
|
||||
mover_inv:add_item("main", stackname)
|
||||
inv:set_stack(v[2], i, stack)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- push items out of the green side; pushing into other movers is considered last in the chain
|
||||
|
||||
local moverstack = mover_inv:get_stack("main", 1)
|
||||
local moverstackname = moverstack:get_name()
|
||||
|
||||
for k, v in pairs(atvomat.mover_output) do
|
||||
|
||||
if front_node.name == k then
|
||||
|
||||
local inv = minetest.get_meta(fpos):get_inventory()
|
||||
|
||||
if v[3] ~= false then
|
||||
|
||||
minetest.get_node_timer(fpos):start(1.0)
|
||||
|
||||
end
|
||||
|
||||
for k2, v2 in pairs(atvomat.fuel_sort) do -- let's see if the mover has a fuel item inside it and check if it will fit inside the fuel slot entirely.
|
||||
|
||||
if inv:room_for_item(v[2], moverstackname) and moverstackname == k2 then
|
||||
|
||||
moverstack:take_item()
|
||||
inv:add_item(v[2], moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if inv:room_for_item(v[1], moverstackname) then -- does it not fit or is the slot incapable of taking it in? fuel will be placed in the cooking or container slot instead.
|
||||
|
||||
moverstack:take_item()
|
||||
inv:add_item(v[1], moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if front_node.name == "atvomat:mover" then -- is the node in front of us a mover? then we'll insert it directly instead of the push pull configuration. this bypasses the pull from container, then push
|
||||
|
||||
local inv = minetest.get_meta(fpos):get_inventory()
|
||||
|
||||
if minetest.get_node_timer(fpos):is_started() == false then
|
||||
|
||||
minetest.get_node_timer(fpos):start(1.0)
|
||||
|
||||
end
|
||||
|
||||
if inv:room_for_item("main", moverstackname) then
|
||||
|
||||
moverstack:take_item()
|
||||
inv:add_item("main", moverstackname)
|
||||
mover_inv:set_stack("main", 1, moverstack)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
atvomat_mover(pos, elapsed, true)
|
||||
return true
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:mover",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"group:planks", "core:iron_ingot", ""},
|
||||
{"core:chest", "core:mese_crystal", "core:chest"},
|
||||
{"group:planks", "core:iron_ingot", ""}
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- mover that only takes a single item
|
||||
|
||||
minetest.register_node("atvomat:mover_alt",{
|
||||
description = "Mover (Takes all but one item.)",
|
||||
drawtype = "mesh",
|
||||
mesh = "atvomat_mover.b3d",
|
||||
paramtype2 = "facedir",
|
||||
groups = {oddly_breakable_by_hand=3},
|
||||
paramtype = "light",
|
||||
tiles = {"atvomat_mover_alt_mesh.png"},
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", atmover)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 1)
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
end,
|
||||
|
||||
on_punch = function(pos)
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
end,
|
||||
|
||||
on_place = mcore.rotate_axis,
|
||||
on_timer = function(pos, elapsed)
|
||||
atvomat_mover(pos, elapsed, false)
|
||||
return true
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "atvomat:mover_alt",
|
||||
recipe = {
|
||||
{"", "core:mese_crystal", ""},
|
||||
{"core:mese_crystal", "atvomat:mover", "core:mese_crystal"},
|
||||
{"", "core:mese_crystal", ""}
|
||||
},
|
||||
})
|
@ -21,7 +21,6 @@ main -- single slot for storing items.
|
||||
]]--
|
||||
|
||||
local atsorter =
|
||||
|
||||
"size[8,9]" ..
|
||||
"list[current_name;main;3.5,3.25;1,1]" ..
|
||||
"list[current_name;up;0,0;3,1]" ..
|
||||
@ -38,104 +37,69 @@ local atsorter =
|
||||
"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
|
||||
|
||||
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)
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
return false
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local function sorting_card(inv, inputstack, inputname, sort_table, face_pos)
|
||||
|
||||
local is_match = false
|
||||
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
is_match = true
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
if is_match == true then return true
|
||||
|
||||
else return false 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 stackstr = ""
|
||||
|
||||
local face_pos = table.copy(pos)
|
||||
|
||||
|
||||
for i=1,6 do -- let's loop through the faces and make face_pos correct per direction
|
||||
|
||||
face_pos = table.copy(pos)
|
||||
|
||||
|
||||
if i == 1 then stackstr = "up"; face_pos.y = face_pos.y + 1
|
||||
elseif i == 2 then stackstr = "down"; face_pos.y = face_pos.y - 1
|
||||
elseif i == 3 then stackstr = "left"; face_pos.x = face_pos.x - 1
|
||||
@ -143,70 +107,42 @@ local function sort(pos, elapsed)
|
||||
elseif i == 5 then stackstr = "front"; face_pos.z = face_pos.z + 1
|
||||
elseif i == 6 then stackstr = "back"; face_pos.z = face_pos.z - 1
|
||||
end
|
||||
|
||||
|
||||
-- let's check sorting inv slots
|
||||
|
||||
for s=1,3 do
|
||||
|
||||
local stack = inv:get_stack(stackstr, s) -- the stack contained in the sorting slots
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if stackname ~= "" then
|
||||
|
||||
if inputname ~= "" then
|
||||
|
||||
if inputname == stackname then
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
if sort_by_item(inv, inputstack, inputname, mover_inv, face_pos) == true then return true end
|
||||
|
||||
end
|
||||
|
||||
if stackname == "atvomat:wood_sorter_card" then -- detect sorter cards! see init.lua:174 for the ordering of sorter cards.
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.wood_sort, face_pos) == true then return true end
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.wood_sort, face_pos) == true then return true end
|
||||
elseif stackname == "atvomat:ore_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.ore_sort, face_pos) == true then return true end
|
||||
|
||||
elseif stackname == "atvomat:ingot_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.ingot_sort, face_pos) == true then return true end
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.ore_sort, face_pos) == true then return true end
|
||||
elseif stackname == "atvomat:ingot_sorter_card" then
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.ingot_sort, face_pos) == true then return true end
|
||||
elseif stackname == "atvomat:block_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.ingot_block_sort, face_pos) == true then return true end
|
||||
|
||||
elseif stackname == "atvomat:tool_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.tool_sort, face_pos) == true then return true end
|
||||
|
||||
elseif stackname == "atvomat:dye_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.dye_sort, face_pos) == true then return true end
|
||||
|
||||
elseif stackname == "atvomat:farm_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.farm_sort, face_pos) == true then return true end
|
||||
|
||||
elseif stackname == "atvomat:fuel_sorter_card" then
|
||||
|
||||
if sorting_card(inv, inputstack, inputname, atvomat.fuel_sort, face_pos) == true then return true end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
for i=1,6 do
|
||||
|
||||
face_pos = table.copy(pos)
|
||||
|
||||
if i == 1 then stackstr = "up"; face_pos.y = face_pos.y + 1
|
||||
@ -218,38 +154,25 @@ local function sort(pos, elapsed)
|
||||
end
|
||||
|
||||
for s=1,3 do
|
||||
|
||||
local stack = inv:get_stack(stackstr, s) -- the stack contained in the sorting slots
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if stackname ~= "" then
|
||||
|
||||
if inputname ~= "" then
|
||||
|
||||
-- after we've literally done everything, let's do the ejecting cards;
|
||||
|
||||
if stackname == "atvomat:eject_card" then
|
||||
|
||||
local mover_inv = minetest.get_meta(face_pos):get_inventory()
|
||||
|
||||
if sort_by_item(inv, inputstack, inputname, mover_inv, face_pos) == true then end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
minetest.register_node("atvomat:sorter", {
|
||||
|
||||
description = "Sorter",
|
||||
paramtype = "light",
|
||||
tiles = {"atvomat_sorter_mesh.png"},
|
||||
@ -258,7 +181,6 @@ minetest.register_node("atvomat:sorter", {
|
||||
groups = {oddly_breakable_by_hand=3},
|
||||
|
||||
on_construct = function(pos)
|
||||
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", atsorter)
|
||||
local inv = meta:get_inventory()
|
||||
@ -273,195 +195,127 @@ minetest.register_node("atvomat:sorter", {
|
||||
end,
|
||||
|
||||
on_punch = function(pos)
|
||||
|
||||
minetest.get_node_timer(pos):start(1.0)
|
||||
|
||||
end,
|
||||
|
||||
on_timer = sort,
|
||||
|
||||
})
|
||||
|
||||
-- register recipes for the sorter and associated cards;
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:sorter",
|
||||
|
||||
recipe = {
|
||||
|
||||
{"group:planks", "core:chest", "group:planks"},
|
||||
{"core:chest", "core:mese", "core:chest"},
|
||||
{"group:planks", "core:chest", "group:planks"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:ore_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_ore",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "group:ore", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:ingot_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_ingot",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:diamond", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:block_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_block",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:iron_block", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:dye_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_dye",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "group:dye", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:wood_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_wood",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:oak_sapling", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:wood_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_wood",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:pine_sapling", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:wood_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_wood",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:cherry_sapling", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:wood_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_wood",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:birch_sapling", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:fuel_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_fuel",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:coal_lump", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:farm_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_farm",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "farming:seed_wheat", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:tool_sorter_card",
|
||||
|
||||
output = "atvomat:sorter_card_tool",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "core:iron_pickaxe", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
||||
output = "atvomat:eject_card",
|
||||
|
||||
output = "atvomat:sorter_card_eject",
|
||||
recipe = {
|
||||
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
{"core:mese_crystal", "", "core:mese_crystal"},
|
||||
{"core:cactus", "core:mese_crystal", "core:cactus"},
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
})
|
Binary file not shown.
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 1001 B |
BIN
mods/atvomat/textures/atvomat_mover_alt_mesh.png
Normal file
BIN
mods/atvomat/textures/atvomat_mover_alt_mesh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -1,15 +1,9 @@
|
||||
--configuration options
|
||||
|
||||
mcore = {}
|
||||
|
||||
give_initial_stuff = {}
|
||||
|
||||
local give_initial_stuff = {}
|
||||
default = {}
|
||||
|
||||
--dofile(minetest.get_modpath("core").."/")
|
||||
--dofile(minetest.get_modpath("core").."/")
|
||||
--dofile(minetest.get_modpath("core").."/")
|
||||
|
||||
-- base mapgen requirements
|
||||
|
||||
minetest.register_alias("mapgen_stone", "core:stone")
|
||||
@ -96,7 +90,6 @@ minetest.register_on_newplayer(give_initial_stuff.give)
|
||||
-- special entity tester
|
||||
|
||||
local mob = {
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "lmao.b3d",
|
||||
use_texture_alpha = true,
|
||||
@ -113,40 +106,29 @@ mob_anim[3] = {x=166, y=191}
|
||||
mob_anim[4] = {x=201, y=231}
|
||||
|
||||
function mob:on_rightclick(clicker)
|
||||
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
if self.anim_type == #mob_anim then
|
||||
|
||||
self.anim_type = 1
|
||||
|
||||
else
|
||||
|
||||
self.anim_type = self.anim_type + 1
|
||||
|
||||
end
|
||||
|
||||
--self.object:set_animation(mob_anim[self.anim_type], 30, 0, false)
|
||||
self.object:set_animation(mob_anim[self.anim_type], 30, 0, false)
|
||||
end
|
||||
|
||||
minetest.register_entity("core:tester", mob)
|
||||
|
||||
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 = mcore.sensible_facedir,
|
||||
|
||||
})
|
||||
|
||||
-- better facedir than minetest.rotate_and_place
|
||||
@ -154,205 +136,129 @@ minetest.register_node("core:model_tester", {
|
||||
--use mcore.sensible_facedir_simple for furnaces or mcore.sensible_facedir for those multiple rotation nodes.
|
||||
|
||||
function mcore.sensible_facedir(itemstack, placer, pointed_thing)
|
||||
|
||||
local rpos = ""
|
||||
|
||||
if minetest.registered_nodes[minetest.get_node(pointed_thing.under).name].buildable_to == true then
|
||||
|
||||
rpos = pointed_thing.under
|
||||
|
||||
else
|
||||
|
||||
rpos = pointed_thing.above
|
||||
|
||||
end
|
||||
|
||||
local hor_rot = math.deg(placer:get_look_horizontal()) -- convert radians to degrees
|
||||
local deg_to_fdir = math.floor(((hor_rot * 4 / 360) + 0.5) % 4) -- returns 0, 1, 2 or 3; checks between 90 degrees in a pacman style angle check, it's quite magical.
|
||||
|
||||
local fdir = 0 -- get initialised, and if we don't ever assign an fdir, then it's safe to ignore?! (probably not a good idea to do so)
|
||||
|
||||
local px = math.abs(placer:get_pos().x - rpos.x) -- measure the distance from the player to the placed nodes position
|
||||
|
||||
local pz = math.abs(placer:get_pos().z - rpos.z)
|
||||
|
||||
if px < 2 and pz < 2 then -- if the node is being placed 1 block away from us, then lets place it either upright or upside down
|
||||
|
||||
local pY = 0
|
||||
|
||||
if placer:get_pos().y < 0 then
|
||||
|
||||
pY = math.abs(placer:get_pos().y - 1.14) -- we invert this Y value since we need to go UPWARDS to compare properly.
|
||||
|
||||
else
|
||||
|
||||
pY = math.abs(placer:get_pos().y + 2.14) -- we measure the y distance by itself as it may not be needed for wall placed blocks.
|
||||
|
||||
end
|
||||
|
||||
print (pY - math.abs(rpos.y))
|
||||
|
||||
if pY - math.abs(rpos.y) > 1.5 then -- are we being placed on the floor? let's be upright then.
|
||||
|
||||
if pY - math.abs(rpos.y) > 1.5 then -- are we being placed on the floor? let's be upright then.
|
||||
if deg_to_fdir == 0 then fdir = 0 -- north
|
||||
elseif deg_to_fdir == 1 then fdir = 3 --east
|
||||
elseif deg_to_fdir == 2 then fdir = 2 -- south
|
||||
elseif deg_to_fdir == 3 then fdir = 1 end -- west
|
||||
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing, fdir)
|
||||
|
||||
else -- if not, let's be upside down.
|
||||
|
||||
if deg_to_fdir == 0 then fdir = 20 -- north
|
||||
elseif deg_to_fdir == 1 then fdir = 21 -- east
|
||||
elseif deg_to_fdir == 2 then fdir = 22 -- south
|
||||
elseif deg_to_fdir == 3 then fdir = 23 end -- west
|
||||
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing, fdir)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- since we couldn't find a place that isn't either on a ceiling or floor, let's place it onto it's side.
|
||||
|
||||
if deg_to_fdir == 0 then fdir = 9 -- north
|
||||
elseif deg_to_fdir == 1 then fdir = 12 -- east
|
||||
elseif deg_to_fdir == 2 then fdir = 7 -- south
|
||||
elseif deg_to_fdir == 3 then fdir = 18 end -- west
|
||||
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing, fdir)
|
||||
|
||||
end
|
||||
|
||||
function mcore.sensible_facedir_simple(itemstack, placer, pointed_thing)
|
||||
|
||||
local rpos = ""
|
||||
|
||||
|
||||
local hor_rot = math.deg(placer:get_look_horizontal())
|
||||
local deg_to_fdir = math.floor(((hor_rot * 4 / 360) + 0.5) % 4)
|
||||
local fdir = 0
|
||||
|
||||
|
||||
if deg_to_fdir == 0 then fdir = 0
|
||||
elseif deg_to_fdir == 1 then fdir = 3
|
||||
elseif deg_to_fdir == 2 then fdir = 2
|
||||
elseif deg_to_fdir == 3 then fdir = 1 end
|
||||
|
||||
return minetest.item_place_node(itemstack, placer, pointed_thing, fdir)
|
||||
|
||||
end
|
||||
|
||||
-- get 3d facedir to simple axis;
|
||||
-- 0 = y+ 1 = z+ 2 = z- 3 = x+ 4 = x- 5 = y-
|
||||
|
||||
function mcore.facedir_stripper(node)
|
||||
|
||||
local number = node.param2/4
|
||||
|
||||
local chara = tostring(number)
|
||||
|
||||
|
||||
number = tonumber(chara:sub(1,1))
|
||||
|
||||
return number
|
||||
|
||||
end
|
||||
|
||||
function mcore.get_node_from_front(pos)
|
||||
--pos is the standard pos table provided by minetest, eg: pos = {x=int, y=int, z=int}
|
||||
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
|
||||
local facedir = mcore.facedir_stripper(node)
|
||||
|
||||
local npos = pos
|
||||
|
||||
if facedir == 0 then
|
||||
|
||||
npos.y = npos.y + 1
|
||||
|
||||
npos.y = npos.y + 1
|
||||
return npos
|
||||
|
||||
elseif facedir == 1 then
|
||||
|
||||
npos.z = npos.z + 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 2 then
|
||||
|
||||
npos.z = npos.z - 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 3 then
|
||||
|
||||
npos.x = npos.x + 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 4 then
|
||||
|
||||
npos.x = npos.x - 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 5 then
|
||||
|
||||
npos.y = npos.y - 1
|
||||
|
||||
return npos
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function mcore.get_node_from_rear(pos)
|
||||
--pos is the standard pos table provided by minetest, eg: pos = {x=int, y=int, z=int}
|
||||
|
||||
local node = minetest.get_node_or_nil(pos)
|
||||
|
||||
local facedir = mcore.facedir_stripper(node)
|
||||
|
||||
local npos = pos
|
||||
|
||||
if facedir == 0 then
|
||||
|
||||
npos.y = npos.y - 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 1 then
|
||||
|
||||
npos.z = npos.z - 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 2 then
|
||||
|
||||
npos.z = npos.z + 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 3 then
|
||||
|
||||
npos.x = npos.x - 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 4 then
|
||||
|
||||
npos.x = npos.x + 1
|
||||
|
||||
return npos
|
||||
|
||||
elseif facedir == 5 then
|
||||
|
||||
npos.y = npos.y + 1
|
||||
|
||||
return npos
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- borrowed mineclone2's axis facedir:
|
||||
@ -406,30 +312,18 @@ function mcore.rotate_axis_and_place(itemstack, placer, pointed_thing, infinites
|
||||
local p2
|
||||
|
||||
if is_x and not is_x2 then
|
||||
|
||||
p2 = 18
|
||||
|
||||
elseif not is_x and not is_x2 then
|
||||
|
||||
p2 = 12
|
||||
|
||||
elseif is_z and not is_z2 then
|
||||
|
||||
p2 = 9
|
||||
|
||||
elseif not is_z and not is_z2 then
|
||||
|
||||
p2 = 7
|
||||
|
||||
elseif is_y then
|
||||
|
||||
p2 = 20
|
||||
|
||||
elseif not is_y then
|
||||
|
||||
p2 = 0
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
minetest.set_node(pos, {name = wield_name, param2 = p2})
|
||||
|
||||
@ -471,9 +365,7 @@ local np_humid = {
|
||||
}
|
||||
|
||||
function mcore.get_heat_humidity(player)
|
||||
|
||||
-- let's get a temparature reading for the local area.
|
||||
|
||||
local pos = player:get_pos()
|
||||
|
||||
local pposx = math.floor(pos.x)
|
||||
@ -481,24 +373,17 @@ function mcore.get_heat_humidity(player)
|
||||
|
||||
local nobj_temp = nobj_temp or minetest.get_perlin(np_temp)
|
||||
local nobj_humid = nobj_humid or minetest.get_perlin(np_humid)
|
||||
|
||||
local nval_temp = nobj_temp:get2d({x = pposx, y = pposz})
|
||||
local nval_humid = nobj_humid:get2d({x = pposx, y = pposz})
|
||||
|
||||
local latch = false
|
||||
|
||||
if nval_humid > 100 then
|
||||
|
||||
nval_humid = 100
|
||||
|
||||
elseif nval_humid < 0 then
|
||||
|
||||
nval_humid = 0
|
||||
|
||||
end
|
||||
|
||||
nval_humid = math.floor(100 * (nval_humid/100))
|
||||
|
||||
nval_temp = math.floor(45 * (nval_temp/100)) + (nval_humid * 0.02)
|
||||
|
||||
if hudclock.month == 1 then
|
||||
@ -528,51 +413,33 @@ function mcore.get_heat_humidity(player)
|
||||
end
|
||||
|
||||
local y = math.abs(pos.y) / 50000
|
||||
|
||||
-- altitude changes heat and humidity
|
||||
|
||||
if pos.y < 0.5 then -- heading into the underground increases heat
|
||||
|
||||
nval_temp = nval_temp + (10000 * y)
|
||||
|
||||
else -- going into the atmosphere reduces heat
|
||||
|
||||
nval_temp = nval_temp + (-1556 * y)
|
||||
|
||||
end
|
||||
|
||||
nval_humid = nval_humid + (-600 * y)
|
||||
|
||||
if nval_temp < -271 then
|
||||
|
||||
nval_temp = -271
|
||||
nval_humid = 0
|
||||
|
||||
elseif nval_temp > 3000 then
|
||||
|
||||
nval_temp = 3000
|
||||
nval_humid = 0
|
||||
|
||||
end
|
||||
|
||||
if nval_humid > 100 then
|
||||
|
||||
nval_humid = 100
|
||||
|
||||
elseif nval_humid < 0 then
|
||||
|
||||
nval_humid = 0
|
||||
|
||||
end
|
||||
|
||||
if nval_temp <= 4 then
|
||||
|
||||
latch = true
|
||||
|
||||
end
|
||||
|
||||
return nval_temp, nval_humid, latch
|
||||
|
||||
end
|
||||
|
||||
-- dofiles for loading files required by "core"
|
||||
|
@ -88,242 +88,155 @@ mcore.mese_swing_speed[4] = 0.75
|
||||
mcore.mese_swing_speed[5] = 0.375
|
||||
|
||||
function mcore.give_mese_exp(itemstack, user, node, digparams)
|
||||
|
||||
if itemstack:get_name() == "core:mese_pickaxe_5" or itemstack:get_name() == "core:mese_shovel_5" or itemstack:get_name() == "core:mese_axe_5" or itemstack:get_name() == "core:mese_sword_5" then
|
||||
|
||||
itemstack:add_wear(digparams.wear)
|
||||
|
||||
|
||||
return itemstack
|
||||
|
||||
end
|
||||
|
||||
local capital, item_string = ""
|
||||
|
||||
for x=1, 4 do
|
||||
|
||||
if x == 1 then
|
||||
|
||||
item_string = "pickaxe"
|
||||
capital = "Pickaxe"
|
||||
|
||||
elseif x == 2 then
|
||||
|
||||
item_string = "axe"
|
||||
capital = "Axe"
|
||||
|
||||
elseif x == 3 then
|
||||
|
||||
item_string = "shovel"
|
||||
capital = "Shovel"
|
||||
|
||||
elseif x == 4 then
|
||||
|
||||
item_string = "sword"
|
||||
capital = "Sword"
|
||||
|
||||
end
|
||||
|
||||
for i=1, 4 do
|
||||
|
||||
if itemstack:get_name() == "core:mese_" .. item_string .. "_" .. i and itemstack:get_wear() < 1 then
|
||||
|
||||
itemstack:set_name("core:mese_" .. item_string .. "_" .. i+1)
|
||||
|
||||
if i ~= 4 then
|
||||
|
||||
local meta = itemstack:get_meta()
|
||||
|
||||
if i == 4 then
|
||||
|
||||
meta:set_string("description", "MESE " .. capital .. " (Level 5)") -- Level 5 no longer need the exp information
|
||||
|
||||
itemstack:set_wear(0) -- reset wear to full durability, we don't need the bar anymore
|
||||
|
||||
else
|
||||
|
||||
itemstack:set_wear(65535) -- reset wear to 0, to reset the exp bar
|
||||
|
||||
meta:set_string("description", "MESE " .. capital .. " (Level " .. i+1 .. ")\n\nExp: 0/" .. mcore.mese_wear_level[i+1] .. " (0%)")
|
||||
|
||||
end
|
||||
|
||||
meta:set_string("exp", "0")
|
||||
|
||||
minetest.sound_play("core_tool_levelling", {
|
||||
|
||||
to_player = user:get_player_name(),
|
||||
gain = 6.0,
|
||||
|
||||
})
|
||||
|
||||
else
|
||||
|
||||
--......
|
||||
|
||||
end
|
||||
|
||||
return itemstack
|
||||
|
||||
elseif itemstack:get_name() == "core:mese_" .. item_string .. "_" .. i then
|
||||
|
||||
local meta = itemstack:get_meta()
|
||||
|
||||
local exp_count = tonumber(meta:get_string("exp"))
|
||||
|
||||
if exp_count == nil then exp_count = 0 end
|
||||
|
||||
exp_count = exp_count + 1
|
||||
|
||||
meta:set_string("exp", tostring(exp_count))
|
||||
|
||||
local add_to = -65535 / mcore.mese_wear_level[i]
|
||||
|
||||
itemstack:add_wear(add_to)
|
||||
|
||||
local perc = (exp_count / mcore.mese_wear_level[i]) * 100
|
||||
|
||||
meta:set_string("description", "MESE " .. capital .. " (Level " .. i .. ")\n\nExp: " .. exp_count .. "/" .. mcore.mese_wear_level[i] .. " (" .. tonumber(string.format("%.2f", perc)) .. "%)")
|
||||
|
||||
return itemstack
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function mcore.diamonds_are_not_forever(itemstack, user, node, digparams)
|
||||
|
||||
local chance = math.random(1,1024)
|
||||
|
||||
if chance == 1 then
|
||||
|
||||
-- damage the tool by adding 10% on top of the current wear level
|
||||
|
||||
itemstack:add_wear(itemstack:get_wear() * 1.10)
|
||||
|
||||
minetest.sound_play("core_glass_break", {
|
||||
|
||||
to_player = user:get_player_name(),
|
||||
gain = 6.0,
|
||||
|
||||
})
|
||||
|
||||
return itemstack
|
||||
|
||||
else
|
||||
|
||||
itemstack:add_wear(65535/8192)
|
||||
|
||||
return itemstack
|
||||
|
||||
end
|
||||
|
||||
return itemstack
|
||||
else
|
||||
itemstack:add_wear(65535/8192)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
local function register_mese_toolsets()
|
||||
|
||||
for i=1, 5 do
|
||||
|
||||
minetest.register_tool("core:mese_pickaxe_" .. i, {
|
||||
|
||||
description = "MESE Pickaxe (Level " .. i .. ")\n\nExp: 0/" .. mcore.mese_wear_level[i] .. " (0%)",
|
||||
inventory_image = "core_mese_pickaxe_".. i .. ".png",
|
||||
tool_capabilities = {
|
||||
|
||||
full_punch_interval = mcore.mese_swing_speed[i] + 0.75,
|
||||
|
||||
max_drop_level = 0,
|
||||
|
||||
groupcaps = mcore.mese_dig_spd_pick[i],
|
||||
|
||||
damage_groups = mcore.mese_dmg_sword[i] / 2,
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.give_mese_exp(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:mese_axe_" .. i, {
|
||||
|
||||
description = "MESE Axe (Level " .. i .. ")\n\nExp: 0/" .. mcore.mese_wear_level[i] .. " (0%)",
|
||||
inventory_image = "core_mese_axe_" .. i .. ".png",
|
||||
|
||||
tool_capabilities = {
|
||||
|
||||
full_punch_interval = mcore.mese_swing_speed[i] + 0.5,
|
||||
|
||||
max_drop_level = 0,
|
||||
|
||||
groupcaps = mcore.mese_dig_spd_axe[i],
|
||||
|
||||
damage_groups = mcore.mese_dmg_sword[i] - 2,
|
||||
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.give_mese_exp(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_tool("core:mese_shovel_" .. i, {
|
||||
|
||||
description = "MESE Shovel (Level " .. i .. ")\n\nExp: 0/" .. mcore.mese_wear_level[i] .. " (0%)",
|
||||
inventory_image = "core_mese_shovel_" .. i .. ".png",
|
||||
tool_capabilities = {
|
||||
|
||||
full_punch_interval = mcore.mese_swing_speed[i] + 1.5,
|
||||
|
||||
max_drop_level = 0,
|
||||
|
||||
groupcaps = mcore.mese_dig_spd_shovel[i],
|
||||
|
||||
damage_groups = (mcore.mese_dmg_sword[i] / 2) - 1,
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.give_mese_exp(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:mese_sword_" .. i, {
|
||||
|
||||
description = "MESE Sword (Level " .. i .. ")\n\nExp: 0/" .. mcore.mese_wear_level[i] .. " (0%)",
|
||||
inventory_image = "core_mese_sword_" .. i .. ".png",
|
||||
tool_capabilities = {
|
||||
|
||||
full_punch_interval = mcore.mese_swing_speed[i],
|
||||
|
||||
max_drop_level = 0,
|
||||
|
||||
groupcaps = mcore.mese_dig_spd_sword[i],
|
||||
|
||||
damage_groups = mcore.mese_dmg_sword[i],
|
||||
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.give_mese_exp(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
register_mese_toolsets()
|
||||
@ -336,7 +249,6 @@ minetest.override_item("core:mese_sword_5", {description = "MESE Sword (Level 5)
|
||||
minetest.register_item(":", {
|
||||
type = "none",
|
||||
wield_image = "wieldhand.png",
|
||||
--wield_scale = {x=1,y=3,z=4},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.25,
|
||||
max_drop_level = 0,
|
||||
@ -348,9 +260,7 @@ minetest.register_item(":", {
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
||||
range = 6,
|
||||
|
||||
})
|
||||
|
||||
-- items
|
||||
@ -359,14 +269,6 @@ minetest.register_craftitem("core:clay_lump", {
|
||||
description = "Clay Lump",
|
||||
inventory_image = "core_clay_lump.png",
|
||||
wield_image = "core_clay_lump.png",
|
||||
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
|
||||
mcore.create_acacia_tree(pointed_thing.under)
|
||||
|
||||
return itemstack
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
-- wood tier
|
||||
@ -378,9 +280,7 @@ minetest.register_tool("core:wooden_pickaxe", {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 0,
|
||||
groupcaps = {
|
||||
|
||||
cracky = {times={[1]=9.00, [2]=4.00, [3]=1.50}, uses=0, maxlevel=0}
|
||||
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
}
|
||||
@ -411,7 +311,6 @@ minetest.register_tool("core:wooden_axe", {
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:wooden_sword", {
|
||||
@ -425,7 +324,6 @@ minetest.register_tool("core:wooden_sword", {
|
||||
},
|
||||
damage_groups = {fleshy=1},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- stone tier
|
||||
@ -441,7 +339,6 @@ minetest.register_tool("core:stone_pickaxe", {
|
||||
},
|
||||
damage_groups = {fleshy=2},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:stone_shovel", {
|
||||
@ -455,7 +352,6 @@ minetest.register_tool("core:stone_shovel", {
|
||||
},
|
||||
damage_groups = {fleshy=2},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:stone_axe", {
|
||||
@ -470,7 +366,6 @@ minetest.register_tool("core:stone_axe", {
|
||||
},
|
||||
damage_groups = {fleshy=2},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:stone_sword", {
|
||||
@ -484,7 +379,6 @@ minetest.register_tool("core:stone_sword", {
|
||||
},
|
||||
damage_groups = {fleshy=2},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- iron tier
|
||||
@ -500,7 +394,6 @@ minetest.register_tool("core:iron_pickaxe", {
|
||||
},
|
||||
damage_groups = {fleshy=4},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:iron_shovel", {
|
||||
@ -514,7 +407,6 @@ minetest.register_tool("core:iron_shovel", {
|
||||
},
|
||||
damage_groups = {fleshy=3},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:iron_axe", {
|
||||
@ -529,7 +421,6 @@ minetest.register_tool("core:iron_axe", {
|
||||
},
|
||||
damage_groups = {fleshy=5},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:iron_sword", {
|
||||
@ -543,7 +434,6 @@ minetest.register_tool("core:iron_sword", {
|
||||
},
|
||||
damage_groups = {fleshy=6},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- ironze tier
|
||||
@ -559,7 +449,6 @@ minetest.register_tool("core:ironze_pickaxe", {
|
||||
},
|
||||
damage_groups = {fleshy=4},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:ironze_shovel", {
|
||||
@ -573,7 +462,6 @@ minetest.register_tool("core:ironze_shovel", {
|
||||
},
|
||||
damage_groups = {fleshy=3},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:ironze_axe", {
|
||||
@ -588,7 +476,6 @@ minetest.register_tool("core:ironze_axe", {
|
||||
},
|
||||
damage_groups = {fleshy=5},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:ironze_sword", {
|
||||
@ -602,7 +489,6 @@ minetest.register_tool("core:ironze_sword", {
|
||||
},
|
||||
damage_groups = {fleshy=6},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
-- diamond tier
|
||||
@ -620,11 +506,8 @@ minetest.register_tool("core:diamond_pickaxe", {
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.diamonds_are_not_forever(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
minetest.register_tool("core:diamond_shovel", {
|
||||
@ -640,9 +523,7 @@ minetest.register_tool("core:diamond_shovel", {
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.diamonds_are_not_forever(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
@ -660,9 +541,7 @@ minetest.register_tool("core:diamond_axe", {
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.diamonds_are_not_forever(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
@ -679,8 +558,6 @@ minetest.register_tool("core:diamond_sword", {
|
||||
},
|
||||
|
||||
after_use = function(itemstack, user, node, digparams)
|
||||
|
||||
mcore.diamonds_are_not_forever(itemstack, user, node, digparams)
|
||||
|
||||
end,
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user