[Mod] More Blocks [moreblocks]

PePe
New member
Posts: 2
Joined: Fri Mar 27, 2020 15:57

Re: [Mod] More Blocks [moreblocks]

by PePe » Post

Calinou wrote:
jolotico wrote:Hello, I have a question, how can I make sure that the pieces of blocks do not fill the inventory pages of unified inventory?
Edit the server's minetest.conf file and add the following line at the end:

Code: Select all

moreblocks.stairsplus_in_creative_inventory = false
(...)
Is there a way to choose which parts of items is displayed in unified inventory?

Like i found those parts in the lua:

Code: Select all

stairsplus_microblocks_not_in_creative_inventory
stairsplus_slabs_not_in_creative_inventory
but a line in the config file like this seems not to work:

Code: Select all

moreblocks.stairsplus_microblocks_not_in_creative_inventory = true

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [Mod] More Blocks [moreblocks]

by Festus1965 » Post

if the parameter of config.file is not read inside the mod lua code, it will sure not change anything ...
like maybe ... packed into an if, to check if value is set, and then ...

Code: Select all

stairsplus_microblocks_not_in_creative_inventory = minetest.setting_get("stairsplus_microblocks_not_in_creative_inventory"))
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

Calinou wrote:I haven't started working on a fix yet.
The easiest fix would be leaving the stairs alone :)
Calinou wrote:pull requests are welcome :)
I don’t use Github anymore, but having this as on_place function in the node’s definition would rudimentary fix most placement issues.

Code: Select all

on_place = function(itemstack, placer, pointed_thing)
    if pointed_thing.type ~= 'node' then return itemstack end
    return on_place_orientation(itemstack, placer, pointed_thing)
end
And then this function:

Code: Select all

-- Derived from original Minetest Game stairs mod
--
-- The function rotates the placed item upside-down when placed against the
-- upper half of a node.
--
-- @param itemstack     The itemstack (wielded node)
-- @param placer        The placer (usually a player)
-- @param pointed_thing The node that the item is placed against
-- @return The item placement
local on_place_orientation = function (itemstack, placer, pointed_thing)
    local under = pointed_thing.under
    local above = pointed_thing.above
    local param2 = 0

    if placer then
        local placer_pos = placer:get_pos()
        local fpos = minetest.pointed_thing_to_face_pos(placer, pointed_thing)
        local fpos = fpos.y % 1

        if placer_pos then
            param2 = minetest.dir_to_facedir(vector.subtract(above, placer_pos))
        end

        if under.y - 1 == above.y or (fpos > 0 and fpos < 0.5) or (fpos < -0.5 and fpos > -0.999999999) then
            param2 = param2 + 20
            if param2 == 21 then
                param2 = 23
            elseif param2 == 23 then
                param2 = 21
            end
        end
    end

    return minetest.item_place(itemstack, placer, pointed_thing, param2)
end
It does not cover the “slabs placed in same orientation“ functionality, though.

zargulthewizard
Member
Posts: 249
Joined: Wed Jul 26, 2017 18:10
In-game: zargul

Re: [Mod] More Blocks [moreblocks]

by zargulthewizard » Post

I need to check my version, but at some point my inventory became WAY overpopulated by every slab type.
May God be with you, always.

User avatar
BuckarooBanzay
Member
Posts: 435
Joined: Tue Apr 24, 2018 05:58
GitHub: BuckarooBanzay
IRC: BuckarooBanzai
In-game: BuckarooBanzai

Re: [Mod] More Blocks [moreblocks]

by BuckarooBanzay » Post

zargulthewizard wrote:I need to check my version, but at some point my inventory became WAY overpopulated by every slab type.
Try adding this to you minetest.conf:

Code: Select all

moreblocks.stairsplus_in_creative_inventory = false
¯\_(ツ)_/¯ Not active here anymore, contact me on the minetest discord, irc, lemmy or github (for programming issues)

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] More Blocks [moreblocks]

by Calinou » Post

