Skip to content

Commit

Permalink
Docusaurus API Plugin + Libraries (#12)
Browse files Browse the repository at this point in the history
* Testing a new way to interact with park

* Squashed 'api/' content from commit 06e27942d

git-subtree-dir: api
git-subtree-split: 06e27942d1def5348e4c82cd6b5afd8b4e79422d

* Migrating to docusaurus-plugin-typedoc-api

* Added libraries, experimental

- TODO: Check library entry points.

* Squashed 'api/typedoc-plugin/' content from commit b069bc730

git-subtree-dir: api/typedoc-plugin
git-subtree-split: b069bc730f29af206c42684c09cdeb6b39d50f00

* Moved packages/plugin/docusaurus-plugin-typedoc-api to docusaurus-typedoc-plugin

* Bump @Docusaurus dependencies (3.6.1 -> 3.6.3)

* Removed typedoc-codicon-theme, since it cannot be used anymore

* Properly linting markdown, ignoring images links

* Added plugin building to package

* Compiling plugin with typescript, copying assets

* Removed plugin footer, useless one

* Typedoc 0.26+ uses ReflectionId as identifier (still number, but with exceptions)

* Plugins should use @theme-init instead of @theme

* Added typedoc 0.26+ document icon

* Added Options type export to entry point, using it in docusaurus.config.ts

* Downgrading to Typedoc 0.25.13 until jiti-v2 is coming out to Docusaurus

- See facebook/docusaurus#10716 for details.

* Migrating plugin back too for now

* Moving plugin to @nernar/docusaurus-plugin-typedoc, migrating to Docusaurus 3.5.2

* Added libraries tsconfig stuff

* Moved declarations to new location

* Added libraries packages to API

* Some dirty stuff to make it work
  • Loading branch information
MaXFeeD authored Dec 4, 2024
1 parent 5628e44 commit 3e0a928
Show file tree
Hide file tree
Showing 180 changed files with 180,940 additions and 1,952 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Dependencies
/node_modules
node_modules/

# Production
/build
/src/pages/api
/innercore*-docs.pdf

# Generated files
Expand Down
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"markdown.preferredMdPathExtensionStyle": "removeExtension",
"markdown.validate.enabled": true,
"mdx.experimentalLanguageServer": true,
"markdown.validate.ignoredLinks": [
"/images/**/*"
],
"search.exclude": {
"**/node_modules": true,
"**/package-lock.json": true,
"**/.wireit": true,
"**/build": true
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
}
}
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ I mean modding documentation for Inner Core of course, rewrited from zero to Typ

Everything divided by categories, which also represents sidebar structure. Every markdown location described in **sidebars.js**, you can use it for auto-generation or manually provide required routes.

## API Reference

New era of Core Engine documentation, generated into single webpage like everything here. See [Nernar/API](https://github.com/Nernar/API) repository for details.

## Modding Examples

Here represented most of legendary Core Engine mods with unique mechanics, that you can freely take into your content.

## Libraries freely to use

At beginning, it located by few locations: **libraries** where everything starts, **i18n** where localization performs and **static** where additional files is located.
Expand Down
6 changes: 6 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Production
docs/

# Generated files
/declarations/core-engine.d.ts
/.wireit
924 changes: 924 additions & 0 deletions api/LICENSE

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions api/core-engine/ActorRenderer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* Class, upon which armor and attachments render is based
* It is a model that consists of parts, same as in {@link Render},
* but more abstract, allows creating root parts instead of
* inheritance from old humanoid model.
* @since 2.2.0b75
*/
declare class ActorRenderer {
/**
* Constructs new {@link ActorRenderer} object without parts.
*/
constructor();

/**
* Constructs new {@link ActorRenderer} object,
* based on one of default Minecraft render templates.
* @param templateName default template name
*/
constructor(templateName: DefaultRenderTemplate);

getUniformSet(): ShaderUniformSet;

setTexture(textureName: string): void;

setMaterial(materialName: string): void;

getPart(name: string): ActorRenderer.ModelPart;

/**
* Adds a child model part of an existing one.
* @param name child model name
* @param parentName parent model name
*/
addPart(name: string, parentName: string, mesh?: RenderMesh): ActorRenderer.ModelPart;

/**
* Adds a root model part.
*/
addPart(name: string, mesh?: RenderMesh): ActorRenderer.ModelPart;

}

declare namespace ActorRenderer {

/**
* All methods of {@link ActorRenderer.ModelPart} build in such a way,
* that you can create full render in one chain of calls.
* @example
* ```js
* new ActorRenderer()
* .addPart("child", "parent")
* .addBox(-4, -4, -4, 4, 0, 4)
* .addPart("grandChild", "child")
* .addBox(-4, 0, -4, 4, 4, 4)
* .setOffset(0, 4, 0)
* .endPart();
* ```
*/
class ModelPart {

endPart(): ActorRenderer;

setTexture(textureName: string): ModelPart;

setMaterial(materialName: string): ModelPart;

setTextureSize(w: number, h: number): ModelPart;

setOffset(x: number, y: number, z: number): ModelPart;

setRotation(x: number, y: number, z: number): ModelPart;

setPivot(x: number, y: number, z: number): ModelPart;

setMirrored(isMirrored: boolean): ModelPart;

/**
* @param inflate increases the box by a certain value in all directions
*/
addBox(x: number, y: number, z: number, sizeX: number, sizeY: number, sizeZ: number, inflate: number, u: number, v: number): ModelPart;

clear(): ModelPart;

}

}
48 changes: 48 additions & 0 deletions api/core-engine/AddonEntityRegistry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Module used to manage custom entities added via add-ons.
* @since 2.0.1b18
* @remarks
* Depends on local player dimension, highly recommended to replace it
* with {@link BlockSource.spawnEntity} and {@link Entity.getTypeName}.
*/
declare namespace AddonEntityRegistry {
/**
* Spawns an entity defined via add-on on the specified coordinates.
* @param nameID entity name ID, as defined from add-on
* @deprecated Client-side method, use {@link BlockSource.spawnEntity} instead.
*/
function spawn(x: number, y: number, z: number, nameID: string): number;

/**
* Added entities stores in registry, so already spawned entity
* data may resolved again by requesting information by UID.
* @returns Add-on entity information by entity ID.
*/
function getEntityData(entity: number): AddonEntity;

interface AddonEntity {
/**
* Entity unique ID.
*/
readonly id: number,

/**
* Add-on defined entity name ID.
*/
readonly type: string,

/**
* Executes command with the entity.
* @param command command to be executed
* @returns Error message or null if the command was run successfully.
*/
exec(command: string): Nullable<string>;

/**
* Executes command with the entity on the specified coordinates.
* @param command command to be executed
* @returns Error message or null if the command was run successfully.
*/
execAt(command: string, x: number, y: number, z: number): Nullable<string>;
}
}
Loading

0 comments on commit 3e0a928

Please sign in to comment.