[Mod] exchange/replace nodes with one click [replacer]

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

[Mod] exchange/replace nodes with one click [replacer]

by Sokomine » Sun Feb 03, 2013 22:40

Update 09.12.2017: Added a configurable blacklist for blocks that shall never be either replaced or placed by the replacer tool. Fixed bug regarding protection.

Short summary of functionality:
* wield the replacer
* shift + right-click in order to store block type, orientation and color of the block you are pointing at
* right-click to place a block like the stored one from your inventory with the stored rotation and color
* left-click to replace the block you clicked at with the stored one; the replaced one will go into your inventory
* left-click with inspector on blocks and entities to learn more about them (i.e. craft receipe)

Particulary useful when:
* stairs, slabs, slopes and/or other blocks from moreblocks are used
* you are unsure which material will look best and can't/don't want to use WorldEdit
* building roads
* creating pixelart

Not needed when:
* other types of games are used where nobody is supposed to build anything (not even your moderators; no worldbuilders present)
* absolute minimalism - only solid blocks, WorldEdit privs for all, no small/detailed buildings
* the server was started by accident; you want to get rid of builders and hope they'll leave if you force them to struggle more with game control than needed
* you love simple cobble boxes without roof or decoration more than anything else

Blacklist functionality:
If you operate a server and want to prevent players from either placing or replacing certain blocks, you can create a custom server mod, let it soft-depend on the replacer mod and i.e call
Code: Select all
replacer.blacklist[ "protector:protect2"] = true;

This will add the small protector to the blacklist. The replacer.blacklist table is public and can be accessed from other mods. Note: TNT, gunpowder and the above protector(s) are already blacklisted.

Long explanation (images have been lost):
Texture and rotation of a node are set at the same time. This allows easier handling of stairsplus-nodes: Just rotate one in the right direction, sneak-rightclick on that correctly rotated node, and either left-click to replace old nodes or right-click to place further nodes with exactly the same rotation.

The mod uses minetest.is_protected provided that the server version is recent enough. That's only relevant for multiplayer servers.

This mod allows you to create more intresting buildings by building the walls first and placing decorative nodes into those walls afterwards (e.g. windows). It replaces every node you left-click on with the node-type you last sneak-right-clicked on (all while wielding the replacement tool). You don't have to dig the old node first and place a new one afterwards. This is most useful for creative building. If you are in survival mode, you have to have enough of the selected replacement nodes in your inventory. For each left-click, the old/replaced node will be added to your inventory and the new one substracted from your inventory. For each normal right click, the stored block type will be placed with the stored
orientation/rotation.

Craft one chest in the upper left corner, another chest in the lower right corner, and a stick in the middle:
Image

Sample usage: Making a roof and decorating a hut
First, let's start with a very simple hut. The brick shall later be turned into a real roof.
Image
Now, let's craft some stone stairs and place them the way we want the roof to be orientated:
Image
Sneak-rightclick on the stone-stairs. Afterwards, left-click on the brick we want to replace:
Image
Repeat the same for the other side. We need to place a new stair here because it's orientation is diffrent:
Image
Finish the roof by left-clicking on the brick nodes on that side:
Image
Now we want to add some glass. Place one on the floor, sneak-rightclick, and then left-click on some wood. See how 8 glass where consumed and 8 wooden planks returned:
Image
Now we want to change the wood into brick. After crafting the bricks back into brick nodes, placing one, sneak-rightclicking and left-clicking once on each wood node, we get the desired result:
Image

The hut may not be very impressive, but the tool is definitely useful. One advantage is that you can build roofs without having to care much about your current view direction. The second is that you can place decorative nodes (and especially windows) very easily into a wall and thus add details to your building. Replacing nodes can of course be done with worldedit as well - provided you have got the privs.

The mod also includes a second tool, which looks like a question mark and provides information about things you may find in your Minetest world. That tool comes bundled with the replacer as both are small but useful. The texture for the new tool has been done by VanessaE.

