mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 22:29:50 +00:00
NEW OPTIMISED MIGRATION_ROADMAP.md
This commit is contained in:
1 parent
cfeb300808
commit
b8a9de00ab
13 files changed
+711
-548
No files matched your search
+4
-9
@@ -30,8 +30,9 @@ Core code must **never** import:
|
||||
| `CompressedStreamTools` | `PlatformServiceHolder.get().readCompressedNBT()` |
|
||||
| `LogWriter` | `PlatformServiceHolder.get().logError()` |
|
||||
| `CustomNpcs.getWorldSaveDirectory()` | `PlatformServiceHolder.get().getWorldSaveDirectory()` |
|
||||
| `EntityPlayer` param | `IUser` (via platform-api) |
|
||||
| `EntityNPCInterface` param | `INpc` (via platform-api, not yet created) |
|
||||
| `EntityPlayer` param | `IPlayer` (via platform-api — `noppes.npcs.api.entity.IPlayer`) |
|
||||
| `ItemStack` param | `IItemStack` (via platform-api — `noppes.npcs.api.item.IItemStack`) |
|
||||
| `World` param | `IWorld` (via platform-api — `noppes.npcs.api.IWorld`) |
|
||||
|
||||
## Split-Package Shadows
|
||||
|
||||
@@ -40,16 +41,10 @@ Core classes share packages with mc1710 classes. The mc1710 version can:
|
||||
- Re-add `SyncController` calls for network sync
|
||||
- Override methods that need `ItemStack`, `EntityPlayer`, etc.
|
||||
|
||||
## DO NOT TOUCH (Forbidden Zones)
|
||||
|
||||
- **Script system** — ScriptHandler, ScriptContainer, I*Script*, Action framework
|
||||
- **Ability system** — Ability.java and ability type classes (30+ MC imports)
|
||||
- **Entity classes** — extend MC Entity directly
|
||||
- **Recipe system** — extends MC recipe classes
|
||||
|
||||
## Adding New Core Code
|
||||
|
||||
1. Ensure zero MC imports — use platform-api interfaces
|
||||
2. NBT via `NBT.compound()` / `NBT.list()`, file I/O via `PlatformServiceHolder`
|
||||
3. Stub out methods needing MC types — mc1710 shadow adds them
|
||||
4. Follow existing package structure (controllers → `controllers/`, data → `controllers/data/`)
|
||||
5. **NEVER create duplicate interface names** — use `IPlayer`, `IItemStack`, `IWorld`, `IEntity` etc. from platform-api as-is
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## What This Is
|
||||
MC-free module containing game logic, enums, data classes, and controllers that compile without
|
||||
Minecraft imports. Uses `platform-api/` interfaces for MC operations. 183 files migrated so far.
|
||||
Minecraft imports. Uses `platform-api/` interfaces for MC operations. 188 files migrated so far.
|
||||
Dependency: `platform-api` ← `core` ← `mc1710 (root src)`.
|
||||
|
||||
## Split-Package Shadow Pattern
|
||||
@@ -10,7 +10,7 @@ Core classes and mc1710 classes share the **same package**. At compile time, mc1
|
||||
core by adding MC-specific functionality:
|
||||
|
||||
```
|
||||
core/ Faction.java → Pure data + INBTCompound serialization
|
||||
core/ Faction.java → Pure data + INbt serialization
|
||||
src/ Faction.java → adds `implements IFaction`, SyncController calls, EntityPlayer methods
|
||||
```
|
||||
|
||||
@@ -31,7 +31,7 @@ All game enums. No MC imports. Domains:
|
||||
- **Misc**: `EnumBardInstrument`, `EnumDayTime`, `EnumParticleType`, `MarkType`, `NBTTypes`, `EnumNpcToolMaterial`
|
||||
|
||||
### controllers/ (8 files)
|
||||
Migrated controller singletons using `INBTCompound` instead of `NBTTagCompound`:
|
||||
Migrated controller singletons using `INbt` instead of `NBTTagCompound`:
|
||||
|
||||
| Controller | Status |
|
||||
|---|---|
|
||||
@@ -75,23 +75,17 @@ Migrated data classes. Key groups:
|
||||
- `developer/` — `Developer` registry
|
||||
|
||||
## Platform Abstraction
|
||||
Core uses `platform-api/` interfaces:
|
||||
- `INBTCompound` / `INBTList` instead of `NBTTagCompound` / `NBTTagList`
|
||||
Core uses `platform-api/` interfaces (the real ones from `noppes.npcs.api.*`):
|
||||
- `INbt` / `INbtList` instead of `NBTTagCompound` / `NBTTagList`
|
||||
- `NBT.compound()` / `NBT.list()` factory methods instead of `new NBTTagCompound()`
|
||||
- `PlatformServiceHolder.get()` for file I/O, logging, world save directory access
|
||||
- `IUser` for player references (not yet widely implemented — blocks many migrations)
|
||||
- `IPlayer` for player references, `IItemStack` for items, `IWorld` for worlds
|
||||
|
||||
## Migration Status
|
||||
183/~1810 files migrated. Blockers for remaining classes:
|
||||
- **IUser wrapper** needed for Availability, Dialog, Quest migrations
|
||||
- **IStack wrapper** needed for item-dependent classes (inventory, trading, recipes)
|
||||
- **Entity abstractions** not planned — entities stay mc1710-side permanently
|
||||
- **Script system** not planned for migration — deeply coupled to engines
|
||||
|
||||
See `CORE_MIGRATION_STATUS.md` and `CORE_PLAN.md` at project root for details.
|
||||
188/~1810 files migrated. See `.AGENTS/SESSION_MEMORY.md` for the full migration roadmap.
|
||||
|
||||
## Forbidden
|
||||
- **NEVER import net.minecraft.* in core/** — use platform-api interfaces only
|
||||
- **NEVER import wrapper classes in core/** — only interfaces from platform-api/
|
||||
- **NEVER break split-package shadow** — core class must compile alone, mc1710 adds MC logic
|
||||
- **NEVER add IUser/IStack to core until platform-api interfaces are finalized**
|
||||
- **NEVER create duplicate interface names** — use the existing `IPlayer`, `IItemStack`, `IWorld`, `IEntity` etc. from platform-api
|
||||
Reference in new issue
Block a user