Compare commits

..

No commits in common. "00a087a992482fd71b7eaa9dc83ae8abfb2f747e" and "a003f57e5275204559d8a2782e1a6a83ff873c2e" have entirely different histories.

111 changed files with 199 additions and 238 deletions

File diff suppressed because one or more lines are too long

View File

@ -52,8 +52,8 @@ Dependencies: Minetest Game or MineClone.
![Screenshot](screenshot.png) ![Screenshot](screenshot.png)
![Transmutation GUI Screenshot](transmutation_screenshot.png) ![Transmutation GUI Screenshot](transmutation_screenshot.png)
## Sources/license: (note: this will change soon) ## Sources/license:
* Code: Originally started as a fork of Enchant97's mod [Element Exchange](https://github.com/enchant97/minetest_element_exchange). Since then, there have been tons of new bugs and features (at this point, at least 95% of the code is my own). Both this mod and Element Exchange are licenced under GPLv3+. Based on Equivalent Exchange and ProjectE, mods for Minecraft. * Code: Forked and *heavily* modified from Enchant97's mod [Element Exchange](https://github.com/enchant97/minetest_element_exchange) (at this point, I'd say 95% of the code is my own). Both this mod and Element Exchange are licenced under GPLv3+. Based on Equivalent Exchange and ProjectE, mods for MineCraft.
* Textures: * Textures:
* Energy Collector, Deconstructor, Constructor: Directly from Element Exchange, GPLv3+. * Energy Collector, Deconstructor, Constructor: Directly from Element Exchange, GPLv3+.
* Exchange Orb: *Slightly* modified from Element Exchange (I just changed the color to white so it could change colors correctly) * Exchange Orb: *Slightly* modified from Element Exchange (I just changed the color to white so it could change colors correctly)
@ -67,8 +67,7 @@ Dependencies: Minetest Game or MineClone.
### PLANS/TODO FOR v7.0 (see dev branch for current progress) ### PLANS/TODO FOR v7.0 (see dev branch for current progress)
[ ] Achievements/advancements/awards [ ] Achievements/advancements/awards
[ ] Textures/sounds from ProjectE/ProjectExpansion (I wanted this for a while, but I couldn't figure out how to get permission until I saw [this tweet](https://twitter.com/MercuriusXeno/status/1662203934713212932) from the creator of Equivalent Exchange) * Improvements to tools (mostly only in MCL at the moment)
[ ] Improvements to tools (mostly only in MCL at the moment)
[x] Wear bar for charge level [x] Wear bar for charge level
[x] Charge levels match ProjectE (both in number and in range) [x] Charge levels match ProjectE (both in number and in range)
[x] Charge level affects speed [x] Charge level affects speed
@ -80,8 +79,6 @@ Dependencies: Minetest Game or MineClone.
[x] Changes to armor (but it's so hard to get it right) [x] Changes to armor (but it's so hard to get it right)
* Unfortunately, due to an [engine bug](https://github.com/minetest/minetest/issues/14344), this means that players are kind of invincible most of the time. * Unfortunately, due to an [engine bug](https://github.com/minetest/minetest/issues/14344), this means that players are kind of invincible most of the time.
[ ] Remove and add alias for DM/RM shields [ ] Remove and add alias for DM/RM shields
[ ] Upgrades affect energy value
[ ] Multiple levels of Exchange Orbs (change to Klein Stars, adjust recipes)
[ ] Divining rods [ ] Divining rods
[ ] Swiftwolf's Rending Gale (maybe rename?) [ ] Swiftwolf's Rending Gale (maybe rename?)
[ ] Mind, Life, Body and Soul Stones (Mind = MCL only) [ ] Mind, Life, Body and Soul Stones (Mind = MCL only)
@ -97,8 +94,6 @@ Dependencies: Minetest Game or MineClone.
[ ] Mind, Life, Body, and Soul Stones [ ] Mind, Life, Body, and Soul Stones
[ ] Modify tools page [ ] Modify tools page
[ ] Remove page for PESA [ ] Remove page for PESA
[ ] DM/RM blocks can only be broken by correct (or higher) type.
[ ] Change energy collector recipes to match ProjectE
## Changelog ## Changelog
<details><summary>Look at this fancy expanding changelog</summary> <details><summary>Look at this fancy expanding changelog</summary>

View File

@ -107,6 +107,8 @@ for color, color_data in pairs(exchangeclone.colors) do
local bag_modifier = "^[multiply:"..color_data.hex local bag_modifier = "^[multiply:"..color_data.hex
if color == "white" then bag_modifier = "" end if color == "white" then bag_modifier = "" end
if color == "black" then bag_modifier = "^[invert:rgb" end if color == "black" then bag_modifier = "^[invert:rgb" end
local chest_modifier = bag_modifier
if color == "black" then chest_modifier = "^[invert:rgb^[colorize:#000000:220" end
local function alchemical_bag_action(itemstack, player, pointed_thing) local function alchemical_bag_action(itemstack, player, pointed_thing)
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing) local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
@ -161,12 +163,12 @@ for color, color_data in pairs(exchangeclone.colors) do
groups = {container = 1, advanced_alchemical_chest = 1, cracky = 2, pickaxey = 2}, groups = {container = 1, advanced_alchemical_chest = 1, cracky = 2, pickaxey = 2},
paramtype2 = "4dir", paramtype2 = "4dir",
tiles = { tiles = {
"exchangeclone_advanced_alchemical_chest_top.png", "exchangeclone_advanced_alchemical_chest_top.png"..chest_modifier,
"exchangeclone_alchemical_chest_bottom.png", "exchangeclone_advanced_alchemical_chest_bottom.png"..chest_modifier,
"exchangeclone_alchemical_chest_side.png", "exchangeclone_advanced_alchemical_chest_side.png"..chest_modifier,
"exchangeclone_alchemical_chest_side.png", "exchangeclone_advanced_alchemical_chest_side.png"..chest_modifier,
"exchangeclone_alchemical_chest_side.png", "exchangeclone_advanced_alchemical_chest_side.png"..chest_modifier,
"exchangeclone_alchemical_chest_side.png^(exchangeclone_advanced_alchemical_chest_overlay.png^[multiply:"..color_data.hex..")", "exchangeclone_advanced_alchemical_chest_front.png"..chest_modifier,
}, },
on_construct = alchemical_on_construct(color_data.name) on_construct = alchemical_on_construct(color_data.name)
}) })