Sometimes you want to know the name and/or rotation of a particular node. The "//inspect" command from WorldEdit does that, but you can also use this new inspect tool. It provides information about protection as well:
Image
You can get information about unknown nodes and find out what they used to be:
Image
Works for mobs as well (also for unknown ones):
Image
There's a mini-craft-guide included which will show the receipes of blocks upon right-click or - in case of dropped blocks/tools/items lying somewhere - sneak (usually shift)+leftclick. The individual indigrents can be clicked at and their receipes will be shown as well. If there is more than one receipe for something, you can click through all alternate receipes with prev/next buttons. The inspection tool can be crafted like this:
Image
The most common groups are supported, but it is not as extensive as i.e. inventory_plus:
Image
Receipes which require special machines show which machine they require. In the case of the circular saw, there is currently some guessing involved:
ImageImage
ImageImage


Version: Please download from GitHub. The attachments are out of date.
3.1 Fixed bug regarding protection. Added blacklist for blocks.
3.0 Added inspect tool with mini-craftguide.
2.1 Bugfix for survival mode
2.0 Facedir/rotation of nodes is stored and transfered as well.
Download: https://github.com/Sokomine/replacer/zipball/master
Browse code: https://github.com/Sokomine/replacer

Depends on: nothing; works in non-creative mode just as well
License: GPLv3
Attachments
replacer_3.0.zip
02.10.14 Includes replacer + inspect tool
(9.84 KiB) Downloaded 209 times
replacer_2.1.zip
old version; deprecated
(5.5 KiB) Downloaded 79 times
Last edited by Sokomine on Sat Dec 09, 2017 20:37, edited 8 times in total.
A list of my mods can be found here.
 

User avatar
Topywo
Member
 
Posts: 1720
Joined: Fri May 18, 2012 20:27

by Topywo » Sun Feb 03, 2013 23:04

Nice :-)

Tested it, it works, also the crafting. I could use this on redcrab's server.
 

Test&Mine
New member
 
Posts: 8
Joined: Sun Feb 03, 2013 12:47

by Test&Mine » Sun Feb 03, 2013 23:04

Nice but can I make a model for it? maybe something goes great for it.

Ok I am done with the Texture Idea.
Last edited by Test&Mine on Sun Feb 03, 2013 23:06, edited 1 time in total.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Mon Feb 04, 2013 00:33

Post your texture idea here or send it to me. I'd be glad if someone could do a texture and maybe a model.
A list of my mods can be found here.
 

Test&Mine
New member
 
Posts: 8
Joined: Sun Feb 03, 2013 12:47

by Test&Mine » Mon Feb 04, 2013 01:49

Well I don't know how to upload a model to a .x Format... so I am doing a texture model way.

http://ompldr.org/vaGNkdg/REPLACE!.zip

Made by likwid he, who made the whole thing, All I did, was change the color of it. plus he added you need a bucket of lava, plus he added a in file texture file, and he making more models he told me though pm.
 

User avatar
Likwid H-Craft
Member
 
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Mon Feb 04, 2013 14:20

Thank you Test&Mine now, back making more Models!! Or I say Model Texture!
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Tue Apr 23, 2013 23:46

Version 2.0 is out. This one saves param1 and param2 (and thus rotation) as well. It is intended for easier handling of stairsplus-nodes (similar but slightly diffrent from the chainsaw).

After you have rotated one node to the desired orientation with the screwdriver that is now part of the default game, hold sneak and right-click with the replacer on that node (sneak+right-click is the same as changing the mode of the screwdriver; here, it stores a new pattern in the replacer). After that, either left-click on an already placed block to turn it into the stored one with the stored blocks orientation (that's the replacement function of the replacer), or right-click to place a node of the stored type with the stored orientation (that's as if you where wielding the stored block; only that orientation will be the stored one). This way, building a roof can get a lot easier!

The crafting receipe has been changed to better reflect what this mod does.
A list of my mods can be found here.
 

User avatar
Inocudom
Member
 
Posts: 3018
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sat Jun 15, 2013 20:50

