Warring NationsWarring Nations MC 1.21.1.NEOFORGE.JAVA 21
Wiki/Developer/Adding Siege Mod Support

Adding Siege Mod Support

How WN Siege protects claimed territory against every target mod it covers: the mixin-vs-event-listener decision, the attribution fallback chain, and a section-by-section reference for every mod currently integrated, for anyone auditing a mod or adding support for a new one.

ADDON DEVS

Mixin vs. event listener

Every integration below is either a Mixin module (redirects or injects into a specific method in the target mod's own bytecode, verified against the real installed jar before it's ever applied) or an event listener (a plain NeoForge @SubscribeEvent / NeoForge.EVENT_BUS.addListener hook on an event the target mod already fires itself, no mixin required).

i
The decision rule. A mod needs a mixin specifically because its code writes to the world through a path that never reaches an event Warring Nations (or WN Siege) could otherwise listen to: a raw Level#setBlock/destroyBlock call, a private Explosion subclass, or a network packet handler. If a mod isn't covered by an integration at all, it either already routes every block change through vanilla's own break/place/explosion events, protected for free by Warring Nations' own core protection, described in the architecture overview, or hasn't been audited yet.

See the extension points page for where these hooks plug into WN Siege's own module system, and Configuration: Core for the config section each integration below is gated by.

Attribution: tracing a block change back to a nation

A protected block write is only useful if WN Siege can also say who caused it, so it can apply the right war preset's rules. The pattern repeats across integrations with three fallback tiers, used in whatever order the mod's own data makes available:

Real owner, when tracked

Threaded straight through the mod's own call chain, e.g. Projectile#getOwner() for a vehicle-fired shot, or carried explicitly by a mixin such as CbcProjectileOwnerMixin or CbcTryFiringShotMixin so a shell traces back to its actual gunner.

Controller, then registered owner

A moving Create contraption with no direct owner (disassembly drops, an unmanned munitions-carrying contraption) falls back to its controlling player, then its train's registered owner, then the chunk it currently occupies, in that order.

Chunk owner at impact

Used when a mod tracks no owner anywhere in its own data model, e.g. a BMNW nuke that can drift before detonating, or a Create Nuclear reactor meltdown, credited to the target chunk's owner instead.

Some cases carry no attributable owner at all and no safe chunk-owner fallback either, and are left to fail closed instead: a Create: Gunsmithing Backtank detonation and a Create: Warnautics land mine are both protected against griefing at peace, but not currently breachable by a legitimate wartime attacker either. Ballistix's missile system tracks no owner anywhere in its own data model from launch to impact, so its missiles cannot be attributed at all; fixing that would require new persistent state inside Ballistix's own save schema, something WN Siege can't add from the outside, so it's left as an open, documented gap.

Integration index

Every target mod WN Siege currently protects, its mod id where it differs from the display name, its config section, and whether it's covered by a mixin or an event listener.

Mod
Mod id
Config section
Kind
Create
-
create
mixin
Create Big Cannons
-
createBigCannons
mixin
CBC Military Supplement
cbcmoreshells
cbcMoreShells
mixin
CBC Neo Warfare
cbcmodernwarfare
cbcNeoWarfare
mixin
Create: Warnautics
cbc_more_content
warnautics
event listener
Create Nuclear
createnuclear
explosions (generic)
event listener
Create: Steam 'n' Rails
railways
railways
mixin
Create Aeronautics
aeronautics
aeronautics
mixin
Create: Gunsmithing
cgs
cgs
mixin
NTGL
ntgl
ntgl
mixin
TaCZ
-
tacz
mixin
Superb Warfare
superbwarfare
superbWarfare
mixin
WarBorn Explosives
warbornexplosives
warbornExplosives
mixin
Point Blank
pointblank
pointBlank
mixin
Just Enough Guns
jeg
justEnoughGuns
mixin
ScorchedGuns
scguns
scorchedGuns
mixin
Immersive Weapons
immersiveweapons
immersiveWeapons
mixin
Ballistix
ballistix
ballistix
mixin
BMNW
bmnw
bmnw
mixin
Insane TNT
insanetnt
insaneTnt
mixin
Pyrotechnics
pyrotechnics
pyrotechnics
mixin
Weapons And Tools
weapon_and_tools_
weaponsAndTools
mixin
Sable
-
sable
event listener
Eshan's Missile Mod
modularordinancelite
mol
event listener + mixin
WariumCE
wariumce
warium
event listener

