Working on baubles
This commit is contained in:
parent
e1d856d62b
commit
2f6f2a6388
46
README.md
46
README.md
|
@ -54,17 +54,36 @@ Dependencies: Minetest Game or MineClone.
|
|||
|
||||
<details><summary><h1>Changelog:</h1></summary>
|
||||
|
||||
### 6.0
|
||||
* New Features:
|
||||
* Infinite food (costs 64 energy to use, equal to steak)
|
||||
* Alchemical Chest
|
||||
* Repair Talisman (maybe, would only work in Alchemical Chest)
|
||||
* Covalence Dust (Aux1+right-click with Philosopher's Stone to open repairer, does not work with modded (non-Why) tools)
|
||||
* Mind, Life, Body, and Soul Stones (although MTG only has the soul stone).
|
||||
* Mercurial Eye (maybe)
|
||||
* Changes:
|
||||
* Tools that break multiple nodes at once (hammer, hoe, pickaxe, morningstar, and katar) use a better method that may (?) slightly decrease lag.
|
||||
* Ender pearls can now be crafted with 4 iron and the Philosopher's Stone.
|
||||
* A couple changes the Philosopher's Stone's transmutation:
|
||||
* Ice and obsidian can now be transmuted into water and lava, respectively.
|
||||
* It is now impossible to transmute between bedrock and barriers (MCL). I don't know why I did it in the first place :D
|
||||
|
||||
### 5.2
|
||||
* Removed unnecessary logging every time players take damage (I was testing stuff out with the armor)
|
||||
* Bugfixes
|
||||
* Removed unnecessary logging every time players take damage (I was testing stuff out with the armor)
|
||||
|
||||
### 5.1
|
||||
* Fixed Mineclonia energy values (I foolishly assumed that all items would have the same itemstrings and groups).
|
||||
* Added new Mineclonia items (pottery, sculk, smithing templates, suspicious sand, etc.)
|
||||
* Changed a couple of energy values (enchanted golden apple was way too cheap, clay seemed too expensive)
|
||||
* Sword/Katar AOE damage now matches ProjectE (DM sword = 12, RM sword = 16, katar = 1000... kinda OP). All AOE cooldowns (including swinging swords/katar) are now 0.7 seconds.
|
||||
* DM/RM pickaxe/hammer/morningstar dig times now are approximately the same as ProjectE (at full charge), meaning they are now maybe too fast.
|
||||
* Red Matter Armor no longer increases player health (the wiki lied to me).
|
||||
* A couple of changes to DM/RM armor in MineClone, which may or may not be noticeable. I really don't know.
|
||||
* New Features:
|
||||
* Added new Mineclonia items (pottery, sculk, smithing templates, suspicious sand, etc.)
|
||||
* Changes:
|
||||
* Changed a couple of energy values (enchanted golden apple was way too cheap, clay seemed too expensive)
|
||||
* Sword/Katar AOE damage now matches ProjectE (DM sword = 12, RM sword = 16, katar = 1000... kinda OP). All AOE cooldowns (including swinging swords/katar) are now 0.7 seconds.
|
||||
* DM/RM pickaxe/hammer/morningstar dig times now are approximately the same as ProjectE (at full charge), meaning they are now probably annoying fast.
|
||||
* Red Matter Armor no longer increases player health (the wiki lied to me).
|
||||
* A couple of changes to DM/RM armor in MineClone, which may or may not be noticeable. I really don't know.
|
||||
* Bugfixes:
|
||||
* Fixed Mineclonia energy values (I foolishly assumed that all items would have the same itemstrings and groups).
|
||||
|
||||
### 5.0 (the most insteresting release so far)
|
||||
**You MUST break and replace any existing Constructors, Deconstructors, and Energy Collectors when updating from any previous version. Nothing will be lost (hopefully). In Minetest Game, this is a bit of a problem (try blowing it up maybe? I don't know, sorry).**
|
||||
|
@ -246,17 +265,6 @@ Dependencies: Minetest Game or MineClone.
|
|||
|
||||
</details>
|
||||
|
||||
### Plans for 6.0
|
||||
* Automatically generated energy values based on crafting recipes
|
||||
* A slightly better method for tools that break multiple nodes at once (hammer, hoe, pickaxe, morningstar, and katar) that may slightly decrease lag.
|
||||
* Alchemical Chest
|
||||
* Repair Talisman (maybe, would only work in Alchemical Chest)
|
||||
* Covalence Dust (maybe custom repairer machine)
|
||||
* Mind, Life, Body, and Soul Stones (although MTG will only have the soul stone).
|
||||
* Ability to smelt with the Philosopher's Stone and coal/charcoal (irritatingly difficult, so maybe not)
|
||||
* Mercurial Eye (maybe)
|
||||
* Energy Condenser (maybe, IDK why anyone would use it)
|
||||
|
||||
### Features that I plan on adding eventually:
|
||||
* As soon as Minetest 5.8 comes out, better textures for armor...
|
||||
* Divining Rods
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
local function alchemical_formspec(color)
|
||||
end
|
||||
|
||||
local colors = {
|
||||
"Red",
|
||||
"Orange",
|
||||
"Yellow",
|
||||
"Green",
|
||||
"Cyan",
|
||||
"Blue",
|
||||
"Magenta",
|
||||
""
|
||||
}
|
||||
|
||||
for _, color in colors do
|
||||
local lower_color = string.lower(color)
|
||||
local itemstring = "exchangeclone:"..lower_color.."_advanced_alchemical_chest"
|
||||
minetest.register_node(itemstring, {
|
||||
description = color.." Alchemical Chest",
|
||||
groups = {container = 1, alchemical_chest = 1},
|
||||
after_place_node = function(pos, player, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", alchemical_formspec(color))
|
||||
meta:set_string("infotext", color.." Alchemical Chest")
|
||||
end,
|
||||
})
|
||||
local wool_itemstring = (exchangeclone.mcl and "mcl_wool:" or "wool:")..lower_color
|
||||
minetest.register_craft({
|
||||
output = itemstring,
|
||||
recipe = {
|
||||
{"exchangeclone:low_covalence_dust", "exchangeclone:medium_covalence_dust", "exchangeclone:high_covalence_dust"},
|
||||
|
||||
}
|
||||
})
|
||||
end
|
|
@ -0,0 +1,158 @@
|
|||
local storage = minetest.get_mod_storage()
|
||||
exchangeclone.bauble_data = minetest.deserialize(storage:get_string("bauble_data"))
|
||||
|
||||
--[[
|
||||
|
||||
Bauble data format:
|
||||
{
|
||||
action_name = {
|
||||
player = {
|
||||
player_name = true,
|
||||
player_name = true,
|
||||
}
|
||||
detached = {
|
||||
detached_name = true,
|
||||
detached_name = true,
|
||||
}
|
||||
node = {
|
||||
pos_string = true,
|
||||
pos_string = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
For example:
|
||||
{
|
||||
repair = {
|
||||
player = {
|
||||
"singleplayer",
|
||||
"ThePython"
|
||||
},
|
||||
detached = {
|
||||
"exchangeclone_transmutation_ThePython",
|
||||
}
|
||||
node = {
|
||||
["(0,0,0)"] = true,
|
||||
["(0,999,0)"] = true,
|
||||
}
|
||||
}
|
||||
density = {
|
||||
player = {
|
||||
"singleplayer"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
What is done with these values must be handled by the actions themselves.
|
||||
|
||||
--]]
|
||||
|
||||
local time = 0
|
||||
local saving_time = 0
|
||||
|
||||
function exchangeclone.run_bauble_actions()
|
||||
for _, data in ipairs(exchangeclone.bauble_data) do
|
||||
for _, action in ipairs(data[2]) do
|
||||
local func = exchangeclone.bauble_actions[action]
|
||||
if func then func(data) end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_globalstep(function(dtime)
|
||||
time = time + dtime
|
||||
saving_time = saving_time + dtime
|
||||
if time >= 1 then
|
||||
exchangeclone.run_bauble_actions()
|
||||
time = 0
|
||||
end
|
||||
end)
|
||||
|
||||
function exchangeclone.show_baubles(player)
|
||||
local formspec
|
||||
minetest.show_formspec(player:get_name(), "exchangeclone_baubles", formspec)
|
||||
end
|
||||
|
||||
minetest.register_tool("exchangeclone:bauble_accessor", {
|
||||
description = "Bauble Accessor",
|
||||
groups = {disable_repair = 1},
|
||||
})
|
||||
|
||||
minetest.register_tool("exchangeclone:repair_talisman", {
|
||||
description = "Repair Talisman",
|
||||
groups = {disable_repair = 1, bauble = 1}, -- kind of ironic :D
|
||||
bauble_info = {
|
||||
action = "repair",
|
||||
hotbar = true
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_tool("exchangeclone:gem_of_eternal_density", {
|
||||
description = "Gem of Eternal Density",
|
||||
groups = {disable_repair = 1, bauble = 1}, -- kind of ironic :D
|
||||
bauble_info = {
|
||||
action = "density",
|
||||
hotbar = true
|
||||
}
|
||||
})
|
||||
|
||||
function exchangeclone.check_baubles(inv, list)
|
||||
if not inv then return end
|
||||
list = list or "main"
|
||||
end
|
||||
|
||||
minetest.register_on_player_inventory_action(function(player, action, inventory, info)
|
||||
-- Make sure that it's the player owning the inventory, not just the player editing the inventory
|
||||
player = minetest.get_player_by_name(inventory:get_location().name)
|
||||
if not player then return end
|
||||
if action == "move" then
|
||||
local stack = inventory:get_stack(info.to_list, info.to_index)
|
||||
if stack:is_empty() then return end
|
||||
local def = minetest.registered_items[stack:get_name()]
|
||||
if not (def and def.groups.bauble) then return end
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
local function repair_item(stack)
|
||||
if not stack:is_empty() then
|
||||
local def = minetest.registered_items[stack:get_name()]
|
||||
if def
|
||||
and def.type == "tool"
|
||||
and (not def.wear_represents or def.wear_represents == "mechanical_wear")
|
||||
and stack:get_wear() ~= 0
|
||||
and ((exchangeclone.mcl and def.durability > 0) or exchangeclone.mtg) then
|
||||
local uses
|
||||
if exchangeclone.mcl then
|
||||
if def.durability then
|
||||
uses = def.durability
|
||||
elseif def._mcl_diggroups then
|
||||
uses = def._mcl_diggroups[1].uses
|
||||
end
|
||||
else
|
||||
if def.tool_capabilities and def.tool_capabilities.groupcaps then
|
||||
local groupcaps = def.tool_capabilities.groupcaps[1]
|
||||
uses = groupcaps.uses*math.pow(3, groupcaps.max_level)
|
||||
elseif def.groups.armor_use then
|
||||
uses = def.groups.armor_use
|
||||
end
|
||||
end
|
||||
if not uses then uses = 1000 end
|
||||
if uses then
|
||||
stack:set_wear(stack:get_wear() + 65535/uses)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return stack
|
||||
end
|
||||
|
||||
exchangeclone.bauble_actions = {
|
||||
repair = function(data)
|
||||
for _, player in ipairs(data.player) do
|
||||
local inv = player:get_inventory()
|
||||
for i = 1, inv:get_size("main") do
|
||||
inv:set_stack("main", i, repair_item(inv:get_stack("main", i)))
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
local cobble_itemstring = exchangeclone.mcl and "mcl_core:cobble" or "default:cobble"
|
||||
local charcoal_itemstring = exchangeclone.mcl and "mcl_core:charcoal" or "group:tree"
|
||||
local iron_itemstring = exchangeclone.mcl and "mcl_core:iron_ingot" or "default:steel_ingot"
|
||||
local redstone_itemstring = exchangeclone.mcl and "mcl_core:redstone" or "default:obsidian"
|
||||
local diamond_itemstring = exchangeclone.mcl and "mcl_core:diamond" or "default:diamond"
|
||||
local coal_itemstring = exchangeclone.mcl and "mcl_core:coal_lump" or "default:coal_lump"
|
||||
|
||||
minetest.register_craftitem("exchangeclone:low_covalence_dust", {
|
||||
description = "Low Covalence Dust"
|
||||
})
|
||||
|
||||
minetest.register_craftitem("exchangeclone:medium_covalence_dust", {
|
||||
description = "Medium Covalence Dust"
|
||||
})
|
||||
|
||||
minetest.register_craftitem("exchangeclone:high_covalence_dust", {
|
||||
description = "High Covalence Dust"
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:low_covalence_dust 40",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
cobble_itemstring,
|
||||
charcoal_itemstring,
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:medium_covalence_dust 40",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
iron_itemstring, redstone_itemstring
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:high_covalence_dust 40",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
diamond_itemstring, coal_itemstring
|
||||
}
|
||||
})
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
local function infinite_food_function(itemstack, player, pointed_thing)
|
||||
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
|
||||
local original = ItemStack(itemstack)
|
||||
if click_test ~= false then
|
||||
return click_test
|
||||
end
|
||||
local player_energy = exchangeclone.get_player_energy(player)
|
||||
if player_energy >= 64 then
|
||||
local hunger_restore = minetest.item_eat(8, original)
|
||||
hunger_restore(itemstack, player, pointed_thing)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
minetest.register_tool("exchangeclone:infinite_food", {
|
||||
description = "Infinite Food\nConsumes 64 energy when eaten",
|
||||
groups = { food = 2, eatable = 8, disable_repair = 1, fire_immune = 1},
|
||||
on_place = infinite_food_function,
|
||||
on_secondary_use = infinite_food_function,
|
||||
_mcl_saturation = 12.8,
|
||||
})
|
||||
|
||||
minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, player, pointed_thing)
|
||||
local player_energy = exchangeclone.get_player_energy(player)
|
||||
if itemstack:get_name() == "exchangeclone:infinite_food" then
|
||||
exchangeclone.set_player_energy(player, player_energy - 64)
|
||||
end
|
||||
end)
|
|
@ -40,5 +40,6 @@ if exchangeclone.mcl then
|
|||
end
|
||||
dofile(modpath.."/philosophers_stone.lua")
|
||||
dofile(modpath.."/pesa.lua")
|
||||
dofile(modpath.."/infinite_food.lua")
|
||||
dofile(modpath.."/transmutation_table.lua")
|
||||
dofile(modpath.."/furnaces.lua")
|
|
@ -276,11 +276,14 @@ end
|
|||
|
||||
exchangeclone.wield_scale = vector.multiply(exchangeclone.wield_scale, 1.4)
|
||||
|
||||
-- Diamonds are used a lot.
|
||||
exchangeclone.diamond_itemstring = "default:diamond"
|
||||
if exchangeclone.mcl then
|
||||
exchangeclone.diamond_itemstring = "mcl_core:diamond"
|
||||
end
|
||||
-- Itemstrings for various items
|
||||
exchangeclone.itemstrings = {
|
||||
diamond = exchangeclone.mcl and "mcl_core:diamond" or "default:diamond",
|
||||
gold = exchangeclone.mcl and "mcl_core:gold_ingot" or "default:gold_ingot",
|
||||
iron = exchangeclone.mcl and "mcl_core:iron_ingot" or "default:steel_ingot",
|
||||
coal = exchangeclone.mcl and "mcl_core:coal_lump" or "default:coal_lump",
|
||||
meseworth = exchangeclone.mcl and "mcl_core:emerald" or "default:mese_crystal"
|
||||
}
|
||||
|
||||
-- Returns a player's inventory formspec with the correct width and hotbar position for the current game
|
||||
function exchangeclone.inventory_formspec(x,y)
|
||||
|
@ -297,7 +300,7 @@ function exchangeclone.inventory_formspec(x,y)
|
|||
return formspec
|
||||
end
|
||||
|
||||
-- Copied from MineClone2
|
||||
-- Modified from MineClone2 {
|
||||
local doTileDrops = minetest.settings:get_bool("mcl_doTileDrops", true)
|
||||
|
||||
local function get_fortune_drops(fortune_drops, fortune_level)
|
||||
|
@ -339,7 +342,6 @@ local function get_drops(drop, toolname, param2, paramtype2)
|
|||
return drops
|
||||
end
|
||||
|
||||
-- Modified from MineClone2
|
||||
function exchangeclone.drop_items_on_player(pos, drops, player) --copied from MineClone's code
|
||||
if not exchangeclone.mcl then
|
||||
return minetest.handle_node_drops(pos, drops, player)
|
||||
|
@ -422,7 +424,6 @@ function exchangeclone.drop_items_on_player(pos, drops, player) --copied from Mi
|
|||
drops = get_drops(drop, tool:get_name(), dug_node.param2, nodedef.paramtype2)
|
||||
end
|
||||
end
|
||||
--]]
|
||||
|
||||
if player and mcl_experience.throw_xp and not silk_touch_drop then
|
||||
local experience_amount = minetest.get_item_group(dug_node.name, "xp")
|
||||
|
@ -452,6 +453,8 @@ function exchangeclone.drop_items_on_player(pos, drops, player) --copied from Mi
|
|||
end
|
||||
end
|
||||
|
||||
-- }
|
||||
|
||||
-- Get the direction a player is facing (rounded to -1, 0, and 1 for each axis)
|
||||
function exchangeclone.get_face_direction(player)
|
||||
local h_look = player:get_look_horizontal()
|
||||
|
|
|
@ -2,5 +2,6 @@ name = exchangeclone
|
|||
title = ExchangeClone
|
||||
description = The main part of the modpack (depends on both the other mods)
|
||||
min_minetest_version = 5.5
|
||||
depends = item_tracking
|
||||
optional_depends = 3d_armor, mcl_item_id, mcl_core, default, moreswords, mcl_stairs, meat_blocks, sticky_things, fake_liquids, sound_machine, stairs, mcl_dispensers, farming, mobs_mc, screwdriver
|
||||
author = ThePython10110
|
|
@ -49,7 +49,9 @@ exchangeclone.node_transmutations = {
|
|||
["mcl_farming:melon"] = "mcl_farming:pumpkin",
|
||||
["mcl_core:water_source"] = "mcl_core:ice",
|
||||
["mclx_core:river_water_source"] = "mcl_core:ice",
|
||||
["mcl_core:ice"] = "mcl_core:water_source",
|
||||
["mcl_core:lava_source"] = "mcl_core:obsidian",
|
||||
["mcl_core:obsidian"] = "mcl_core:lava_source",
|
||||
["mcl_flowers:dandelion"] = "mcl_flowers:poppy",
|
||||
["mcl_flowers:poppy"] = "mcl_flowers:dandelion",
|
||||
["mcl_mushrooms:mushroom_brown"] = "mcl_mushrooms:mushroom_red",
|
||||
|
@ -106,8 +108,6 @@ exchangeclone.node_transmutations = {
|
|||
["mcl_deepslate:deepslate_with_redstone"] = "mcl_core:stone_with_redstone",
|
||||
["mcl_deepslate:deepslate_with_diamond"] = "mcl_core:stone_with_diamond",
|
||||
["mcl_deepslate:deepslate_with_copper"] = "mcl_copper:stone_with_copper",
|
||||
["mcl_core:bedrock"] = "mcl_core:barrier",
|
||||
["mcl_core:barrier"] = "mcl_core:bedrock",
|
||||
["mcl_end:end_stone"] = "mcl_nether:netherrack",
|
||||
["mcl_nether:soul_sand"] = "mcl_blackstone:soul_soil",
|
||||
["mcl_blackstone:soul_soil"] = "mcl_nether:soul_sand",
|
||||
|
@ -138,7 +138,9 @@ exchangeclone.node_transmutations = {
|
|||
["default:silver_sandstone"] = "default:gravel",
|
||||
["default:water_source"] = "default:ice",
|
||||
["default:river_water_source"] = "default:ice",
|
||||
["default:ice"] = "default:water_source",
|
||||
["default:lava_source"] = "default:obsidian",
|
||||
["default:obsidian"] = "default:lava_source",
|
||||
["flowers:mushroom_brown"] = "flowers:mushroom_red",
|
||||
["flowers:mushroom_red"] = "flowers:mushroom_brown",
|
||||
["flowers:dandelion_yellow"] = "flowers:rose",
|
||||
|
@ -266,56 +268,7 @@ if exchangeclone.mcl then
|
|||
end
|
||||
end
|
||||
|
||||
--[[ local fuel_items = {
|
||||
["mcl_core:charcoal_lump"] = true,
|
||||
["mcl_core:coal_lump"] = true,
|
||||
["default:coal_lump"] = true,
|
||||
}
|
||||
|
||||
minetest.register_on_joinplayer(function(player, last_login)
|
||||
local inv = player:get_inventory()
|
||||
inv:set_size("exchangeclone_smelting_input", 1)
|
||||
inv:set_size("exchangeclone_smelting_output", 1)
|
||||
inv:set_size("exchangeclone_smelting_fuel", 1)
|
||||
end)
|
||||
|
||||
minetest.register_allow_player_inventory_action(function(player, action, inventory, info)
|
||||
if action == "put" then
|
||||
if info.listname == "exchangeclone_smelting_output" then
|
||||
return 0
|
||||
elseif info.listname == "exchangeclone_smelting_fuel" then
|
||||
if not fuel_items[info.stack:get_name()] then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
elseif action == "move" then
|
||||
if info.to_list == "exchangeclone_smelting_output" then
|
||||
return 0
|
||||
elseif info.to_list == "exchangeclone_smelting_fuel" then
|
||||
if not fuel_items[inventory:get_stack(info.from_list, info.from_index):get_name()] then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local function set_smelting_output(player)
|
||||
end
|
||||
|
||||
minetest.register_on_player_inventory_action(function(player, action, inventory, info)
|
||||
if action == "put" then
|
||||
if info.listname == "exchangeclone_smelting_input" or info.listname == "exchangeclone_smelting_fuel" then
|
||||
set_smelting_output(player)
|
||||
end
|
||||
elseif action == "take" then
|
||||
if info.listname == "exchangeclone_smelting_input"
|
||||
or info.listname == "exchangeclone_smelting_fuel" then
|
||||
set_smelting_output(player)
|
||||
elseif info.listname == "exchangeclone_smelting_output" then
|
||||
-- TODO
|
||||
end
|
||||
end
|
||||
end) --]]
|
||||
|
||||
local function on_right_click(itemstack, player, pointed_thing)
|
||||
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
|
||||
|
@ -367,114 +320,6 @@ if exchangeclone.mcl then
|
|||
usagehelp = usagehelp..extra_stuff
|
||||
end
|
||||
|
||||
--[[ Could NOT figure out how to make this work.
|
||||
|
||||
for name, def in pairs(minetest.registered_nodes) do
|
||||
local result, _ = minetest.get_craft_result({
|
||||
method = "cooking",
|
||||
width = 1,
|
||||
items = {ItemStack(name)}
|
||||
})
|
||||
local name = result.item:get_name()
|
||||
if minetest.registered_items[name] then
|
||||
minetest.registered_items[name].groups.exchangeclone_cookable = true
|
||||
end
|
||||
end
|
||||
|
||||
local recipe_table = {"exchangeclone:philosophers_stone"}
|
||||
|
||||
minetest.register_craftitem("exchangeclone:cooked_item", {description = "Cooked Item"})
|
||||
|
||||
for i = 1,7 do
|
||||
table.insert(recipe_table, "group:exchangeclone_cookable")
|
||||
for fuel, _ in pairs(fuel_items) do
|
||||
recipe_table[2] = fuel
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:cooked_item "..tostring(i),
|
||||
type = "shapeless",
|
||||
recipe = table.copy(recipe_table)
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_craft_predict(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if itemstack == ItemStack("exchangeclone:cooked_item") then
|
||||
local phil = 0 -- yes, I'm calling it Phil.
|
||||
local fuel = 0
|
||||
local item_type = false
|
||||
local item_count = 0
|
||||
for _, item in ipairs(old_craft_grid) do
|
||||
local name = item:get_name()
|
||||
if name == "" then
|
||||
-- do nothing
|
||||
elseif name == "exchangeclone:philosophers_stone" then
|
||||
phil = phil + 1
|
||||
elseif fuel_items[name] then
|
||||
fuel = fuel + 1
|
||||
else
|
||||
if item_type and item_type ~= name then
|
||||
minetest.log(dump({item_type, name}))
|
||||
return
|
||||
else
|
||||
item_type = name
|
||||
item_count = item_count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.log(dump({phil=phil,fuel=fuel,item_type=item_type,item_count=item_count}))
|
||||
if not (item_type and (phil == 1) and (fuel == 1)) then return end
|
||||
local result, _ = minetest.get_craft_result({
|
||||
method = "cooking",
|
||||
width = 1,
|
||||
items = {ItemStack(item_type)}
|
||||
})
|
||||
result = result.item
|
||||
if result:get_name() ~= "" then
|
||||
result:set_count(item_count)
|
||||
return result
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if itemstack == ItemStack("exchangeclone:cooked_item") then
|
||||
local phil = 0 -- yes, I'm calling it Phil.
|
||||
local fuel = 0
|
||||
local item_type = false
|
||||
local item_count = 0
|
||||
for _, item in ipairs(old_craft_grid) do
|
||||
local name = item:get_name()
|
||||
if name == "" then
|
||||
-- do nothing
|
||||
elseif name == "exchangeclone:philosophers_stone" then
|
||||
phil = phil + 1
|
||||
elseif fuel_items[name] then
|
||||
fuel = fuel + 1
|
||||
else
|
||||
if item_type and item_type ~= name then
|
||||
minetest.log(dump({item_type, name}))
|
||||
return
|
||||
else
|
||||
item_type = name
|
||||
item_count = item_count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
minetest.log(dump({phil=phil,fuel=fuel,item_type=item_type,item_count=item_count}))
|
||||
if not (item_type and (phil == 1) and (fuel == 1)) then return end
|
||||
local result, _ = minetest.get_craft_result({
|
||||
method = "cooking",
|
||||
width = 1,
|
||||
items = {ItemStack(item_type)}
|
||||
})
|
||||
result = result.item
|
||||
if result:get_name() ~= "" then
|
||||
result:set_count(item_count)
|
||||
return result
|
||||
end
|
||||
end
|
||||
end) --]]
|
||||
|
||||
minetest.register_tool("exchangeclone:philosophers_stone", {
|
||||
description = "Philosopher's Stone\nAlways returned when crafting",
|
||||
inventory_image = "exchangeclone_philosophers_stone.png",
|
||||
|
@ -489,7 +334,7 @@ minetest.register_tool("exchangeclone:philosophers_stone", {
|
|||
groups = {philosophers_stone = 1, disable_repair = 1, fire_immune = 1}
|
||||
})
|
||||
|
||||
local diamond = "default:diamond"
|
||||
local diamond = exchangeclone.itemstrings.diamond
|
||||
local corner = "default:tin_ingot"
|
||||
local side = "default:obsidian"
|
||||
|
||||
|
@ -532,43 +377,22 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:iron_ingot",
|
||||
output = exchangeclone.itemstrings.iron,
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:coal_lump",
|
||||
"mcl_core:coal_lump"
|
||||
exchangeclone.itemstrings.coal,
|
||||
exchangeclone.itemstrings.coal,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:steel_ingot",
|
||||
output = exchangeclone.itemstrings.coal.." 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:coal_lump",
|
||||
"default:coal_lump"
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:coal_lump 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:iron_ingot",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:coal_lump 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:steel_ingot",
|
||||
exchangeclone.itemstrings.iron
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
@ -610,6 +434,18 @@ minetest.register_craft({
|
|||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_throwing:ender_pearl",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:iron_ingot 2",
|
||||
|
@ -666,139 +502,70 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:iron_ingot 8",
|
||||
output = exchangeclone.itemstrings.iron.." 8",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:gold_ingot"
|
||||
exchangeclone.itemstrings.gold
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:steel_ingot 8",
|
||||
output = exchangeclone.itemstrings.gold,
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:gold_ingot"
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
exchangeclone.itemstrings.iron,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:gold_ingot",
|
||||
output = exchangeclone.itemstrings.meseworth,
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
"mcl_core:iron_ingot",
|
||||
exchangeclone.itemstrings.gold,
|
||||
exchangeclone.itemstrings.gold,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:gold_ingot",
|
||||
output = exchangeclone.itemstrings.gold.." 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
"default:steel_ingot",
|
||||
exchangeclone.itemstrings.meseworth,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:mese_crystal",
|
||||
output = exchangeclone.itemstrings.diamond,
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:gold_ingot",
|
||||
"default:gold_ingot",
|
||||
exchangeclone.itemstrings.meseworth,
|
||||
exchangeclone.itemstrings.meseworth,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:gold_ingot 2",
|
||||
output = exchangeclone.itemstrings.meseworth.." 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:mese_crystal",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:diamond",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:mese_crystal",
|
||||
"default:mese_crystal",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:mese_crystal 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:diamond"
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:emerald",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:gold_ingot",
|
||||
"mcl_core:gold_ingot",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:gold_ingot 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:emerald"
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:diamond",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:emerald",
|
||||
"mcl_core:emerald",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:emerald 2",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:diamond"
|
||||
exchangeclone.itemstrings.diamond
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
@ -888,46 +655,21 @@ minetest.register_craft({
|
|||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
if exchangeclone.mcl then
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:alchemical_coal",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"mcl_core:coal_lump",
|
||||
"mcl_core:coal_lump",
|
||||
"mcl_core:coal_lump",
|
||||
"mcl_core:coal_lump",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = "exchangeclone:alchemical_coal",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"default:coal_lump",
|
||||
"default:coal_lump",
|
||||
"default:coal_lump",
|
||||
"default:coal_lump",
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "default:coal_lump 4",
|
||||
output = "exchangeclone:alchemical_coal",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
"exchangeclone:alchemical_coal",
|
||||
exchangeclone.itemstrings.coal,
|
||||
exchangeclone.itemstrings.coal,
|
||||
exchangeclone.itemstrings.coal,
|
||||
exchangeclone.itemstrings.coal,
|
||||
},
|
||||
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_core:coal_lump 4",
|
||||
output = exchangeclone.itemstrings.coal.." 4",
|
||||
type = "shapeless",
|
||||
recipe = {
|
||||
"exchangeclone:philosophers_stone",
|
||||
|
|
Loading…
Reference in New Issue