For the sake of adding some spice to this mod, you could make a sound effect for blocks being switched and a sound effect for blocks being placed.
Recovering from the abomination I am. Clocking time for Garry's Mod I am too.
 

User avatar
Jordach
Member
 
Posts: 4518
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Wed Jul 03, 2013 20:35

Nice, how did this gem go missing?
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 

User avatar
Jordach
Member
 
Posts: 4518
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Thu Jul 04, 2013 15:18

Hybrid Dog wrote:
Jordach wrote:Nice, how did this gem go missing?
I guess:
the usual way here
There are so many awesome mods, just not enough people give a damn on how useful it is.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 

User avatar
GloopMaster
Member
 
Posts: 213
Joined: Wed Aug 01, 2012 18:03
Location: http://minetest.net/forum/

by GloopMaster » Thu Jul 04, 2013 19:03

Wand of Equal Trade? Me smells a Wand of Equal Trade.
Meow.

That is all.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Wed Nov 20, 2013 21:20

I don't know what a "Wand of Equal Trade" is.

The mod has been updated and now uses minetest.is_protected if the server version is recent enough. Else it uses the old code from homedecor that supports the protector- and node_ownership mod in order to determine if the replacement is allowed.

If you run it in your singleplayer world, there's no need to update.

The mod is very useful for all servers that have players on them who want to build more complex buildings and are attracted by moreblocks/starisplus nodes - which usually require the correct placement (slabs, panels, stairs etc.).

Inocudom wrote:For the sake of adding some spice to this mod, you could make a sound effect for blocks being switched and a sound effect for blocks being placed.

I usually play with sound off or at least muted considerably, so I don't know much about sounds. As this tool is intended to be used for building, a sound that does not go on peoples nerves but instead just confirms that the action has succeeded would be fine. If you have such a sound at hand, I can integrate it as an option.
A list of my mods can be found here.
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Thu Nov 21, 2013 07:45

I believe a wand of equal trade is a equivalent exchange mod item that replaces large numbers of blocks at once iirc.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Sun Jan 12, 2014 19:44

HybridDog detected a bug related to usage of the replacer on a server that is not in creative mode (namely, replacing a chest with content and thus destroying it). That bug has been fixed now. Please update your version in order to avoid item loss! I've attached a new version for easy download as well.
A list of my mods can be found here.
 

User avatar
Krock
Developer
 
Posts: 4144
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

by Krock » Mon Feb 24, 2014 16:50

*bump*

This replacer has been removed from my server for following reasons:
- does not take damage on use
- can get abused as obsidian mining tool (click and replace with dirt)
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Wed Feb 26, 2014 04:50

Krock wrote:This replacer has been removed from my server for following reasons:
- does not take damage on use

It's a tool for building - not for digging. It's a shame that the screwdriver does take damage. Those tools are for building, to circumvent problems with handling nodes/placement. Like your mouse and keyboard are.

Krock wrote:- can get abused as obsidian mining tool (click and replace with dirt)

When I wrote the tool, I wondered shortly if any abuse might be possible and if so if it would be worth including any restrictions. The only possible abuse that came to my mind was "digging" ores by replacing them with easier-diggable material. That is of course possible. It could be circumvented by allowing use of the replacer only above ground - except that there are cellars and people building large cities underground. They didn't do anything wrong there and there's no reason to limit their building capabilities.

If players really abuse the replacer as a digging tool, insert some local log functions and talk to the players who do it. There's no real way to decide weather a node has been placed by mapgen or has been placed by the player who now legitimately prefers a diffrent material for his/her house - or just wants to build with stairsplus nodes without getting permanent damage to his/her real life hand.

As long as players do not exaggerate it, I see no gain in abusing the replacer. Normal mining usually gives you enough mese and diamonds for the tools you need. Constantly changing the tools wielded and waiting for the server would be far more annoying than crafting a new pick once in a while.
A list of my mods can be found here.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] exchange/replace nodes with one click (replacer)

by Sokomine » Thu Sep 11, 2014 02:46

Added the images that where lost and which show how the mod may be used.