I think a good way to solve the creative inventory problem would be to add a /saw command that displays the circular saw GUI and remove Stairs+ nodes from the creative inventory in the process. Help is welcome in adding it, see https://github.com/minetest-mods/moreblocks/issues/144.

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

Calinou wrote:and remove Stairs+ nodes from the creative inventory
Please, please ffs, PLEASE stop messing with the stairs! Damn! Those are not from your mod, so why not simply leave them alone completely? They’re none of your business :)

tigersharke
New member
Posts: 5
Joined: Thu Jan 16, 2020 23:09

Re: [Mod] More Blocks [moreblocks]

by tigersharke » Post

The circular saw is an amazing feature and permits a great deal of creativity with its variety of shapes. I too am very interested in additional shapes such as the peak, and apex blocks as well as the inverse remains for such, which would be a hollow in a block the shape of the apex, and similarly for the other shape. The apex block is what I am calling a 1-block with 4-sided slope to a center point on the top face of that block. The inclusion of these will add other possibilities for decoration and further creativity.

Now, I hear the issue of 32768 (max int?) in relation to shapes but not being familiar with the inner workings or how things are setup, I am not clear about why it has to be a problem.

However, perhaps a solution in that the "circular saw" (which many say is not accurately named as its depiction in table saw form) could split the shapes into two categories, angled and square, then either the table saw button will pull-in two different tools, displaying all shapes, and actually tie only part to each. The button would not require UI complexity but the backend would have it instead. If the button and display cannot group it all into the display, how about the construction of a table saw enables the gain of both the square tablesaw and the angled one. How ever the mechanics are, if the groups of shapes were divided logically like this, it would allow for adding further shapes. The concept of multiple table saws along with the name change, may make it clearer if this were to become two mods (circ saw as is, plus table saw as described) or if it is a revision change for one mod (ie, with added capability it gets the name change and this is noted by revision number).

I would hope the above concept would also reduce the chance that the 32768 issue is bumped into but as I said, I do not understand how that numerical value relates to the whole of minetest or mods in general, maybe it is related to sqlite/database stuff. I hope I offered a possible solution that can be implemented fairly easily. I would also very very much like to see minetest be better in all ways possible than the corporate purchased version.

Thank you for your time and your hard work.

InitialD
New member
Posts: 6
Joined: Wed May 13, 2020 11:00

Re: [Mod] More Blocks [moreblocks]

by InitialD » Post

table saw has bug where if you click nodes with newly made nodes from the circular saw it deletes the old nodes if 1. they're from [moreblocks], nodes from other mods don't seem to get deleted/overwritten, 2. they're a full stack or a different shape than the one you're trying to place.

apart from that having shift functionality would be very usefull. rn you have to move both input and output manually.

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

tigersharke wrote:
Wed May 13, 2020 11:30
I would hope the above concept would also reduce the chance that the 32768 issue is bumped into but as I said, I do not understand how that numerical value relates to the whole of minetest or mods in general, maybe it is related to sqlite/database stuff.
It was somewhat arbitrary set in early days of Minetest. And now it won’t be fixed forever.

https://github.com/minetest/minetest/issues/6101
https://github.com/minetest/minetest/issues/9799

qawsedrftgzh
Member
Posts: 32
Joined: Sat Jul 25, 2020 08:36
GitHub: qawsedrftgzh
Location: Germany

Re: [Mod] More Blocks [moreblocks]

by qawsedrftgzh » Post

I Think it will be usefull if in the inventory are only the chainsaw and full blocks, beacause there would be a lesser number of nodes. Or is there a option for this? If yes how do i enable it?
My English is not so good, because I am german

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] More Blocks [moreblocks]

by Calinou » Post

qawsedrftgzh wrote:
Sat Aug 15, 2020 08:31
I Think it will be usefull if in the inventory are only the chainsaw and full blocks, beacause there would be a lesser number of nodes. Or is there a option for this? If yes how do i enable it?
You can add the following line to your minetest.conf, either using the mod settings menu or by editing it directly:

Code: Select all

moreblocks.stairsplus_in_creative_inventory = false

