User Tools

Site Tools


tutorial:custom_portals

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:custom_portals [2020/12/20 19:54] – Add Scroll-To-Text Implementation calum6541tutorial:custom_portals [2022/09/18 13:45] (current) nexus-dino
Line 13: Line 13:
 <code java> <code java>
 maven {  maven { 
-    url "https://dl.bintray.com/kyrptonaught/customportalapi+    url "https://maven.kyrptonaught.dev"
 } }
 </code> </code>
Line 20: Line 20:
  
 <code java> <code java>
-modImplementation 'net.kyrptonaught:customportalapi:0.0.1-beta18-1.16+  modImplementation 'net.kyrptonaught:customportalapi:<version>
-include 'net.kyrptonaught:customportalapi:0.0.1-beta18-1.16'+  include 'net.kyrptonaught:customportalapi:<version>'
 </code> </code>
  
-**Note:** The library only works currently for 1.16, 1.17 version will release soon.+**Note:** You need to choose the right version for your mod. The library works currently for 1.16, 1.18 and 1.19.
  
 ===== Registering your Portal ===== ===== Registering your Portal =====
 +**Note:** The syntax here has changed since the first writing of this article while the basic function is still the same. Please refer to the examples on GitHub for newer versions.
  
 To register a basic portal, lets say a Gold Block frame and Flint and Steel. You can place a simple method in your ''ModInitializer''((Not Client or Server)) To register a basic portal, lets say a Gold Block frame and Flint and Steel. You can place a simple method in your ''ModInitializer''((Not Client or Server))
 The portals created using the CustomPortalApi act like vanilla portals, and can be as big as 23×23. The portals created using the CustomPortalApi act like vanilla portals, and can be as big as 23×23.
  
-<code java> +<code java>; 
-//  CustomPortalApiRegistry.addPortal(Block frameBlock, Identifier dimID, int r, int g, int b+ 
-CustomPortalApiRegistry.addPortal(Blocks.GOLD_BLOCKnew Identifier("my_mod_id", "my_dimension_id")234, 183, 8);+CustomPortalBuilder.beginPortal()   
 +        .frameBlock(Blocks.GOLD_BLOCK)   
 +        .lightWithItem(Items.ENDER_EYE)   
 +      //.lightWithFluid(Fluids.WATER) 
 +        .destDimID(new Identifier("my_mod_id", "my_dimension_id"))   
 +        .tintColor(234, 183, 8)   
 +        .registerPortal();
 </code> </code>
  
-Now, this would the following portal (Custom Portals can work in any dimension!):+Now, this would create the following portal (Custom Portals can work in any dimension!):
  
 {{https://raw.githubusercontent.com/kyrptonaught/customportalapi/main/images/2020-11-15_17.07.38.png}} {{https://raw.githubusercontent.com/kyrptonaught/customportalapi/main/images/2020-11-15_17.07.38.png}}
  
-However, this is limited to the flint and steel. Let say we want to make a portal with a lava bucket as an ignition source.+However, this is limited to Flint and Steel. Let say we want to make a portal with a Lava bucket as an ignition source.
 Easy! This can be easily done by using a ''PortalIgnitionSource'' Easy! This can be easily done by using a ''PortalIgnitionSource''
  
 <code java> <code java>
-//  CustomPortalApiRegistry.addPortal(Block frameBlock, PortalIgnitionSource ignitionSource, Identifier dimID, int r, int g, int b)  + 
-CustomPortalApiRegistry.addPortal(Blocks.NETHERITE_BLOCK, PortalIgnitionSource.FluidSource(Fluids.LAVA)new Identifier("my_mod_id", "my_dimension_id"), 5152, 49+CustomPortalBuilder.beginPortal()   
 +        .frameBlock(Blocks.NETHERITE_BLOCK)   
 +        .lightWithItem(Items.ENDER_EYE)   
 +      //.lightWithFluid(Fluids.WATER) 
 +        .destDimID(new Identifier("the_end"))   
 +        .tintColor(45,65,101)   
 +        .registerPortal();
 </code> </code>
  
tutorial/custom_portals.1608494049.txt.gz · Last modified: 2020/12/20 19:54 by calum6541