View File

@ -2,7 +2,7 @@ local S = minetest.get_translator()
local function get_armor_texture(type, matter, preview) local function get_armor_texture(type, matter, preview)
local modifier local modifier
-- hsl unfortunately only works in 5.8 -- hsl only works in 5.8 which hasn't been released yet
if matter == "dark" then if matter == "dark" then
modifier = "^[multiply:#222222" modifier = "^[multiply:#222222"
--modifier = "^[hsl:0:-100:-100^[hsl:0:-100:-100" --modifier = "^[hsl:0:-100:-100^[hsl:0:-100:-100"
@ -11,9 +11,7 @@ local function get_armor_texture(type, matter, preview)
--modifier = "^[hsl:-180:100:-100" --modifier = "^[hsl:-180:100:-100"
end end
local result local result
if type:sub(1,3) == "inv" then if exchangeclone.mcl then
result = "exchangeclone_"..type..".png"
elseif exchangeclone.mcl then
result = "exchangeclone_mcl_"..type.."_base.png"..modifier result = "exchangeclone_mcl_"..type.."_base.png"..modifier
else else
result = "exchangeclone_mtg_"..type.."_base" result = "exchangeclone_mtg_"..type.."_base"
@ -209,10 +207,10 @@ if exchangeclone.mcl then
end end
end end
-- Until Minetest fixes an issue, there's no way to make this work correctly.
mcl_damage.register_modifier(function(obj, damage, reason) mcl_damage.register_modifier(function(obj, damage, reason)
local start_time = minetest.get_us_time() local start_time = minetest.get_us_time()
if not obj:is_player() then return end if not obj:is_player() then return end
minetest.log(dump({damage, reason}))
local inv = mcl_util.get_inventory(obj) local inv = mcl_util.get_inventory(obj)
local blocked = 0 local blocked = 0
if inv then if inv then

View File

@ -2,7 +2,7 @@ local S = minetest.get_translator()
local formspec = local formspec =
"size["..(exchangeclone.mcl and 9 or 8)..",9]".. "size["..(exchangeclone.mcl and 9 or 8)..",9]"..
"label[2,1;"..S("Star").."]".. "label[2,1;"..S("Orb").."]"..
"list[context;fuel;2,2;1,1;]".. "list[context;fuel;2,2;1,1;]"..
"label[3,1;"..S("Source").."]".. "label[3,1;"..S("Source").."]"..
"list[context;src;3,2;1,1;]".. "list[context;src;3,2;1,1;]"..
@ -25,12 +25,12 @@ end
minetest.register_alias("exchangeclone:element_constructor", "exchangeclone:constructor") minetest.register_alias("exchangeclone:element_constructor", "exchangeclone:constructor")
local function constructor_action(pos) local function constructor_action(pos)
local using_star = true local using_orb = true
local player local player
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "klein_star" < 1 then if inv:get_stack("fuel", 1):get_name() ~= "exchangeclone:exchange_orb" then
using_star = false using_orb = false
player = minetest.get_player_by_name(meta:get_string("exchangeclone_placer")) player = minetest.get_player_by_name(meta:get_string("exchangeclone_placer"))
if not (player and player ~= "") then return end if not (player and player ~= "") then return end
end end
@ -45,10 +45,10 @@ local function constructor_action(pos)
end end
end end
local result = exchangeclone.handle_alias(src_stack) local result = exchangeclone.handle_alias(src_stack)
-- make sure star/player has enough energy -- make sure orb/player has enough energy
local current_energy local current_energy
if using_star then if using_orb then
current_energy = exchangeclone.get_star_energy(inv, "fuel", 1) current_energy = exchangeclone.get_orb_energy(inv, "fuel", 1)
else else
current_energy = exchangeclone.get_player_energy(player) current_energy = exchangeclone.get_player_energy(player)
end end
@ -57,8 +57,8 @@ local function constructor_action(pos)
local max_amount = math.min(src_stack:get_stack_max(), math.floor(current_energy/energy_value)) local max_amount = math.min(src_stack:get_stack_max(), math.floor(current_energy/energy_value))
local added_amount = max_amount - inv:add_item("dst", ItemStack(result.." "..max_amount)):get_count() local added_amount = max_amount - inv:add_item("dst", ItemStack(result.." "..max_amount)):get_count()
local result_energy = math.min(current_energy, current_energy - (energy_value * added_amount)) -- not sure if "math.min()" is necessary local result_energy = math.min(current_energy, current_energy - (energy_value * added_amount)) -- not sure if "math.min()" is necessary
if using_star then if using_orb then
exchangeclone.set_star_energy(inv, "fuel", 1, result_energy) exchangeclone.set_orb_energy(inv, "fuel", 1, result_energy)
else else
exchangeclone.set_player_energy(player, result_energy) exchangeclone.set_player_energy(player, result_energy)
end end
@ -90,7 +90,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
return 0 return 0
end end
if listname == "fuel" then if listname == "fuel" then
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -155,13 +155,13 @@ minetest.register_node("exchangeclone:constructor", {
allow_metadata_inventory_take = allow_metadata_inventory_take, allow_metadata_inventory_take = allow_metadata_inventory_take,
on_timer = constructor_action, on_timer = constructor_action,
_mcl_hoppers_on_try_pull = exchangeclone.mcl2_hoppers_on_try_pull(), _mcl_hoppers_on_try_pull = exchangeclone.mcl2_hoppers_on_try_pull(),
_mcl_hoppers_on_try_push = exchangeclone.mcl2_hoppers_on_try_push(nil, function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 end), _mcl_hoppers_on_try_push = exchangeclone.mcl2_hoppers_on_try_push(nil, function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end),
_mcl_hoppers_on_after_push = function(pos) _mcl_hoppers_on_after_push = function(pos)
minetest.get_node_timer(pos):start(1.0) minetest.get_node_timer(pos):start(1.0)
end, end,
_on_hopper_in = exchangeclone.mcla_on_hopper_in( _on_hopper_in = exchangeclone.mcla_on_hopper_in(
nil, nil,
function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 end function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end
), ),
}) })
@ -186,7 +186,7 @@ if exchangeclone.pipeworks then
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if get_list(direction) == "fuel" then if get_list(direction) == "fuel" then
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return inv:room_for_item("fuel", stack) return inv:room_for_item("fuel", stack)
end end
else else
@ -207,8 +207,8 @@ minetest.register_craft({
type = "shaped", type = "shaped",
output = "exchangeclone:constructor", output = "exchangeclone:constructor",
recipe = { recipe = {
{"exchangeclone:klein_star_drei"}, {"exchangeclone:exchange_orb"},
{recipe_ingredient}, {recipe_ingredient},
{"exchangeclone:klein_star_drei"} {"exchangeclone:exchange_orb"}
} }
}) })