qawsedrftgzh
Member
Posts: 32
Joined: Sat Jul 25, 2020 08:36
GitHub: qawsedrftgzh
Location: Germany

Re: [Mod] More Blocks [moreblocks]

by qawsedrftgzh » Post

Ok that is very usefull, Thanks
My English is not so good, because I am german

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

Not that I want to brag about it or something, but I fixed the mod’s stairs/slabs placement with my mod (there is even a newer version available already).

viewtopic.php?p=379681#p379681

Image

Maybe someone is interested to check that out or use it to create a pull request on GitHub (since I do not use it). Code is GPLv3 or later.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] More Blocks [moreblocks]

by Calinou » Post

Code is GPLv3 or later.
I need the code to be licensed under zlib to merge it. Do you allow me to use that code under the zlib license? Thanks in advance :)

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

Calinou wrote:
Sat Aug 22, 2020 12:31
I need the code to be licensed under zlib to merge it. Do you allow me to use that code under the zlib license?
This would make no sense because the code as a whole is specifically made for my Minor Redefinitions mod which loads the code after all other mods were loaded and then tries to detect the things by string parsing and then overriding the item’s on_place functions.

A much better solution would be adding those functions directly when registering the items.

Since the GPL version 3 and the zlib license are compatible, feel free to use the functions (you need both for the slabs) as foundation for adding the rotation feature back to slabs and stairs and also add it to your own slopes (I just updated the mod so that it does exactly that).

LNJ
Member
Posts: 252
Joined: Tue Sep 23, 2014 16:02
GitHub: lnjX
IRC: LNJ
In-game: LNJ
Location: Europe/Berlin

Re: [Mod] More Blocks [moreblocks]

by LNJ » Post

Linuxdirk wrote:
Sat Aug 22, 2020 21:19
Calinou wrote:
Sat Aug 22, 2020 12:31
I need the code to be licensed under zlib to merge it. Do you allow me to use that code under the zlib license?
This would make no sense because the code as a whole is specifically made for my Minor Redefinitions mod which loads the code after all other mods were loaded and then tries to detect the things by string parsing and then overriding the item’s on_place functions.

A much better solution would be adding those functions directly when registering the items.

Since the GPL version 3 and the zlib license are compatible, feel free to use the functions (you need both for the slabs) as foundation for adding the rotation feature back to slabs and stairs and also add it to your own slopes (I just updated the mod so that it does exactly that).
AFAIK zlib is more permissive than the GPL, so zlib code is GPL compatible, but GPL code is not zlib compatible. That would mean that Calinou would strictly need to distribute the whole mod as "GPLv3", if he wants to include your code. And I'd guess that's not what you both (or at least Calinou) want.

EDIT: By the way thanks for your changes, that was exactly what we needed on our server. Also the ladders are pretty cool! :)
Storage Drawers - The simplest item storage in Minetest

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [Mod] More Blocks [moreblocks]

by Linuxdirk » Post

LNJ wrote:
Sun Aug 23, 2020 17:51
AFAIK zlib is more permissive than the GPL, so zlib code is GPL compatible, but GPL code is not zlib compatible. That would mean that Calinou would strictly need to distribute the whole mod as "GPLv3", if he wants to include your code.
Using it as some sort of API would work.

https://gitlab.com/4w/redef/-/tree/mast ... tation_api

No license changes needed (see additional terms added in accordance with the GPL version 3).
LNJ wrote:
Sun Aug 23, 2020 17:51
EDIT: By the way thanks for your changes, that was exactly what we needed on our server. Also the ladders are pretty cool! :)
Thanks, glad you like it. Please keep in mind that ladders only work with default textures.

Johann
Member
Posts: 13
Joined: Wed Mar 18, 2020 03:17
GitHub: johann-lau
In-game: JohannLau
Location: Hong Kong

Re: [Mod] More Blocks [moreblocks]

by Johann » Post

