SortSavvy

SortSavvy

16 Downloads

Contributors Forks Stargazers Issues


Logo

SortSavvy

A fabric mod to organize and have fun with sorting systems

· Report Bug · Request Feature ·

About The Project

I wrote this mod for a server my friends and I play on. We want to build an awesome sorting system with some extended functionality.

The current features are:

  • Adding a block that exposes the content of a chest via a rest API

Installation

Download the jar file from CurseForge or install it directly in the launcher.

Blocks

QuantumChestReader

QuantumChestReader

Crafting

QuantumChestReaderRecipe

API

Port for now 8082

APIExample

Authentication

All endpoints need to be called with a bearer token.

Authorization: Bearer <token>

GET /quantum-chest-reader/{quantumChestReaderId}

Get a QuantumChestReader results based on the provided ID.

200 OK request successful

Returns QuantumChestReaderResponse

400 BAD REQUEST parameter was not provided

Returns ErrorResponse with

{
    "error": "id-parameter-not-provided",
    "message": "ID parameter not provided"
}

404 NOT FOUND QuantumChestReader with the provided it not found

Returns ErrorResponse with

{
    "error": "id-no-found",
    "message": "QuantumChestReader with ID $quantumChestReaderId not found"
}

404 NOT FOUND inventory not found

Returns ErrorResponse with

{
    "error": "no-inventory-found",
    "message": "No inventory found at x=$x y=$y z=$z",
    "context": {
        "x": 12,
        "y": 64,
        "z": 12
    }
}

GET /quantum-chest-reader/all

Get all QuantumChestReader results.

200 OK request successful

Returns array of QuantumChestReaderResponse

Interfaces

Coordinates

interface Coordinates {
  x: number;
  y: number;
  z: number
}

QuantumChestReaderScannedContent

interface QuantumChestReaderScannedContent {
    id: string;
    amount: number;
    category?: string;
    durability?: number;
    damage?: number;
    enchantments?: unknown[]; // Did not looked up the structure but the java class is 'NbtElement'
}

QuantumChestReaderResponse

interface QuantumChestReaderResponse {
  quantumChestReaderId: string;
  quantumChestReaderCoordinates: Coordinates;
  primaryInventoryCoordinates?: Coordinates;
  secondaryInventoryCoordinates?: Coordinates;
  scannedContent: QuantumChestReaderScannedContent[]
}

ErrorResponse

interface Coordinates {
  error: string;
  message: string;
  context?: unknown;
}

TODO

  • Add filter organize block
  • Add command to rescan all placed QuantumChestReaders
  • Add support for other dimensions

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Luis Beu - [email protected]