Compare commits

...

6 Commits

Author SHA1 Message Date
ThePython10110 00a087a992
Started changing sounds 2024-02-12 10:19:04 -08:00
ThePython10110 28a99bc0f9
Replaced orbs with stars (untested) 2024-02-12 10:02:52 -08:00
ThePython 62c6c5341b Added fuel blocks 2024-02-12 08:09:18 -08:00
ThePython 79e2d93ad6 Started changing textures, adding fuel blocks 2024-02-12 07:51:09 -08:00
ThePython 01f6abed28 Update readme 2024-02-11 11:12:00 -08:00
ThePython 757a84e7cd Armor is broken due to engine problem 2024-02-11 11:06:16 -08:00
111 changed files with 238 additions and 199 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: ## Sources/license: (note: this will change soon)
* 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. * 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.
* 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,7 +67,8 @@ 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
* Improvements to tools (mostly only in MCL at the moment) [ ] 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)
[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
@ -79,6 +80,8 @@ 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)
@ -94,6 +97,8 @@ 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,8 +107,6 @@ 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)
@ -163,12 +161,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"..chest_modifier, "exchangeclone_advanced_alchemical_chest_top.png",
"exchangeclone_advanced_alchemical_chest_bottom.png"..chest_modifier, "exchangeclone_alchemical_chest_bottom.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_front.png"..chest_modifier, "exchangeclone_alchemical_chest_side.png^(exchangeclone_advanced_alchemical_chest_overlay.png^[multiply:"..color_data.hex..")",
}, },
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 only works in 5.8 which hasn't been released yet -- hsl unfortunately only works in 5.8
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,7 +11,9 @@ 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 exchangeclone.mcl then if type:sub(1,3) == "inv" 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"
@ -207,10 +209,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("Orb").."]".. "label[2,1;"..S("Star").."]"..
"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_orb = true local using_star = 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 inv:get_stack("fuel", 1):get_name() ~= "exchangeclone:exchange_orb" then if minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "klein_star" < 1 then
using_orb = false using_star = 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 orb/player has enough energy -- make sure star/player has enough energy
local current_energy local current_energy
if using_orb then if using_star then
current_energy = exchangeclone.get_orb_energy(inv, "fuel", 1) current_energy = exchangeclone.get_star_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_orb then if using_star then
exchangeclone.set_orb_energy(inv, "fuel", 1, result_energy) exchangeclone.set_star_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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 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 stack:get_name() == "exchangeclone:exchange_orb" end), _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_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 stack:get_name() == "exchangeclone:exchange_orb" end function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 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:exchange_orb"}, {"exchangeclone:klein_star_drei"},
{recipe_ingredient}, {recipe_ingredient},
{"exchangeclone:exchange_orb"} {"exchangeclone:klein_star_drei"}
} }
}) })

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_dust.png^[colorize:#00ff00:128", inventory_image = "exchangeclone_low_covalence_dust.png",
wield_image = "exchangeclone_dust.png^[colorize:#00ff00:128", wield_image = "exchangeclone_low_covalence_dust.png",
}) })
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_dust.png^[colorize:#00ffff:128", inventory_image = "exchangeclone_medium_covalence_dust.png",
wield_image = "exchangeclone_dust.png^[colorize:#00ffff:128", wield_image = "exchangeclone_medium_covalence_dust.png",
}) })
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_dust.png^[colorize:#0000ff:128", inventory_image = "exchangeclone_high_covalence_dust.png",
wield_image = "exchangeclone_dust.png^[colorize:#0000ff:128", wield_image = "exchangeclone_high_covalence_dust.png",
}) })
minetest.register_craft({ minetest.register_craft({

View File

@ -47,6 +47,36 @@ 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",
@ -66,7 +96,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, level = get_level(4)}, --ridiculous workaround groups = {pickaxey=5, material_stone=1, cracky = 3, building_block = 1, level = get_level(4)}, --ridiculous workaround
_mcl_blast_resistance = 1500, _mcl_blast_resistance = 1500,
_mcl_hardness = 12, _mcl_hardness = 12,
}) })
@ -77,29 +107,19 @@ 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, level = get_level(5)}, groups = {pickaxey=6, material_stone=1, cracky = 3, building_block = 1, 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", "mcl_core:diamondblock", "exchangeclone:aeternalis_fuel"}, {"exchangeclone:aeternalis_fuel", exchangeclone.mcl and "mcl_core:diamondblock" or 'default: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("Orb").."]".. "label[5,1;"..S("Star").."]"..
"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,17 +22,19 @@ 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 = exchangeclone.orb_max local limit
local using_orb = true local using_star = 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 inv:get_stack("fuel", 1):get_name() ~= "exchangeclone:exchange_orb" then if minetest.get_item_group(inv:get_stack("fuel", 1):get_name(), "klein_star") < 1 then
limit = exchangeclone.limit limit = exchangeclone.limit
using_orb = false using_star = 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)
@ -42,13 +44,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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then
individual_energy_value = individual_energy_value + exchangeclone.get_orb_itemstack_energy(stack) individual_energy_value = individual_energy_value + exchangeclone.get_star_itemstack_energy(stack)
end end
local current_energy local current_energy
if using_orb then if using_star then
current_energy = exchangeclone.get_orb_energy(inv, "fuel", 1) current_energy = exchangeclone.get_star_energy(inv, "fuel", 1)
else else
current_energy = exchangeclone.get_player_energy(player) current_energy = exchangeclone.get_player_energy(player)
end end
@ -58,8 +60,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_orb then if using_star then
exchangeclone.set_orb_energy(inv, "fuel", 1, result) exchangeclone.set_star_energy(inv, "fuel", 1, result)
else else
exchangeclone.set_player_energy(player, result) exchangeclone.set_player_energy(player, result)
end end
@ -92,7 +94,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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -155,13 +157,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 stack:get_name() == "exchangeclone:exchange_orb" end), _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_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 stack:get_name() == "exchangeclone:exchange_orb" end function(stack) return minetest.get_item_group(stack:get_name(), "klein_star") > 0 end
), ),
}) })
@ -186,7 +188,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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then
return inv:room_for_item("fuel", stack) return inv:room_for_item("fuel", stack)
end end
else else
@ -207,8 +209,8 @@ end
minetest.register_craft({ minetest.register_craft({
output = "exchangeclone:deconstructor", output = "exchangeclone:deconstructor",
recipe = { recipe = {
{"exchangeclone:exchange_orb"}, {"exchangeclone:klein_star_drei"},
{recipe_ingredient}, {recipe_ingredient},
{"exchangeclone:exchange_orb"} {"exchangeclone:klein_star_drei"}
} }
}) })

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("Orb").."]".. "label[3,2;"..S("Star").."]"..
"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_orb = true local using_star = true
if inv:is_empty("main") then if inv:is_empty("main") then
using_orb = false using_star = false
end end
local light = minetest.get_natural_light(above) local light = minetest.get_natural_light(above)
@ -59,14 +59,15 @@ 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_orb then if using_star then
local stored = exchangeclone.get_orb_energy(inv, "main", 1) local max = exchangeclone.get_star_max(inv:get_stack("main", 1))
if stored + amount <= exchangeclone.orb_max then local stored = exchangeclone.get_star_energy(inv, "main", 1)
if stored + amount <= max then
stored = stored + amount stored = stored + amount
else else
stored = math.max(stored, exchangeclone.orb_max) stored = math.max(stored, max)
end end
exchangeclone.set_orb_energy(inv, "main", 1, stored) exchangeclone.set_star_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
@ -95,7 +96,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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then
return stack:get_count() return stack:get_count()
else else
return 0 return 0
@ -122,12 +123,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_up.png"..modifier, "exchangeclone_energy_collector_base.png^(exchangeclone_energy_collector_overlay.png"..modifier..")",
"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 "exchangeclone_energy_collector_base.png",
}, },
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,
@ -183,7 +184,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 stack:get_name() == "exchangeclone:exchange_orb" then if minetest.get_item_group(stack:get_name(), "klein_star") > 0 then
return inv:room_for_item("main", stack) return inv:room_for_item("main", stack)
end end
end, end,
@ -205,7 +206,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:exchange_orb", chest, "exchangeclone:exchange_orb"}, {"exchangeclone:klein_star_drei", chest, "exchangeclone:klein_star_drei"},
{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.png", "exchangeclone_dark_matter_furnace_active.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.png", "exchangeclone_red_matter_furnace_active.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.."/orb.lua") dofile(modpath.."/klein_stars.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

@ -0,0 +1,74 @@
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"},
}
})

View File

@ -1,38 +0,0 @@
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/init.lua so it would load first -- exchangeclone.node_transmutations moved to zzzz_exchangeclone_init 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_ability_sound(player) exchangeclone.play_sound(player, "exchangeclone_transmute")
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.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 288 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 798 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 803 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 B

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 896 B

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 263 B

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