kyrptonaught / customportalapi

Developer Api for creating custom portals to any dimension
MIT License
63 stars 22 forks source link

is it possible to use an ID for the portal instead of having the frame block be the id? #65

Open andrewzah opened 1 year ago

andrewzah commented 1 year ago

it would be nice to have multiple portals with the same frame type.

kyrptonaught commented 1 year ago

This is technically possible but I chose not to do so, mostly for performance.

When a portal is attempted to be lit, we just grab the block that is making up the new "frame" and check it against a hashmap. This allows the lookup to be fast. This quickness also allows us to avoid using a BE for the portal itself. We can quckly get our "portal link" and determine what color we are supposed to be based on this hashmap lookup. So tinting the block itself, tinting the loading screen, tinting particles, etc. This is also important since we can be checking for a potential portal every time a block is updated, or we interact with a block though right click, place a block, etc.