# API Usage

**This page will describe how use the API from** <img src="/files/kE0XyFAw8w7bM8FId4bb" alt="" data-size="line"> **Create Encased**

:warning: Warning: All of these methods doesn't generate blockstates, models or textures, you need to do them manually

***

## Available Features

### Casing Related Methods

<details>

<summary>Casing</summary>

**Definition** : `createCasing(registrate,name,connectedTexturesSprite)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing

**Returns :** *BlockEntry\<CasingBlock>* — The Block Entry of the Casing

**Example :**

```java
CreateCasingApi.createCasing(
    Create.REGISTRATE,
    "andesite",
    AllSpriteShifts.ANDESITE_CASING
)
```

</details>

<details>

<summary>Encased Shaft</summary>

**Definition** : `createEncasedShaft(registrate,name,casing,connectedTexturesSprite)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `casing` *Supplier\<Block>* — Supplier of the casing block applied to the shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing

**Returns :** *BlockEntry\<PublicEncasedShaftBlock>* — The Block Entry of the Encased Shaft

**Example :**

```java
CreateCasingApi.createEncasedShaft(
    Create.REGISTRATE,
    "andesite",
    () -> AllBlocks.ANDESITE_CASING.get(),
    AllSpriteShifts.ANDESITE_CASING
)
```

</details>

<details>

<summary>Encased Cogwheel</summary>

**Definition** : `createEncasedCogwheel(registrate,name,casing,connectedTexturesSprite,verticalCogwheelSide,horizontalCogwheelSide)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `casing` *Supplier\<Block>* — Supplier of the casing block applied to the shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing
* `verticalCogwheelSide` *CTSpriteShiftEntry* — The sprite for the vertical side of the cogwheel
* `horizontalCogwheelSide` *CTSpriteShiftEntry* — The sprite for the horizontal side of the cogwheel

**Returns :** *BlockEntry\<PublicEncasedCogwheelBlock>* — The Block Entry of the Encased Cogwheel

**Example :**

```java
CreateCasingApi.createEncasedCogwheel(
    Create.REGISTRATE,
    "andesite",
    () -> AllBlocks.ANDESITE_CASING.get(),
    AllSpriteShifts.ANDESITE_CASING,
    AllSpriteShifts.ANDESITE_ENCASED_COGWHEEL_SIDE,
    AllSpriteShifts.ANDESITE_ENCASED_COGWHEEL_OTHERSIDE
)
```

</details>

<details>

<summary>Encased Large Cogwheel</summary>

**Definition** : `createEncasedLargeCogwheel(registrate,name,casing,connectedTexturesSprite)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `casing` *Supplier\<Block>* — Supplier of the casing block applied to the shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing

**Returns :** *BlockEntry\<PublicEncasedCogwheelBlock>* — The Block Entry of the Encased Large Cogwheel

**Example :**

```java
CreateCasingApi.createEncasedLargeCogwheel(
    Create.REGISTRATE,
    "andesite",
    () -> AllBlocks.ANDESITE_CASING.get(),
    AllSpriteShifts.ANDESITE_CASING
)
```

</details>

<details>

<summary>Encased Pipe</summary>

**Definition** : `createEncasedPipe(registrate,name,casing,connectedTexturesSprite)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `casing` *Supplier\<Block>* — Supplier of the casing block applied to the shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing

**Returns :** *BlockEntry\<PublicEncasedPipeBlock>* — The Block Entry of the Encased Pipe

:warning: **Warning** : This method doesn't create an item because Create doesn't offer the possibility to do it

**Example :**

```java
CreateCasingApi.createEncasedPipe(
    Create.REGISTRATE,"andesite",
    () -> AllBlocks.ANDESITE_CASING.get(),
    AllSpriteShifts.ANDESITE_CASING
)
```

</details>

<details>

<summary>Gearbox</summary>

**Definition** : `createGearbox(registrate,name,connectedTexturesSprite,shouldGenerateVerticalItem)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the casing in your shaft
* `connectedTexturesSprite` *CTSpriteShiftEntry* — The sprite with the connected texture of your casing
* `shouldGenerateVerticalItem` *boolean* — Whether to generate a vertical item for the gearbox

**Returns :** *BlockEntry\<ApiGearboxBlock>* — The Block Entry of the Gearbox

**Example :**

```java
CreateCasingApi.createGearbox(
    Create.REGISTRATE,
    "andesite",
    AllSpriteShifts.ANDESITE_CASING,
    true
)
```

</details>

<details>

<summary>Depot</summary>

**Definition** : `createDepot(registrate, name)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the depot (e.g. andesite)

**Returns :** *BlockEntry\<ApiDepotBlock>* — The Block Entry of the Depot

**Example :**

```java
CreateCasingApi.createDepot(
    Create.REGISTRATE,
    "andesite"
)
```

</details>

<details>

<summary>Mixer</summary>

**Definition** : `createMixer(registrate, name)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the mixer (e.g. andesite)

**Returns :** *BlockEntry\<ApiMixerBlock>* — The Block Entry of the Mixer

**Example :**

```java
CreateCasingApi.createMixer(
    Create.REGISTRATE,
    "andesite"
)
```

</details>

### Shaft and Cogwheels Related Methods <a href="#casing-related-methods" id="casing-related-methods"></a>

<details>

<summary>Small Cogwheel</summary>

**Definition** : `createSmallCogwheel(registrate, name)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the cogwheel (e.g. andesite)

**Returns :** *BlockEntry\<ApiCogwheelBlock>* — The Block Entry of the Small Cogwheel

**Example :**

```java
CreateCasingApi.createSmallCogwheel(
    Create.REGISTRATE,
    "andesite"
)
```

</details>

<details>

<summary>Large Cogwheel</summary>

**Definition** : `createLargeCogwheel(registrate, name, shaftlessModel)`

**Parameters :**

* `registrate` *CreateRegistrate* — The registrate of your mod
* `name` *String* — The name of the cogwheel (e.g. andesite)
* `shaftlessModel` *PartialModel* — The model used when the cogwheel is shaftless

**Returns :** *BlockEntry\<ApiCogwheelBlock>* — The Block Entry of the Large Cogwheel

**Example :**

```java
CreateCasingApi.createLargeCogwheel(
    Create.REGISTRATE,
    "andesite",
    AllPartialModels.SHAFTLESS_LARGE_COGWHEEL
)
```

</details>

<details>

<summary>For Custom Shafts</summary>

**Definition** : `forCustomShafts(action)`

**Parameters :**

* `action` *Consumer\<BlockEntry\<? extends ShaftBlock>>* — A consumer that will receive each registered custom shaft

**Returns :** *void* — This method is used for performing an action on all custom shafts registered via the API

**Example :**

```java
CreateCasingApi.forCustomShafts(shaft -> {
    // do something with each shaft
});
```

</details>

***

## Additional informations

Takes in note that these methods can change at any time and may not work as intended for some peoples

The datagen will be added to these methods in a future update.

It's recommanded to use these method with the registrate from Create Encased (`CreateCasing.REGISTRATE`) because the stress config verify if the block is from the mod.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iglee.fr/encased/api-usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
