Описание
#  PowerStones
Minecraft mod with overlapping wires of Redstone, Bluestone, Greenstone and Yellowstone

Copyright (c) 2023-2026 CalvinMT
## Dependencies
Mods needed to be installed in order for PowerStones to function correctly:
### Fabric
| Mod | Reason |
| ------------- | ------ |
| [Fabric API] | Essential for Fabric mods to work. |
| [FerriteCore] | Enables Minecraft to load with the default number of RAM, instead of 12GB which requires the addition of an argument (-Xmx12G). |
[Fabric API]: https://modrinth.com/mod/fabric-api
[FerriteCore]: https://modrinth.com/mod/ferrite-core
### Forge
| Mod | Reason |
| ------------- | ------ |
| [FerriteCore] | Enables Minecraft to load with the default number of RAM, instead of 12GB which requires the addition of an argument (-Xmx12G). |
## Compatibility
PowerStones is compatible with other redstone mods, such as Red Bits or Redstone Bits.
It is intended to make PowerStones compatible with as much other mods as possible, but this will take some time.
If there is a mod that you like which seems incompatible with PowerStones, please make an new issue on GitHub using the "Mod compatibility request".
## Features
### Functionalities
- Four independent wire colours are available: **Redstone**, **Bluestone**, **Greenstone**, and **Yellowstone**, each carrying its own separate power signal.
- Powerstone wires can **overlap in pairs**, allowing two independent wire colours to occupy the same block **without interfering** with each other.
- Each wire colour **only connects** to and receives power from wires, blocks, torches, repeaters, comparators, and other redstone components **of the same colour**.
- **Redstone Repeaters** can **transfer power** from one wire colour to another, allowing controlled interaction between otherwise independent circuits.
- Breaking a wire while **holding a powerstone dust item** only removes wire channels matching the colour of the item held, making it easy to edit overlapping wires without disturbing the other channel.
### Blocks and items
| Name | Image | Crafting recipes |
| ----------------- | ----- | ---------------- |
| Redstone | | |
| Bluestone | |
| Greenstone | |
| Yellowstone | |
| Bluestone Block | |
| Greenstone Block | |
| Yellowstone Block | |
| Bluestone Torch | |
| Greenstone Torch | |
| Yellowstone Torch | |
## Implementation process and limitations
The initial idea was to be able to place all four powerstone wires on a single block. This meant that the redstone wire block would have had more than 5 308 416 states (3x3x3x3x16x16x16x16) compared to its unmoded version of 1 296 states (3x3x3x3x16). As all states of all the game's blocks are computed on startup, this would have taken more computation time and memory than a computer can handle.
In order to keep the initial idea, an effort was made to limit the powerstone's power to two states (0-1), instead of sixteen (0-15). This lowered the number of states for the redstone wire block down to its unmoded version of 1 296 states (3x3x3x3x2x2x2x2). However, this number of states would not have been final as more would have been added to display all possible connections. Eventually, the implementation proved itself too complicated and unreasonable to continue, as it required an overhaul of the redstone wire block's power updates and removed all vanilla redstone functionalities related to redstone power levels.
The idea of having overlappable powerstones still viewed as a goal, an attempt to first add bluestone on top of redstone was made with success through the addition of another power property and the incrementation of both power properties by one. Thus, the number of states for the redstone wire block was of 23 409 (3x3x3x3x17x17), which only added a couple of seconds more to the loading time.
Extending the mod with greenstone and yellowstone wires could not have been achieved through the addition of two more power properties for the same reason as stated in the initial idea (too many states). The choice had then been made to make wires overlappable by pairs. Redstone wires would be overlappable with bluestone wires, while greenstone wires would be overlappable with yellowstone wires. This was easily achievable through the addition of a single property with two states (one state per pair of powerstones), ending with a number of states for the redstone wire block of 46 818 (3x3x3x3x17x17x2). Adding this basic property rendered the game's startup slower (~1mn30s). However, with higher concern, the number of memory (RAM) needed in order for the game to load every state approximated 12GB. Even if asking users to add a simple Java argument in the Minecraft's launcher to extend the maximum amount of allocated memory to the game is done for other mods, 12GB of memory is huge in comparison to the small addition this mod would have brought to the game.
As the powerstone pair property seemed like a good settle point to bring the project as close to the initial goal as it could have after six weeks of learning and developping, the decision was taken to find a mod which could considerably reduce the amount of memory allocated to run the game with PowerStones. After a quick search, [FerriteCore] seemed adequate and, against all expectations, made it possible for the game to run with PowerStones wihtout changing the maximum amount of allocated memory (