Custom Portal API Reforged
Forge port of Fabrics Custom Portal API, updated for newer versions of MC.
Custom Portal API Reforged
<center>
<font size=+4><b>Custom Portal API Reforged</font></b>
<font size=+1> Library mod allowing developers to create portals to their custom dimensions easily. These custom portals will function exactly like nether portals, except being fully customizable. You can control the frame block, portal block, tinting, ignition source, destination, and more! </br></br>

<font size=+2><b>Usage</font></b>
Add the repository/mod to your build.gradle. </font> </center>
```java repositories { maven {url 'https://maven.azuredoom.com/mods'} } dependencies { //1.20.1 implementation fg.deobf('net.kyrptonaught.customportalapi:customportalapi-reforged:MODVERSION') //1.20.2+ implementation fg.deobf("net.kyrptonaught.customportalapi:cpapireforged-neo-1.20.2:MODVERSION") } ```
<center>
<font size=+1>
Now onto creating and registering the portal itself, this is simple thanks to the CustomPortalBuilder class. We will make use of this in FMLCommonSetupEvent.
The following is a very simple portal that will take us to The End, and is lit by right-clicking the frame with an Eye of Ender: </center>
```java CustomPortalBuilder.beginPortal() .frameBlock(Blocks.DIAMOND_BLOCK) .lightWithItem(Items.ENDER_EYE) .destDimID(new ResourceLocation("the_end")) .tintColor(45,65,101) .registerPortal(); ```
A Nether portal would be registered as follows: ```java CustomPortalBuilder.beginPortal() .frameBlock(Blocks.OBSIDIAN) .destDimID(new ResourceLocation("the_nether")) .tintColor(131, 66, 184) .registerPortal(); ```
<center> CustomPortalBuilder is filled with plenty of methods to customize the functionality of your portal, all of which are documented in the class.
</br></br> Some noteworthy methods to mention: </center>
- lightWithWater/Item/Fluid - These allow you to control how the portal is lit. - onlyLightInOverworld - Only allow the portal to be used in the overworld to your destination of choice - flatPortal - Flat Portal similar to the End or the Twilight Forest portal.
</br></br> <center> <font size=+2><b>Credits</font></b>
Based off the main Fabric mod HERE and an older ported mod HERE </center>