Compare commits
2 Commits
9ee585f552
...
229e191706
Author | SHA1 | Date |
---|---|---|
ThePython | 229e191706 | |
ThePython | 53d6973e10 |
|
@ -68,6 +68,9 @@ Dependencies: Minetest Game or MineClone.
|
|||
## Changelog
|
||||
<details><summary>Look at this fancy expanding changelog</summary>
|
||||
|
||||
### 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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue