Skip to content

About

Sector Space mod: tiered station-only refinery modules (I-V) with large hoppers that refine ore in O(1).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

StationRefinery

Banner

A mod for Sector Space that adds tiered, station-only Station Refinery modules (I–V) with hoppers far larger than the stock refineries (10 / 20 / 30 / 40 / 50). They refine ore into raw materials using the game's exact per-unit output distribution, without a per-unit loop.

It is an SSFML / Fabric-style mixin mod that hooks into the game at runtime, so no game files are modified permanently.

Source: github.com/jpreed00/StationRefinery

What it does

  • Registers five station-only modules, Station Refinery I–V, and stocks them at NPC Industrial markets. They are not unique — a station can run more than one.
  • Install them on a station; each module pass consumes up to the hopper's worth of the first in-range ore stack and produces the same materials (and waste) the stock refinery would, including tier-gated recipes.
  • Hopper size and efficiency are not item stats in Sector Space — they are hardcoded per id. These modules document the values the mixin actually uses:
Module Hopper Efficiency
Station Refinery I 10 50%
Station Refinery II 20 60%
Station Refinery III 30 70%
Station Refinery IV 40 80%
Station Refinery V 50 90%

Stock refineries top out around hopper 4–5, so these are meant for station-scale ore processing.

How it works (and why it's light on performance)

  • Item registration hooks _database.ItemDatabase.loadDatabase() (tail) and writes the five modules with the 13-arg ModuleList.write(...) (station-only).
  • Market stock hooks game.markets.MarketDatabase.loadDatabase() (tail) and adds market ids 99011–99015 (base id + 90000) to industrial markets.
  • Refine intercepts items.actions.Module.run at HEAD for those ids, runs one aggregated batch (RefineBatch), and cancels the rest of run. Yields are sampled in O(1) via Bernoulli→Binomial aggregation, so a hopper of 50 is no more work than a hopper of 4.

There is no window and no hotkey. Debug chat logging (ore in, materials out) is a compile-time switch: make DEBUG=1 (see below).

Requirements

  • Sector Space >= 0.6.0.2 (may work with older versions; only tested on this one).
  • SSFML (the Sector Space Fabric Mod Loader) with Fabric Loader >= 0.18.4.
  • JDK 25+ (only needed to build from source, not to play).

Installation (players)

  1. Download stationrefinery.jar from GitHub Releases or build from source.
  2. Copy it into the mods\ folder inside your Sector Space install directory, e.g.:
    ...\Steam\steamapps\common\Sector Space\mods\stationrefinery.jar
    
  3. Launch Sector Space (with SSFML installed). The mod loads automatically.

Building from source

The mod compiles against the game's own jars, so the project folder is expected to live inside your Sector Space install directory (alongside Sector Space.jar, SSFML.jar, and libs\):

Sector Space\
├─ Sector Space.jar
├─ SSFML.jar
├─ libs\*.jar
├─ mods\
└─ StationRefinery\        <- this repo
   ├─ stationrefinery\mixin\*.java
   ├─ stationrefinery\refine\*.java
   ├─ fabric.mod.json
   └─ stationrefinery.mixins.json
git clone https://github.com/jpreed00/StationRefinery.git

1. Point to your JDK

Make sure a JDK 25+ javac/jar is on your PATH, or note the path to its bin folder (the bundled Makefile defaults to D:\Java\jdk-25.0.4.1).

2. Build

From the StationRefinery folder:

make

That compiles the sources against the game jars one directory up and packages ..\mods\stationrefinery.jar, ready to load. make run will also launch the game.

make DEBUG=1 compiles debug chat logging in. A plain make strips it.

From the Sector Space directory, make builds every mod that has a Makefile (make DEBUG=1 forwards the flag to mods that support it).

To build by hand instead:

javac -encoding UTF-8 -cp "../Sector Space.jar;../SSFML.jar;../libs/*" -d build/classes stationrefinery/mixin/*.java stationrefinery/refine/*.java
jar --create --file ../mods/stationrefinery.jar -C build/classes . -C . fabric.mod.json -C . stationrefinery.mixins.json

On Linux/macOS, use : instead of ; as the classpath separator.

Project layout

Path Purpose
stationrefinery/mixin/ Mixins: item registry, market stock, refine dispatch
stationrefinery/refine/ Batch refine, recipes, binomial sampler, debug log
fabric.mod.json Mod metadata, dependencies, and mixin registration
stationrefinery.mixins.json Mixin configuration

License

Released under the MIT License.

About

Sector Space mod: tiered station-only refinery modules (I-V) with large hoppers that refine ore in O(1).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages