#Technical blocks
1 messages · Page 2 of 1
for me everything generates and loads just fine
and bop manages to register block items
before illicit blocks can finish checking whether to add a block item
for a block
maybe compilation or something?
it happen on run time
maybe you can
get it to happen
with more mods
installed
i don't think a lot of mods
expect their
identifier to be already taken
messing with other mod's namespaces
oh
nevermind
terrestria crashed
it just failed to get info for render extensions apparently
erm
right here
Caused by: java.lang.IllegalStateException: Adding duplicate key 'ResourceKey[minecraft:item / terrestria:redwood_log]' to registry
at knot
oh boy
imagine having to make an exclusion list
for every single mod
that adds blocks
and all the blocks in the mod
it would be for all the blocks
that don't have yet a block item form
which the other mod (not illicit) is trying to add
but illicit intercepted it before that
just make illicit not generate anything that's excluded
then no crash
i dont know if
like
you are going to have
to make your own exclusion list
that's gonna be like over hundreds of lines
especially in a mod pack
but a problem is
a block that illicitblocks is supposed to add in a block item for
it looks the same as a regular block
you just have to keep on excluding
see if it crashes or not (if the mod eventually registers a block item for it )
if you want i could probably
do something more invasive:
using a mixing to hook into minecraft registration code
and see if it already exists, if it is then stop continuing
because illicit blocks handled those
instead
this could break mod compatibility
the easiest way again is just adding in _illicit to the end of the items
maybe
to duplicates?
_illicit would break world upgrades and stuff
from like 1.7 to 1.21
I feel like with this
_illicit for duplicates only
or an exclusion list
it would not place
a custom block
with _illicit
theres no block
biomesoplenty:white_sand_illicit
it will only make an item called
biomesoplenty:white_sand_illicit
but the actual block in game is still
biomesoplenty:white_sand
so it will survive world updates
you mean block items in chests
theres no actual block items being registered
if you have a piston_head block item in the chest
and then you remove the mod
the piston_head block item is gone
because the item doesnt actually exist
in the base game
you upgrade
no _illicit and everything is fine
with _illicit gone
huh
the item is gone
the block item is gone
but if you were to actually
middle pick the block
or break it
it would still be fine i believe
even without the _illicit
i dont think thats how
it works
minecraft utilizes
something called datafixerupper
yeah
my mod does not do that
well thats because it had their own vanilla stuff
pretty sure the illicit ones would be the same
yeah but minecraft:water existed
others did too
i think as it stands
even without the _illicit
so like
minecraft:moving_piston
its never gonna be saved
if you upgrade minecraft versions
no
that does something
fabric legacy exists
yeah I know
i dont know if the vanilla datafixerupper would work with my mod
because
these block items are not really
considered in the datafixerupper
also
modded dfu is not really a thing
apparently it would be ground breaking
don't think there is a dfu to convert from ID versions of the custom blocks that illicit blocks have
to the string versions
maybe there is
im inexperienced with dfu
we would somehow have to map ids to current block items for the mc version upgrade to work
so for that
leave it for before blockstates
so that would make the roadmap
exclusion list or whatever solution we come up with -> backwards compatibility -> blockstates
i'll add in exclusion list
but i'll test without
other mods
the user will have to create the exclusion list
for themselves
even then i dont believe backwards compatibility will exist
so like what else should be added
I think
lang stuff
copying over any missing item lang from blocks
will test later with terrestria
only terrestria causes a crash
normal powder snow is fine
I think we can test different mods and make a default config
the problem is though that finding mods that potentially add blocks like these could be difficult
I think
this system is perfectly fine
but just needs some documentation for end users
the documentation is
whenever mc crash add that block to the exclusion list

