diff --git a/models/prtl_0.blend b/models/prtl_0.blend index 280106a..6097b7f 100644 Binary files a/models/prtl_0.blend and b/models/prtl_0.blend differ diff --git a/models/prtl_0.blend1 b/models/prtl_0.blend1 index 797d022..95910e0 100644 Binary files a/models/prtl_0.blend1 and b/models/prtl_0.blend1 differ diff --git a/models/tureta.b3d b/models/tureta.b3d new file mode 100644 index 0000000..c2316c6 Binary files /dev/null and b/models/tureta.b3d differ diff --git a/models/tureta.blend b/models/tureta.blend new file mode 100644 index 0000000..82ef3b2 Binary files /dev/null and b/models/tureta.blend differ diff --git a/models/tureta.blend1 b/models/tureta.blend1 new file mode 100644 index 0000000..7017164 Binary files /dev/null and b/models/tureta.blend1 differ diff --git a/scripts/portalgun.lua b/scripts/portalgun.lua index d66edd6..55b0713 100644 --- a/scripts/portalgun.lua +++ b/scripts/portalgun.lua @@ -412,11 +412,6 @@ minetest.register_craftitem( range = 100, inventory_image = "portalgun_gun0_rndr.png", wield_image = "portalgun_gun0_rndr.png", - tool_capabilities = { - full_punch_interval = 0.5, - max_drop_level = 3, - damage_groups = {fleshy = 1} - }, on_place = function(itemstack, user, pointed_thing) local node = minetest.get_node(pointed_thing.under) if node.name == "portalgun:button" then @@ -428,10 +423,6 @@ minetest.register_craftitem( return itemstack end, on_use = function(itemstack, user, pointed_thing) - --if pointing at turret then start breaking it - if pointed_thing.type == "node" then - local node = minetest.get_node(pointed_thing.under) - end portalgun_onuse(itemstack, user, pointed_thing, 1) return itemstack end @@ -442,12 +433,13 @@ local function rnd(r) return math.floor(r + 0.5) end +minetest.register_privilege("allblocksportal", "Can use place portals everywhere") + function portalgun_onuse(itemstack, user, pointed_thing, mode) -- using the gun if pointed_thing.type == "object" then portalgun_gravity(itemstack, user, pointed_thing) return itemstack end - local pos = user:get_pos() local dir = user:get_look_dir() local key = user:get_player_control() @@ -493,10 +485,14 @@ function portalgun_onuse(itemstack, user, pointed_thing, mode) -- using the gun if minetest.registered_nodes[nname].walkable then portalgun_portal[name].lifelime = portalgun_lifelime - if minetest.get_node_group(nname, "antiportal") > 0 then - minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3}) - return itemstack - elseif minetest.get_node_group(nname, "proportal") == 0 then + -- if minetest.get_node_group(nname, "antiportal") > 0 then + -- minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3}) + -- return itemstack + -- end + --check if the name doesnt start with portalgun:testblock or if has priv allblocksportal + local allplace = minetest.check_player_privs(user:get_player_name(), {allblocksportal = true}) + local istestblock = string.find(nname, "portalgun:testblock", 1) + if not istestblock and not allplace then minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3}) return itemstack end diff --git a/textures/portalgun_gun0_rndr.png b/textures/portalgun_gun0_rndr.png index f2b3799..86745b4 100644 Binary files a/textures/portalgun_gun0_rndr.png and b/textures/portalgun_gun0_rndr.png differ diff --git a/textures/portalgun_turreta.png b/textures/portalgun_turreta.png new file mode 100644 index 0000000..4873b74 Binary files /dev/null and b/textures/portalgun_turreta.png differ