Create: the largest integration

Create's own automation writes blocks in ways vanilla's block-place/break events never see, and covers the widest set of distinct write paths of any integration.

Stationary Drill/Saw terrain removal
  CreateDrillBreakMixin, CreateSawTreeMixin,
  BlockBreakingKineticBlockEntityAccessor

Contraption-mounted Drill/Saw (different base class)
  CreateMovementBreakMixin -> BlockBreakingMovementBehaviour
  (Plough and Roller override destroyBlock but still fall
  through to this base method via super.destroyBlock(...))

Mechanical Roller: clear ahead, pave behind
  CreateRollerBreakMixin, CreateRollerPaveMixin

Harvester / Plough / Dispenser / Deployer
  CreateHarvesterMixin, CreatePloughMixin,
  CreateDispenserMixin, CreateDeployerMixin

Tree felling (all three paths)
  CreateSawTreeMixin (stationary Saw)
  CreateSawMovementTreeMixin (contraption-mounted Saw)
  CreateTreeCutterFilterMixin -> TreeCutterTreeAccessor (vanilla TreeCutter)

Contraption disassembly block drops
  CreateContraptionPlacementMixin (guardContraptionPlacement toggle)
  attributed: controller -> train owner -> chunk owner

Remote-interaction network packets (8, no server-side permission
check before this module):
  CreateClipboardEditPacketMixin
  CreateSuperGlueSelectionPacketMixin
  CreateSuperGlueRemovalPacketMixin
  CreateToolboxEquipPacketMixin
  CreateToolboxDisposeAllPacketMixin
  CreateRadialWrenchMenuSubmitPacketMixin
  CreateBlockEntityConfigurationPacketMixin
  CreateCurvedTrackDestroyPacketMixin

Create only gates the client-side UI for these eight packets (a right-click menu, a wrench), never the packet's server-side handler itself, so a crafted or replayed packet would otherwise reach its handler with zero positional permission check. CreateCurvedTrackDestroyPacketMixin gets its own extra check because a track connection's far end can sit on a different claim than its near end, something the shared block-entity-config gate alone wouldn't catch.

i
Downstream of Create. Two integrations extend Create's own write paths rather than adding new ones: Create: Steam 'n' Rails' Roller extension (RailwaysTrackReplacePaverMixin) diverts around Create's normal Roller-paving path the create module already gates. Create Aeronautics needs a mixin only for its Levitite Blend catalyzer packet (AeronauticsLevititeCrystallizePacketMixin), which carries a client-supplied block position with no distance or permission check; everything else it adds (balloons, propellers, hot-air burner, mounted potato cannon) mutates no blocks. Aeronautics ship interaction itself is covered separately by the Sable module below, since Aeronautics ships are built on Sable's own sub-level engine.

Create Big Cannons and its family

Four separate mods build on Create Big Cannons' munitions system, each requiring its own module since none of them call CBC's own canDamageTerrain choke point.

Create Big Cannons itself filters cannon/autocannon shell and bullet penetration (CbcBigCannonPenetrationMixin, CbcAutocannonPenetrationMixin), shrapnel bursts (CbcShrapnelMixin, CbcShrapnelBurstAttributionMixin), and shell explosions (CbcExplosionMixin) per affected block rather than all-or-nothing, with CbcTryFiringShotMixin and CbcProjectileOwnerMixin carrying attribution through the firing chain. Its cannon-welder network packet (CbcWelderPacketMixin) carries two client-supplied block positions with no distance check of its own. CC:CBC (the ComputerCraft compat addon) is covered for free since it only remote-fires the already-gated CBC cannon mounts.