maybe i guess
have the lang file
like
somehow make it so
it reuses the same name as the block the block item is copying off of
yeah
block names -> the item names
with a decent default config it should be fine
back on my computer
will test the new system
done
that was very easy
okay well
some translations are still broken
but thats fine
instead of
BlockItem blockItem = new BlockStateBlockItem(block, new Item.Settings()
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Registries.BLOCK.getId(block)))
);
all i had to do was
BlockItem blockItem = new BlockStateBlockItem(block, new Item.Settings()
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Registries.BLOCK.getId(block)))
.useBlockPrefixedTranslationKey()
);
the rest someone can add themselves
yeah
OH
@charred pasture remember my world conversion thing
I put water and lava into a 1.7.10 chest
when upgrading they were preserved
Thats crazy
did they get turned into the illicit blocks
i have an idea
i'll just forego the backward compatibility for
other mods
but keep it for minecraft
so for other mods i'll just add in a _illicit
but for minecraft none
maybe add it in
as a default option
yep
nice
what do you think of this
to detect the duplicate crash items
hmm
yeah
send a crash log
yea
WHY DOES IT TRUNCATE THE LOG AAAAAAAAAAAAAAA
Erm
i can't imagine
launching septillion times
to find one block
to add to the ignore list
gotta automate it
no
but minecraft is truncating the logs
so instead of the full log we get and 9 more...
how are you viewing the log
so
we don't have many options
we need some way to automate this though
hmm
cursed idea
what if the mod name starts with a Z
biomes o plenty works and terrestria seems to load last
i don't think fabric loads stuff
alphabetically
huh
i opened it and it looks fine to me
in the .minecraft/crash-reports
hmm
no 9 more?
at this point
wait
in the json
why not have ignored namespaces
and include too
so like this
huh
okay
then maybe
ignored identifiers
ignored namespace
include identifier (overrides everything else)
exactly
I have tried excluding terrestria blocks and it seems like there isn't much hope
yeah
I excluded every wood type
but there's more stuff and I just don't feel like launching the game 50 times
maybe if
True
illicititems were to automatically generate a file containing all unregistered blocks when you're ingame
and just save it somewhere
then that would be nice
autosaving to the exclusion list would be a bit destructive though
maybe i can include
a command
/dumpunregisteredblocks
that dumps unregistered blocks
to a txt file
or maybe
idk how would you track that
probably a command would be nice
yeah
or a function keybind
on world entry
a function keybind would just work
maybe uhm
although F4+I would probably be better
i'll have to add in a
config option
so that it doesn't
try adding block items
that crash the game
just puts them in a list
then once you want to actually use it
you turn it off
then when you enter a world
and run the command
it'll generate a file
then when you start the game again everything will register
command or key bind or both
yeah
probably uh
once you run the keybind
it'll set the add in block items
so it reads the file
my idea is
set config option to true
start the game
run F4+I or /illicitgen
it generates a file
and when you start the game again it reads the unregistered blocks so it knows what to register on startup
also with F4+I it would be nice to have it be universal
so not restricted to gameplay
making it as easy as waiting for the game to load to the menu and pressing F4+I
ok
this system
would make everything way easier
you lose the dynamic part
but no compromises on namespaces or names
so
if there are
is like
if there is a file
called like
illicit_static.json
yeah
it would dump everything to that file
oh
in .minecraft/mods
also a small thing
small thing big difference with this one
loading item models as block models
quite a few would be broken but at least you can differentiate some stuff
what's going on
okay so for the static idea
illicitblocks.json
two new config stuff
use_static_list: true/false
static_list:
im thinking
it should be
an array of strings
so wait
use_static_list: false
if false then it's dynamic
respects the (ignore identifier, ignore namespace, include identifier)
if true then
it only registers the block items for the block identifiers in static_list
which by default is nothing
yep
so nothing is loaded
yeah exactly
then when you press keybind/run command
static_list gets updated
automatically
yeah
so you relaunch
so like no matter what include identifier array is loaded
yeah
if the thing is ignored should it still be added to the static_list
or not added
okay
this is probably better
so ignore_identifiers/ignore_namespace
it will check if the block is in any of those
but if the player excludes something and wants to include it
they will have to regenerate
yep
or include the identifier
if it is then it's doesnt get added to static list
yep
wdym
put it in the inclusion list
if a block is excluded they'll either have to regenerate or include
it overrides it
then it gets loaded no matter what
yeah exactly
okay
btw i dont think minecraft supports
modifier keys for the normal keybinds you see in controls
f4 + I
ill just make it right bracket for now
hmm
I'm quite eager to test every change lol
also with the mod
from my ideas with it
you can probably tell that it's more about just
sort of like purity and cross compatibility
cross compatibility is pretty important though so the mod can be used backwards and forwards
essentially making the mod last as long as possible
trying to check if the registry is frozen
rn
because having it
be on the main menu
the keybind for it
maybe the registries arent frozen yet
theres no simple isfrozen thing
its also not gonna be configurable in game
that's fine
I don't think anyone would really need to set a different binding
okay i pushed some updates
press right bracket ] to dump
delete your old config file too
i forgot to add something
okay you can test now by compiling
pushed another commit
yeah
delete your old config file
yeah
when dumping no errors
but at launch
it ignores literally everything
the config has no static data
what does it say
in config
ignoring block because not included in identifiers or whatever for the logs
does it say
and "static_list": [] is in the config ignoring other stuff
nothing is manipulated using the 3 identifier things
Ignoring block because not in static and not in included identifiers
static list is enabled
exactly
I can't launch it though due to terrestria
with the ] thing
what I had an idea for
was after the registry is frozen
just check through it as is used in startup
then write missing block -> item pairs
right now what it does is
it adds in the pairs (block item for block)
and adds it to an array
then whenever you press the ]
it saves that array into the config
i don't really check to see if the registry is frozen
i should make it so uh
maybe add in another config option
disable_blockitems
if true then it doesn't register the block items at all
though the logging is still kept
then you can use it
to dump
without crashing
seems very inflexible to me rn
but it'll do
okay done
i pushed another commit
delete old config file
so for your usecase
it would be
{
"excluded_identifiers": [],
"excluded_namespaces": [],
"included_identifiers": [],
"use_static_list": false,
"register_block_items": false,
"static_list": []
}
shouldn't crash and should dump
to static list when you press ]
ok
it dumps properly this time
oh no
opening the inventory somehow does this
oh no
terrestria duplicates
hmm
I have an idea
before dumping
erm
list all items in non minecraft namespaces that have items
dump
then delete anything in the dump from that list
it somehow also
with this
it registers nothing new
no water
no moving pistons or potted plants
wdym
what's your config
erm turn on register block items to true
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
if you want it to register block items
it crashes
hmm
duplicates remember
yeah
it registers stuff only in static list
but then the other mod already like
] gives duplicates
registered so duplicate
yeah
wdym it gives duplicates
it writes the EXACT same stuff that it would detect in normal mode
yeah
yeah
it tries to do add everything
so like terrestria redwood log
my block tries to add a block items for it with the
same
yeah
yep
in-game
it should exist now
see what there is
yeah exactly
yeah
and just dump everything that has no name equivalent item
so like
/setblock vs /give
or something
this all happening with the keypress
pushed a commit
okay wait it didn't go through yet
yeah the exact same thing happened as earlier
wdym i see logic
and terrestria looks a lot better
the true and false stuff it spits out in the logs
yea
if its true it removes, bc theres already a block item associated
if its false it keeps
hmm
so there's at least something instead of purple and black checkered things
okay
how do the block models look like
as in like
do they actually have block models
im gonna try messing with it
to see if i can generate something at least recognizable and unique
well each block has a model
if you point each new items model
you know like
there's minecraft/blockstates and minecraft/items
oh no
they point to models
yeah but uh
if all of them just point to their respective block models
wait erm
well at least i know how to set the model identifier now
right so
{
"model": {
"type": "minecraft:model",
"model": "minecraft:block/acacia_planks"
}
}
like this
so we have this
BlockItem blockItem = new BlockStateBlockItem(block, new Item.Settings()
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Registries.BLOCK.getId(block)))
.useBlockPrefixedTranslationKey()
.modelId(Identifier.of("minecraft", "water_bucket"))
);
and just throw in every block
this makes everything have the model of a water bucket
hmm
however there is no item for it
rn
there is no item model for the block
cause like
hmm
we need to manipulate the minecraft/items part
and not minecraft/models/item
so pointing blocks to their own models
minecraft:piston_head
so use that thing instead
im looking under
assets/minecraft/items/
no piston_head in sight
maybe look into
/assets/minecraft/models/block
instead of item
which is for piston_head
{
"parent": "minecraft:block/template_piston_head",
"textures": {
"platform": "minecraft:block/piston_top",
"side": "minecraft:block/piston_side",
"unsticky": "minecraft:block/piston_top"
}
}
so taking this
and for each block
making the name the block name .json
and change acacia_planks to the block name
so in (block name).json in (namespace)/items
i dont know if thats possible to do
{
"model": {
"type": "minecraft:model",
"model": "(namespace):block/(block name)"
}
}
well just use this template for every registered block
throw in the namespaces
throw in the block name
and done
there it is
like i dont know if making jsons during runtime would work for model stuff
at the very worst it would require a resource reload
we could just make it autoload a resource pack it generates
so imagine like
2 layers
base
block based, hardcoded, and autogenerated models
however hardcoded would likely be in base already
thinking of using a
ModelLoadingPlugin
might restrict it to later fabric api versions
though
what do you think
like how far back could it go
sure
not sure
in the worst case i can just make different versions of the mod
just remember though
for every block use this
with the model loading stuff we can just use this template and load it in for every new item
hmm
{
"model": {
"type": "minecraft:model",
"model": "namespace:block/illicitblock"
}
}
like this
for each item just copy off of this, search and replace, then load
so for instance
search and replace means like
namespace and illicitblock are replaced with actual things
{
"model": {
"type": "minecraft:model",
"model": "terrestria:block/potted_agave_plant"
}
}
like this
this is done manually right
they kinda like
the benefit to manually making models
is that then we know how autogenerated ones should work
what the
why is it stone
maybe try this
like
autogenerate a resource pack
then do the find and replace thing for every block and put everything generated into the pack under assets/namespace/items
so what I mean by this
make a folder in resourcepacks
copy over a pack.mcmeta file into the folder
well
for now you can i guess use a python script to automatically do that
ill make one
yeah
yeah
hm
this is only gonna work
after you compile the mod
its the built in resource pack
not a generated one at runtime
its kind of bad but
well it works for some stuff
the python script
ive already pushed
ill just leave it at that until
someone else knows how to do
ModelLoadingPlugin
run ./gen_models.py
and it'll check your static_list
and generate
the models.json
it's not a nice solution but it's there
yeah
maybe make the mod run it or something on startup
or possibly rewrite in java and integrate it
i guess
im not sure if it will work
in a jar
probably only works in dev environment
so
like it works in .minecraft
so
for the resource pack
right now I can't create it as I'm not at my computer
but not too long from now I can do it
it'll be automatically generated i think
you can add your own
which will override it
i believe
yeah I know
we will need to hardcode bubble columns, end gateways, and end portals
interface with the rendering of those blocks
make the inventory render them and hope it works
with this method if it works then all blocks could have proper and correct models
so like water is 15/16 tall
end portals would have their weird texture
wall signs would be rendered as they would be
stuff like that
wdym the water is 15/16 tall
uhh huh
let me test
placing those blocks
cubic water on top is 15/16 of a block tall
huh
end gateway seems to be fine i think
end portals work fine
bubble columns work only when theres a soul sand beneath
i think everything works as expected
what I mean though by this
like rendering the block itself
but inside the inventory
so like
you want it to
hardcode specific blocks
the models for them
so it'll look correct
also
before trying this thing
in our current system we need to fix certain types of blocks
what's happening
like
the dumping system should probably dump tags too
so we know what models to use
so this would fix crops, liquids, fire, etc.
I'm not 100% sure this is right, but it looks like the model loading api no longer supports this usecase.
I think I've got a working mixin though
🔥
just trying to make items use block models which we've kinda done
and now it's kinda just more stuff like doing different things for crops and liquids
finally can map dynamic json models to minecraft block item models
hmmmmmmmm
https://gist.github.com/cputnam-a11y/5c98947276c2bae7d7a834417aa58d2f going to ask in the morning when pepper is up if the removal of functionality is intentional, and if something like this could be included in fapi
including something in FAPI would break backwards compatibility
I want the mod to be backwards compatible down to possibly 1.14.4
first
good luck 
second
it wouldn't, as the way to do this was recently removed from fabric api
so you'd just use the old way when in the old version
and the new way in the new version
hmm
this stuff is optional
so the core mod functionality could probably go way back
model generation
also do you know of a way
to render a block in the inventory as if it was rendered in the world
because for most blocks this seems it would work
and then blocks like end portals would work
not really?
it's going to take a lot of porting
mojang has changed item registration no less than 4 times
interesting
I have like an idea for the mod
like of course it'll be made for modern versions and be quite interesting
but there's also the part of it spanning across many versions
I feel like this is the type of mod that would last for a pretty long time
I want it to be useful for everyone
personally after venturing into the world of having these blocks it's hard to imagine not having them
oh also the community around making modern minecraft look old would like this
I have not told anyone anything about this because of course it is quite the new mod
this is all I sent them
once the mod gets to a stage where it's quite "presentable"
probably once it goes on modrinth or something
then they'll know
but for now I'm keeping everything pretty quiet as the mod evolves
me holding block powder snow instead of a bucket
and lava in a bush
but yeah
so it's like at this point blockstates are quite far into the future
now the big hurdle is trying to make item models

