fixes
This commit is contained in:
parent
381337dd07
commit
3009c1555a
19
.luacheckrc
Normal file
19
.luacheckrc
Normal file
@ -0,0 +1,19 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"minetest",
|
||||
"mobkit"
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
|
||||
-- Builtin
|
||||
"vector", "ItemStack",
|
||||
"dump", "DIR_DELIM", "VoxelArea", "Settings",
|
||||
|
||||
-- MTG
|
||||
"default", "sfinv", "creative",
|
||||
}
|
@ -13,10 +13,10 @@ minetest.register_chatcommand("clear_mobs", {
|
||||
return
|
||||
end
|
||||
for _, obj in ipairs(minetest.get_objects_inside_radius(player_pos, 100)) do
|
||||
ent_name = obj:get_entity_name()
|
||||
local ent_name = obj:get_entity_name()
|
||||
if not(obj:is_player()) and minetest.registered_entities[ent_name] then
|
||||
colon_pos = string.find(ent_name, ':')
|
||||
ent_modname = string.sub(ent_name, 1, colon_pos-1)
|
||||
local colon_pos = string.find(ent_name, ':')
|
||||
local ent_modname = string.sub(ent_name, 1, colon_pos-1)
|
||||
local ent = obj:get_luaentity()
|
||||
if ent_modname == modname and ent.type and not(ent.tamed) then
|
||||
mokapi.remove_mob(ent)
|
||||
|
@ -4,6 +4,7 @@ function mokapi.feed(self, clicker, feed_rate, msg_full_health, sound_type)
|
||||
local wielded_item_name = wielded_item:get_name()
|
||||
if mokapi.item_in_itemlist(wielded_item_name, self.follow) then -- Can eat/tame with item in hand
|
||||
fed = true
|
||||
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||
if creative_mode == false then -- if not in creative, take item
|
||||
wielded_item:take_item()
|
||||
clicker:set_wielded_item(wielded_item)
|
||||
@ -17,7 +18,7 @@ function mokapi.feed(self, clicker, feed_rate, msg_full_health, sound_type)
|
||||
end
|
||||
end
|
||||
self.food_count = mobkit.remember(self, "food_count", self.food_count + 1) --increase the food count
|
||||
if sound_name then
|
||||
if sound_type then
|
||||
mobkit.make_sound(self, sound_type)
|
||||
end
|
||||
end
|
||||
|
@ -25,7 +25,7 @@ petz.lay_egg = function(self)
|
||||
end
|
||||
|
||||
--Extract Egg from a Nest
|
||||
petz.extract_egg_from_nest = function(self, pos, player, egg_type)
|
||||
petz.extract_egg_from_nest = function(pos, player, egg_type)
|
||||
local inv = player:get_inventory()
|
||||
if inv:room_for_item("main", egg_type) then
|
||||
inv:add_item("main", egg_type) --add the egg to the player's inventory
|
||||
|
@ -277,7 +277,7 @@ petz.create_detached_saddlebag_inventory = function(name)
|
||||
local saddlebag_inventory = minetest.create_detached_inventory(name, {
|
||||
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
return allow_put(pos, to_list, to_index, stack, player)
|
||||
return allow_put(inv, from_list, from_index, stack, player)
|
||||
end,
|
||||
allow_put = function(inv, listname, index, stack, player)
|
||||
return stack:get_count()
|
||||
|
@ -40,6 +40,7 @@ end
|
||||
--
|
||||
|
||||
function petz.on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||
local pos = self.object:get_pos() --pos of the petz
|
||||
if mobkit.is_alive(self) then
|
||||
if self.is_mountable and puncher == self.driver then --Do not punch when you mount on it
|
||||
return
|
||||
|
@ -501,7 +501,7 @@ function mobkit.hq_approach_torch(self, prty, tpos)
|
||||
local distance = vector.distance(pos, tpos)
|
||||
if distance < self.view_range and (distance >= self.view_range) then
|
||||
if mobkit.is_queue_empty_low(self) then
|
||||
mobkit.lq_followliquidair(self, target)
|
||||
--mobkit.lq_followliquidair(self, target)
|
||||
end
|
||||
elseif distance >= self.view_range then
|
||||
petz.ownthing(self)
|
||||
@ -554,7 +554,6 @@ function mobkit.lq_dumbfly(self, speed_factor)
|
||||
if timer < 0 then
|
||||
--minetest.chat_send_player("singleplayer", tostring(timer))
|
||||
local velocity
|
||||
local mob = self.object
|
||||
mobkit.animate(self, 'fly')
|
||||
local random_num = math.random(1, 5)
|
||||
local yaw = self.object:get_yaw()
|
||||
@ -926,7 +925,7 @@ function mobkit.lq_approach_behive(self)
|
||||
return true
|
||||
end
|
||||
local pos = self.object:get_pos()
|
||||
local y_distance = tpos.y - pos.y
|
||||
--local y_distance = tpos.y - pos.y
|
||||
if mobkit.drive_to_pos(self, tpos, 1.5, 6.28, (self.view_range / 4) ) then
|
||||
mobkit.clear_queue_high(self)
|
||||
return true
|
||||
|
@ -547,7 +547,7 @@ function petz.semiaquatic_brain(self)
|
||||
if self.warn_attack == true then --attack player
|
||||
mobkit.clear_queue_high(self) -- abandon whatever they've been doing
|
||||
if petz.isinliquid(self) then
|
||||
mobkit.hq_aqua_attack(self, 10, puncher, 6) -- get revenge
|
||||
mobkit.hq_aqua_attack(self, 10, player, 6) -- get revenge
|
||||
else
|
||||
mobkit.hq_hunt(self, 10, player)
|
||||
end
|
||||
|
@ -193,7 +193,7 @@ minetest.register_node("petz:fishtank", {
|
||||
param2 = 50,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
light_source = default.LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
@ -376,7 +376,7 @@ minetest.register_node("petz:bottle_moth", {
|
||||
param2 = 50,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
light_source = default.LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
|
@ -394,7 +394,7 @@ minetest.register_chatcommand("howl", {
|
||||
return false, "Error: You are not a werewolf."
|
||||
end
|
||||
else
|
||||
return false, player_name .." ".."not online!"
|
||||
return false, name .." ".."not online!"
|
||||
end
|
||||
end,
|
||||
})
|
||||
@ -512,6 +512,7 @@ petz:register_egg("petz:werewolf", S("Werewolf"), "petz_spawnegg_werewolf.png",
|
||||
|
||||
--hbhunger support
|
||||
if minetest.get_modpath("hbhunger") ~= nil then
|
||||
local org_eat = core.do_item_eat
|
||||
core.do_item_eat = function(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
local old_itemstack = itemstack
|
||||
if not(petz.is_werewolf(user)) or not(minetest.get_item_group(itemstack:get_name(), "food_meat_raw") == 0) then
|
||||
|
@ -147,7 +147,7 @@ minetest.register_node("petz:ducky_nest_egg", {
|
||||
fixed= {-0.25, -0.75, -0.25, 0.25, -0.25, 0.25},
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
petz.extract_egg_from_nest(self, pos, player, "petz:ducky_egg") --extract the egg
|
||||
petz.extract_egg_from_nest(pos, player, "petz:ducky_egg") --extract the egg
|
||||
end,
|
||||
})
|
||||
|
||||
@ -171,7 +171,7 @@ minetest.register_node("petz:chicken_nest_egg", {
|
||||
fixed= {-0.25, -0.75, -0.25, 0.25, -0.25, 0.25},
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
petz.extract_egg_from_nest(self, pos, player, "petz:chicken_egg") --extract the egg
|
||||
petz.extract_egg_from_nest(pos, player, "petz:chicken_egg") --extract the egg
|
||||
end,
|
||||
})
|
||||
|
||||
@ -664,7 +664,7 @@ minetest.register_node("petz:honey_block", {
|
||||
param2 = 50,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
light_source = LIGHT_MAX - 1,
|
||||
light_source = default.LIGHT_MAX - 1,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
|
||||
})
|
||||
|
@ -5,7 +5,7 @@ minetest.register_node("petz:parchment", {
|
||||
inventory_image = "petz_parchment.png",
|
||||
tiles = {"petz_transparency.png"},
|
||||
groups = {snappy=1, bendy=2, cracky=1},
|
||||
sounds = default_stone_sounds,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user