No overlay for entities
taziup opened this issue ยท 6 comments
there are no overlay (missing, wrong state, ...) on entites. At least painting, armor stands and item_frames should be great.
Perhaps having at least some sort of indication is a good idea, though in such a way that it is clear that it is not absolute.
I think I'll probably do it in block grid sized boxes, and just check if there is a different number of entities in the client world within those boxes compared to the schematic world. And I think I'll handle paintings and item frames specially, also checking the contents of those.
One thing to note is that this will happen from the sub-chunk re-render call, so very complicated many-to-many type checks with margins and everything can get relatively expensive and thus visibly hurt the rendering performance of the schematic.
Here are a few ideas I thought up.
In the case of entities with highly variable block positioning, for example, minecarts and armour stands, I also suggest a way to solely highlight the blocks containing such entities to make it easy to visually inspect a potentially large completed build to manually ensure the positioning is correct.
In the case of minecarts, additional checks could be made for positioning over multiple hoppers, ensuring that the minecart distributes to the intended hoppers.
Another idea: highlight based on a user-adjustable margin of error from the exact positioning within a block. This way, the required placement precision for entities in specific builds can be factored in by the user. This could be done per entity type per schematic, or, potentially, per specific entity.
This quite tricky to fix "nicely", because the entities are not on a nice predefined grid, so it's not easy to check "is there an entity in this location". Because there might be an arbitrary number of entities crammed in the same place in the schematic, and they may be slightly offset from eachother...
So how should that be handled when it comes to the overlay? Should the mod just build a bounding box that is wide enough to contain all entities that "continuously overlap from the first entity" and then count the number of entities in the client world within that box that are of the same type? Does the concept of wrong entities even make sense here? Should this overlay only render the missing colored box? Should this only work for the hangable entities, ie. item frames and paintings, or all entities (mobs etc.)? Hangable entities shouldn't have the overlap issue mentioned above, but entities in general would.
in fact i don't think all entities are usefull, maybe focus on paintings, item frames and armor stands.
for other entites, i think we have to distinguish entities that are able to move or not, for example a zombie surrounded by wall or a villager in a big room can't be checked the same way.
Maybe proceed step by step and start with the simple things to do.