XFactHD / FramedBlocks

Fancy building blocks
GNU Lesser General Public License v3.0
69 stars 26 forks source link

[Feature]: Tool that stops block placement and only allows placing into framed block. #531

Open Ianthasys opened 3 days ago

Ianthasys commented 3 days ago

Describe the feature

So I'm going to try to describe this in a way that isn't too abstract, as it's a weird issue to explain verbally.

When using framed blocks in conjunction with mods like Building Gadgets, copying and then pasting a build that uses many framed blocks has the unfortunate side effect of not copying the data of the framed block itself. Now, I'm not sure if this is due to Building Gadgets limiting the amount of data that it pulls from blocks to place things, or if it's a limitation within framed blocks. Either way, this results in needing to fill dozens of framed blocks to hundreds or thousands of them each time that build is copied, which even still is much less than manually rebuilding the whole thing a second, third, or fourth, etc. time, and Most builders like myself I'd imagine are fine with placing the blocks manually if it means not having to redo everything every time. The one main struggle that comes with this, is the fact that while filling all of the framed blocks, unless the player is blocking the space adjacent to the framed block, (or another block,) it's fairly common to fill the framed block and accidentally place another block in world. Obviously this is more of an annoyance than anything, but doing this a few hundred times or more when filling a thousand or more framed blocks adds up.

Now, this proposed tool idea would be something to mitigate this annoyance by only allowing the player to filter the framed block under the cursor as if they were placing a block, without giving the player the ability to actually place the block in world. I've thought of a few possible implementations of this, which could have their own downsides/drawbacks that I may or may have not considered, and I'll list them here.

  1. The first implementation would be that the tool in question would simply use the block in the opposite hand, while removing the player's ability to place that block in the world, and if the player is looking at a part of a framed block, will set the filter in that slot, removing one of the block from the player's inventory as normal.
  2. The second implementation would be a similar tool, except in this case while holding an item in the opposite hand, a player could shift right click the tool in the air to set that block to the tool's filter, and then when using the tool on any framed block, would then pull the filtered block from the inventory as if the player was holding the block to filter the framed block, but without the ability to place any blocks in world. The player would then be able to hold the tool without any blocks in either hand, and the above issue would be mitigated. The tool would also be able to have its filter reset by either shift clicking on air with nothing in the offhand, or set to another block the same way as mentioned earlier in this example.

Either way, as mentioned above this is largely a solution to something that is mostly an inconvenience at most, but adds up to time that could be spent otherwise while doing large scale builds that involve large numbers of framed blocks that were placed by a means that doesn't keep the metadata. As such if this would be too much energy spent on something better spent elsewhere, by all means. Honestly, if I knew and understood Java, the minecraft codebase, and modding in general, I'd throw it together myself. (maybe something to work on in the future)

TL;DR: filling lots of framed blocks is time consuming and a pain in the ass, why do I have to accidentally place blocks in world that I then need to break before moving on over and over again while doing so....

XFactHD commented 2 days ago

The issue of Building Gadgets 2 not providing a way for me to tell it to consume additional resources and apply additional data to the placed block has been a pain for quite a while. Building Gadgets 1 had facilities for that. Once BG2 gets the necessary API, I will make sure that copying framed blocks with it includes data again. Create's Schematicannon had a similar issue but Create 0.5.1i added support for FramedBlocks.

With that being said, I can certainly see the use in a dedicated tool for mass applying camos to framed blocks that are already placed. The first variant you suggested is not possible due to how interactions are handled by the game. The second option (which would presumably consume the block it's filtered for from the player's inventory) would work but would be a bit annoying to implement (specifying the filter in a UI instead of via right-clicking with the camo in the off-hand would be a bit easier). One solution that would definitely work and be pretty straightforward to implement is to add a "brush" tool with an inventory (could be opened by shift-right clicking the item in the air) where you place the camo to be used. This of course would need to be refilled more often than the player inventory. I will look into the slightly adapted version of the second suggestion and the version with a builtin inventory. I can't guarantee that this will make it into 1.20.1 though in case this is relevant to you.