Skip to content

Commit

Permalink
Datapack porting
Browse files Browse the repository at this point in the history
  • Loading branch information
CommandrMoose committed Apr 25, 2024
1 parent 225df17 commit eb5f51f
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 1 deletion.
Binary file added Writerside/images/console_patterns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/desktop_basic_structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/shell_change_gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/shell_patterns.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions Writerside/topics/Console-Unit-Patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Console Unit Patterns

A console unit design can be modified by interacting with a Console Configurator on the side of a console using the Pattern Manipulator item. Users can select from a range of available patterns and designs to customize the look of their console unit.

## Datapack

### File Structure
Console patterns follow the following structure:
```
* data
* [your_datapack_pack_namespace]
* tardis_refined
* patterns
* console
* [console_theme_id].json
```

### Pattern JSON

Inside the datapack you need to create a ``.json`` file to define the properties of the Console Pattern.

The name of this JSON file MUST match the name of the shell theme you are modifying. E.g. If you are modifying the Copper Console theme you must use its id of copper.

> To see the list of Console theme IDs, you can find them inside the mod's JAR file using a computer program such as 7zip. The directory inside the JAR file is data/tardis_refined/tardis_refined/patterns/console.
A JSON must follow the following structure:

``copper.json``
```json
{
"patterns": [
{
"id": "example:copper",
"name_component": "{\"color\":\"yellow\",\"text\":\"Copper\"}",
"texture_definition": {
"emissive": true,
"texture": "tardis_refined:textures/patterns/console/copper/copper_console.png"
}
},
{
"id": "example:sculk",
"name_component": "{\"color\":\"yellow\",\"text\":\"Sculk\"}",
"texture_definition": {
"emissive": false,
"texture": "example:textures/patterns/console/copper/copper_console_sculk.png"
}
}
]
}
```

## Resource Pack
You also need to create a Minecraft Resource Pack that contains all the textures you will be using in each pattern.

The structure of the resource pack should match what you have defined in the pattern JSON.

Example:

For instance, in the ``example:sculk`` example of the example patterns shown above, the texture path is defined as:

``example:textures/patterns/console/copper/copper_console_sculk.png``

This means our Resource pack that contains the texture file will need to be structured according to the full path, like so:

```
* assets
* example
* textures
* patterns
* console
* copper_console_sculk.png
```

> NOTE: The image file MUST be a .png file type because Minecraft will only accept these type of image files.
### Emissive Texture Files

You can allow your Patterns to be emissive, meaning it will glow in the dark like Minecraft Glow Squids!

This is disabled by default, however you can enable it by using the following steps:

1. Inside the pattern JSON file, set the ``emissive`` field for the texture object of a Pattern to be ``true``.
2. Rename the texture file to append the word ``_emissive`` to the end. You MUST use this exact spelling or the texture won't be picked up by the mod. i.e. ``copper_console_sculk.png`` --> ``copper_console_sculk_emissive.png``
72 changes: 72 additions & 0 deletions Writerside/topics/Desktops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Desktops

Through the use of Datapacks, it is possible to implement custom desktops which can be taken from the save file and reused in other areas.

## Datapack Work


### Requirements
In order to create desktop, there are only two requirements.

1. The TARDIS Door
2. The Airlock Generator

```
/give @p tardis_refined:air_lock_generator
```

The Airlock Generator will place the airlock upon generating the desktop. It will be placed SOUTH of the block.

![desktop_basic_structure.png](desktop_basic_structure.png)


### Desktop Export Command

As a handy tool, we have provided the following command. This command will generate all the required datapack files for a new desktop, and automatically load it into the datapack folder of the world save so you don't have to!

```
/tardis_refined data export desktop <X1> <Y1> <Z1> <X2> <Y2> <Z2> <include_entities> <name_space> <desktop_id> <datapack_name> <display_name>
```

``X1, Y1, Z1``
: A BlockPos, the first corner of the built structure.

``X2 Y2 Z2``
: A BlockPos, the direct opposite corner of the built structure.

``include_entities``
: True or False, Includes saving entities in the structure. Can be useful for if item frames or armor stands are present in the build.

``name_space``
: String, The namespace of the datapack.
: Examples: ``tardis_refined_tweaks``, ``panda``

``desktop_id``
: String, Unique identifier for the desktop.
: Examples: ``neon``, ``hartnell_lounge``

``datapack_name``
: String, Name of the datapack.
: Examples: ``cool_pack``, ``custom_name_here``

