Описание
# Minecarts Load Chunks Mod
A **Fabric mod** that prevents minecarts from getting stuck at unloaded chunk borders by automatically loading chunks as the minecarts travel. It works with **all minecart types**: regular, chest, furnace, and hopper carts, ensuring smooth and uninterrupted transportation across your Minecraft world.
## Features
- **Automatic Chunk Loading:** Loads a **3x3 grid** of chunks around any moving minecart to prevent chunk border issues.
- **Supports All Minecart Types:** Works with **regular minecarts**, **chest minecarts**, **furnace minecarts**, and **hopper minecarts**.
- **Tick-Based Expiry:** Chunks remain loaded for **30 seconds (600 ticks)** after the minecart leaves. This can be changed in the configuration file.
- **Persistent Chunk Data:** Loaded chunks are saved on a **per-world basis** and restored when the server restarts, preventing stranded minecarts even through server reboots.
## How It Works
- The mod scans for **all minecarts** (regular, chest, furnace, and hopper carts) every server tick.
- When a minecart is detected with **nonzero velocity**, it records the tick and forces a **3x3 grid** of chunks around the minecart’s position to be loaded.
- The chunks remain loaded for **30 seconds (600 ticks)**.
- **Persistent storage:** The chunk data is saved to **each world’s save directory** and restored when the world is reloaded, preventing stranded minecarts.
## Configuration
The mod uses a JSON configuration file (`config/minecartsloadchunks.json`) to allow you to customize its behavior. You can modify the settings to suit your needs. Here’s what each configuration option does:
### General Settings
- **`loadChunks`** - Enables or disables the mod entirely. Set this to `false` to disable the mod without removing it. (**Default:** `true`)
- **`spamConsole`** - Enables detailed logging in the console every second for debugging purposes. (**Default:** `false`)
### Chunk Loading Durations
- **`cartLoadDuration`** - Specifies how long (in seconds) each chunk remains loaded after a minecart passes through. (**Default:** `30`)
- **`movementDuration`** - Defines how long (in seconds) a chunk stays loaded after a minecart stops moving. (**Default:** `10`)
### Minecart Type Settings
These settings determine which minecart types can load chunks. Set to `true` to enable chunk loading for specific minecart types:
- **`loadMinecarts`** – Standard minecarts (**Default:** `true`)
- **`loadFurnaceMinecarts`** – Furnace minecarts (**Default:** `true`)
- **`loadChestMinecarts`** – Chest minecarts (**Default:** `true`)
- **`loadHopperMinecarts`** – Hopper minecarts (**Default:** `true`)
- **`loadTntMinecarts`** – TNT minecarts (**Default:** `false`)
- **`loadCommandBlockMinecarts`** – Command block minecarts (**Default:** `false`, disabled to prevent unintended behavior)
## Contributing
Feel free to contribute to this project by:
- Reporting issues
- Submitting pull requests
- Requesting new features
## License
This mod is available under the **MIT License**.
## Credits
- Developed by **Dylan**
- Special thanks to the Minecraft and Fabric communities for making modding such a joy.
- [Github](https://github.com/cpagentboot/MinecartsLoadChunks)