API for creating Portals
benfah opened this issue ยท 5 comments
Hello,
I wanted to ask if there are any future plans to create an API for creating portals, so that other devs can use your portals in other mods. :)
What do you want the API to be like?
First, there is a system for BreakablePortalEntity which nether portal uses.
There is BlockPortalShape https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/nether_portal/BlockPortalShape.java
And this can generate portal by block portal shape
https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/nether_portal/NetherPortalGeneration.java#L488
And it can indicate when to break portal like this
https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/nether_portal/NetherPortalEntity.java
If this system does not fit the requirement, you can manipulate portals directly.
https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/Portal.java#L28
Use GeometryPortalShape for strangely shaped portals
https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/GeometryPortalShape.java
Creating one portal and then complete bi way portal, bi faced portal
https://github.com/qouteall/ImmersivePortalsMod/blob/1.15/src/main/java/com/qouteall/immersive_portals/portal/PortalManipulation.java#L39
Oh well, thank you :D. I just wasn't sure if these method names would all hold up for future releases.