1
0
mirror of https://github.com/tacigar/maidroid.git synced 2024-11-11 04:30:26 +01:00

Modify various

This commit is contained in:
tacigar 2017-01-03 10:43:56 +09:00
parent 4fa83404d5
commit 4b32c4c5cd
6 changed files with 10 additions and 8 deletions

View File

@ -301,7 +301,7 @@ end
function maidroid.register_core(core_name, def)
maidroid.registered_cores[core_name] = def
minetest.register_craftitem(core_name, {
minetest.register_tool(core_name, {
stack_max = 1,
description = def.description,
inventory_image = def.inventory_image,
@ -312,7 +312,7 @@ end
function maidroid.register_egg(egg_name, def)
maidroid.registered_eggs[egg_name] = def
minetest.register_craftitem(egg_name, {
minetest.register_tool(egg_name, {
description = def.description,
inventory_image = def.inventory_image,
stack_max = 1,

View File

@ -14,6 +14,7 @@ end
local function on_stop(self)
self.state = nil
self.object:setvelocity{x = 0, y = 0, z = 0}
self:set_animation(maidroid.animation_frames.STAND)
end
local function on_step(self, dtime)

View File

@ -3,9 +3,11 @@
-- https://github.com/tacigar/maidroid
------------------------------------------------------------
maidroid_tool._aux = {}
-- maidroid_tool.shared.generate_writer is a shared
-- function called for registering egg writer and core writer.
function maidroid_tool.register_writer(nodename, options)
function maidroid_tool._aux.register_writer(nodename, options)
local description = options.description
local formspec = options.formspec
local tiles = options.tiles
@ -16,7 +18,6 @@ function maidroid_tool.register_writer(nodename, options)
local on_deactivate = options.on_deactivate
local empty_itemname = options.empty_itemname
local dye_item_map = options.dye_item_map
--~ local is_mainitem = options.is_mainitem
local on_metadata_inventory_put_to_main = options.on_metadata_inventory_put_to_main
local on_metadata_inventory_take_from_main = options.on_metadata_inventory_take_from_main

View File

@ -148,7 +148,7 @@ do -- register core writer
core_entity.object:remove()
end
maidroid_tool.register_writer("maidroid_tool:core_writer", {
maidroid_tool._aux.register_writer("maidroid_tool:core_writer", {
description = "maidroid tool : core writer",
formspec = formspec,
tiles = tiles,

View File

@ -165,7 +165,7 @@ do -- register egg writer
egg_entity.object:remove()
end
maidroid_tool.register_writer("maidroid_tool:egg_writer", {
maidroid_tool._aux.register_writer("maidroid_tool:egg_writer", {
description = "maidroid tool : egg writer",
formspec = formspec,
tiles = tiles,

View File

@ -8,7 +8,7 @@ maidroid_tool = {}
maidroid_tool.modname = "maidroid_tool"
maidroid_tool.modpath = minetest.get_modpath(maidroid_tool.modname)
dofile(maidroid_tool.modpath .. "/api.lua")
dofile(maidroid_tool.modpath .. "/_aux.lua")
dofile(maidroid_tool.modpath .. "/core_writer.lua")
dofile(maidroid_tool.modpath .. "/egg_writer.lua")
dofile(maidroid_tool.modpath .. "/crafting.lua")