diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-12 09:26:25 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-06-12 09:26:25 +0200 |
commit | 079fc5df95ee4545e88af0f895a4438cd0886563 (patch) | |
tree | 437b21c58440c05551d27746cc893292430b3fcb /src | |
parent | cdae996583a6342c78a5693724f8f6542f0b00ec (diff) | |
download | skycraft-079fc5df95ee4545e88af0f895a4438cd0886563.tar.xz |
Changed Join Skyblock Entity
Diffstat (limited to 'src')
-rw-r--r-- | src/main/god_stick.lua | 3 | ||||
-rw-r--r-- | src/main/join_skyblock_entity.lua | 29 | ||||
-rw-r--r-- | src/main/join_skyblock_mob.lua | 32 |
3 files changed, 31 insertions, 33 deletions
diff --git a/src/main/god_stick.lua b/src/main/god_stick.lua index a405538..d702082 100644 --- a/src/main/god_stick.lua +++ b/src/main/god_stick.lua @@ -13,8 +13,9 @@ minetest.register_tool("skycraft:god_stick", { axey = groupcaps, shovely = groupcaps, fleshy = groupcaps, + handy = groupcaps, }, - damage_groups = {fleshy = 1000}, + damage_groups = {fleshy = 65535}, } }) diff --git a/src/main/join_skyblock_entity.lua b/src/main/join_skyblock_entity.lua new file mode 100644 index 0000000..ea2cfce --- /dev/null +++ b/src/main/join_skyblock_entity.lua @@ -0,0 +1,29 @@ +local function on_punch_or_rightclick(self, player) + if not player:is_player() then return end + local name = player:get_player_name() + if player:get_wielded_item():get_name() ~= "skycraft:god_stick" then + skycraft.join_skyblock(name) + else + self.object:remove() + end +end + +local function on_activate(self) + self.object:set_pos({x = 17, y = 10000.5, z = 0,}) + self.object:set_yaw(math.pi * 1.5) + self.object:set_nametag_attributes({color = "#00B59A", text = "Join Skyblock"}) + self.object:set_animation({x = 0, y = 79}, 30, 0) + self.object:set_armor_groups({immortal = 1}) +end + +minetest.register_entity("skycraft:join_skyblock", { + initial_properties = { + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3}, + visual = "mesh", + mesh = "character.b3d", + textures = {"character.png"}, + }, + on_punch = on_punch_or_rightclick, + on_rightclick = on_punch_or_rightclick, + on_activate = on_activate, +}) diff --git a/src/main/join_skyblock_mob.lua b/src/main/join_skyblock_mob.lua deleted file mode 100644 index 2c47853..0000000 --- a/src/main/join_skyblock_mob.lua +++ /dev/null @@ -1,32 +0,0 @@ -local function on_punch_or_rightclick(self, player) - if player and player.is_player and player:is_player() then - local name = player:get_player_name() - if player:get_wielded_item():get_name() == "mcl_core:stick" and minetest.check_player_privs(name, {server = true}) then - self.object:remove() - else - skycraft.join_skyblock(name) - end - end - return false -end - -mobs:register_mob("skycraft:join_skyblock", { - nametag = "Join Skyblock", - type = "npc", - jump = false, - armor = 0, - stand_chance = 100, - walk_chance = 0, - collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3}, - visual = "mesh", - mesh = "character.b3d", - textures = { - {"mcl_skins_character_1.png"}, - }, - glow = 10, - do_custom = function(self) - self.object:set_yaw(math.pi * 1.5) - end, - on_rightclick = on_punch_or_rightclick, - do_punch = on_punch_or_rightclick, -}) |