mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Merge pull request 'Enable enchanting on sheers & allow enchanted shears to shear.' (#3884) from Codiac/MineClone2:shears_fix into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3884 Reviewed-by: AFCMS <afcm.contact@gmail.com>
This commit is contained in:
commit
3c266f5cfd
5 changed files with 5 additions and 5 deletions
|
@ -105,7 +105,7 @@ mooshroom_def.on_rightclick = function(self, clicker)
|
||||||
end
|
end
|
||||||
local item = clicker:get_wielded_item()
|
local item = clicker:get_wielded_item()
|
||||||
-- Use shears to get mushrooms and turn mooshroom into cow
|
-- 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()
|
local pos = self.object:get_pos()
|
||||||
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
|
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
|
||||||
if self:feed_tame(clicker, 1, true, false) then return end
|
if self:feed_tame(clicker, 1, true, false) then return end
|
||||||
if mcl_mobs:protect(self, clicker) 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
|
self.gotten = true
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
|
minetest.sound_play("mcl_tools_shears_cut", {pos = pos}, true)
|
||||||
|
|
|
@ -114,7 +114,7 @@ mcl_mobs.register_mob("mobs_mc:snowman", {
|
||||||
-- Remove pumpkin if using shears
|
-- Remove pumpkin if using shears
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
local item = clicker:get_wielded_item()
|
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
|
-- Remove pumpkin
|
||||||
self.gotten = true
|
self.gotten = true
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
|
|
|
@ -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.
|
-- Function to allow harvesting honey and honeycomb from the beehive and bee nest.
|
||||||
local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
|
local honey_harvest = function(pos, node, player, itemstack, pointed_thing)
|
||||||
local inv = player:get_inventory()
|
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 bottle = player:get_wielded_item():get_name() == "mcl_potions:glass_bottle"
|
||||||
local beehive = "mcl_beehives:beehive"
|
local beehive = "mcl_beehives:beehive"
|
||||||
local is_creative = minetest.is_creative_enabled(player:get_player_name())
|
local is_creative = minetest.is_creative_enabled(player:get_player_name())
|
||||||
|
|
|
@ -661,7 +661,7 @@ minetest.register_tool("mcl_tools:shears", {
|
||||||
inventory_image = "default_tool_shears.png",
|
inventory_image = "default_tool_shears.png",
|
||||||
wield_image = "default_tool_shears.png",
|
wield_image = "default_tool_shears.png",
|
||||||
stack_max = 1,
|
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 = {
|
tool_capabilities = {
|
||||||
full_punch_interval = 0.5,
|
full_punch_interval = 0.5,
|
||||||
max_drop_level=1,
|
max_drop_level=1,
|
||||||
|
|
Loading…
Reference in a new issue