From 3c4970c7cd0b5bc774d655829478f9e58e5556d5 Mon Sep 17 00:00:00 2001 From: ThePython <87204246+ThePython10110@users.noreply.github.com> Date: Wed, 20 Mar 2024 07:52:06 -0700 Subject: [PATCH] Did stuff --- CHANGELOG.md | 10 +-- README.md | 8 +-- exchangeclone/furnaces.lua | 10 +-- exchangeclone/init.lua | 2 + exchangeclone/register_emc.lua | 49 ++++++++++++++ exchangeclone/rings.lua | 71 +++++++++++++++++++++ zzzz_exchangeclone_init/base_emc_values.lua | 1 + zzzz_exchangeclone_init/lib.lua | 3 + 8 files changed, 141 insertions(+), 13 deletions(-) create mode 100644 exchangeclone/rings.lua diff --git a/CHANGELOG.md b/CHANGELOG.md index 161b5a2..9116e3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -432,13 +432,14 @@ I didn't get to everything I wanted to, mostly because the automatic energy valu * Alchemical Books\*\* * Catalytic Lens * Mercurial Eye -* Evertide Amulet (but without being able to stand on water)\* -* Volcanite Amulet (but without being able to stand on lava)\* +* Evertide Amulet (but without being able to stand on water)\*\* +* Volcanite Amulet (but without being able to stand on lava)\*\* * Pedestals\*\* (haven't added all the abilities yet) -* Black Hole Band and Void Ring\* +* Black Hole Band and Void Ring\*\* * Nova Catalyst/Cataclysm? * Knowledge Sharing Book * EMC Link\*\* +* Support for EMC values greater than 1 trillion with the [BigNum](https://github.com/thepython10110/bignum) library \* Planned for v8.0 @@ -448,5 +449,4 @@ I didn't get to everything I wanted to, mostly because the automatic energy valu * Divining Rods (I would have to manually add energy values for ores, and I'm not going to do that) * Energy Condensers (what's the point?) * Watch of Flowing Time (impossible/laggy) -* Interdiction Torches (extremely laggy) -* Any item from ProjectE(xpansion) with an EMC value of over 1 trillion \ No newline at end of file +* Interdiction Torches (laggy) \ No newline at end of file diff --git a/README.md b/README.md index 1ae5803..28e8125 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ ExchangeClone upports all items in the following mods/games (and anything that c * Nether * Mobs Redo API and Mobs Animals * Animalia +* Logistica ExchangeClone is tested with the latest release of Minetest, Minetest Game, MineClone2, and Mineclonia. @@ -36,13 +37,12 @@ Dependencies: Minetest Game or MineClone. ## Known issues: * The sword/katar AOE ability does not take upgrades (looting, fire aspect, etc.) into account. This will probably not be fixed (MCL) -* Klein Stars and Upgrades can be used as fuel. This isn't really a problem, but it will probably be removed once I decide the new hopper API is old enough that most people are using it. -* Dark/Red Matter Shears will sometimes (randomly) be treated as normal shears when used by dispensers. This will not be fixed. +* Dark/Red Matter Shears will sometimes (randomly) be treated as normal shears when used by MCL dispensers. This will not be fixed. * In Mineclonia, when inserting items into Dark/Red Matter Furnaces with hoppers, they will not start at the correct speed, instead being limited to a maximum of 1 item/second. This will not be fixed unless Mineclonia changes how things work. * In Mineclonia, hoppers can put invalid items into Energy Collectors. This will not be fixed. * Tools do not show the wear bar (to show the charge level) when first created or crafted. It only appears after changing the range. This will not be fixed. -* Unfortunately, caused by the performance improvements to various tool abilities, using the shear ability on sea grass (MCL) will also remove the sand below the sea grass. I can't think of a good way to fix it. -* Dark and Red Matter Armor can make the player invincible. This is an [engine problem](https://github.com/minetest/minetest/issues/14344) that I can't fix. +* Unfortunately, changes to various tool abilities in v7.0, using the shear ability on sea grass (MCL) will also remove the sand below the sea grass. I can't think of a good way to fix it. +* Dark and Red Matter Armor can make the player invincible. This is an [engine problem](https://github.com/minetest/minetest/issues/14344) that I can't fix without simply making the armor worse. * Mobs Redo (and mods that use it) don't care that DM/RM tools are supposed to be unbreakable and add wear to them anyway. * Covalence Dust and the Talisman of Repair cannot repair certain tools. This will not be fixed. * DM/RM tools are too fast in MTG (can't figure out why) diff --git a/exchangeclone/furnaces.lua b/exchangeclone/furnaces.lua index 1885046..6b47b10 100644 --- a/exchangeclone/furnaces.lua +++ b/exchangeclone/furnaces.lua @@ -177,10 +177,12 @@ local function allow_metadata_inventory_move(pos, from_list, from_index, to_list end local function allow_metadata_inventory_take(pos, listname, index, stack, player) - local name = player:get_player_name() - if minetest.is_protected(pos, name) then - minetest.record_protection_violation(pos, name) - return 0 + if player:is_player() then + local name = player:get_player_name() + if minetest.is_protected(pos, name) then + minetest.record_protection_violation(pos, name) + return 0 + end end return stack:get_count() end diff --git a/exchangeclone/init.lua b/exchangeclone/init.lua index d25f37c..b9758f5 100644 --- a/exchangeclone/init.lua +++ b/exchangeclone/init.lua @@ -108,6 +108,7 @@ if exchangeclone.mcl2 then mcl_item_id.set_mod_namespace("exchangeclone") end +-- The order is usually unimportant local files = { "craftitems", "fuels", @@ -137,6 +138,7 @@ local files = { "alchemical_books", "dark_matter_pedestal", "black_hole_band", + "rings", } if exchangeclone.mcl or minetest.get_modpath("3d_armor") then diff --git a/exchangeclone/register_emc.lua b/exchangeclone/register_emc.lua index b8350bb..4df489b 100644 --- a/exchangeclone/register_emc.lua +++ b/exchangeclone/register_emc.lua @@ -283,6 +283,55 @@ if exchangeclone.mtg then end +if minetest.global_exists("logistica") then + exchangeclone.register_craft_type("lava_furnace", "shapeless") -- weird that it's not cooking but I can't see any way around that + exchangeclone.register_craft({ + output = "logistica:silverin", + type = "lava_furnace", + recipe = { + exchangeclone.mcl and "mcl_core:sand" or "default:silver_sand", + exchangeclone.itemstrings.ice + } + }) + exchangeclone.register_craft({ + output = "logistica:silverin_circuit", + type = "lava_furnace", + recipe = { + "logistica:silverin_slice", + exchangeclone.mcl and "mesecons:redstone" or "default:mese_crystal_fragment" + } + }) + exchangeclone.register_craft({ + output = "logistica:silverin_mirror_box", + type = "lava_furnace", + recipe = { + exchangeclone.itemstrings.glass, + "logistica:silverin_slice", + "logistica:silverin_slice", + "logistica:silverin_slice", + "logistica:silverin_slice", + "logistica:silverin_slice", + "logistica:silverin_slice", + } + }) + exchangeclone.register_craft({ + output = "logistica:silverin_plate", + type = "lava_furnace", + recipe = { + "logistica:silverin", + exchangeclone.itemstrings.iron, + } + }) + exchangeclone.register_craft({ + output = "logistica:wireless_crystal", + type = "lava_furnace", + recipe = { + "logistica:silverin", + exchangeclone.itemstrings.emeraldworth, + } + }) +end + -- Up to this point, no EMC values have actually been set. diff --git a/exchangeclone/rings.lua b/exchangeclone/rings.lua new file mode 100644 index 0000000..55e3777 --- /dev/null +++ b/exchangeclone/rings.lua @@ -0,0 +1,71 @@ +minetest.register_tool("exchangeclone:zero_ring", { + description = "Zero Ring", + inventory_image = "exchangeclone_zero_ring.png", + _exchangeclone_passive = { + func = function() end, + active_image = "exchangeclone_zero_ring_active.png", + } +}) + +local set_fire + +if exchangeclone.mcl then + set_fire = function(player, pos) + -- Check protection + local protname = player:get_player_name() + if minetest.is_protected(pos, protname) then + minetest.record_protection_violation(pos, protname) + end + local above = vector.offset(pos, 0,1,0) + local pointed_thing = {type="node",under=pos,above=above} + local nodedef = minetest.registered_nodes[minetest.get_node(pos).name] + if nodedef and nodedef._on_ignite then + local overwrite = nodedef._on_ignite(player, pointed_thing) + if not overwrite then + mcl_fire.set_fire(pointed_thing, player, false) + end + else + mcl_fire.set_fire(pointed_thing, player, false) + end + end +else + set_fire = function(player, pos) + local protname = player:get_player_name() + if minetest.is_protected(pos, protname) then + minetest.record_protection_violation(pos, protname) + end + local nodedef = minetest.registered_nodes[minetest.get_node(pos).name] + local above = vector.offset(pos, 0,1,0) + if nodedef.on_ignite then + nodedef.on_ignite(pos, player) + else + minetest.set_node(above, {name = "fire:basic_flame"}) + end + end +end + +minetest.register_tool("exchangeclone:ring_of_ignition", { + description = "Ring of Ignition", + inventory_image = "exchangeclone_ring_of_ignition.png", + on_secondary_use = exchangeclone.toggle_active, + on_place = exchangeclone.toggle_active, + _exchangeclone_passive = { + func = function(player) + local player_pos = player:get_pos() + local offset = vector.new(5,1,5) + local start, _end = player_pos + offset, player_pos - offset + minetest.log(dump({start = start, _end = _end})) + -- conveniently, MTG and MCL agree on the flammable group + local nodes = minetest.find_nodes_in_area(start, _end, "group:flammable") + for _, pos in pairs(nodes) do + local above_pos = vector.offset(pos,0,1,0) + if minetest.get_node(above_pos).name == "air" then + if math.random() < 0.2 then + set_fire(player, pos) + end + end + end + end, + active_image = "exchangeclone_ring_of_ignition_active.png", + } +}) \ No newline at end of file diff --git a/zzzz_exchangeclone_init/base_emc_values.lua b/zzzz_exchangeclone_init/base_emc_values.lua index 8ad8852..4922ebe 100644 --- a/zzzz_exchangeclone_init/base_emc_values.lua +++ b/zzzz_exchangeclone_init/base_emc_values.lua @@ -1,3 +1,4 @@ +-- You can edit these tables any time before minetest.register_on_mods_loaded functions are run. exchangeclone.group_values = {} exchangeclone.base_emc_values = {} diff --git a/zzzz_exchangeclone_init/lib.lua b/zzzz_exchangeclone_init/lib.lua index 72a0885..2b20483 100644 --- a/zzzz_exchangeclone_init/lib.lua +++ b/zzzz_exchangeclone_init/lib.lua @@ -390,6 +390,9 @@ exchangeclone.itemstrings = { water_bucket = exchangeclone.mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water", lava_bucket = exchangeclone.mcl and "mcl_buckets:bucket_lava" or "bucket:bucket_lava", empty_bucket = exchangeclone.mcl and "mcl_buckets:bucket_empty" or "bucket:bucket_empty", + snow = exchangeclone.mcl and "mcl_core:snow" or "default:snow", + fire = exchangeclone.mcl and "mcl_fire:fire" or "fire:fire", + ice = exchangeclone.mcl and "mcl_core:ice" or "default:ice" } exchangeclone.emc_aliases = {}