master
runs 2020-05-18 01:17:55 +02:00
parent 872315eee1
commit 3dc87d137e
10 changed files with 8 additions and 12 deletions

View File

@ -7,7 +7,7 @@ function mokapi.cron_clear(cron_time, modname)
end
function mokapi.cron_clear_mobs(cron_time, modname)
for _,player in ipairs(minetest.get_connected_players()) do
for _, player in ipairs(minetest.get_connected_players()) do
local player_pos = player:get_pos()
mokapi.clear_mobs(player_pos, modname)
end

View File

@ -20,8 +20,6 @@ function mokapi.replace(self, sound_name, max_hear_distance)
end
pos.y = pos.y + y_offset
if #minetest.find_nodes_in_area(pos, pos, what) > 0 then
local oldnode = {name = what}
local newnode = {name = with}
minetest.set_node(pos, {name = with})
if sound_name then
mokapi.make_sound("object", self.object, sound_name, max_hear_distance or mokapi.consts.DEFAULT_MAX_HEAR_DISTANCE)

View File

@ -28,7 +28,7 @@ assert(loadfile(modpath .. "/api/api_whistle.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_silk.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_on_step.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_sleep.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_env_damage.lua"))(moh, S)
assert(loadfile(modpath .. "/api/api_env_damage.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_bees.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_throw.lua"))(modpath, S)
assert(loadfile(modpath .. "/api/api_collisionbox.lua"))(modpath, S)

View File

@ -3,7 +3,7 @@ petz.bottled = function(self, clicker)
--capture the petz with the 'bottled' property in the bottle
local new_stack = ItemStack(self.bottled) -- add special mob egg with all mob information
local stack_meta = new_stack:get_meta()
itemstack_meta = petz.capture(self, clicker, false)
local itemstack_meta = petz.capture(self, clicker, false)
stack_meta:set_int("petz:texture_no", itemstack_meta:get_int("texture_no"))
--minetest.chat_send_all("texture= "..itemstack_meta:get_int("texture_no"))
local inv = clicker:get_inventory()

View File

@ -192,7 +192,7 @@ petz.create_form = function(player_name, context)
local exchange_items = ''
local dropdown_index = 1
for i = 1, #petz.settings.selling_exchange_items_list do
description = petz.settings.selling_exchange_items_list[i].description
local description = petz.settings.selling_exchange_items_list[i].description
if description then
if i > 1 then
exchange_items = exchange_items .. ","

View File

@ -55,7 +55,7 @@ petz.mount = function(self, clicker, wielded_item, wielded_item_name)
end
petz.put_saddle = function(self, clicker, wielded_item, wielded_item_name)
local saddle_type = ""
local saddle_type
local another_saddle = ""
if wielded_item_name == "petz:saddle" then
saddle_type = "saddle"

View File

@ -303,7 +303,7 @@ minetest.register_craft({
minetest.register_tool("petz:lasso", {
description = S("Lasso"),
inventory_image = "petz_lasso.png",
groups = {flammable = 2},
groups = {flammable = 2, lasso = 1},
})
minetest.register_craft({
@ -409,7 +409,7 @@ for i=1, 2 do
local texture_no = meta:get_int("petz:texture_no")
--minetest.chat_send_all("texture= "..tostring(meta:get_int("petz:texture_no")))
if texture_no then
ent_ref = ent:get_luaentity()
local ent_ref = ent:get_luaentity()
if texture_no == 0 then
texture_no = math.random(1, #ent_ref.textures)
end

View File

@ -565,7 +565,6 @@ minetest.register_craft({
--Cat Basket
minetest.register_node("petz:cat_basket", {
description = S("Cat Basket"),
groups = {snappy=1, bendy=2, cracky=1},
sounds = default.node_sound_wood_defaults(),
tiles = {
"petz_cat_basket_top.png",

View File

@ -59,7 +59,7 @@ function mobkit.lq_dumbfly(self, speed_factor)
fly_status = "ascend"
y_impulse = 3
end
height_from_ground = mobkit.check_height(self) --returns 'false' if the mob flies higher that max_height, otherwise returns the height from the ground
local height_from_ground = mobkit.check_height(self) --returns 'false' if the mob flies higher that max_height, otherwise returns the height from the ground
--minetest.chat_send_player("singleplayer", tostring(height_from_ground))
if not(height_from_ground) or mobkit.node_name_in(self, "top") ~= "air" then --check if max height, then stand or descend, or a node above the petz
random_num = math.random(1, 100)

View File

@ -37,7 +37,6 @@ for i=1, 2 do
type_of_egg = "node",
max_height = 5,
has_affinity = false,
is_wild = false,
give_orders = false,
can_be_brushed = false,
capture_item = "net",