Compare commits
10 Commits
8c6eb64f1b
...
a9fbd4028f
Author | SHA1 | Date | |
---|---|---|---|
|
a9fbd4028f | ||
|
42456051e5 | ||
|
469ee9c208 | ||
|
caf121201d | ||
|
a20eba23d0 | ||
|
11cf9a1515 | ||
|
9319e0bdbc | ||
|
b126d32b51 | ||
|
53873f44bb | ||
|
2d762d9328 |
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
## Pontoons
|
||||
|
||||
This mod adds some simple building blocks that can be placed on top of liquid, making it easier to construct things on a body of water without needing to first build a piling from the ground underneath.
|
||||
|
||||
Wood pontoons are for building on the surface of water and steel pontoons can be placed on either water or lava.
|
||||
|
||||
There is also an option to add this property to wood and tree blocks to allow them to be used this way directly.
|
@ -1,5 +0,0 @@
|
||||
## Pontoons
|
||||
|
||||
This mod adds some simple building blocks that can be placed on top of liquid, making it easier to construct things on a body of water without needing to first build a piling from the ground underneath.
|
||||
|
||||
It also allows wood and tree blocks to have this property added to them.
|
@ -1,4 +0,0 @@
|
||||
default?
|
||||
moretrees?
|
||||
intllib?
|
||||
doc?
|
@ -1 +0,0 @@
|
||||
A "floating" block that can be placed at the surface of a body of water without needing to build pilings first.
|
87
init.lua
87
init.lua
@ -1,16 +1,23 @@
|
||||
-- internationalization boilerplate
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
local S = minetest.get_translator("pontoons")
|
||||
|
||||
local pontoons_override_logs = minetest.setting_getbool("pontoons_override_logs")
|
||||
if pontoons_override_logs == nil then pontoons_override_logs = true end -- default true
|
||||
-- MCL2 compatibility
|
||||
local moditems = {}
|
||||
|
||||
local pontoons_override_wood = minetest.setting_getbool("pontoons_override_wood")
|
||||
if pontoons_override_wood == nil then pontoons_override_wood = true end -- default true
|
||||
if core.get_modpath("mcl_core") and mcl_core then -- means MineClone 2 is loaded, this is its core mod
|
||||
moditems.IRON_ITEM = "mcl_core:iron_ingot" -- MCL iron
|
||||
else -- fallback, assume default (MineTest Game) is loaded, otherwise it will error anyway here.
|
||||
moditems.IRON_ITEM = "default:steel_ingot" -- MCL iron
|
||||
end
|
||||
|
||||
local pontoons_wood_pontoons = minetest.setting_getbool("pontoons_wood_pontoons") -- default false
|
||||
|
||||
local pontoons_steel_pontoons = minetest.setting_getbool("pontoons_steel_pontoons")
|
||||
local pontoons_override_logs = minetest.settings:get_bool("pontoons_override_logs") -- default false
|
||||
|
||||
local pontoons_override_wood = minetest.settings:get_bool("pontoons_override_wood") -- default false
|
||||
|
||||
local pontoons_wood_pontoons = minetest.settings:get_bool("pontoons_wood_pontoons")
|
||||
if pontoons_wood_pontoons == nil then pontoons_wood_pontoons = true end -- default true
|
||||
|
||||
local pontoons_steel_pontoons = minetest.settings:get_bool("pontoons_steel_pontoons")
|
||||
if pontoons_steel_pontoons == nil then pontoons_steel_pontoons = true end -- default true
|
||||
|
||||
local default_modpath = minetest.get_modpath("default")
|
||||
@ -32,7 +39,11 @@ if pontoons_wood_pontoons then
|
||||
local default_sound
|
||||
local wood_burn_time
|
||||
if default_modpath then
|
||||
default_sound = default.node_sound_wood_defaults()
|
||||
if mcl_sounds then
|
||||
default_sound = mcl_sounds.node_sound_wood_defaults()
|
||||
else
|
||||
default_sound = default.node_sound_wood_defaults()
|
||||
end
|
||||
wood_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("group:wood")}}).time
|
||||
end
|
||||
if not wood_burn_time then wood_burn_time = 7 end
|
||||
@ -48,7 +59,19 @@ if pontoons_wood_pontoons then
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
|
||||
sounds = default_sound,
|
||||
})
|
||||
|
||||
|
||||
-- modify recipe, if "airtank" mod is loaded as it has similar recipe and conflicts with pontoons.
|
||||
|
||||
if core.get_modpath("airtanks") and airtanks then
|
||||
minetest.register_craft({
|
||||
output = 'pontoons:wood_pontoon 4',
|
||||
recipe = {
|
||||
{"group:wood","group:wood","group:wood"},
|
||||
{"","",""},
|
||||
{"","","group:wood"},
|
||||
}
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = 'pontoons:wood_pontoon 4',
|
||||
recipe = {
|
||||
@ -57,7 +80,8 @@ if pontoons_wood_pontoons then
|
||||
{"","group:wood",""},
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "pontoons:wood_pontoon",
|
||||
@ -69,10 +93,14 @@ end
|
||||
if pontoons_steel_pontoons then
|
||||
local default_sound
|
||||
if default_modpath then
|
||||
if default.node_sound_metal_defaults ~= nil then
|
||||
default_sound = default.node_sound_metal_defaults()
|
||||
if mcl_sounds then
|
||||
default_sound = mcl_sounds.node_sound_metal_defaults()
|
||||
else
|
||||
default_sound = default.node_sound_wood_defaults()
|
||||
if default.node_sound_metal_defaults then
|
||||
default_sound = default.node_sound_metal_defaults()
|
||||
else
|
||||
default_sound = default.node_sound_wood_defaults()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -88,13 +116,24 @@ if pontoons_steel_pontoons then
|
||||
})
|
||||
|
||||
if default_modpath then
|
||||
minetest.register_craft({
|
||||
output = 'pontoons:steel_pontoon',
|
||||
recipe = {
|
||||
{"","default:steel_ingot",""},
|
||||
{"default:steel_ingot","","default:steel_ingot"},
|
||||
{"","default:steel_ingot",""},
|
||||
}
|
||||
})
|
||||
if core.get_modpath("airtanks") and airtanks then
|
||||
minetest.register_craft({
|
||||
output = 'pontoons:steel_pontoon',
|
||||
recipe = {
|
||||
{"",moditems.IRON_ITEM,""},
|
||||
{moditems.IRON_ITEM,"",moditems.IRON_ITEM},
|
||||
{"","",moditems.IRON_ITEM},
|
||||
}
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = 'pontoons:steel_pontoon',
|
||||
recipe = {
|
||||
{"",moditems.IRON_ITEM,""},
|
||||
{moditems.IRON_ITEM,"",moditems.IRON_ITEM},
|
||||
{"",moditems.IRON_ITEM,""},
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
45
intllib.lua
45
intllib.lua
@ -1,45 +0,0 @@
|
||||
|
||||
-- Fallback functions for when `intllib` is not installed.
|
||||
-- Code released under Unlicense <http://unlicense.org>.
|
||||
|
||||
-- Get the latest version of this file at:
|
||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||
|
||||
local function format(str, ...)
|
||||
local args = { ... }
|
||||
local function repl(escape, open, num, close)
|
||||
if escape == "" then
|
||||
local replacement = tostring(args[tonumber(num)])
|
||||
if open == "" then
|
||||
replacement = replacement..close
|
||||
end
|
||||
return replacement
|
||||
else
|
||||
return "@"..open..num..close
|
||||
end
|
||||
end
|
||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||
end
|
||||
|
||||
local gettext, ngettext
|
||||
if minetest.get_modpath("intllib") then
|
||||
if intllib.make_gettext_pair then
|
||||
-- New method using gettext.
|
||||
gettext, ngettext = intllib.make_gettext_pair()
|
||||
else
|
||||
-- Old method using text files.
|
||||
gettext = intllib.Getter()
|
||||
end
|
||||
end
|
||||
|
||||
-- Fill in missing functions.
|
||||
|
||||
gettext = gettext or function(msgid, ...)
|
||||
return format(msgid, ...)
|
||||
end
|
||||
|
||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||
return format(n==1 and msgid or msgid_plural, ...)
|
||||
end
|
||||
|
||||
return gettext, ngettext
|
11
locale/pontoons.fr.tr
Normal file
11
locale/pontoons.fr.tr
Normal file
@ -0,0 +1,11 @@
|
||||
# textdomain: pontoons
|
||||
|
||||
# French translation
|
||||
# Copyright (C) 2020, Louis Royer
|
||||
# This file is distributed under the same license as the pontoons package.
|
||||
# Louis Royer <55180044+louisroyer@users.noreply.github.com>, 2020
|
||||
#
|
||||
Wood Pontoon=Ponton en bois
|
||||
A hollow wooden block designed to be built on the surface of liquids.=Un bloc de bois creux conçu pour être construit à la surface des liquides.
|
||||
Steel Pontoon=Ponton en acier
|
||||
A hollow steel block designed to be built on the surface of liquids. Magma-safe.=Un bloc d’acier creux conçu pour être construit à la surface des liquides. Résiste au magma.
|
@ -1,35 +0,0 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-02-12 12:54-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: init.lua:57
|
||||
msgid "Wood Pontoon"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua:58
|
||||
msgid "A hollow wooden block designed to be built on the surface of liquids."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua:96
|
||||
msgid "Steel Pontoon"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua:97
|
||||
msgid ""
|
||||
"A hollow steel block designed to be built on the surface of liquids. Magma-"
|
||||
"safe."
|
||||
msgstr ""
|
11
locale/template.txt
Normal file
11
locale/template.txt
Normal file
@ -0,0 +1,11 @@
|
||||
# textdomain: pontoons
|
||||
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
Wood Pontoon=
|
||||
A hollow wooden block designed to be built on the surface of liquids.=
|
||||
Steel Pontoon=
|
||||
A hollow steel block designed to be built on the surface of liquids. Magma-safe.=
|
4
mod.conf
4
mod.conf
@ -1 +1,3 @@
|
||||
name = pontoons
|
||||
name = pontoons
|
||||
description = A "floating" block that can be placed at the surface of a body of water without needing to build pilings first.
|
||||
optional_depends = default, mcl_core, mcl_sounds, airtanks, moretrees, doc
|
||||
|
@ -1,18 +1,17 @@
|
||||
#When enabled, all logs can now be built "floating" in liquids. Note that
|
||||
#a log placed in lava will not last for long.
|
||||
pontoons_override_logs (Logs float) bool true
|
||||
pontoons_override_logs (Logs float) bool false
|
||||
|
||||
#When enabled, all wood blocks can now be built "floating" in liquids.
|
||||
#Note that wood blocks placed in lava will not last for long.
|
||||
pontoons_override_wood (Wood floats) bool true
|
||||
pontoons_override_wood (Wood floats) bool false
|
||||
|
||||
#Adds craftable wooden pontoon blocks that can be built on the
|
||||
#surface of liquids. This is only really useful if wood floating
|
||||
#is not enabled, so this feature is disabled by default.
|
||||
pontoons_wood_pontoons (Wooden pontoons) bool false
|
||||
#is not enabled.
|
||||
pontoons_wood_pontoons (Wooden pontoons) bool true
|
||||
|
||||
#Adds craftable steel pontoon blocks that can be built on the
|
||||
#surface of liquids. These are are lava-resistant, and so are
|
||||
#useful even when logs and wood are able to be built on liquid
|
||||
#so they're enabled by default.
|
||||
#useful even when logs and wood are able to be built on liquids.
|
||||
pontoons_steel_pontoons (Steel pontoons) bool true
|
Loading…
x
Reference in New Issue
Block a user