CBC Military Supplement

Reimplements block penetration itself rather than calling CBC's hook: dual-cannon shells, racked rockets/bombs, normal shells, the anti-air machine gun's rounds, all three torpedo variants (attribution and burst), and incendiary fire spread across all three shell-body variants, each checked at its own destruction site.

CBC Neo Warfare

Its Big Cannon shells and autocannon rounds extend CBC's already-gated classes for free. Its Medium Cannon shell (CbcnwMediumCannonPenetrationMixin) is a sibling class, not a descendant, and needs its own raw-setBlock gate, as does its unmanned munitions-carrying Create contraption (CbcnwMunitionsContraptionPenetrationMixin).

Create: Warnautics

The one CBC-family mod covered by a real event, not a mixin: it fires its own cancellable WarnauticsBlockDetonateEvent, handled by WarnauticsExplosionHandler. Its small-shrapnel mine variant routes through CBC's own explosion handler instead and is covered by the Create Big Cannons module.

Sable: ship sub-level coordinate translation

A structurally different problem from every other integration: not an unfiltered block write, but block interactions that resolve to the wrong world position entirely.

Right-click, left-click, and block-break aimed at a block on a moving ship's own detached sub-level never resolve to the world position that block actually occupies unless something explicitly translates the coordinates. By default this lets a player fly a ship over a claim and interact with or break its blocks completely unprotected. WnSiegeSableHandler (event listener, no mixin, referencing Sable's own API types directly) resolves that local position to its real world position before claim rules apply, ported from the reference implementation in the CurseForge addon "FTB Chunks: Sable Aerospace," which solves the identical problem for FTB Chunks directly. It also covers Create Aeronautics ship interaction for free, since Aeronautics ships are built on Sable's own sub-level engine.

!
Known gaps. Sable does not cover ship movement into a claim, or ship-borne weapon fire; no reference implementation exists for either to port from, so both remain open, documented gaps. It also has no concept of ship ownership independent of the land underneath it, so a player's own ship is denied the same as a stranger's while parked over neutral foreign territory specifically; every other case (unclaimed, allied, wartime enemy) already resolves correctly.

WariumCE: an experimental upstream event

A cautionary example for anyone integrating a mod whose maintainer hasn't shipped the needed hook publicly yet.

WariumCE, a large MCreator-generated military/artillery mod, has every weapon and explosion procedure's block writes checked through the mod's own WariumBlockAlterEvent via WariumBlockAlterHandler, attributed to the firing entity where one is tracked and falling back to the target chunk's owner otherwise. That event only exists on a WariumCE build carrying an unmerged upstream patch (branch wn-siege-block-event-integration) that the maintainer added on request but has not yet released publicly. Loading the handler class against any real public WariumCE release throws NoClassDefFoundError; WN Siege catches exactly that case and disables just this one module with a log warning, leaving every other module running normally, rather than crashing the server or silently failing to protect. WariumCE block edits during sieges stay unenforced on any server not running that maintainer's private fork, despite warium.enabled defaulting to true and appearing as a normal toggle, until that branch ships in a public release.

Checked, nothing needed

Some mods get audited and turn out to need no integration at all, either because they already route every block change through vanilla's own event chain (protected for free), or because they add no block-mutating mechanic in the first place.

AUDITED, NO MODULE NEEDED

Better Weaponry (melee only), Guns Craft: Reforged (projectiles don't alter blocks), TNT Grenades! (vanilla primed TNT, already owner-tagged by the entity that threw it).

A number of individual weapons and mines inside covered mods land in the same bucket at the per-item level rather than the whole-mod level: TaCZ's and Immersive Weapons' explosive ammo/grenades, most of Superb Warfare's and WarBorn Explosives' non-mine ordnance, and Pyrotechnics' non-Sticky-Grenade explosives all already route through a real vanilla explosion or an already-covered choke point, so no per-item mixin is needed for them.