[Mod]Sponge[sponge]

Post Reply
User avatar
FiftySix
Member
Posts: 14
Joined: Sun Jan 14, 2018 10:58
GitHub: BenjieFiftysix
In-game: fiftysix or benjie
Location: Scotland

[Mod]Sponge[sponge]

by FiftySix » Post

Sponges, based off of minecr*fts sponges, that remove water in an area around them.

They can be used to remove large amounts of water in survival, where worldedit would not be an option

Soggy sponges are quite rare, found deep in the sea, where it is dark (below -11).
These can be cooked into dry sponges, and then placed near a liquid to remove an area of it.
They will hold the water away until they are removed.
They turn in to soggy sponges when used, so to use them again, they have to be cooked.

How it works:
- sponges create a 9x9 area of air-like nodes that water can't flow through (checks for protection)
- if sponges have cleared more than 3 nodes of liquid, they become soggy sponges
- removing a sponge or soggy sponge will turn air-like nodes in the 9x9 area back into air.
(Air-like nodes can be removed in protection by removing a sponge outside the protection. they are not meant to be permanent)


Dependencies: default

Licence (code and textures): MIT License

Download
Github

Image
Attachments
sponge screenshot.png
sponge in action
(722.13 KiB) Not downloaded yet
Last edited by FiftySix on Thu Aug 30, 2018 14:47, edited 1 time in total.
Frustrated with formspec strings? Check my formspec editor!

User avatar
Edgy1
Member
Posts: 157
Joined: Thu Nov 24, 2016 16:29
GitHub: JamesTobin
In-game: Trump

Re: [Mod]Sponge[sponge]

by Edgy1 » Post

you should add a screenshot.

--Edgy1

User avatar
Hume2
Member
Posts: 557
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [Mod]Sponge[sponge]

by Hume2 » Post

Nice and simple mod! +1

I found a tiny bug: When I'm in creative and place sponge, the sponge vanishes from my hand. Use something like this:

Code: Select all

if not (creative and creative.is_enabled_for and creative.is_enabled_for(player_name)) then
	itemstack:take_item()
end
EDIT: Also when right-click a chest with a sponge in hand, the sponge is placed. Use code like this:

Code: Select all

local under = pointed_thing.under
local node = minetest.get_node(under)
local udef = minetest.registered_nodes[node.name]
if udef and udef.on_rightclick and not (placer and placer:is_player() and placer:get_player_control().sneak) then
	return udef.on_rightclick(under, node, placer, itemstack, pointed_thing) or itemstack
end
If you lack the reality, go on a trip or find a job.

User avatar
FiftySix
Member
Posts: 14
Joined: Sun Jan 14, 2018 10:58
GitHub: BenjieFiftysix
In-game: fiftysix or benjie
Location: Scotland

Re: [Mod]Sponge[sponge]

by FiftySix » Post

Ok, thanks.

All problems with placing should now be fixed.
Frustrated with formspec strings? Check my formspec editor!

User avatar
DancingWombat
Member
Posts: 14
Joined: Tue Nov 14, 2017 12:53

Re: [Mod]Sponge[sponge]

by DancingWombat » Post

Cool, this will save time clearing out underwater rooms.

Post Reply

Who is online

Users browsing this forum: runs and 5 guests