
Adding warming blocks using datapacks
CrossWayIstaken opened this issue ยท 5 comments
Hello! I've been using your mod for some time, and it's amazing and works great in pair with fabric seasons.
But I found it quite annoying that you can only add blocks using tags. It's great for campfires and torches, but it doesn't fit modded blocks like furnaces and stoves.
My solution for this would be datapacks
My example of how this could look is based on vanilla's recipes and /setblock command.
It uses the "type" ID like in recipes, and the "block" part similar to /setblock, so modpack creators or regular user would be familiar with the format and wouldn't get lost when making large changes to the game. e.g:
{ "type": "enviromentz:warming_blocks", "block": "farmersdelight:stove[lit=true]" }
This could also work with blocks that don't use the "lit=true" format, but introduce their own, e.g:
{ "type": "enviromentz:warming_blocks", "block": "kibe:heater[enabled=true]" }
And It also could make the heating distance more dynamic
{ "type": "enviromentz:warming_blocks", "block": "kibe:heater[enabled=true]", "warm_radius": 4 }
Anyway, thanks for reading my suggestion, and thank you for making this amazing mod.
I'd like to second the idea of adding additional blocks for warmth and even cooling. It would be cool to have heated floors, by having a layer of magna blocks under your house. =) Also it feels odd that lava can't keep you warm. =)
Hey CrossWayIstaken,
Your idea is pretty good but I see a problem codewise:
The player searches every second (every 20th tick) for a warming block in the set radius (if he is in a cold biome) which costs performance (in the view of, everything costs performance). So the pre set value of 2 means it searches 148 (if I calculated it right xD) blocks every second for a block (one up, three down, two north, two south, two east, two west).
Why it is checked by the player and not sent by the blocks? cause the blocks would need a blockentity and those entities can only get set and add via code to the existing block while initializing. the campfire has a blockentity so that would be fine but a datapack which tells this block (any block) has this kind of heat value would need a mixin into (if existing) blockentity or even create a new blockentity and mixin into the block to add the entity to the block - then the block would also tick every second which takes performance too.
I guess this gives a better understanding for the warming block problem
Hi, again, thanks for reading my suggestion.
But I got a bit confused about your explanation. Are you talking about the "warming_radius" thing? If talking about the whole idea, I don't understand why the player can't check the block state of a... block and needs a block entity. Is there's some sort of limitation? Or this can only be done with code, just like the furnace?
Yes I was talking about the changing radius thing :)
Instead of using block entities the player could of course just check blocks with the max radius set and check if a block with the specific warming radius is inside it but if I increase the radius by one, it would check 392 blocks every second. blockstate shouldn't be a problem