Skip to content

Commit 0573d27

Browse files
committed
bug fixes
- Fix: Admin power applied to current power value - Fix: Admin protection prevent actions on claims if required power is higher than current power value
1 parent 55e99e7 commit 0573d27

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/io/icker/factions/api/persistents/Faction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ public String getMOTD() {
163163

164164
public int getPower() {
165165
int basePowerMax = getBasePowerMax();
166-
int basePower = Math.min(power + adminPower, basePowerMax);
167-
return basePower + getWealthPower() + getWarPower() + getFamePower() + getVassalPowerBonus();
166+
int basePower = Math.min(power, basePowerMax);
167+
return basePower + adminPower + getWealthPower() + getWarPower() + getFamePower() + getVassalPowerBonus();
168168
}
169169

170170
public int getBasePowerMax() {
@@ -677,7 +677,7 @@ public int calculateMaxPower() {
677677
}
678678

679679
public Collection<User> getRelationships() {
680-
// TODO Auto-generated method stub
680+
// TO DO Auto-generated method stub
681681
throw new UnsupportedOperationException("Unimplemented method 'getRelationships'");
682682
}
683683

src/main/java/io/icker/factions/core/InteractionManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private static ActionResult checkPermissions(PlayerEntity player, BlockPos posit
288288

289289
Faction claimFaction = claim.getFaction();
290290

291-
if (claimFaction.getClaims().size() * FactionsMod.CONFIG.POWER.CLAIM_WEIGHT > claimFaction
291+
if (!claimFaction.isAdminProtected() && claimFaction.getClaims().size() * FactionsMod.CONFIG.POWER.CLAIM_WEIGHT > claimFaction
292292
.getPower()) {
293293
return ActionResult.PASS;
294294
}

0 commit comments

Comments
 (0)