This commit is contained in:
ThePython 2024-02-24 09:12:30 -08:00
parent 95b7a33739
commit 0631764b2c
3 changed files with 34 additions and 11 deletions

View File

@ -30,7 +30,6 @@ Dependencies: Minetest Game or MineClone.
* 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.
* ExchangeClone axes cannot strip bamboo blocks or remove wax from copper blocks in MCL. This will probably be fixed in v7.1, but I want to release this as soon as possible.
* 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.
* The recipe for Energy Collectors doesn't include glowstone even though they are very glowstone-y. This will probably not be fixed because glowstone doesn't exist in MTG.
@ -64,6 +63,7 @@ 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>
### v7.1
* Axes and Katars now correctly function when used on bamboo and copper blocks.
* The Gem of Eternal Density and various other things now respects players' actual hotbar size (reported by @programmerjake)
### v7.0 (The Parity Update)

View File

@ -1,6 +1,6 @@
local S = minetest.get_translator()
function exchangeclone.axe_action(itemstack, player, center)
function exchangeclone.axe_action(itemstack, player, center, force_strip)
if exchangeclone.check_cooldown(player, "axe") then return end
local strip
local start_node = minetest.get_node(center)
@ -8,15 +8,17 @@ function exchangeclone.axe_action(itemstack, player, center)
local start_def = minetest.registered_items[start_node.name]
local stripped_variant = start_def._mcl_stripped_variant
if exchangeclone.mcl then
if charge == 1 then
if force_strip then
strip = true
elseif charge == 1 then
strip = true
else
strip = not player:get_player_control().sneak
end
if strip and not stripped_variant then return end
if strip and not (exchangeclone.mcla or stripped_variant) then return end
end
local nodes
local groups_to_search = strip and {start_node.name} or {"group:tree", "group:leaves"}
local groups_to_search = strip and {start_node.name} or {"group:tree", "group:leaves", "group:bamboo_block"}
local range_type = strip and "basic_radius" or "large_radius"
if charge > 1 then
local vector1, vector2 = exchangeclone.process_range(player, range_type, charge)
@ -33,11 +35,14 @@ function exchangeclone.axe_action(itemstack, player, center)
else
if strip then
if node.param2 == start_node.param2 then
local on_axe_place = minetest.registered_items[node.name]._on_axe_place
if on_axe_place then
on_axe_place(itemstack, player, {type="node",under=pos})
if exchangeclone.mcla then
local on_axe_place = minetest.registered_items[node.name]._on_axe_place
if on_axe_place then
on_axe_place(itemstack, player, {type="node",under=pos})
end
else
minetest.swap_node(pos, {name=stripped_variant, param2=node.param2})
end
minetest.swap_node(pos, {name=stripped_variant, param2=node.param2})
end
else
local drops = minetest.get_node_drops(node.name, itemstack:get_name())
@ -64,8 +69,18 @@ local function axe_on_place(itemstack, player, pointed_thing)
end
if pointed_thing.type == "node" then
if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "tree") > 0 then
local name = minetest.get_node(pointed_thing.under).name
if (minetest.get_item_group(name, "tree") > 0)
or (minetest.get_item_group(name, "bamboo_block") > 0) then
exchangeclone.axe_action(itemstack, player, pointed_thing.under)
elseif exchangeclone.mcl then
if minetest.registered_items[name]._mcl_stripped_variant then
exchangeclone.axe_action(itemstack, player, pointed_thing.under, true)
end
elseif exchangeclone.mcla then
if minetest.registered_items[name]._on_axe_place then
exchangeclone.axe_action(itemstack, player, pointed_thing.under, true)
end
end
end

View File

@ -46,8 +46,13 @@ local katar_on_use = function(itemstack, player, pointed_thing)
else
exchangeclone.hoe_action(itemstack, player, pointed_thing.under)
end
elseif minetest.get_item_group(node.name, "tree") > 0 then
elseif (minetest.get_item_group(node.name, "tree") > 0)
or (minetest.get_item_group(node.name, "bamboo_block") > 0) then
exchangeclone.axe_action(itemstack, player, pointed_thing.under)
elseif exchangeclone.mcl2 and minetest.registered_items[node.name]._mcl_stripped_variant then
exchangeclone.axe_action(itemstack, player, pointed_thing.under, true)
elseif exchangeclone.mcla and minetest.registered_items[node.name]._on_axe_place then
exchangeclone.axe_action(itemstack, player, pointed_thing.under, true)
elseif exchangeclone.mcl
and (minetest.get_item_group(node.name, "shearsy") > 0
or minetest.get_item_group(node.name, "shearsy_cobweb") > 0) then
@ -164,10 +169,13 @@ local function morningstar_on_use(itemstack, player, pointed_thing)
exchangeclone.multidig_data[player:get_player_name()] = nil
exchangeclone.start_cooldown(player, "pickaxe", 0.5)
return
-- I don't remember why I'm doing the dirt group separetely... but there must be a reason.
elseif minetest.get_item_group(name, "exchangeclone_dirt") > 0 and exchangeclone.mcl then
exchangeclone.shovel_action(itemstack, player, pointed_thing.under)
elseif minetest.get_item_group(name, exchangeclone.shovel_group) > 0 then
exchangeclone.shovel_action(itemstack, player, pointed_thing.under)
elseif exchangeclone.mcla and minetest.registered_items[name]._on_shovel_place then
exchangeclone.shovel_action(itemstack, player, pointed_thing)
elseif minetest.get_item_group(name, exchangeclone.pickaxe_group) > 0 and sneaking then
exchangeclone.hammer_action(itemstack, player, pointed_thing.under)
else