forked from mtcontrib/maidroid
Update
This commit is contained in:
parent
bb590d0141
commit
5051654528
2
api.lua
2
api.lua
@ -142,7 +142,7 @@ function maidroid.register_maidroid(product_name, def)
|
|||||||
minetest.register_craftitem(product_name.."_swawn_egg", {
|
minetest.register_craftitem(product_name.."_swawn_egg", {
|
||||||
description = def.description.." Swapn Egg",
|
description = def.description.." Swapn Egg",
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
minetest.add_entity(pointed_thing.above, "maidroid:maidroid")
|
minetest.add_entity(pointed_thing.above, product_name)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -11,9 +11,11 @@ maidroid.register_maidroid("maidroid:maidroid", {
|
|||||||
maidroid.register_maidroid("maidroid:maidroid_mk2", {
|
maidroid.register_maidroid("maidroid:maidroid_mk2", {
|
||||||
hp_max = 10,
|
hp_max = 10,
|
||||||
description = "Maidroid : Maidroid MkII",
|
description = "Maidroid : Maidroid MkII",
|
||||||
|
textures = {"maidroid_mk2.png"},
|
||||||
})
|
})
|
||||||
|
|
||||||
maidroid.register_maidroid("maidroid:maidroid_mk3", {
|
maidroid.register_maidroid("maidroid:maidroid_mk3", {
|
||||||
hp_max = 10,
|
hp_max = 10,
|
||||||
description = "Maidroid : Maidroid MkIII",
|
description = "Maidroid : Maidroid MkIII",
|
||||||
|
textures = {"maidroid_mk3.png"},
|
||||||
})
|
})
|
||||||
|
BIN
models/maidroid_mk2.png
Normal file
BIN
models/maidroid_mk2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1005 B |
BIN
models/maidroid_mk3.png
Normal file
BIN
models/maidroid_mk3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 990 B |
@ -47,7 +47,7 @@ end
|
|||||||
-- 落ちているアイテムを拾う
|
-- 落ちているアイテムを拾う
|
||||||
function maidroid.modules._aux.pickup_item(self, radius, target_pred)
|
function maidroid.modules._aux.pickup_item(self, radius, target_pred)
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
local pred = target_list or (function(itemstring) return true end)
|
local pred = target_pred or (function(itemstring) return true end)
|
||||||
local all_objects = minetest.get_objects_inside_radius(pos, radius)
|
local all_objects = minetest.get_objects_inside_radius(pos, radius)
|
||||||
for _, obj in ipairs(all_objects) do
|
for _, obj in ipairs(all_objects) do
|
||||||
if not obj:is_player() and obj:get_luaentity() then
|
if not obj:is_player() and obj:get_luaentity() then
|
||||||
|
@ -72,7 +72,7 @@ maidroid.register_module("maidroid:farming_module", {
|
|||||||
elseif pos.x == self.preposition.x or pos.z == self.preposition.z then
|
elseif pos.x == self.preposition.x or pos.z == self.preposition.z then
|
||||||
_aux.change_dir(self)
|
_aux.change_dir(self)
|
||||||
elseif forward_node.name == "air"
|
elseif forward_node.name == "air"
|
||||||
and minetest.get_item_group(inetest.get_node(forward_under_pos).name, "wet") > 0
|
and minetest.get_item_group(minetest.get_node(forward_under_pos).name, "wet") > 0
|
||||||
and has_seed_item(self) then
|
and has_seed_item(self) then
|
||||||
self.state = state.plant
|
self.state = state.plant
|
||||||
self.object:set_animation(maidroid.animations.mine, 15, 0)
|
self.object:set_animation(maidroid.animations.mine, 15, 0)
|
||||||
@ -85,6 +85,7 @@ maidroid.register_module("maidroid:farming_module", {
|
|||||||
elseif self.state == state.punch then
|
elseif self.state == state.punch then
|
||||||
if self.time_count >= max_punch_time then
|
if self.time_count >= max_punch_time then
|
||||||
if maidroid.util.table_find_value(target_plants_list, forward_node.name) then
|
if maidroid.util.table_find_value(target_plants_list, forward_node.name) then
|
||||||
|
minetest.remove_node(forward_pos)
|
||||||
local inv = minetest.get_inventory{type = "detached", name = self.invname}
|
local inv = minetest.get_inventory{type = "detached", name = self.invname}
|
||||||
local stacks = minetest.get_node_drops(forward_node.name)
|
local stacks = minetest.get_node_drops(forward_node.name)
|
||||||
for _, stack in ipairs(stacks) do
|
for _, stack in ipairs(stacks) do
|
||||||
|
Loading…
Reference in New Issue
Block a user