Started adding EMC link

This commit is contained in:
ThePython 2024-02-27 18:16:22 -08:00
parent 5548c91ecf
commit 704dc487c9
6 changed files with 62 additions and 8 deletions

View File

@ -99,8 +99,15 @@ You can find the old textures and sounds by going back to previous commits in Gi
<details><summary>Look at this fancy expanding changelog</summary>
### v8.0
* The Constructor and Deconstructor are now deprecated. Element Exchange is no more.
* Upgrades and Stars can no longer be used as fuel.
* New Features:
*
* Changes:
* The Constructor and Deconstructor are now deprecated. Element Exchange is no more.
* Upgrades and Stars can no longer be used as fuel.
* Dark and Red Matter Armor now uses ProjectE's textures
* Bugfixes:
* Dark and Red Matter Armor display properly (and identically) in both games.
### v7.3 (not released yet because there's not enough)
* Renamed Alchemical Tome to Tome of Knowledge, and made it uncraftable by default.

View File

@ -53,7 +53,7 @@ minetest.register_node("exchangeclone:constructor", {
"exchangeclone_constructor_right.png",
"exchangeclone_constructor_right.png",
},
groups = {cracky = 2, container = exchangeclone.mcl2 and 2 or 4, pickaxey = 2, not_in_creative_inventory = 1, not_in_craft_guide = 1},
groups = {cracky = 2, pickaxey = 2, not_in_creative_inventory = 1, not_in_craft_guide = 1},
_mcl_hardness = 3,
_mcl_blast_resistance = 6,
sounds = exchangeclone.sound_mod.node_sound_metal_defaults(),
@ -108,7 +108,7 @@ minetest.register_node("exchangeclone:deconstructor", {
"exchangeclone_deconstructor_right.png",
"exchangeclone_deconstructor_right.png",
},
groups = {cracky = 2, container = exchangeclone.mcl2 and 2 or 4, pickaxey = 2, not_in_creative_inventory = 1, not_in_craft_guide = 1},
groups = {cracky = 2, pickaxey = 2, not_in_creative_inventory = 1, not_in_craft_guide = 1},
_mcl_hardness = 3,
_mcl_blast_resistance = 6,
sounds = exchangeclone.sound_mod.node_sound_metal_defaults(),

View File

@ -0,0 +1,46 @@
-- I want to make this without a formspec.
local function on_rightclick(pos, node, player, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if player:get_player_control().sneak then
local contained = inv:get_stack("star", 1)
if minetest.get_item_group(itemstack:get_name(), "klein_star") > 0 then
inv:set_stack("star", 1, itemstack)
return contained
elseif itemstack:is_empty() then
inv:set_stack("star", 1, ItemStack(""))
return contained
end
elseif not itemstack:is_empty() then
local dealiased = exchangeclone.handle_alias(itemstack)
local emc = exchangeclone.get_item_emc(dealiased)
if emc and emc > 0 then
minetest.chat_send_player(player:get_player_name(), "Target Item: "..ItemStack(dealiased):get_short_description())
meta:set_string("target_item", dealiased)
end
end
end
minetest.register_node("exchangeclone:emc_link", {
description = "EMC Link\nAllows automation with personal EMC",
tiles = {"exchangeclone_emc_link.png"},
on_rightclick = on_rightclick,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("star", 1)
inv:set_size("input", 1)
inv:set_size("output", 1)
meta:set_string("infotext", "EMC Link")
end,
after_place_node = function(pos, player, itemstack, pointed_thing)
local player_name = player:get_player_name()
local meta = minetest.get_meta(pos)
meta:set_string("exchangeclone_placer", player_name)
meta:set_string("infotext", "EMC Link".."\n"..S("Owned by ")..player_name)
if exchangeclone.pipeworks then
pipeworks.after_place(pos, player, itemstack, pointed_thing)
end
end,
})

View File

@ -109,14 +109,14 @@ if exchangeclone.mcl2 then
end
local files = {
"deprecated_stuff",
"energy_collector",
"klein_stars",
"craftitems",
"tool_upgrades",
"deprecated_stuff",
"energy_collectors",
"klein_stars",
"swords",
"pickaxes",
"axes",
"tool_upgrades",
"shovels",
"hoes",
"hammers",
@ -130,6 +130,7 @@ local files = {
"gem_of_eternal_density",
"talisman_of_repair",
"passive_stones",
"emc_link",
}
if exchangeclone.mcl or minetest.get_modpath("3d_armor") then

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB