0
0
Fork 0

Merge pull request 'Enable enchanting on sheers & allow enchanted shears to shear.' (#3884) from Codiac/MineClone2:shears_fix into master

Reviewed-on: MineClone2/MineClone2#3884
Reviewed-by: AFCMS <afcm.contact@gmail.com>
This commit is contained in:
ancientmarinerdev 2023-08-27 23:42:53 +00:00
commit 3c266f5cfd
5 changed files with 5 additions and 5 deletions

View File

@ -105,7 +105,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
end
local item = clicker:get_wielded_item()
-- Use shears to get mushrooms and turn mooshroom into cow
if item:get_name() == "mcl_tools:shears" then
if minetest.get_item_group(item:get_name(), "shears") > 0 then
local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)

View File

@ -234,7 +234,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
if self:feed_tame(clicker, 1, true, false) then return end
if mcl_mobs:protect(self, clicker) then return end
if item:get_name() == "mcl_tools:shears" and not self.gotten and not self.child then
if minetest.get_item_group(item:get_name(), "shears") > 0 and not self.gotten and not self.child then
self.gotten = true
local pos = self.object:get_pos()
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)

View File

@ -114,7 +114,7 @@ mcl_mobs.register_mob("mobs_mc:snowman", {
-- Remove pumpkin if using shears
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if self.gotten ~= true and item:get_name() == "mcl_tools:shears" then
if self.gotten ~= true and minetest.get_item_group(item:get_name(), "shears") > 0 then
-- Remove pumpkin
self.gotten = true
self.object:set_properties({

View File

@ -8,7 +8,7 @@ local S = minetest.get_translator(minetest.get_current_modname())
-- Function to allow harvesting honey and honeycomb from the beehive and bee nest.
local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
local inv = player:get_inventory()
local shears = player:get_wielded_item():get_name() == "mcl_tools:shears"
local shears = minetest.get_item_group(player:get_wielded_item():get_name(), "shears") > 0
local bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle"
local beehive = "mcl_beehives:beehive"
local is_creative = minetest.is_creative_enabled(player:get_player_name())

View File

@ -661,7 +661,7 @@ minetest.register_tool("mcl_tools:shears", {
inventory_image = "default_tool_shears.png",
wield_image = "default_tool_shears.png",
stack_max = 1,
groups = { tool=1, shears=1, dig_speed_class=4, },
groups = { tool=1, shears=1, dig_speed_class=4, enchantability=-1, },
tool_capabilities = {
full_punch_interval = 0.5,
max_drop_level=1,