作者:rebot | 分类:模组
Minecraft 版本: 1.21.10
平台: neoforge
标签: library
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")
}
Now onto creating and registering the portal itself, this is simple thanks to the [CustomPortalBuilder](https://github.com/AzureDoom/customportalapi-reforged/blob/1.20.1/src/main/java/net/kyrptonaught/customportalapi/api/CustomPortalBuilder.java) 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:
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:
CustomPortalBuilder.beginPortal()
.frameBlock(Blocks.OBSIDIAN)
.destDimID(new ResourceLocation("the_nether"))
.tintColor(131, 66, 184)
.registerPortal();
CustomPortalBuilder is filled with plenty of methods to customize the functionality of your portal, all of which are documented in the class.
Some noteworthy methods to mention:
请登录后举报
暂无评论,抢个沙发吧~