forked from mtcontrib/throwing
Merge branch 'gitlab'
This commit is contained in:
commit
b03bc65d54
@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_build_box", {
|
||||
},
|
||||
tiles = {"throwing_arrow_build.png", "throwing_arrow_build.png", "throwing_arrow_build_back.png", "throwing_arrow_build_front.png", "throwing_arrow_build_2.png", "throwing_arrow_build.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
use_texture_alpha = "opaque",
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
@ -74,7 +75,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
if self.lastpos.x~=nil then
|
||||
if node.name ~= "air" then
|
||||
self.object:remove()
|
||||
if self.inventory and self.stack and not minetest.setting_getbool("creative_mode") then
|
||||
if self.inventory and self.stack and not minetest.settings:get_bool("creative_mode") then
|
||||
self.inventory:remove_item("main", {name=self.stack:get_name()})
|
||||
end
|
||||
if self.stack then
|
||||
|
@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_dig_box", {
|
||||
},
|
||||
tiles = {"throwing_arrow_dig.png", "throwing_arrow_dig.png", "throwing_arrow_dig_back.png", "throwing_arrow_dig_front.png", "throwing_arrow_dig_2.png", "throwing_arrow_dig.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
use_texture_alpha = "opaque",
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
|
@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_fire_box", {
|
||||
},
|
||||
tiles = {"throwing_arrow_fire.png", "throwing_arrow_fire.png", "throwing_arrow_fire_back.png", "throwing_arrow_fire_front.png", "throwing_arrow_fire_2.png", "throwing_arrow_fire.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
use_texture_alpha = "opaque",
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
|
@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_teleport_box", {
|
||||
},
|
||||
tiles = {"throwing_arrow_teleport.png", "throwing_arrow_teleport.png", "throwing_arrow_teleport_back.png", "throwing_arrow_teleport_front.png", "throwing_arrow_teleport_2.png", "throwing_arrow_teleport.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
use_texture_alpha = "opaque",
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
|
@ -27,6 +27,7 @@ minetest.register_node("throwing:arrow_tnt_box", {
|
||||
},
|
||||
tiles = {"throwing_arrow_tnt.png", "throwing_arrow_tnt.png", "throwing_arrow_tnt_back.png", "throwing_arrow_tnt_front.png", "throwing_arrow_tnt_2.png", "throwing_arrow_tnt.png"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
use_texture_alpha = "opaque",
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
@ -47,7 +48,7 @@ local loss_prob = {}
|
||||
loss_prob["default:cobble"] = 3
|
||||
loss_prob["default:dirt"] = 4
|
||||
|
||||
local radius = tonumber(minetest.setting_get("tnt_radius") or 3)
|
||||
local radius = tonumber(minetest.settings:get("tnt_radius") or 3)
|
||||
|
||||
-- Fill a list with data for content IDs, after all nodes are registered
|
||||
local cid_data = {}
|
||||
@ -82,8 +83,8 @@ local function eject_drops(drops, pos, radius)
|
||||
local obj = minetest.add_item(drop_pos, item)
|
||||
if obj then
|
||||
obj:get_luaentity().collect = true
|
||||
obj:setacceleration({x=0, y=-10, z=0})
|
||||
obj:setvelocity({x=math.random(-3, 3), y=10,
|
||||
obj:set_acceleration({x=0, y=-10, z=0})
|
||||
obj:set_velocity({x=math.random(-3, 3), y=10,
|
||||
z=math.random(-3, 3)})
|
||||
end
|
||||
count = count - max
|
||||
@ -152,7 +153,7 @@ local function entity_physics(pos, radius)
|
||||
local dist = math.max(1, vector.distance(pos, obj_pos))
|
||||
|
||||
if obj_vel ~= nil then
|
||||
obj:setvelocity(calc_velocity(pos, obj_pos,
|
||||
obj:set_velocity(calc_velocity(pos, obj_pos,
|
||||
obj_vel, radius * 10))
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user