dev/MCPitanLib/Overview/en の変更点
#author("2025-06-16T13:27:28+09:00","default:pitan","pitan")
* MCPitanLib Documentation [#z03e78cb]
You can more easily create a project using the IntelliJ IDEA plugin [[MCPitanLib Plugin - JetBrains Marketplace>https://plugins.jetbrains.com/plugin/27584-mcpitanlib]] or the [[Template - GitHub>https://github.com/Pitan76/TemplateMod-for-MCPitanLib]]. Please feel free to use them if you like.
** 1. Overview [#g5ee34a8]
- ''What is MCPitanLib'': A library for developing Minecraft mods compatible with multiple versions in a single JAR file.
- ''Main features'':
-- Registration of items, blocks, entities, GUI, commands, etc.
-- Various utilities to simplify support for multiple Minecraft versions
- ''Development status and notes'': Still under development. Specifications may change without notice and bugs may be present.
** 2. License [#d4065116]
- MIT License
** 3. Installation [#efe12032]
*** 3.1. Required Mods [#a0464d47]
- ''Mod Loaders'':
-- [[FabricMC>https://fabricmc.net/]]
-- [[Minecraft Forge>https://files.minecraftforge.net/]]
-- [[NeoForge>https://neoforged.net/]]
- ''Required Mod'':
-- Architectury API [[CurseForge>https://www.curseforge.com/minecraft/mc-mods/architectury-api]]
*** 3.2. Download [#s022737e]
- [[CurseForge>https://www.curseforge.com/minecraft/mc-mods/mcpitanlibarch]]
- [[Modrinth>https://modrinth.com/mod/mcpitanlibarch]]
*** 3.3. Adding to Your Project [#ld93eb84]
- Add repositories and dependencies to your ''build.gradle'':
#gcode(groovy){{
repositories {
maven {
url = "https://maven.pitan76.net/"
}
}
dependencies {
// FabricMC ※Use a different build.gradle for each
modImplementation "net.pitan76:mcpitanlib-fabric:${rootProject.mcpitanlib_version}"
// Minecraft Forge
modImplementation "net.pitan76:mcpitanlib-forge:${rootProject.mcpitanlib_version}"
// NeoForge
modImplementation "net.pitan76:mcpitanlib-neoforge:${rootProject.mcpitanlib_version}"
}
}}
- Specify the version in ''gradle.properties'':
#gcode(properties){{
# Example: mcpitanlib_version=+1.18.2:3.3.1
mcpitanlib_version=+x.x.x:x.x.x
}}
Check the latest version at [[maven.pitan76.net>https://maven.pitan76.net/net/pitan76/]].
** 4. File Structure [#ibd964ac]
- ''README.md'': General description and setup instructions
- ''LICENSE'': License file
- ''build.gradle'', ''gradle.properties'', ''settings.gradle'': Gradle build scripts
- ''.github/'': GitHub Actions workflow definitions
-- ''workflows/'': Contains CI/CD pipelines for auto builds, tests, releases, cherry-picks, etc.
- ''common/'': Source code shared across all mod loaders
-- ''src/main/java/net/pitan76/mcpitanlib/api/'': Core API of MCPitanLib, includes classes like ''CommonModInitializer'', ''CompatRegistryV2'', and ''CompatIdentifier'' which are foundational for multi-version support
-- ''src/main/java/net/pitan76/mcpitanlib/test/ExampleMod.java'': Sample mod showing basic usage of MCPitanLib
- ''fabric/'': Source code specific to the Fabric environment
- ''forge/'': Source code specific to the Forge environment
- ''neoforge/'': Source code specific to the NeoForge environment
- ''mappings/'': Mappings
- ''upload_maven.php'': PHP script to upload the library to the Maven repository (for developers)
- ''info.properties'': Version info, etc.
** 5. Getting Started with Mod Development (Using MCPitanLib) [#xf4d91da]
1. Create a class that extends CommonModInitializer: This becomes the main mod class and contains initialization code (see ''ExampleMod.java'').
2. Define IDs: Use ''CompatIdentifier.of("your_mod_id", "object_id")'' to define IDs for items, blocks, etc.
3. Register objects: Use the CompatRegistryV2 instance (registry), automatically generated in CommonModInitializer, to register items, blocks, screen handlers, etc.
-- Item: ''new CompatItem(CompatibleItemSettings.of(...))''
-- Block: ''new CompatBlock(CompatibleBlockSettings.of(...))''
-- GUI (ScreenHandler): ''registry.registerScreenHandlerType(...)''
4. ''Platform-specific code'': If needed, write platform-specific code in the respective directories (fabric/, forge/, etc.). These generally invoke the main class in common/ which extends CommonModInitializer.
** 6. Main API Concepts (MCPitanLib) [#d2c29397]
- ''CompatRegistryV2'': Core class for registering items, blocks, entities, GUIs, etc.
- ''CompatIdentifier'': A compatibility wrapper for Minecraft's Identifier (net.minecraft.util.Identifier)
- ''CompatibleItemSettings'': Compatibility class for Item.Settings
- ''CompatibleBlockSettings'': Compatibility class for AbstractBlock.Settings
- ''CompatItem'', ''CompatBlock'': Compatibility classes provided by the library
- ''CommonModInitializer'': Common entry point initializer
- ''CommandRegistry'': Utility for registering commands
- ''GUI-related'': Includes SimpleScreenHandlerTypeBuilder, GuiRegistry, etc. for GUI creation support
** 7. Automatic Cherry-Pick (GitHub Actions) [#y3bf1eee]
About the workflows included in MCPitanLib
- If a commit message starts with ''[cp]'', GitHub Actions will automatically attempt to cherry-pick it to lower-version branches.
- If conflicts occur, a pull request will be created (currently, these PRs must be handled manually)
** 8. How to Contribute [#t6a7ed7f]
Please report bugs or request features via GitHub Issues. For code improvements, submit a pull request.