Initial commit

This commit is contained in:
FaceDeer 2017-02-12 13:01:46 -07:00
commit e704ea27b1
14 changed files with 301 additions and 0 deletions

17
.gitattributes vendored Normal file
View File

@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

47
.gitignore vendored Normal file
View File

@ -0,0 +1,47 @@
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

15
LICENSE.txt Normal file
View File

@ -0,0 +1,15 @@
Copyright (C) 2017 FaceDeer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

1
README.txt Normal file
View File

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

4
depends.txt Normal file
View File

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

1
description.txt Normal file
View File

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

116
init.lua Normal file
View File

@ -0,0 +1,116 @@
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local pontoons_override_logs = minetest.setting_getbool("pontoons_override_logs")
if pontoons_override_logs == nil then pontoons_override_logs = true end -- default true
local pontoons_override_wood = minetest.setting_getbool("pontoons_override_wood")
if pontoons_override_wood == nil then pontoons_override_wood = true end -- default true
local pontoons_wood_pontoons = minetest.setting_getbool("pontoons_wood_pontoons") -- default false
local pontoons_steel_pontoons = minetest.setting_getbool("pontoons_steel_pontoons")
if pontoons_steel_pontoons == nil then pontoons_steel_pontoons = true end -- default true
local default_modpath = minetest.get_modpath("default")
if pontoons_override_logs or pontoons_override_wood then
local def_overrides = {}
-- must override a registered node definition with a brand new one,
-- can't just twiddle with the parameters of the existing table for some reason
local override_def = function (node_name, old_def)
local new_def = {}
for param, value in pairs(old_def) do
new_def[param] = value
end
new_def.liquids_pointable = true
def_overrides[node_name] = new_def
end
for node_name, node_def in pairs(minetest.registered_nodes) do
if pontoons_override_logs and minetest.get_item_group(node_name, "tree") > 0 then
override_def(node_name, node_def)
end
if pontoons_override_wood and minetest.get_item_group(node_name, "wood") > 0 then
override_def(node_name, node_def)
end
end
for node_name, new_def in pairs(def_overrides) do
minetest.debug("overriding", node_name)
minetest.register_node(":" .. node_name, new_def)
end
end
if pontoons_wood_pontoons then
local default_sound
local wood_burn_time
if default_modpath then
default_sound = default.node_sound_wood_defaults()
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
minetest.register_node("pontoons:wood_pontoon", {
description = S("Wood Pontoon"),
_doc_items_longdesc = S("A hollow wooden block designed to be built on the surface of liquids."),
tiles = {"pontoon_wood.png"},
paramtype2 = "facedir",
place_param2 = 0,
is_ground_content = false,
liquids_pointable = true,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
sounds = default_sound,
})
minetest.register_craft({
output = 'pontoons:wood_pontoon 4',
recipe = {
{"","group:wood",""},
{"group:wood","","group:wood"},
{"","group:wood",""},
}
})
minetest.register_craft({
type = "fuel",
recipe = "pontoons:wood_pontoon",
burntime = wood_burn_time,
})
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()
else
default_sound = default.node_sound_wood_defaults()
end
end
minetest.register_node("pontoons:steel_pontoon", {
description = S("Steel Pontoon"),
_doc_items_longdesc = S("A hollow steel block designed to be built on the surface of liquids. Magma-safe."),
is_ground_content = false,
tiles = {"pontoon_steel.png"},
liquids_pointable = true,
is_ground_content = false,
groups = {cracky = 1, level = 2},
sounds = default_sound,
})
if default_modpath then
minetest.register_craft({
output = 'pontoons:steel_pontoon',
recipe = {
{"","default:steel_ingot",""},
{"default:steel_ingot","","default:steel_ingot"},
{"","default:steel_ingot",""},
}
})
end
end

45
intllib.lua Normal file
View File

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

35
locale/template.pot Normal file
View File

@ -0,0 +1,35 @@
# 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 ""

1
mod.conf Normal file
View File

@ -0,0 +1 @@
name = pontoons

18
settingtypes.txt Normal file
View File

@ -0,0 +1,18 @@
#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
#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
#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
#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.
pontoons_steel_pontoons (Steel pontoons) bool true

1
textures/license.txt Normal file
View File

@ -0,0 +1 @@
Steel block and aspen wood base textures are Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) from the default Minetest subgame

BIN
textures/pontoon_steel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

BIN
textures/pontoon_wood.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B