pointable.lua 689 B

123456789101112131415161718192021222324
  1. -- Pointability test Entities
  2. -- Register wrapper for compactness
  3. local function register_pointable_testentity(name, pointable)
  4. local texture = "testnodes_"..name..".png"
  5. core.register_entity("testentities:"..name, {
  6. initial_properties = {
  7. visual = "cube",
  8. visual_size = {x = 0.6, y = 0.6, z = 0.6},
  9. textures = {
  10. texture, texture, texture, texture, texture, texture
  11. },
  12. pointable = pointable,
  13. },
  14. on_activate = function(self)
  15. self.object:set_armor_groups({[name.."_test"] = 1})
  16. end
  17. })
  18. end
  19. register_pointable_testentity("pointable", true)
  20. register_pointable_testentity("not_pointable", false)
  21. register_pointable_testentity("blocking_pointable", "blocking")