so why didn't addModel work
does it only support adding models
then having to use static json files
for said models
so i have some plans right now:
- Make it use the new way of registering addition item assets (no longer need to use resource packs, on demand changing on launch)
- I dont believe there is a way of dynamically adding block items to all blocks that are missing block items, because my mod steals the block item identifier before the other mod gets to add their own (if they even add one later). This is fine for Minecraft blocks because they're already finished with their initialization, however fabric launcher doesn't guarantee mod loading order, and I don't think there is a way to wait until all other mods finish their registration because then other mods may use this method causing a race condition. Unless there is way where if I am able to mixin into the registration process and somehow unregister my own block items if another mod adds in their own to prevent this IllegalStateException. I think static_list will have to stay.
- Then for BlockStates, I have an idea. I should be able to add in "variants" of existing block items by setting a component containing the BlockState, from which my own implementation of BlockItem can use when placed. I think it should be
ItemGroupEvents.modifyEntriesEvent(ILLICIT_GROUP).register(entries -> {
// loop over the intended blockItem's block states
// create a unique item stack for each blockstate, by adding a component onto that item stack
entries.add(customStack); // Add it to the tab
});
- Then comes the issue with differentiating the variants of the BlockItem from each other; how should it be done? I believe the easiest way is for a tooltip that dynamically changes based on the BlockState of that ItemStack. So then it should look like
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
| Item Name |
| short = false |
| type = sticky |
| minecraft:piston_head|
| Data: 11 component(s) |
|____________________|
|‾ ‾ ‾ ‾ ‾ ‾ ‾|
| Item Icon |
|_________|
- Then use something like this https://modrinth.com/mod/condensed-creative to condense all the block items into a slot in the item group. However this is not updated for 1.21.5, and so I will need to port it manually
If I wanted different item models for each block state, I don't know if this is possible using this #1380192601516408984 message (I have not tried)
Or if there is another way to do so, so that is why I recommended doing the tooltip way
Well, it looks like it's baked into the item model definition now
I think we should hardcode certain item models to make it easier, but if it isn't possible then fall back to the dynamic item model generation
This might impose backwards compatibility restrictions if I have to create my own Component because I dont know if Minecraft already has a BlockState component
addModel is designed for mods like flywheel, from what I understood
It's meant to create a freestanding model not bound to anything that can be rendered in the world more efficiently
okay
Still planning to ask pepper when they're online.
Yeah, I guess that describes it well
yeah
do you think
that the mod should dump the first time you press a button every launch
so then it can have a list of items it can use every time except first launch
I'm sure you'll also notice, I added a way to tell what models are already provided, so you can probably just make it so a resource pack can override any of them
ooo