``display_name``
: NBTComponent, Display Text for the UI.
: ONLY USE the Minecraft Tellraw generated text, DO NOT include the tellraw command syntax. <a href="https://www.minecraftjson.com/">You can find a generator here.</a>
: Example: ``{\"color\":\"gold\",\"text\":\"Copper\"}``

## Resource Pack
### Desktop Preview Texture
By default, the desktop preview texture will show a placeholder texture. If you want to show a texture for the desktops, you need to create a Minecraft Resource Pack that follows the following structure:

```
* assets
* [your_resource_pack_namespace]
* textures
* ui
* desktops
* [your_desktop_id].png
```

>Note: It is very important that this EXACT folder structure is used, because Tardis Desktops will only look from this exact type of folder structure.
>
> {style="warning"}
99 changes: 99 additions & 0 deletions Writerside/topics/External-Shell-Patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Shell Patterns

The external shell of the Tardis can be customised in the External Shell Selection Screen, which can be accessed from the Computer Bank Control on a Tardis Console unit.

![shell_change_gui.png](shell_change_gui.png)

This feature provides users the ability to match their console with their personal preferences and style.

![shell_patterns.png](shell_patterns.png)

## Datapack

### File Structure
Shell patterns follow the following structure:
```
* data
* [your_datapack_pack_namespace]
* tardis_refined
* patterns
* shell
* [shell_theme_id].json
```

### Pattern JSON

Inside the datapack you need to create a ``.json`` file to define the properties of the Shell Pattern.

The name of this JSON file MUST match the name of the shell theme you are modifying. E.g. If you are modifying the Police Box Shell theme you must use its id of police_box.

> To see the list of Shell theme IDs, you can find them inside the mod's JAR file using a computer program such as 7zip. The directory inside the JAR file is data/tardis_refined/tardis_refined/patterns/shell.
The JSON structure for Shell Patterns differ slightly from that of Console Patterns, most notably, the exterior and interior fields, which define the texture for the Exterior Shell and Internal Door model respectively.

``police_box.json``
```json
{
"patterns": [
{
"id": "example:police_box_green",
"exterior": {
"emissive": false,
"texture": "example:textures/blockentity/shell/police_box/police_box_green.png"
},
"interior": {
"emissive": false,
"texture": "example:textures/blockentity/shell/police_box/police_box_green_door.png"
},
"name_component": "{\"color\":\"yellow\",\"text\":\"Green\"}"
},
{
"id": "example:missing_key",
"exterior": {
"emissive": false,
"texture": "example:textures/blockentity/shell/police_box/missing_key.png"
},
"interior": {
"emissive": false,
"texture": "example:textures/blockentity/shell/police_box/missing_key_door.png"
},
"name_component": "{\"color\":\"yellow\",\"text\":\"Missing Key\"}"
}
]
}
```

## Resource Pack
You also need to create a Minecraft Resource Pack that contains all the textures you will be using in each pattern.

The structure of the resource pack should match what you have defined in the pattern JSON.

Example:

For instance, in the ``example:missing_key`` example of the example patterns shown above, the texture path is defined as:

``example:textures/patterns/shell/police_box/missing_key.png``
``example:textures/patterns/shell/police_box/missing_key_door.png``

This means our Resource pack that contains the texture file will need to be structured according to the full path, like so:

```
* assets
* example
* textures
* patterns
* shell
* missing_key.png
* missing_key_door.png
```

> NOTE: The image file MUST be a .png file type because Minecraft will only accept these type of image files.
### Emissive Texture Files

You can allow your Patterns to be emissive, meaning it will glow in the dark like Minecraft Glow Squids!

This is disabled by default, however you can enable it by using the following steps:

1. Inside the pattern JSON file, set the ``emissive`` field for the texture object of a Pattern to be ``true``.
2. Rename the texture file to append the word ``_emissive`` to the end. You MUST use this exact spelling or the texture won't be picked up by the mod. i.e. ``missing_key.png`` --> ``missing_key_emissive.png``
8 changes: 8 additions & 0 deletions Writerside/topics/Patterns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Patterns

## What are Patterns?
Patterns allow you to customise the existing texture of a Tardis Console Unit or External Shell.

![console_patterns.png](console_patterns.png)

![shell_patterns.png](shell_patterns.png)
3 changes: 3 additions & 0 deletions Writerside/topics/Piloting-the-TARDIS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Piloting the TARDIS

Start typing here...
9 changes: 8 additions & 1 deletion Writerside/tr.tree
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<toc-element topic="Locating-a-TARDIS-Seed.md"/>
<toc-element topic="Your-TARDIS.md"/>
<toc-element topic="The-Eye-of-Harmony-Power.md"/>
<toc-element topic="Piloting-the-TARDIS.md"/>
<toc-element topic="Upgrades-and-Functions.md"/>
</toc-element>
<toc-element topic="Blocks.md">
Expand All @@ -36,7 +37,13 @@
<toc-element topic="Pattern-Manipulator.md"/>
<toc-element topic="Growth-Drill.md"/>
</toc-element>
<toc-element topic="Datapack-Customisation.md"/>
<toc-element topic="Datapack-Customisation.md">
<toc-element topic="Desktops.md"/>
<toc-element topic="Patterns.md">
<toc-element topic="Console-Unit-Patterns.md"/>
<toc-element topic="External-Shell-Patterns.md"/>
</toc-element>
</toc-element>
<toc-element topic="Contributing-to-this-Wiki.md"/>

</instance-profile>

0 comments on commit eb5f51f

Please sign in to comment.