In general, if you want to support builders on your server, please install this mod. It is very helpful especially for stairsplus/moreblocks nodes.
A list of my mods can be found here.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] exchange/replace nodes with one click [replacer]

by Sokomine » Thu Oct 02, 2014 16:20

Update
The mod now also includes a second tool, which looks like a question mark and provides information about things you may find in your Minetest world. That tool comes bundled with the replacer as both are small but useful. The texture for the new tool has been done by VanessaE.

Sometimes you want to know the name and/or rotation of a particular node. The "//inspect" command from WorldEdit does that, but you can also use this new inspect tool. It provides information about protection as well:
Image
You can get information about unknown nodes and find out what they used to be:
Image
Works for mobs as well (also for unknown ones):
Image
There's a mini-craft-guide included which will show the receipes of blocks upon right-click or - in case of dropped blocks/tools/items lying somewhere - sneak (usually shift)+leftclick. The individual indigrents can be clicked at and their receipes will be shown as well. If there is more than one receipe for something, you can click through all alternate receipes with prev/next buttons. The inspection tool can be crafted like this:
Image
The most common groups are supported, but it is not as extensive as i.e. inventory_plus:
Image
Receipes which require special machines show which machine they require. In the case of the circular saw, there is currently some guessing involved:
ImageImage
ImageImage
A list of my mods can be found here.
 

User avatar
Inocudom
Member
 
Posts: 3018
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] exchange/replace nodes with one click [replacer]

by Inocudom » Thu Oct 02, 2014 20:40

Very good work you did here, Sokomine.
Recovering from the abomination I am. Clocking time for Garry's Mod I am too.
 

User avatar
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: [Mod] exchange/replace nodes with one click [replacer]

by ExeterDad » Fri Oct 03, 2014 02:03

I've been building a bunch of streets and roads the last few days and I've been hating it. So I decide to use your mod to build them with. AMAZING! I was laying asphalt in flattened areas as fast as I could click and run. Grassy dirt into asphalt with a click. Love it. Striping is the same way. Just watch the grass or other plants at high speed. They turn into blocks too if clicked and will stop you in your tracks. :P
My vote for favorite mod of the evening.
Thanks for your efforts.
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] exchange/replace nodes with one click [replacer]

by dgm5555 » Mon Mar 02, 2015 22:16

This would be a brilliant tool to integrate with worldedit...
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] exchange/replace nodes with one click [replacer]

by Sokomine » Tue Mar 17, 2015 21:15

dgm5555 wrote:This would be a brilliant tool to integrate with worldedit...

It ought to be available to all players :-) Not only to those who have the WorldEdit priv.
A list of my mods can be found here.
 

User avatar
Krock
Developer
 
Posts: 4144
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] exchange/replace nodes with one click [replacer]

by Krock » Wed Mar 18, 2015 19:27

This tool is made to replace just one node at once.
If you really want to place many nodes, use the current WorldEdit with //copy
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] exchange/replace nodes with one click [replacer]

by Sokomine » Tue Jul 28, 2015 21:01

The inspection tool - which includes a mini-craft-guide - now works a bit diffrent. It shows its receipe when you left-click on a node or entity - right-click/shift-right-click is no longer required (but still supported). Instead of writing the information in the chat, position, protection state, node name, param2 and (new) light level are shown in the mini-craft-guide. This will hopefully make it easier for tablet-users to use the tool.

As the inspection tool is intended to help players with finding out node names and craft receipes, I've made the tool cheaper. It now costs only a torch plus a stick. That is hopefully something new players can afford.

The inspector tool can help if no craft guide is installed or if you want to find out information like param2, nodename etc.
A list of my mods can be found here.
 

User avatar
ExeterDad
Member
 
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
Location: New Hampshire U.S.A
In-game: ExeterDad

Re: [Mod] exchange/replace nodes with one click [replacer]

by ExeterDad » Wed Jul 29, 2015 04:39

One of my favorite mods. Looking forward to exploring your new features soon.
Thanks :)
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: DSRTTRTS and 2 guests