ModError: Failed to load and run script from /Users/johann/Library/Application Support/minetest/mods/moreblocks/init.lua:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: table index is nil
stack traceback:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: in function 'copy'
...rt/minetest/mods/moreblocks/stairsplus/registrations.lua:106: in main chunk
[C]: in function 'dofile'
...ion Support/minetest/mods/moreblocks/stairsplus/init.lua:82: in main chunk
[C]: in function 'dofile'
...ry/Application Support/minetest/mods/moreblocks/init.lua:21: in main chunk
Check debug.txt for details.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] More Blocks [moreblocks]

by Calinou » Post

Johann wrote:
Fri Dec 18, 2020 04:19
ModError: Failed to load and run script from /Users/johann/Library/Application Support/minetest/mods/moreblocks/init.lua:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: table index is nil
stack traceback:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: in function 'copy'
...rt/minetest/mods/moreblocks/stairsplus/registrations.lua:106: in main chunk
[C]: in function 'dofile'
...ion Support/minetest/mods/moreblocks/stairsplus/init.lua:82: in main chunk
[C]: in function 'dofile'
...ry/Application Support/minetest/mods/moreblocks/init.lua:21: in main chunk
Check debug.txt for details.
Which Minetest version and More Blocks version are you using? More Blocks 2.0.0 and later require Minetest 5.0.0 or later.

zargulthewizard
Member
Posts: 249
Joined: Wed Jul 26, 2017 18:10
In-game: zargul

Re: [Mod] More Blocks [moreblocks]

by zargulthewizard » Post

BuckarooBanzay wrote:
Sun Mar 29, 2020 17:01
zargulthewizard wrote:I need to check my version, but at some point my inventory became WAY overpopulated by every slab type.
Try adding this to you minetest.conf:

Code: Select all

moreblocks.stairsplus_in_creative_inventory = false
THX!
May God be with you, always.

Johann
Member
Posts: 13
Joined: Wed Mar 18, 2020 03:17
GitHub: johann-lau
In-game: JohannLau
Location: Hong Kong

Re: [Mod] More Blocks [moreblocks]

by Johann » Post

Calinou wrote:
Fri Dec 18, 2020 14:48
Johann wrote:
Fri Dec 18, 2020 04:19
ModError: Failed to load and run script from /Users/johann/Library/Application Support/minetest/mods/moreblocks/init.lua:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: table index is nil
stack traceback:
...t.app/Contents/Resources/builtin/common/misc_helpers.lua:480: in function 'copy'
...rt/minetest/mods/moreblocks/stairsplus/registrations.lua:106: in main chunk
[C]: in function 'dofile'
...ion Support/minetest/mods/moreblocks/stairsplus/init.lua:82: in main chunk
[C]: in function 'dofile'
...ry/Application Support/minetest/mods/moreblocks/init.lua:21: in main chunk
Check debug.txt for details.
Which Minetest version and More Blocks version are you using? More Blocks 2.0.0 and later require Minetest 5.0.0 or later.
5.3.0

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] More Blocks [moreblocks]

by Calinou » Post

Johann wrote:
Mon Jan 04, 2021 04:22
5.3.0
Then I don't know what could be causing this error, sorry. Try running a new world with only moreblocks enabled, no other mods to see if it's not due to some kind of mod conflict.

User avatar
Getsuga
New member
Posts: 5
Joined: Tue Jan 14, 2020 19:34
IRC: Getsuga
In-game: Getsuga
Contact:

Re: [Mod] More Blocks [moreblocks]

by Getsuga » Post

Hey Calinou !

I came across this bug a few days ago, i first reported it to the server admin and it seems that the mod is up to date.
As you can see in the screenshot bellow the circular saw gives 8 slabs of 1/16th of a block instead of 16, didn't check the other shapes though as they are a bit more complex to tally up lol

I also checked the issues on github very quickly, this doesn't seem to have been reported yet.

Image

Cheers !

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] More Blocks [moreblocks]

by j0j0n4th4n » Post

I like this mod, but I don't like the sloped blocks. Is there a easy way to not use them? Looking throught the files I'm afraid it isn't so simple as commenting one line on the init file
cdb_894a100ddd76

Post Reply

Who is online

Users browsing this forum: Google [Bot], SFENCE and 22 guests