From 86e4972776c0274ad1ae1dcc47ede055eb2dbd97 Mon Sep 17 00:00:00 2001 From: tacigar Date: Thu, 15 Sep 2016 07:16:25 +0900 Subject: [PATCH] [ADD] Add core_writer method --- maidroid_tool/core_writer.lua | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/maidroid_tool/core_writer.lua b/maidroid_tool/core_writer.lua index 7c3a862..cf802f0 100644 --- a/maidroid_tool/core_writer.lua +++ b/maidroid_tool/core_writer.lua @@ -266,15 +266,31 @@ end) () paramtype2 = "facedir", }) + local function on_activate(self, staticdata) + self.object:set_properties{ + textures = {"maidroid_tool:core_node"}, + } + end + + local function start_rotate(self) + self.object:set_properties{ + automatic_rotate = 1, + } + end + + local function stop_rotate(self) + self.object:set_properties{ + automatic_rotate = 0, + } + end + minetest.register_entity("maidroid_tool:core_entity", { physical = false, visual = "wielditem", visual_size = {x = 0.5, y = 0.5}, collisionbox = {0, 0, 0, 0, 0, 0}, - on_activate = function(self, staticdata) - self.object:set_properties{textures = {"maidroid_tool:core_node"}} - end, + on_activate = on_activate, on_step = function(self, dtime) local yaw = self.object:getyaw()