tutorial:custom_portals
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:custom_portals [2020/12/20 19:54] – Add Scroll-To-Text Implementation calum6541 | tutorial:custom_portals [2022/09/18 13:45] (current) – nexus-dino | ||
---|---|---|---|
Line 13: | Line 13: | ||
<code java> | <code java> | ||
maven { | maven { | ||
- | url " | + | url = " |
} | } | ||
</ | </ | ||
Line 20: | Line 20: | ||
<code java> | <code java> | ||
- | modImplementation ' | + | |
- | include ' | + | include ' |
</ | </ | ||
- | **Note:** The library | + | **Note: |
===== 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 '' | To register a basic portal, lets say a Gold Block frame and Flint and Steel. You can place a simple method in your '' | ||
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_BLOCK, new Identifier(" | + | CustomPortalBuilder.beginPortal() |
+ | .frameBlock(Blocks.GOLD_BLOCK) | ||
+ | .lightWithItem(Items.ENDER_EYE) | ||
+ | // | ||
+ | .destDimID(new Identifier(" | ||
+ | .tintColor(234, 183, 8) | ||
+ | .registerPortal(); | ||
</ | </ | ||
- | Now, this would the following portal (Custom Portals can work in any dimension!): | + | Now, this would create |
{{https:// | {{https:// | ||
- | 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 '' | Easy! This can be easily done by using a '' | ||
<code java> | <code java> | ||
- | // CustomPortalApiRegistry.addPortal(Block frameBlock, PortalIgnitionSource ignitionSource, | + | |
- | CustomPortalApiRegistry.addPortal(Blocks.NETHERITE_BLOCK, PortalIgnitionSource.FluidSource(Fluids.LAVA), new Identifier(" | + | CustomPortalBuilder.beginPortal() |
+ | .frameBlock(Blocks.NETHERITE_BLOCK) | ||
+ | .lightWithItem(Items.ENDER_EYE) | ||
+ | //.lightWithFluid(Fluids.WATER) | ||
+ | .destDimID(new Identifier(" | ||
+ | .tintColor(45,65,101) | ||
+ | .registerPortal(); | ||
</ | </ | ||
tutorial/custom_portals.txt · Last modified: 2022/09/18 13:45 by nexus-dino