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 [2021/12/28 18:35] – update to 1.18 banana | tutorial:custom_portals [2022/09/18 13:45] (current) – nexus-dino | ||
---|---|---|---|
Line 24: | Line 24: | ||
</ | </ | ||
- | **Note:** You need to choose the right version for your mod. The library works currently for 1.16 - 1.18. | + | **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 ===== | ||
Line 32: | Line 32: | ||
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(); | ||
</ | </ | ||
Line 45: | Line 51: | ||
<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.1640716556.txt.gz · Last modified: 2021/12/28 18:35 by banana