|
| 1 | +# Conduit Registry Event |
| 2 | + |
| 3 | +This event allows you to register custom conduits. |
| 4 | + |
| 5 | +**It is a server event and reloadable!** |
| 6 | +Keep in mind that server events have to be located inside the `kubejs/server_scripts` folder. |
| 7 | + |
| 8 | +## Overview |
| 9 | + |
| 10 | +EnderIO for 1.21.1 and above supports data-driven conduits by default. This event adds convenience methods to register custom conduits via KubeJS. |
| 11 | + |
| 12 | +It automatically generates the required JSON files for the conduit as well as the language file entry. The only thing you have to provide is a texture |
| 13 | +for your custom conduit. |
| 14 | + |
| 15 | +- access in a server script via: `EnderIOEvents.conduits` |
| 16 | +- supported conduits |
| 17 | + - energy conduit |
| 18 | + - fluid conduit |
| 19 | + - chemical conduit (Mekanism) |
| 20 | + - ME conduit (Applied Energistics 2) |
| 21 | + |
| 22 | +## Registration |
| 23 | + |
| 24 | +To register a custom conduit, the first thing you need to do is to open an event listener for the `conduits` event in a server script. |
| 25 | + |
| 26 | +```js |
| 27 | +EnderIOEvents.conduits(event => { |
| 28 | + // ... |
| 29 | +}) |
| 30 | +``` |
| 31 | + |
| 32 | +After that, use one of the following methods to register the respective conduit type. All conduits need an `id` that is used as the registry name and a |
| 33 | +`name` that is used for the automatic language file entry generation. |
| 34 | + |
| 35 | +The custom conduit will be part of the normal EnderIO Conduits creative tab. Recipes are **not** generated automatically. You have to add a recipe |
| 36 | +for your custom conduits yourself! |
| 37 | + |
| 38 | +### Energy Conduit |
| 39 | + |
| 40 | +- `transferRate` - specifies the transfer rate of energy per tick |
| 41 | + |
| 42 | +```js |
| 43 | +EnderIOEvents.conduits(event => { |
| 44 | + event.registerEnergyConduit(String id, String name, int transferRate); // [!code focus] |
| 45 | +}); |
| 46 | +``` |
| 47 | + |
| 48 | +### Fluid Conduit |
| 49 | + |
| 50 | +- `transferRate` - specifies the transfer rate of fluid per tick |
| 51 | +- `multiFluid` - specifies whether the conduit can transport multiple fluids at once |
| 52 | +- `supportPriority` - specifies whether the conduit supports priority settings |
| 53 | + |
| 54 | +```js |
| 55 | +EnderIOEvents.conduits(event => { |
| 56 | + event.registerFluidConduit(String id, String name, int transferRate, boolean multiFluid, boolean supportPriority); // [!code focus] |
| 57 | +}); |
| 58 | +``` |
| 59 | + |
| 60 | +### Chemical Conduit |
| 61 | + |
| 62 | +- `transferRate` - specifies the transfer rate of chemical per tick |
| 63 | +- `multiChemical` - specifies whether the conduit can transport multiple chemicals at once |
| 64 | + |
| 65 | +```js |
| 66 | +EnderIOEvents.conduits(event => { |
| 67 | + event.registerChemicalConduit(String id, String name, int transferRate, boolean multiChemical); // [!code focus] |
| 68 | +}); |
| 69 | +``` |
| 70 | + |
| 71 | +### ME Conduit |
| 72 | + |
| 73 | +- `color` - specifies the AE2 color conduit transports channels for |
| 74 | + - this needs to be a value from the `AEColor` enum, for universal color use `TRANSPARENT` |
| 75 | + - possible values: `BLACK`, `BLUE`, `BROWN`, `CYAN`, `GRAY`, `GREEN`, `LIGHT_BLUE`, `LIGHT_GRAY`, `LIME`, `MAGENTA`, `ORANGE`, `PINK`, `PURPLE`, `RED`, `TRANSPARENT`, `WHITE`, `YELLOW` |
| 76 | +- `dense` - specifies whether the conduit is a dense ME conduit (32 channels) or a normal one (8 channels) |
| 77 | + |
| 78 | +```js |
| 79 | +EnderIOEvents.conduits(event => { |
| 80 | + event.registerMeConduit(String id, String name, String color, boolean dense); // [!code focus] |
| 81 | +}); |
| 82 | +``` |
| 83 | + |
| 84 | +## Texture |
| 85 | + |
| 86 | +After registering the custom conduit inside the event, the language file as well as the model file are automatically generated. The |
| 87 | +only things you have to provide are the textures. |
| 88 | + |
| 89 | +### Block Texture |
| 90 | + |
| 91 | +For the block of the conduit, the texture file needs to be placed inside the following directory: |
| 92 | +`kubejs/assets/enderio/textures/block/conduit` |
| 93 | + |
| 94 | +It needs to have the same name as the `id` parameter you used when registering the custom conduit. Make sure it's a valid `.png` file. |
| 95 | +You can download a template PSD file [here](files/conduit.psd). |
| 96 | + |
| 97 | +### Conduit Icon |
| 98 | + |
| 99 | +For the icon inside the conduit GUI, you need to provide an additional texture file. It has to be placed in the following directory: |
| 100 | +`kubejs/assets/enderio/textures/conduit_icon` |
| 101 | + |
| 102 | +Once again, the texture should have the same name as your conduit `id`. Make sure to crop the texture accordingly so it only consists of the actual icon. |
| 103 | + |
| 104 | +## Example |
| 105 | + |
| 106 | +In this example, we add the _Stellar Energy Conduit_ with the id `enderio:stellar_conduit` and a transfer rate of `50000` RF/t. |
| 107 | + |
| 108 | +```js |
| 109 | +EnderIOEvents.conduits(event => { |
| 110 | + event.registerEnergyConduit("stellar_conduit", "Stellar Energy Conduit", 50000) |
| 111 | +}) |
| 112 | +``` |
| 113 | + |
| 114 | +Texture: |
| 115 | + |
| 116 | + |
| 117 | +Creative Tab: |
| 118 | + |
| 119 | + |
| 120 | +Connection: |
| 121 | + |
| 122 | + |
| 123 | +GUI: |
| 124 | + |
0 commit comments