mirror of
https://github.com/mt-mods/hangglider.git
synced 2025-11-21 17:45:28 +01:00
Add support for games without default game (MTG) (#25)
* Add support for games without `default` This adds support for games like Mineclonia, and any game xcompat adds support for. The only asterix is dye support, the pattern for dyes has been expanded for common dye mods, but if a new dye mod has different dye names those might not work without an update to the pattern. * Refactor & fix Farlands dye support * Add some mcl colors, make names & their order consistent * Fix old crafting bug & refacfor crafting * Minor refactor & reorder for clarity * Fix for Farlands `get_name` returning "" not nil Farlands seems to return "" instead of nil/0 when no item is present. By accounting for this, this commit fixes an issue where any empty slot repaired the glider. * Separate color handling to new module * Luacheck fix * Ignore empty `do end` luacheck warnings * Replace `minetest.` with `core.`
This commit is contained in:
@@ -5,9 +5,16 @@ globals = {
|
|||||||
|
|
||||||
read_globals = {
|
read_globals = {
|
||||||
"minetest",
|
"minetest",
|
||||||
|
"core",
|
||||||
"vector", "ItemStack",
|
"vector", "ItemStack",
|
||||||
|
|
||||||
"player_monoids",
|
"player_monoids",
|
||||||
"pova",
|
"pova",
|
||||||
"unifieddyes",
|
"unifieddyes",
|
||||||
|
"xcompat",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ignore = {
|
||||||
|
"541", -- Empty "do end" block warning
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
91
colors.lua
Normal file
91
colors.lua
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
local S = hangglider.translator
|
||||||
|
local module = {}
|
||||||
|
|
||||||
|
local has_unifieddyes = core.get_modpath("unifieddyes")
|
||||||
|
local dye_prefix_pattern_universal = "^.*dyes?:" -- Known dye prefix matches: dyes, mcl_dyes, mcl_dye, fl_dyes.
|
||||||
|
local dye_suffix_pattern_farlands = "_dye$" -- A suffix appended to dye names in the Farlands game.
|
||||||
|
|
||||||
|
local dye_colors = {
|
||||||
|
black = "111111",
|
||||||
|
blue = "0000ff",
|
||||||
|
brown = "592c00",
|
||||||
|
cyan = "00ffff",
|
||||||
|
dark_green = "005900",
|
||||||
|
dark_grey = "444444",
|
||||||
|
green = "00ff00",
|
||||||
|
grey = "888888",
|
||||||
|
light_blue = "258ec9",
|
||||||
|
lime = "60ac19",
|
||||||
|
magenta = "ff00ff",
|
||||||
|
orange = "ff7f00",
|
||||||
|
pink = "ff7f9f",
|
||||||
|
purple = "6821a0",
|
||||||
|
red = "ff0000",
|
||||||
|
silver = "818177",
|
||||||
|
violet = "8000ff",
|
||||||
|
white = "ffffff",
|
||||||
|
yellow = "ffff00",
|
||||||
|
}
|
||||||
|
|
||||||
|
local translated_colors = {
|
||||||
|
black = S("Black"),
|
||||||
|
blue = S("Blue"),
|
||||||
|
brown = S("Brown"),
|
||||||
|
cyan = S("Cyan"),
|
||||||
|
dark_green = S("Dark Green"),
|
||||||
|
dark_grey = S("Dark Grey"),
|
||||||
|
green = S("Green"),
|
||||||
|
grey = S("Grey"),
|
||||||
|
light_blue = S("Light Blue"),
|
||||||
|
lime = S("Lime"),
|
||||||
|
magenta = S("Magenta"),
|
||||||
|
orange = S("Orange"),
|
||||||
|
pink = S("Pink"),
|
||||||
|
purple = S("Purple"),
|
||||||
|
red = S("Red"),
|
||||||
|
silver = S("Light Grey"),
|
||||||
|
violet = S("Violet"),
|
||||||
|
white = S("White"),
|
||||||
|
yellow = S("Yellow"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function module.get_dye_name(name)
|
||||||
|
-- Remove prefix and potential suffix
|
||||||
|
name = string.gsub(name, dye_suffix_pattern_farlands, "")
|
||||||
|
name = string.match(name, dye_prefix_pattern_universal.."(.+)$")
|
||||||
|
return name
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function module.get_dye_color(name)
|
||||||
|
local color
|
||||||
|
if has_unifieddyes then
|
||||||
|
color = unifieddyes.get_color_from_dye_name(name)
|
||||||
|
end
|
||||||
|
|
||||||
|
if not color then
|
||||||
|
color = module.get_dye_name(name)
|
||||||
|
if color then
|
||||||
|
color = dye_colors[color]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return color
|
||||||
|
end
|
||||||
|
|
||||||
|
function module.get_color_name(name)
|
||||||
|
return translated_colors[module.get_dye_name(name)]
|
||||||
|
end
|
||||||
|
|
||||||
|
function module.get_color_name_from_color(color)
|
||||||
|
for name, color_hex in pairs(dye_colors) do
|
||||||
|
if color == color_hex then
|
||||||
|
return translated_colors[name]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return module
|
||||||
156
crafts.lua
156
crafts.lua
@@ -1,105 +1,82 @@
|
|||||||
|
|
||||||
local S = hangglider.translator
|
local S = hangglider.translator
|
||||||
|
local colors = assert(dofile(core.get_modpath("hangglider").."/colors.lua"))
|
||||||
|
|
||||||
local has_unifieddyes = minetest.get_modpath("unifieddyes")
|
local repair_items = {"group:wool", xcompat.materials.paper}
|
||||||
|
local repair_percentage = 100
|
||||||
|
|
||||||
local dye_colors = {
|
|
||||||
white = "ffffff",
|
|
||||||
grey = "888888",
|
|
||||||
dark_grey = "444444",
|
|
||||||
black = "111111",
|
|
||||||
violet = "8000ff",
|
|
||||||
blue = "0000ff",
|
|
||||||
cyan = "00ffff",
|
|
||||||
dark_green = "005900",
|
|
||||||
green = "00ff00",
|
|
||||||
yellow = "ffff00",
|
|
||||||
brown = "592c00",
|
|
||||||
orange = "ff7f00",
|
|
||||||
red = "ff0000",
|
|
||||||
magenta = "ff00ff",
|
|
||||||
pink = "ff7f9f",
|
|
||||||
}
|
|
||||||
|
|
||||||
local translated_colors = {
|
-- Placeholder repairing recipes (Doesn't directly apply repair, see handler)
|
||||||
white = S("White"),
|
core.register_craft({
|
||||||
grey = S("Grey"),
|
output = "hangglider:hangglider",
|
||||||
dark_grey = S("Dark_grey"),
|
recipe = {
|
||||||
black = S("Black"),
|
{xcompat.materials.paper, xcompat.materials.paper, xcompat.materials.paper},
|
||||||
violet = S("Violet"),
|
{xcompat.materials.paper, "hangglider:hangglider", xcompat.materials.paper},
|
||||||
blue = S("Blue"),
|
{xcompat.materials.paper, xcompat.materials.paper, xcompat.materials.paper},
|
||||||
cyan = S("Cyan"),
|
},
|
||||||
dark_green = S("Dark_green"),
|
})
|
||||||
green = S("Green"),
|
|
||||||
yellow = S("Yellow"),
|
|
||||||
brown = S("Brown"),
|
|
||||||
orange = S("Orange"),
|
|
||||||
red = S("Red"),
|
|
||||||
magenta = S("Magenta"),
|
|
||||||
pink = S("Pink"),
|
|
||||||
}
|
|
||||||
|
|
||||||
local function get_dye_color(name)
|
core.register_craft({
|
||||||
local color
|
output = "hangglider:hangglider",
|
||||||
if has_unifieddyes then
|
recipe = {"hangglider:hangglider", "group:wool"},
|
||||||
color = unifieddyes.get_color_from_dye_name(name)
|
type = "shapeless",
|
||||||
end
|
})
|
||||||
if not color then
|
|
||||||
color = string.match(name, "^dye:(.+)$")
|
|
||||||
if color then
|
|
||||||
color = dye_colors[color]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return color
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_color_name(name)
|
-- Placeholder color recipe (Doesn't drectly apply color, see handler)
|
||||||
name = string.gsub(name, "^dye:", "")
|
|
||||||
return translated_colors[name]
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_color_name_from_color(color)
|
|
||||||
for name, color_hex in pairs(dye_colors) do
|
|
||||||
if color == color_hex then
|
|
||||||
return translated_colors[name]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- This recipe is just a placeholder
|
|
||||||
do
|
do
|
||||||
local item = ItemStack("hangglider:hangglider")
|
local item = ItemStack("hangglider:hangglider")
|
||||||
item:get_meta():set_string("description", S("Colored Glider"))
|
item:get_meta():set_string("description", S("Colored Glider"))
|
||||||
minetest.register_craft({
|
core.register_craft({
|
||||||
output = item:to_string(),
|
output = item:to_string(),
|
||||||
recipe = {"hangglider:hangglider", "group:dye"},
|
recipe = {"hangglider:hangglider", "group:dye"},
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This is what actually creates the colored hangglider
|
-- Recipe handler (This is what applies color and repair)
|
||||||
minetest.register_on_craft(function(crafted_item, _, old_craft_grid)
|
local function crafting_callback_handle_placeholder_recipe(crafted_item, _, old_craft_grid)
|
||||||
if crafted_item:get_name() ~= "hangglider:hangglider" then
|
if crafted_item:get_name() ~= "hangglider:hangglider" then
|
||||||
|
-- Function called for an unrelated crafting recipe
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local wear, color, color_name
|
-- Get existing state and present materials
|
||||||
|
local wear, repaired, dye_name, color, color_name = 0, false, nil, nil, nil
|
||||||
for _,stack in ipairs(old_craft_grid) do
|
for _,stack in ipairs(old_craft_grid) do
|
||||||
local name = stack:get_name()
|
local name = stack:get_name()
|
||||||
if name == "hangglider:hangglider" then
|
if not name or name == "" then
|
||||||
|
do end -- The stack is empty, do nothing and skip all checks for this stack.
|
||||||
|
elseif name == "hangglider:hangglider" then
|
||||||
wear = stack:get_wear()
|
wear = stack:get_wear()
|
||||||
color = stack:get_meta():get("hangglider_color")
|
color = stack:get_meta():get("hangglider_color")
|
||||||
color_name = get_color_name_from_color(color)
|
color_name = colors.get_color_name_from_color(color)
|
||||||
elseif minetest.get_item_group(name, "dye") ~= 0 then
|
elseif core.get_item_group(name, "dye") ~= 0 then
|
||||||
color = get_dye_color(name)
|
dye_name = name
|
||||||
color_name = get_color_name(name)
|
else
|
||||||
elseif "wool:white" == stack:get_name()
|
for _,repair_item in ipairs(repair_items) do
|
||||||
or "default:paper" == stack:get_name()
|
if name == repair_item
|
||||||
|
or core.get_item_group(name, string.match(repair_item, "^group:(.*)$")) ~= 0
|
||||||
then
|
then
|
||||||
wear = 0
|
repaired = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Overwrite color with dye if present
|
||||||
|
if dye_name then
|
||||||
|
color = colors.get_dye_color(dye_name)
|
||||||
|
color_name = colors.get_color_name(dye_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Repair if any repair item present
|
||||||
|
if repaired then
|
||||||
|
wear = wear - (65535 * (repair_percentage / 100))
|
||||||
|
if wear < 0 then wear = 0 end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Apply item changes if valid
|
||||||
if wear and color and color_name then
|
if wear and color and color_name then
|
||||||
if color == "ffffff" then
|
if color == "ffffff" then
|
||||||
|
-- Return an uncolored glider
|
||||||
return ItemStack({name = "hangglider:hangglider", wear = wear})
|
return ItemStack({name = "hangglider:hangglider", wear = wear})
|
||||||
end
|
end
|
||||||
local meta = crafted_item:get_meta()
|
local meta = crafted_item:get_meta()
|
||||||
@@ -109,30 +86,17 @@ minetest.register_on_craft(function(crafted_item, _, old_craft_grid)
|
|||||||
crafted_item:set_wear(wear)
|
crafted_item:set_wear(wear)
|
||||||
return crafted_item
|
return crafted_item
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
-- Register handler as a callback for any crafting action
|
||||||
|
core.register_on_craft(crafting_callback_handle_placeholder_recipe)
|
||||||
|
|
||||||
-- Repairing
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "hangglider:hangglider",
|
|
||||||
recipe = {
|
|
||||||
{"default:paper", "default:paper", "default:paper"},
|
|
||||||
{"default:paper", "hangglider:hangglider", "default:paper"},
|
|
||||||
{"default:paper", "default:paper", "default:paper"},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "hangglider:hangglider",
|
|
||||||
recipe = {
|
|
||||||
{"hangglider:hangglider", "wool:white"},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Main craft
|
-- Hangglider recipe
|
||||||
minetest.register_craft({
|
core.register_craft({
|
||||||
output = "hangglider:hangglider",
|
output = "hangglider:hangglider",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"wool:white", "wool:white", "wool:white"},
|
{"group:wool", "group:wool", "group:wool"},
|
||||||
{"default:stick", "", "default:stick"},
|
{xcompat.materials.stick, "", xcompat.materials.stick},
|
||||||
{"", "default:stick", ""},
|
{"", xcompat.materials.stick, ""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
48
init.lua
48
init.lua
@@ -1,17 +1,17 @@
|
|||||||
|
|
||||||
hangglider = {
|
hangglider = {
|
||||||
translator = minetest.get_translator('hangglider'),
|
translator = core.get_translator('hangglider'),
|
||||||
}
|
}
|
||||||
local S = hangglider.translator
|
local S = hangglider.translator
|
||||||
|
|
||||||
local has_player_monoids = minetest.get_modpath("player_monoids")
|
local has_player_monoids = core.get_modpath("player_monoids")
|
||||||
local has_pova = minetest.get_modpath("pova")
|
local has_pova = core.get_modpath("pova")
|
||||||
local has_areas = minetest.get_modpath("areas")
|
local has_areas = core.get_modpath("areas")
|
||||||
|
|
||||||
local enable_hud_overlay = minetest.settings:get_bool("hangglider.enable_hud_overlay", true)
|
local enable_hud_overlay = core.settings:get_bool("hangglider.enable_hud_overlay", true)
|
||||||
local enable_flak = has_areas and minetest.settings:get_bool("hangglider.enable_flak", true)
|
local enable_flak = has_areas and core.settings:get_bool("hangglider.enable_flak", true)
|
||||||
local flak_warning_time = tonumber(minetest.settings:get("hangglider.flak_warning_time")) or 2
|
local flak_warning_time = tonumber(core.settings:get("hangglider.flak_warning_time")) or 2
|
||||||
local hangglider_uses = tonumber(minetest.settings:get("hangglider.uses")) or 250
|
local hangglider_uses = tonumber(core.settings:get("hangglider.uses")) or 250
|
||||||
|
|
||||||
local flak_warning = S("You have entered restricted airspace!@n"
|
local flak_warning = S("You have entered restricted airspace!@n"
|
||||||
.. "You will be shot down in @1 seconds by anti-aircraft guns!",
|
.. "You will be shot down in @1 seconds by anti-aircraft guns!",
|
||||||
@@ -23,7 +23,7 @@ local hud_overlay_ids = {}
|
|||||||
|
|
||||||
|
|
||||||
if enable_flak then
|
if enable_flak then
|
||||||
minetest.register_chatcommand("area_flak", {
|
core.register_chatcommand("area_flak", {
|
||||||
params = S("<ID>"),
|
params = S("<ID>"),
|
||||||
description = S("Toggle airspace restrictions for area <ID>."),
|
description = S("Toggle airspace restrictions for area <ID>."),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
@@ -57,7 +57,7 @@ local function set_hud_overlay(player, name, show)
|
|||||||
end
|
end
|
||||||
if not hud_overlay_ids[name] and show == true then
|
if not hud_overlay_ids[name] and show == true then
|
||||||
hud_overlay_ids[name] = player:hud_add({
|
hud_overlay_ids[name] = player:hud_add({
|
||||||
[minetest.features.hud_def_type_field and "type" or "hud_elem_type"] = "image",
|
[core.features.hud_def_type_field and "type" or "hud_elem_type"] = "image",
|
||||||
text = "hangglider_overlay.png",
|
text = "hangglider_overlay.png",
|
||||||
position = {x = 0, y = 0},
|
position = {x = 0, y = 0},
|
||||||
scale = {x = -100, y = -100},
|
scale = {x = -100, y = -100},
|
||||||
@@ -159,11 +159,11 @@ local function can_fly(pos, name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function safe_node_below(pos)
|
local function safe_node_below(pos)
|
||||||
local node = minetest.get_node_or_nil(vector.new(pos.x, pos.y - 0.5, pos.z))
|
local node = core.get_node_or_nil(vector.new(pos.x, pos.y - 0.5, pos.z))
|
||||||
if not node then
|
if not node then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local def = minetest.registered_nodes[node.name]
|
local def = core.registered_nodes[node.name]
|
||||||
if def and (def.walkable or (def.liquidtype ~= "none" and def.damage_per_second <= 0)) then
|
if def and (def.walkable or (def.liquidtype ~= "none" and def.damage_per_second <= 0)) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -171,7 +171,7 @@ local function safe_node_below(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function shoot_flak_sound(pos)
|
local function shoot_flak_sound(pos)
|
||||||
minetest.sound_play("hangglider_flak_shot", {
|
core.sound_play("hangglider_flak_shot", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
max_hear_distance = 30,
|
max_hear_distance = 30,
|
||||||
gain = 10.0,
|
gain = 10.0,
|
||||||
@@ -213,7 +213,7 @@ local function hangglider_step(self, dtime)
|
|||||||
if not self.flak_timer then
|
if not self.flak_timer then
|
||||||
self.flak_timer = 0
|
self.flak_timer = 0
|
||||||
shoot_flak_sound(pos)
|
shoot_flak_sound(pos)
|
||||||
minetest.chat_send_player(name, flak_warning)
|
core.chat_send_player(name, flak_warning)
|
||||||
else
|
else
|
||||||
self.flak_timer = self.flak_timer + dtime
|
self.flak_timer = self.flak_timer + dtime
|
||||||
end
|
end
|
||||||
@@ -244,14 +244,14 @@ local function hangglider_use(stack, player)
|
|||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if not hanggliding_players[name] then
|
if not hanggliding_players[name] then
|
||||||
minetest.sound_play("hanggliger_equip", {pos = pos, max_hear_distance = 8, gain = 1.0}, true)
|
core.sound_play("hanggliger_equip", {pos = pos, max_hear_distance = 8, gain = 1.0}, true)
|
||||||
local entity = minetest.add_entity(pos, "hangglider:glider")
|
local entity = core.add_entity(pos, "hangglider:glider")
|
||||||
if entity then
|
if entity then
|
||||||
entity:set_attach(player, "", vector.new(0, 10, 0), vector.new(0, 0, 0))
|
entity:set_attach(player, "", vector.new(0, 10, 0), vector.new(0, 0, 0))
|
||||||
local color = stack:get_meta():get("hangglider_color")
|
local color = stack:get_meta():get("hangglider_color")
|
||||||
if color then
|
if color then
|
||||||
entity:set_properties({
|
entity:set_properties({
|
||||||
textures = {"wool_white.png^[multiply:#"..color, "default_wood.png"}
|
textures = {xcompat.textures.wool.white.."^[multiply:#"..color, xcompat.textures.wood.apple.planks}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
set_hud_overlay(player, name, true)
|
set_hud_overlay(player, name, true)
|
||||||
@@ -269,20 +269,20 @@ local function hangglider_use(stack, player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
core.register_on_dieplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
hanggliding_players[name] = nil
|
hanggliding_players[name] = nil
|
||||||
remove_physics_overrides(player)
|
remove_physics_overrides(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
core.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
hanggliding_players[name] = nil
|
hanggliding_players[name] = nil
|
||||||
hud_overlay_ids[name] = nil
|
hud_overlay_ids[name] = nil
|
||||||
remove_physics_overrides(player)
|
remove_physics_overrides(player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
core.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if hanggliding_players[name] and reason.type == "fall" then
|
if hanggliding_players[name] and reason.type == "fall" then
|
||||||
-- Stop all fall damage when hanggliding
|
-- Stop all fall damage when hanggliding
|
||||||
@@ -291,24 +291,24 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
|||||||
return hp_change
|
return hp_change
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
minetest.register_entity("hangglider:glider", {
|
core.register_entity("hangglider:glider", {
|
||||||
initial_properties = {
|
initial_properties = {
|
||||||
visual = "mesh",
|
visual = "mesh",
|
||||||
visual_size = {x = 12, y = 12},
|
visual_size = {x = 12, y = 12},
|
||||||
collisionbox = {0,0,0,0,0,0},
|
collisionbox = {0,0,0,0,0,0},
|
||||||
mesh = "hangglider.obj",
|
mesh = "hangglider.obj",
|
||||||
textures = {"wool_white.png", "default_wood.png"},
|
textures = {xcompat.textures.wool.white, xcompat.textures.wood.apple.planks},
|
||||||
immortal = true,
|
immortal = true,
|
||||||
static_save = false,
|
static_save = false,
|
||||||
},
|
},
|
||||||
on_step = hangglider_step,
|
on_step = hangglider_step,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("hangglider:hangglider", {
|
core.register_tool("hangglider:hangglider", {
|
||||||
description = S("Glider"),
|
description = S("Glider"),
|
||||||
inventory_image = "hangglider_item.png",
|
inventory_image = "hangglider_item.png",
|
||||||
sound = {breaks = "default_tool_breaks"},
|
sound = {breaks = "default_tool_breaks"},
|
||||||
on_use = hangglider_use,
|
on_use = hangglider_use,
|
||||||
})
|
})
|
||||||
|
|
||||||
dofile(minetest.get_modpath("hangglider").."/crafts.lua")
|
dofile(core.get_modpath("hangglider").."/crafts.lua")
|
||||||
|
|||||||
2
mod.conf
2
mod.conf
@@ -1,5 +1,5 @@
|
|||||||
name = hangglider
|
name = hangglider
|
||||||
description = Adds a functional hang glider for exploring
|
description = Adds a functional hang glider for exploring
|
||||||
depends = default, wool, dye
|
depends = xcompat
|
||||||
optional_depends = areas, player_monoids, pova, unifieddyes
|
optional_depends = areas, player_monoids, pova, unifieddyes
|
||||||
min_minetest_version = 5.0
|
min_minetest_version = 5.0
|
||||||
|
|||||||
Reference in New Issue
Block a user