Compare commits

...

9 Commits

Author SHA1 Message Date
ThePython 229e191706 Merge branch 'main' of https://github.com/thepython10110/exchangeclone 2024-01-04 07:48:09 -08:00
ThePython 53d6973e10 v6.1 2024-01-04 07:48:04 -08:00
ThePython 9ee585f552
Update README.md 2023-12-27 12:56:09 -08:00
ThePython 065022a926
Update README.md 2023-12-27 12:56:00 -08:00
ThePython d6c2fdc768 Remove todo list 2023-12-26 17:54:30 -08:00
ThePython f1c222ef1a Remove shield 2023-12-26 17:51:45 -08:00
ThePython ab1c28c041 fix shield 2023-12-26 17:51:13 -08:00
ThePython 233d84d3e2 Fix shield 2023-12-26 17:50:32 -08:00
ThePython 638fd4666d v6.0 2023-12-26 17:49:27 -08:00
4 changed files with 9 additions and 14 deletions

View File

@ -1,8 +1,9 @@
# ExchangeClone
[![ContentDB](https://content.minetest.net/packages/ThePython10110/ExchangeClone/shields/downloads)](https://content.minetest.net/packages/ThePython10110/ExchangeClone)
[![ContentDB](https://content.minetest.net/packages/ThePython/exchangeclone/shields/downloads/)](https://content.minetest.net/packages/ThePython/exchangeclone/)
Allows players to turn items into energy, and energy into items. Supports all items in Minetest Game and MineClone 2, and anything that can be made from them! Also adds a whole bunch of other stuff.
Welcome to the dev branch! This is the branch I'm currently working on, so it's likely that there are bugs.
If you would like to see the latest changes, check out (pun) the dev branch! Beware of bugs.
ExchangeClone is tested with the latest release of Minetest, Minetest Game, MineClone2, and Mineclonia.
@ -67,14 +68,8 @@ Dependencies: Minetest Game or MineClone.
## Changelog
<details><summary>Look at this fancy expanding changelog</summary>
### TODO:
* Finish changelog
* Finish wiki
* Test everything in MTG, MCL2, and MCLA (and 5.7)
* Everything breaks properly
* Item transfer mods work correctly
* Shears seem to work fine (MCL)
* Other tools work
### v6.1
* Damaged tools now give the correct amount of energy (thanks @programmerjake!).
### v6.0 (The Compatibility Update)
This update took a while... there was just so much that had to be done.
@ -354,4 +349,4 @@ I didn't get to everything I wanted to, mostly because the automatic energy valu
* Mercurial Eye
* Talisman of Repair
* Gem of Eternal Density
* Probably other things
* Probably other things

View File

@ -40,7 +40,7 @@ local function deconstructor_action(pos, elapsed)
if not (individual_energy_value and individual_energy_value > 0) then return end
local wear = stack:get_wear()
if wear and wear > 0 then
individual_energy_value = math.max(math.floor(individual_energy_value * (65536 / wear)), 1)
individual_energy_value = math.max(math.floor(individual_energy_value * ((65536 - wear)/65536)), 1)
end
if stack:get_name() == "exchangeclone:exchange_orb" then
individual_energy_value = individual_energy_value + exchangeclone.get_orb_itemstack_energy(stack)

View File

@ -137,7 +137,7 @@ local function handle_inventory(player, inventory, to_list)
if not individual_energy_value or individual_energy_value <= 0 then return end
local wear = stack:get_wear()
if wear and wear > 1 then
individual_energy_value = math.max(math.floor(individual_energy_value * (65536 / wear)), 1)
individual_energy_value = math.max(math.floor(individual_energy_value * ((65536 - wear)/65536)), 1)
end
if itemstring == "exchangeclone:exchange_orb" then
individual_energy_value = individual_energy_value + exchangeclone.get_orb_itemstack_energy(stack)

View File

@ -44,7 +44,7 @@ end
--- Gets the energy value of an itemstring or ItemStack
--- Handles "group:group_name" syntax (although it goes through every item), returns cheapest item in group
function exchangeclone.get_item_energy(item, ignore_wear)
function exchangeclone.get_item_energy(item)
if (item == "") or not item then return end
-- handle groups
if type(item) == "string" and item:sub(1,6) == "group:" and exchangeclone.group_values then