Skip to content
Aithor Dev

Factory Core

On this page

FactoryCore Tax Routing

When a FactoryCore factory sits inside a nation's claimed territory, the tax its owner pays in FactoryCore's tax system can be forwarded into that nation's treasury instead of disappearing.

The two-key switch

Both plugins must have the integration enabled before any money moves:

YAML
# NationCore β€” config.yml
integration:
  factory-tax:
    enabled: true
YAML
# FactoryCore β€” its own config
integration:
  nation-tax:
    enabled: true

This is deliberate: neither server operator can be surprised by money suddenly appearing in a treasury.

Settings (NationCore side)

YAML
integration:
  factory-tax:
    enabled: true
    share-percent: 100.0
    max-per-payment: 0.0
    log: true
Key Default Meaning
enabled true Master switch for accepting routed factory taxes
share-percent 100.0 Percentage of each payment banked into the owning nation's treasury (0–100, clamped). The remainder behaves exactly as before β€” consumed by FactoryCore
max-per-payment 0.0 Anti-abuse cap: the most a single payment may add to a treasury. 0 disables the cap
log true Write every routed payment to the console for auditing

How a payment is processed

Every routed payment passes through these gates on the NationCore side:

  1. Enabled β€” the operator switch must be on.
  2. Sane amount β€” positive, finite, not NaN.
  3. Valid location β€” the location exists and its world is loaded.
  4. Claimed land β€” the chunk must actually belong to a nation.

Then the amount is computed:

Text
amount = gross Γ— (share-percent / 100)
amount = min(amount, max-per-payment)   # when the cap is enabled
amount = floor(amount Γ— 100) / 100      # strip floating-point dust

The result is deposited into the owning nation's treasury as TAX_INCOME, with the description Factory tax (<label>) and the payer's UUID recorded in the ledger.

The method returns how much was actually banked β€” 0.0 if the integration is off, the land is unclaimed, or any guard trips. It never throws.

Why policy lives in NationCore

All of it β€” the enable flag, the revenue share, the per-payment cap, the audit log β€” lives on the side that owns the treasury. An outdated or misbehaving FactoryCore can never move more money than the server operator has authorised.

Console output

With log: true, each routed payment produces a line like:

Text
[FactoryTax] Routed $1,250.00 from factory 'smelter-04' into the treasury of nation 'Avalon' (payer 3f1a...).

Failures to deposit are logged as warnings.

Land permits

FactoryCore also participates in the land-use permit system: before it carves out a new factory region on claimed ground, it asks NationCore whether the player may build there. See Land Permit Integration.

Search documentation

    Type to start searching.