Compare commits

...

10 Commits

Author SHA1 Message Date
FaceDeer
a9fbd4028f
Merge pull request #6 from louisroyer/french-translation
Add french translation
2020-02-26 21:46:28 -07:00
Louis
42456051e5 Add french translation
Change translation system to use minetest builtin’s translation api,
which allow client side translation.
2020-02-12 21:01:35 +01:00
FaceDeer
469ee9c208
Merge pull request #5 from minertestdude/master
add compatibility to Mineclone2
2018-10-20 18:04:11 -06:00
minertestdude
caf121201d
fix variable visibility issue 2018-10-11 16:57:56 +02:00
minertestdude
a20eba23d0
Add support for MCL2, fix incompatibilitat with Airtanks 2018-10-09 23:51:19 +02:00
FaceDeer
11cf9a1515 update descs 2018-05-29 21:31:28 -06:00
FaceDeer
9319e0bdbc swap defaults 2018-05-29 21:12:33 -06:00
FaceDeer
b126d32b51 update readme 2018-05-26 23:27:24 -06:00
FaceDeer
53873f44bb Merge pull request #3 from tacotexmex/patch-1
Replace deprecated settings method
2017-06-18 14:18:33 -06:00
texmex
2d762d9328 Replace deprecated settings method 2017-06-18 21:03:54 +02:00
11 changed files with 100 additions and 121 deletions

7
README.md Normal file
View 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.

View File

@ -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.

View File

@ -1,4 +0,0 @@
default?
moretrees?
intllib?
doc?

View File

@ -1 +0,0 @@
A "floating" block that can be placed at the surface of a body of water without needing to build pilings first.

View File

@ -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
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
@ -49,6 +60,18 @@ if pontoons_wood_pontoons then
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,6 +80,7 @@ if pontoons_wood_pontoons then
{"","group:wood",""},
}
})
end
minetest.register_craft({
type = "fuel",
@ -69,12 +93,16 @@ end
if pontoons_steel_pontoons then
local default_sound
if default_modpath then
if default.node_sound_metal_defaults ~= nil then
if mcl_sounds then
default_sound = mcl_sounds.node_sound_metal_defaults()
else
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
minetest.register_node("pontoons:steel_pontoon", {
description = S("Steel Pontoon"),
@ -88,13 +116,24 @@ if pontoons_steel_pontoons then
})
if default_modpath then
if core.get_modpath("airtanks") and airtanks then
minetest.register_craft({
output = 'pontoons:steel_pontoon',
recipe = {
{"","default:steel_ingot",""},
{"default:steel_ingot","","default:steel_ingot"},
{"","default:steel_ingot",""},
{"",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

View File

@ -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
View 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 dacier creux conçu pour être construit à la surface des liquides. Résiste au magma.

View File

@ -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
View 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.=

View File

@ -1 +1,3 @@
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

View File

@ -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