Add files via upload

This commit is contained in:
AiTechEye 2019-10-13 20:14:36 +02:00 committed by GitHub
parent 20213eb14f
commit 3316e88964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 9 deletions

@ -1,15 +1,15 @@
-- Code by UjEdwin
portalgun_power={} portalgun_power={}
portalgun_power_tmp_power=0 portalgun_power_tmp_power=0
function portalgun_gravity(itemstack, user, pointed_thing) function portalgun_gravity(itemstack, user, pointed_thing)
local ob=pointed_thing.ref local ob=pointed_thing.ref
if ob:get_luaentity() and ob:get_luaentity().portalgun_power then local at = ob:get_attach()
ob:get_luaentity().target:set_detach() if at and at:get_luaentity() and at:get_luaentity().portalgun_power then
if ob:get_luaentity().target:get_luaentity() and (ob:get_luaentity().target:get_luaentity().itemstring or ob:get_luaentity().target:get_luaentity().wsc) then ob:set_detach()
ob:get_luaentity().target:set_velocity({x=0, y=-1, z=0}) local target = at:get_luaentity().target
ob:get_luaentity().target:set_acceleration({x=0, y=-8, z=0}) if target and target:get_luaentity() and (target:get_luaentity().itemstring or target:get_luaentity().wsc) then
target:set_velocity({x=0, y=-1, z=0})
target:set_acceleration({x=0, y=-8, z=0})
end end
return itemstack return itemstack
end end
@ -21,6 +21,13 @@ function portalgun_gravity(itemstack, user, pointed_thing)
ob:set_attach(m, "", {x=0,y=0,z=0}, {x=0,y=0,z=0}) ob:set_attach(m, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
return itemstack return itemstack
end end
return itemstack return itemstack
end end

4
mod.conf Normal file

@ -0,0 +1,4 @@
name = portalgun
description = Portals and stuff
depends = default
optional_depends = mesecons