Skip to content

Commit

Permalink
Apply changes by Clickety
Browse files Browse the repository at this point in the history
  • Loading branch information
Hume2 committed May 1, 2023
1 parent 50b0d4e commit 0203ec9
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 16 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Wooden Bucket mod [bucket_wooden]

This mod is simple. It adds a bucket made of wood. Wooden buckets can hold only water or river water, not lava. This bucket lets you start farming before you find any iron.

If you use the mods Ethereal NG [ethereal] and/or Farming Redo [farming], their bowl recipes are changed so as not to conflict with the bucket recipe: 3 wood blocks -> bucket -> 4 bowls.

https://forum.minetest.net/viewtopic.php?f=11&t=22133

Changelog:

- 1.0 - Initial release. Wooden bucket of water is not in the group:water_bucket, to prevent getting an empty iron bucket when using a wooden bucket of water in recipes. farming:bowl and ethereal:bowl are crafted from wooden buckets.
- 1.0.1 - Mod renamed to bucket\_wooden because the name "wooden_bucket" is already taken by viewtopic.php?t=16472
- 1.0.2 - Refined conditions for bowl recipe. Added "Wooden" to bucket names, and intllib support.
4 changes: 0 additions & 4 deletions depends.txt

This file was deleted.

1 change: 1 addition & 0 deletions description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wooden buckets (for water, not lava)
67 changes: 55 additions & 12 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
-- Minetest 0.4 mod: bucket
-- See README.txt for licensing and other information.

minetest.register_craft({
output = 'bucket_wooden:bucket_empty 1',
recipe = {
{'group:wood', '', 'group:wood'},
{'', 'group:wood', ''},
}
})

if minetest.registered_items["farming:bowl"] then
-- New recipes added for the right bowl.
local eth = minetest.get_modpath("ethereal")
local farm = minetest.get_modpath("farming") and farming and farming.mod -- as in mobs_animal, cow.lua

-- ethereal uses recipe for farming:bowl if registered, see extra.lua.
if farm and minetest.registered_items["farming:bowl"] then

minetest.clear_craft({ output = "farming:bowl" })

minetest.register_craft({
output = 'farming:bowl 4',
recipe = {'bucket_wooden:bucket_empty'},
type = 'shapeless',
})
end

if minetest.registered_items["ethereal:bowl"] then
elseif eth and minetest.registered_items["ethereal:bowl"] then

minetest.clear_craft({ output = "ethereal:bowl" })

minetest.register_craft({
output = 'ethereal:bowl 4',
recipe = {'bucket_wooden:bucket_empty'},
type = 'shapeless',
})
end
-- End change

minetest.register_craft({
output = 'bucket_wooden:bucket_empty 1',
recipe = {
{'group:wood', '', 'group:wood'},
{'', 'group:wood', ''},
}
})

minetest.register_craft({
type = "fuel",
Expand All @@ -33,6 +45,37 @@ minetest.register_craft({


bucket_wooden = {}

-- intllib
--------------------------------------------------------------------------------
-- Copied from TenPlus1 mod mobs:
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"

-- Check for translation method.
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("bucket_wooden") -- 5.x translation function
else
if minetest.get_modpath("intllib") then
dofile(minetest.get_modpath("intllib") .. "/init.lua")
if intllib.make_gettext_pair then
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
else
gettext = intllib.Getter() -- old text file method
end
S = gettext
else -- boilerplate function
S = function(str, ...)
local args = {...}
return str:gsub("@%d+", function(match)
return args[tonumber(match:sub(2))]
end)
end
end
end
--------------------------------------------------------------------------------
bucket_wooden.intllib = S
--End change
bucket_wooden.liquids = {}

local function check_protection(pos, name, text)
Expand Down Expand Up @@ -204,7 +247,7 @@ bucket_wooden.register_liquid(
"default:water_flowing",
"bucket_wooden:bucket_water",
"bucket_wooden_water.png",
"Water Bucket",
"Wooden Water Bucket", -- Change: added Wooden
{water_bucket_wooden = 1}
)

Expand All @@ -219,7 +262,7 @@ bucket_wooden.register_liquid(
"default:river_water_flowing",
"bucket_wooden:bucket_river_water",
"bucket_wooden_river_water.png",
"River Water Bucket",
"Wooden River Water Bucket", -- Change: added Wooden
{water_bucket_wooden = 1},
true
)
Expand Down
4 changes: 4 additions & 0 deletions locale/template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# textdomain: bucket_wooden
Empty Wooden Bucket=
Wooden Water Bucket=
Wooden River Water Bucket=
4 changes: 4 additions & 0 deletions mod.conf
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
name = bucket_wooden
depends = default
optional_depends = intllib, ethereal, farming
description = Wooden buckets (for water, not lava)

0 comments on commit 0203ec9

Please sign in to comment.