View File

@ -25,21 +25,21 @@ local charcoal_itemstring = exchangeclone.mcl and "mcl_core:charcoal_lump" or "g
minetest.register_craftitem("exchangeclone:low_covalence_dust", { minetest.register_craftitem("exchangeclone:low_covalence_dust", {
description = S("Low Covalence Dust"), description = S("Low Covalence Dust"),
groups = {covalence_dust = 1}, groups = {covalence_dust = 1},
inventory_image = "exchangeclone_low_covalence_dust.png", inventory_image = "exchangeclone_dust.png^[colorize:#00ff00:128",
wield_image = "exchangeclone_low_covalence_dust.png", wield_image = "exchangeclone_dust.png^[colorize:#00ff00:128",
}) })
minetest.register_craftitem("exchangeclone:medium_covalence_dust", { minetest.register_craftitem("exchangeclone:medium_covalence_dust", {
description = S("Medium Covalence Dust"), description = S("Medium Covalence Dust"),
groups = {covalence_dust = 2}, groups = {covalence_dust = 2},
inventory_image = "exchangeclone_medium_covalence_dust.png", inventory_image = "exchangeclone_dust.png^[colorize:#00ffff:128",
wield_image = "exchangeclone_medium_covalence_dust.png", wield_image = "exchangeclone_dust.png^[colorize:#00ffff:128",
}) })
minetest.register_craftitem("exchangeclone:high_covalence_dust", { minetest.register_craftitem("exchangeclone:high_covalence_dust", {
description = S("High Covalence Dust"), description = S("High Covalence Dust"),
groups = {covalence_dust = 3}, groups = {covalence_dust = 3},
inventory_image = "exchangeclone_high_covalence_dust.png", inventory_image = "exchangeclone_dust.png^[colorize:#0000ff:128",
wield_image = "exchangeclone_high_covalence_dust.png", wield_image = "exchangeclone_dust.png^[colorize:#0000ff:128",
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -47,36 +47,6 @@ minetest.register_craft({
burntime = 5120, burntime = 5120,
}) })
minetest.register_node("exchangeclone:alchemical_coal_block", {
description = S("Alchemical Coal Block"),
tiles = {"exchangeclone_alchemical_coal_block.png"},
is_ground_content = false,
sounds = exchangeclone.sound_mod.node_sound_stone_defaults(),
groups = {pickaxey=5, material_stone=1, cracky = 3, building_block = 1, level = get_level(2)}, --ridiculous workaround
_mcl_blast_resistance = 8,
_mcl_hardness = 7,
})
minetest.register_node("exchangeclone:mobius_fuel_block", {
description = S("Mobius Fuel Block"),
tiles = {"exchangeclone_mobius_fuel_block.png"},
is_ground_content = false,
sounds = exchangeclone.sound_mod.node_sound_stone_defaults(),
groups = {pickaxey=5, material_stone=1, cracky = 3, building_block = 1, level = get_level(2)}, --ridiculous workaround
_mcl_blast_resistance = 10,
_mcl_hardness = 8,
})
minetest.register_node("exchangeclone:aeternalis_fuel_block", {
description = S("Aeternalis Fuel Block"),
tiles = {"exchangeclone_aeternalis_fuel_block.png"},
is_ground_content = false,
sounds = exchangeclone.sound_mod.node_sound_stone_defaults(),
groups = {pickaxey=5, material_stone=1, cracky = 3, building_block = 1, level = get_level(2)}, --ridiculous workaround
_mcl_blast_resistance = 10,
_mcl_hardness = 8,
})
minetest.register_craftitem("exchangeclone:dark_matter", { minetest.register_craftitem("exchangeclone:dark_matter", {
description = S("Dark Matter Orb"), description = S("Dark Matter Orb"),
wield_image = "exchangeclone_dark_matter.png", wield_image = "exchangeclone_dark_matter.png",
@ -96,7 +66,7 @@ minetest.register_node("exchangeclone:dark_matter_block", {
tiles = {"exchangeclone_dark_matter_block.png"}, tiles = {"exchangeclone_dark_matter_block.png"},
is_ground_content = false, is_ground_content = false,
sounds = exchangeclone.sound_mod.node_sound_stone_defaults(), sounds = exchangeclone.sound_mod.node_sound_stone_defaults(),
groups = {pickaxey=5, material_stone=1, cracky = 3, building_block = 1, level = get_level(4)}, --ridiculous workaround groups = {pickaxey=5, material_stone=1, cracky = 3, level = get_level(4)}, --ridiculous workaround
_mcl_blast_resistance = 1500, _mcl_blast_resistance = 1500,
_mcl_hardness = 12, _mcl_hardness = 12,
}) })
@ -107,19 +77,29 @@ minetest.register_node("exchangeclone:red_matter_block", {
is_ground_content = false, is_ground_content = false,
light_source = 14, light_source = 14,
sounds = exchangeclone.sound_mod.node_sound_stone_defaults(), sounds = exchangeclone.sound_mod.node_sound_stone_defaults(),
groups = {pickaxey=6, material_stone=1, cracky = 3, building_block = 1, level = get_level(5)}, groups = {pickaxey=6, material_stone=1, cracky = 3, level = get_level(5)},
_mcl_blast_resistance = 1500, _mcl_blast_resistance = 1500,
_mcl_hardness = 37, _mcl_hardness = 37,
}) })
if exchangeclone.mcl then
minetest.register_craft({ minetest.register_craft({
output = "exchangeclone:dark_matter", output = "exchangeclone:dark_matter",
recipe = { recipe = {
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"}, {"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"},
{"exchangeclone:aeternalis_fuel", exchangeclone.mcl and "mcl_core:diamondblock" or 'default:diamondblock', "exchangeclone:aeternalis_fuel"}, {"exchangeclone:aeternalis_fuel", "mcl_core:diamondblock", "exchangeclone:aeternalis_fuel"},
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"} {"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"}
} }
}) })
else
minetest.register_craft({
output = "exchangeclone:dark_matter",
recipe = {
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"},
{"exchangeclone:aeternalis_fuel", "default:diamondblock", "exchangeclone:aeternalis_fuel"},
{"exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel", "exchangeclone:aeternalis_fuel"}
}
})
end
minetest.register_craft({ minetest.register_craft({
output = "exchangeclone:red_matter", output = "exchangeclone:red_matter",

View File

@ -4,7 +4,7 @@ local formspec =
"size["..(exchangeclone.mcl and 9 or 8)..",9]".. "size["..(exchangeclone.mcl and 9 or 8)..",9]"..
"label[2,1;"..S("Input").."]".. "label[2,1;"..S("Input").."]"..
"list[context;src;2,2;1,1;]".. "list[context;src;2,2;1,1;]"..
"label[5,1;"..S("Star").."]".. "label[5,1;"..S("Orb").."]"..
"list[context;fuel;5,2;1,1;]".. "list[context;fuel;5,2;1,1;]"..
exchangeclone.inventory_formspec(0,5).. exchangeclone.inventory_formspec(0,5)..
"listring[current_player;main]".. "listring[current_player;main]"..
@ -22,19 +22,17 @@ end
minetest.register_alias("exchangeclone:element_deconstructor", "exchangeclone:deconstructor") minetest.register_alias("exchangeclone:element_deconstructor", "exchangeclone:deconstructor")
local function deconstructor_action(pos, elapsed) local function deconstructor_action(pos, elapsed)
local limit local limit = exchangeclone.orb_max
local using_star = true local using_orb = true
local player local player
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "klein_star") < 1 then if inv:get_stack("fuel", 1):get_name() ~= "exchangeclone:exchange_orb" then
limit = exchangeclone.limit limit = exchangeclone.limit
using_star = false using_orb = false
player = minetest.get_player_by_name(meta:get_string("exchangeclone_placer")) player = minetest.get_player_by_name(meta:get_string("exchangeclone_placer"))
if not (player and player ~= "") then return end if not (player and player ~= "") then return end
else
limit = exchangeclone.get_star_max(inv:get_stack("fuel", 1))
end end
local stack = inv:get_stack("src", 1) local stack = inv:get_stack("src", 1)
@ -44,13 +42,13 @@ local function deconstructor_action(pos, elapsed)
if wear and wear > 0 then if wear and wear > 0 then
individual_energy_value = math.max(math.floor(individual_energy_value * ((65536 - wear)/65536)), 1) individual_energy_value = math.max(math.floor(individual_energy_value * ((65536 - wear)/65536)), 1)
end end
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
individual_energy_value = individual_energy_value + exchangeclone.get_star_itemstack_energy(stack) individual_energy_value = individual_energy_value + exchangeclone.get_orb_itemstack_energy(stack)
end end
local current_energy local current_energy
if using_star then if using_orb then
current_energy = exchangeclone.get_star_energy(inv, "fuel", 1) current_energy = exchangeclone.get_orb_energy(inv, "fuel", 1)
else else
current_energy = exchangeclone.get_player_energy(player) current_energy = exchangeclone.get_player_energy(player)
end end
@ -60,8 +58,8 @@ local function deconstructor_action(pos, elapsed)
local result = current_energy + energy_value local result = current_energy + energy_value
if result < 0 or result > limit then return end if result < 0 or result > limit then return end
if using_star then if using_orb then
exchangeclone.set_star_energy(inv, "fuel", 1, result) exchangeclone.set_orb_energy(inv, "fuel", 1, result)
else else
exchangeclone.set_player_energy(player, result) exchangeclone.set_player_energy(player, result)
end end
@ -94,7 +92,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
return 0 return 0
end end
if listname == "fuel" then if listname == "fuel" then
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -157,13 +155,13 @@ minetest.register_node("exchangeclone:deconstructor", {
allow_metadata_inventory_move = allow_metadata_inventory_move, allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take, allow_metadata_inventory_take = allow_metadata_inventory_take,
on_timer = deconstructor_action, on_timer = deconstructor_action,
_mcl_hoppers_on_try_push = exchangeclone.mcl2_hoppers_on_try_push(nil, function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 end), _mcl_hoppers_on_try_push = exchangeclone.mcl2_hoppers_on_try_push(nil, function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end),
_mcl_hoppers_on_after_push = function(pos) _mcl_hoppers_on_after_push = function(pos)
minetest.get_node_timer(pos):start(1.0) minetest.get_node_timer(pos):start(1.0)
end, end,
_on_hopper_in = exchangeclone.mcla_on_hopper_in( _on_hopper_in = exchangeclone.mcla_on_hopper_in(
nil, nil,
function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 end function(stack) return stack:get_name() == "exchangeclone:exchange_orb" end
), ),
}) })
@ -188,7 +186,7 @@ if exchangeclone.pipeworks then
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if get_list(direction) == "fuel" then if get_list(direction) == "fuel" then
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return inv:room_for_item("fuel", stack) return inv:room_for_item("fuel", stack)
end end
else else
@ -209,8 +207,8 @@ end
minetest.register_craft({ minetest.register_craft({
output = "exchangeclone:deconstructor", output = "exchangeclone:deconstructor",
recipe = { recipe = {
{"exchangeclone:klein_star_drei"}, {"exchangeclone:exchange_orb"},
{recipe_ingredient}, {recipe_ingredient},
{"exchangeclone:klein_star_drei"} {"exchangeclone:exchange_orb"}
} }
}) })

View File

@ -2,7 +2,7 @@ local S = minetest.get_translator()
local formspec = local formspec =
"size["..(exchangeclone.mcl and 9 or 8)..",9]".. "size["..(exchangeclone.mcl and 9 or 8)..",9]"..
"label[3,2;"..S("Star").."]".. "label[3,2;"..S("Orb").."]"..
"list[context;main;4,2;1,1;]".. "list[context;main;4,2;1,1;]"..
exchangeclone.inventory_formspec(0,5).. exchangeclone.inventory_formspec(0,5)..
"listring[current_player;main]".. "listring[current_player;main]"..
@ -46,9 +46,9 @@ local function on_timer(pos, elapsed)
-- get node above -- get node above
local above = vector.add({x=0,y=1,z=0}, pos) local above = vector.add({x=0,y=1,z=0}, pos)
local using_star = true local using_orb = true
if inv:is_empty("main") then if inv:is_empty("main") then
using_star = false using_orb = false
end end
local light = minetest.get_natural_light(above) local light = minetest.get_natural_light(above)
@ -59,15 +59,14 @@ local function on_timer(pos, elapsed)
return true return true
end end
local amount = meta:get_int("collector_amount") local amount = meta:get_int("collector_amount")
if using_star then if using_orb then
local max = exchangeclone.get_star_max(inv:get_stack("main", 1)) local stored = exchangeclone.get_orb_energy(inv, "main", 1)
local stored = exchangeclone.get_star_energy(inv, "main", 1) if stored + amount <= exchangeclone.orb_max then
if stored + amount <= max then
stored = stored + amount stored = stored + amount
else else
stored = math.max(stored, max) stored = math.max(stored, exchangeclone.orb_max)
end end
exchangeclone.set_star_energy(inv, "main", 1, stored) exchangeclone.set_orb_energy(inv, "main", 1, stored)
else else
local placer = meta:get_string("exchangeclone_placer") local placer = meta:get_string("exchangeclone_placer")
if placer and placer ~= "" then if placer and placer ~= "" then
@ -96,7 +95,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
return 0 return 0
end end
if listname == "main" then if listname == "main" then
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -123,12 +122,12 @@ function exchangeclone.register_energy_collector(itemstring, name, amount, modif
minetest.register_node(itemstring, { minetest.register_node(itemstring, {
description = name.."\nGenerates "..exchangeclone.format_number(amount).." energy/second", description = name.."\nGenerates "..exchangeclone.format_number(amount).." energy/second",
tiles = { tiles = {
"exchangeclone_energy_collector_base.png^(exchangeclone_energy_collector_overlay.png"..modifier..")", "exchangeclone_energy_collector_up.png"..modifier,
"exchangeclone_energy_collector_base.png", "exchangeclone_energy_collector_down.png"..modifier,
"exchangeclone_energy_collector_base.png", "exchangeclone_energy_collector_right.png"..modifier,
"exchangeclone_energy_collector_base.png", "exchangeclone_energy_collector_right.png"..modifier,
"exchangeclone_energy_collector_base.png", "exchangeclone_energy_collector_right.png"..modifier,
"exchangeclone_energy_collector_base.png", "exchangeclone_energy_collector_right.png"..modifier
}, },
groups = {cracky = 2, container = 2, pickaxey = 2, energy_collector = amount, tubedevice = 1, tubedevice_receiver = 1}, groups = {cracky = 2, container = 2, pickaxey = 2, energy_collector = amount, tubedevice = 1, tubedevice_receiver = 1},
_mcl_hardness = 3, _mcl_hardness = 3,
@ -184,7 +183,7 @@ function exchangeclone.register_energy_collector(itemstring, name, amount, modif
can_insert = function(pos, node, stack, direction) can_insert = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() local inv = meta:get_inventory()
if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then if stack:get_name() == "exchangeclone:exchange_orb" then
return inv:room_for_item("main", stack) return inv:room_for_item("main", stack)
end end
end, end,
@ -206,7 +205,7 @@ end
exchangeclone.register_energy_collector("exchangeclone:energy_collector_mk1", S("Energy Collector MK1"), 4, "", { exchangeclone.register_energy_collector("exchangeclone:energy_collector_mk1", S("Energy Collector MK1"), 4, "", {
{glass, glass, glass}, {glass, glass, glass},
{"exchangeclone:klein_star_drei", chest, "exchangeclone:klein_star_drei"}, {"exchangeclone:exchange_orb", chest, "exchangeclone:exchange_orb"},
{iron_block, iron_block, iron_block} {iron_block, iron_block, iron_block}
} }
) )

View File

@ -584,7 +584,7 @@ local active_def = {
"exchangeclone_dark_matter_block.png"..pipeworks_connect, "exchangeclone_dark_matter_block.png"..pipeworks_connect,
"exchangeclone_dark_matter_block.png"..pipeworks_connect, "exchangeclone_dark_matter_block.png"..pipeworks_connect,
"exchangeclone_dark_matter_block.png"..pipeworks_connect, "exchangeclone_dark_matter_block.png"..pipeworks_connect,
"exchangeclone_dark_matter_furnace_active.png", "exchangeclone_dark_matter_furnace.png",
}, },
paramtype2 = "4dir", paramtype2 = "4dir",
parammatter_type = "light", parammatter_type = "light",
@ -717,7 +717,7 @@ minetest.override_item("exchangeclone:red_matter_furnace_active", {
"exchangeclone_red_matter_block.png", "exchangeclone_red_matter_block.png",
"exchangeclone_red_matter_block.png", "exchangeclone_red_matter_block.png",
"exchangeclone_red_matter_block.png", "exchangeclone_red_matter_block.png",
"exchangeclone_red_matter_furnace_active.png", "exchangeclone_red_matter_furnace.png",
}, },
drop = "exchangeclone:red_matter_furnace", drop = "exchangeclone:red_matter_furnace",
groups = {pickaxey=6, not_in_creative_inventory = 1, cracky = 3, container = exchangeclone.mcl2 and 2 or 4, deco_block=1, material_stone=1, level = get_level(5), exchangeclone_furnace = 2, tubedevice = 1, tubedevice_receiver = 1}, groups = {pickaxey=6, not_in_creative_inventory = 1, cracky = 3, container = exchangeclone.mcl2 and 2 or 4, deco_block=1, material_stone=1, level = get_level(5), exchangeclone_furnace = 2, tubedevice = 1, tubedevice_receiver = 1},

View File

@ -111,7 +111,7 @@ end
dofile(modpath.."/constructor.lua") dofile(modpath.."/constructor.lua")
dofile(modpath.."/deconstructor.lua") dofile(modpath.."/deconstructor.lua")
dofile(modpath.."/energy_collector.lua") dofile(modpath.."/energy_collector.lua")
dofile(modpath.."/klein_stars.lua") dofile(modpath.."/orb.lua")
dofile(modpath.."/craftitems.lua") dofile(modpath.."/craftitems.lua")
if exchangeclone.mcl or minetest.get_modpath("3d_armor") then if exchangeclone.mcl or minetest.get_modpath("3d_armor") then
dofile(modpath.."/armor.lua") dofile(modpath.."/armor.lua")

View File

@ -1,74 +0,0 @@
local S = minetest.get_translator()
local function read_star_charge(itemstack, player, pointed_thing)
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
if click_test ~= false then
return click_test
end
local stored = exchangeclone.get_star_itemstack_energy(itemstack)
minetest.chat_send_player(player:get_player_name(), S("Current Charge: @1", exchangeclone.format_number(stored)))
return itemstack
end
local names = {
"Klein Star Ein",
"Klein Star Zwei",
"Klein Star Drei",
"Klein Star Vier",
"Klein Star Sphere",
"Klein Star Omega",
"Magnum Star Ein",
"Magnum Star Zwei",
"Magnum Star Drei",
"Magnum Star Vier",
"Magnum Star Sphere",
"Magnum Star Omega",
}
minetest.register_alias("exchangeclone:exchange_orb", "exchangeclone:klein_star_omega")
for i, name in ipairs(names) do
local codified_name = name:lower():gsub(" ", "_")
minetest.register_tool("exchangeclone:"..codified_name, {
description = S(name).."\n"..S("Current Charge: @1", 0)
inventory_image = "exchangeclone_"..codified_name..".png",
wield_image = "exchangeclone_"..codified_name..".png",
on_secondary_use = read_star_charge,
on_place = read_star_charge,
groups = {klein_star = i, disable_repair = 1, fire_immune = 1},
max_capacity = 50000*math.pow(4,i-1),
_mcl_generate_description = function(itemstack)
return name.."\n"..S("Current Charge: @1", exchangeclone.get_star_itemstack_energy(itemstack))
end
})
if i > 1 then
previous_codified_name = names[i-1]:lower():gsub(" ", "_")
minetest.register_craft({
output = "exchangeclone:"..codified_name,
type = "shapeless",
recipe = {
"exchangeclone:"..previous_codified_name,
"exchangeclone:"..previous_codified_name,
"exchangeclone:"..previous_codified_name,
"exchangeclone:"..previous_codified_name,
}
})
end
minetest.register_craft({ -- Making it fuel so old versions of MCL's hoppers will work with (de)constructors
type = "fuel",
recipe = "exchangeclone:"..codified_name,
burntime = 24000 --Basically 30 coal blocks...
})
end
minetest.register_craft({
output = "exchangeclone:klein_star_ein",
recipe = {
{"exchangeclone:mobius_fuel", "exchangeclone:mobius_fuel", "exchangeclone:mobius_fuel"},
{"exchangeclone:mobius_fuel", exchangeclone.itemstrings.diamond, "exchangeclone:mobius_fuel"},
{"exchangeclone:mobius_fuel", "exchangeclone:mobius_fuel", "exchangeclone:mobius_fuel"},
}
})

38
exchangeclone/orb.lua Normal file
View File

@ -0,0 +1,38 @@
local S = minetest.get_translator()
local function read_orb_charge(itemstack, player, pointed_thing)
local click_test = exchangeclone.check_on_rightclick(itemstack, player, pointed_thing)
if click_test ~= false then
return click_test
end
local stored = exchangeclone.get_orb_itemstack_energy(itemstack)
minetest.chat_send_player(player:get_player_name(), S("Current Charge: @1", exchangeclone.format_number(stored)))
return itemstack
end
minetest.register_tool("exchangeclone:exchange_orb", {
description = S("Exchange Orb").."\n"..S("Current Charge: @1", 0),
inventory_image = "exchangeclone_exchange_orb.png",
color = "#000000",
on_secondary_use = read_orb_charge,
on_place = read_orb_charge,
groups = {exchange_orb = 1, disable_repair = 1, fire_immune = 1}
})
minetest.register_craft({
type = "shaped",
output = "exchangeclone:exchange_orb",
groups = {},
recipe = {
{exchangeclone.itemstrings.diamond, exchangeclone.itemstrings.iron, exchangeclone.itemstrings.diamond},
{exchangeclone.itemstrings.iron, "exchangeclone:philosophers_stone", exchangeclone.itemstrings.iron},
{exchangeclone.itemstrings.diamond, exchangeclone.itemstrings.iron, exchangeclone.itemstrings.diamond}
},
replacements = {{"exchangeclone:philosophers_stone", "exchangeclone:philosophers_stone"}}
})
minetest.register_craft({ -- Making it fuel so MineClone hoppers will work with (de)constructors
type = "fuel",
recipe = "exchangeclone:exchange_orb",
burntime = 24000 --Basically 30 coal blocks...
})

View File

@ -36,7 +36,7 @@ if exchangeclone.mcl then
mcl_formspec.get_itemslot_bg(2*width/3-0.5,1,1,1) mcl_formspec.get_itemslot_bg(2*width/3-0.5,1,1,1)
end end
-- exchangeclone.node_transmutations moved to zzzz_exchangeclone_init so it would load first -- exchangeclone.node_transmutations moved to zzzz_exchangeclone_init/init.lua so it would load first
-- This means it can be modified by other mods -- This means it can be modified by other mods
function exchangeclone.phil_action(itemstack, player, center) function exchangeclone.phil_action(itemstack, player, center)
@ -58,7 +58,7 @@ function exchangeclone.phil_action(itemstack, player, center)
local pos1, pos2 = vector.add(center, vector1), vector.add(center, vector2) local pos1, pos2 = vector.add(center, vector1), vector.add(center, vector2)
nodes = minetest.find_nodes_in_area(pos1, pos2, start_node.name) nodes = minetest.find_nodes_in_area(pos1, pos2, start_node.name)
end end
exchangeclone.play_sound(player, "exchangeclone_transmute") exchangeclone.play_ability_sound(player)
for i, pos in pairs(nodes) do for i, pos in pairs(nodes) do
if minetest.is_protected(pos, player:get_player_name()) then if minetest.is_protected(pos, player:get_player_name()) then
minetest.record_protection_violation(pos, player:get_player_name()) minetest.record_protection_violation(pos, player:get_player_name())

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 5.4 KiB

Some files were not shown because too many files have changed in this diff Show More