Scope
Add a server-configurable setting that allows enemy factions to use explosives (TNT, etc.) in each other's claimed territory. Currently, ProtectionChecker.shouldBlockExplosion() (line 892-896) blocks ALL explosions in claimed territory regardless of faction relation.
- New global config option to enable/disable enemy explosions in claims
- When enabled, explosions from enemy faction members should damage blocks in enemy claims
- Own faction, ally, and neutral explosions should remain blocked in claims
- Should respect existing zone-level
EXPLOSION_DAMAGE flag overrides
Implementation Details
Current code (ProtectionChecker.java:892-896):
UUIDclaimOwner = claimManager.getClaimOwner(worldName, chunkX, chunkZ);
if (claimOwner != null) {
returntrue; // Block explosions in ALL claims
}Needed changes:
- Add config option in
CoreConfig.java: allowEnemyExplosionsInClaims = false (default off) - Modify
shouldBlockExplosion() to accept explosion source (attacker UUID/faction) - Check
RelationManager.areEnemies(sourceFaction, claimOwnerFaction) — if enemies and config enabled, allow - Mixin enhancement needed: Current mixin hook (
HyperProtectIntegration.evaluateExplosion() line 269) only passes coordinates, not attacker identity. Would need to pass the explosion source entity/player UUID through the mixin callback.
Suggested config:
{
"territory": {
"allowEnemyExplosionsInClaims": false
}
}Suggested permission:hyperfactions.territory.explosions.enemy (could be per-faction toggle via faction settings)
Related code:
RelationManager.java — areEnemies() (line 202), getEffectiveRelation() (line 136)HyperProtectIntegration.java (line 269 — mixin hook point)ZoneFlags.java — EXPLOSION_DAMAGE flag (line 205)
Risks and Alternatives
- Risk: Mixin modification required — current explosion hook doesn't carry attacker identity. This is the primary technical challenge.
- Risk: Potential for griefing if misconfigured — clear documentation and default-off is important
- Alternative: Per-faction toggle (faction setting) instead of global server config — gives faction leaders control
- Alternative: Zone-level flag override to selectively enable in specific areas
References and Media
Similar to MCFactions/FactionsUUID "enemy TNT" feature where enemy factions can use TNT in each other's territory.
Scope
Add a server-configurable setting that allows enemy factions to use explosives (TNT, etc.) in each other's claimed territory. Currently,
ProtectionChecker.shouldBlockExplosion()(line 892-896) blocks ALL explosions in claimed territory regardless of faction relation.EXPLOSION_DAMAGEflag overridesImplementation Details
Current code (
ProtectionChecker.java:892-896):Needed changes:
CoreConfig.java:allowEnemyExplosionsInClaims = false(default off)shouldBlockExplosion()to accept explosion source (attacker UUID/faction)RelationManager.areEnemies(sourceFaction, claimOwnerFaction)— if enemies and config enabled, allowHyperProtectIntegration.evaluateExplosion()line 269) only passes coordinates, not attacker identity. Would need to pass the explosion source entity/player UUID through the mixin callback.Suggested config:
{ "territory": { "allowEnemyExplosionsInClaims": false } }Suggested permission:
hyperfactions.territory.explosions.enemy(could be per-faction toggle via faction settings)Related code:
RelationManager.java—areEnemies()(line 202),getEffectiveRelation()(line 136)HyperProtectIntegration.java(line 269 — mixin hook point)ZoneFlags.java—EXPLOSION_DAMAGEflag (line 205)Risks and Alternatives
References and Media
Similar to MCFactions/FactionsUUID "enemy TNT" feature where enemy factions can use TNT in each other's territory.