#Custom Block Placing Preview

80 messages · Page 1 of 1 (latest)

safe shoal
#

Originally designed as a config option for my AutoSlabs mod, I think I will release this as a standalone mod (once I patch custom replacement placements like snow layers) Done! I didn't need to do anything besides utilize ItemPlacementContext's canPlace() and canReplaceExisting(). Now the only thing left is to get multiblocks like doors and beds working

craggy geode
#

That is so cool

safe shoal
#

Thanks!

craggy geode
#

Are you going to make the fences preview show the part that gets added on the neighboring fence

safe shoal
#

Maybe. The game doesn't know that the fence wireframe is there at all, so I'd have to do some trickery to fake render them

craggy geode
#

Ya

silent plinth
#

are you going to keep the vanilla outline around the targeted block? i feel like you probably don't need it when the preview wireframe is already rendering

safe shoal
#

I'll make it a config option

astral moth
#

Is this client sided by chance? Would be super epic if it was

safe shoal
#

yep!

safe shoal
rugged bluff
#

You're pushing out some cracking mods recently! 🤯

safe shoal
#

Thank you!

finite horizon
#

I recognize your name from somewhere

safe shoal
# finite horizon I recognize your name from somewhere

Uh, I've been developing mods for a little while now, you can search from: andrew6rant in:showcase-old has:file and from: andrew6rant in:showcase has:file to see some of what I've made
I also was a tweak developer in the iOS jailbreaking community a few years ago if that's what you remember

finite horizon
#

No it was from mods

safe shoal
#

Oh! Just looked through your Modrinth page. I made the deep underground lava fix mod that you forked

finite horizon
#

Aha

safe shoal
#

I was actually just about to patch it for 1.19.2

finite horizon
#

Thats what it was yeah

safe shoal
#

Missed notifications from that repo for some reason didn't know it was broken on that version

finite horizon
#

Btw your fix makes bedrock visible in some caves

safe shoal
#

Wait, really?

median thistle
#

yooo this is awesome!

#

you make such cool mods

#

i am making seamless so the shape only extends when the other blocks really are there though, so after that update this won't work anymore unless the other half of the bed is there already

safe shoal
median thistle
#

yeah it will be data driven

#

you can add rules which specify what blocks with what blockstates combine in specified directions

#

and then when rendering it will recursively find blocks to connect

#

you could for example make all iron blocks connect

#

although it does this every frame, its is much faster than you would think

safe shoal
#

Very cool. I was trying to hook into the block placement/ neighbor check to see if another block was placed from the initial block (doors, beds, tall flowers, etc) and then merge the outline voxelshapes, but it hasn't worked out exactly

median thistle
#

yeah that would be difficult, i would imagine different blocks handle that differently too

safe shoal
#

Yeah

median thistle
#

i guess for the vanilla blocks you could hardcode it too

finite horizon
safe shoal
median thistle
#

yeah no problem, i made rotation methods to make it easier

safe shoal
#

The rotation should be handled by my placement code, I think all I need to do is override the actual voxelshape

median thistle
#

well you still need to specify the shape for every state right?

safe shoal
#

Ah, that's true

#

I was thinking of the tall flowers which don't need rotation like doors and beds lol

median thistle
#

ah

safe shoal
#

color customization! now instead of not showing, you can have the option of showing an "invalid" render

#

also I'm building a very simple API for mods to use to make their own custom preview render

median thistle
#

Oh cool!

#

Really looking forward to the release

median thistle
#

and other 2 block blocks of course

safe shoal
median thistle
#

nice

safe shoal
#

only problem is that since the getPlacementState is null, I don't know the state, lol. I just set the default

#

that is partially why I am making an API

median thistle
#

ah

median thistle
safe shoal
#

Instead of just using the bedblock's placement code, I could run custom fake placement code that'll basically just return the proper bed bottom state
because right now the bed returns null if the top block is invalid

summer elbow
#

Potentially like Minecraft Classic there could be a toggle to instead render a transparent model of what your placing instead of the outline?

#

That would be very cool

#

I’ll try find a picture

safe shoal
median thistle
#

I hate it when my black vertical slabs go all over the place

safe shoal
median thistle
#

I had that exact problem many times but in reverse, mine was 16 times too small, yours 16 times too big

#

Gotta remember the difference between Block.box and Shapes.box xD

safe shoal
#

yep lol

#

except yarn mappings for me

median thistle
#

Oh right

#

createcuboid right?

safe shoal
#

Block.createCuboidShape

median thistle
#

Ah

safe shoal
#

and VoxelShapes.cuboid

rare anvil
#

This is pretty sick

summer elbow
safe shoal
#

Trying to figure out how to nicely implement an API that allows other mods to mess with the crosshair rendering. Here's something simple I built for AutoSlabs' new keybind system (textures are WIP)

astral moth
#

Oooooh

silent plinth
#

ngl i kinda like those little preview textures, if those are wip then what would be your goal plan?

safe shoal
#

right now they are hardcoded based on AutoSlab's slab lock keybind (this is a part of AutoSlabs and not this mod, don't worry). I'm currently working on a way to make them data-driven

silent plinth
#

ah i see

astral moth
#

(any update on this)