Buggy code:
public Rel getRole ( ) { } public void setRole ( Rel role ) { } public boolean hasTitle ( ) { } public String getTitle ( ) { } public void setTitle ( String title ) { } public double getPowerBoost ( ) { } public void setPowerBoost ( Double powerBoost ) { } public boolean hasPowerBoost ( ) { } public double getPowerMaxUniversal ( ) { } public double getPowerMax ( ) { } public double getPowerMin ( ) { } public double getPowerPerHour ( ) { } public double getPowerPerDeath ( ) { } public double getLimitedPower ( double power ) { } public int getPowerMaxRounded ( ) { } public int getPowerMinRounded ( ) { } public int getPowerMaxUniversalRounded ( ) { } public double getDefaultPower ( ) { } public double getPower ( ) { } public void setPower ( Double power ) { } public int getPowerRounded ( ) { } public String getFactionName ( ) { } public String getNameAndSomething ( String color , String something ) { } public String getNameAndFactionName ( ) { } public String getNameAndTitle ( String color ) { } public String getNameAndTitle ( Faction faction ) { } public String getNameAndTitle ( UPlayer uplayer ) { } @ Override public String describeTo ( RelationParticipator observer , boolean ucfirst ) { } @ Override public String describeTo ( RelationParticipator observer ) { } @ Override public Rel getRelationTo ( RelationParticipator observer ) { } @ Override public Rel getRelationTo ( RelationParticipator observer , boolean ignorePeaceful ) { } @ Override public ChatColor getColorTo ( RelationParticipator observer ) { } public void heal ( int amnt ) { } public boolean isInOwnTerritory ( ) { } public boolean isInEnemyTerritory ( ) { } public void leave ( ) { } public boolean tryClaim ( Faction newFaction , PS ps , boolean verbooseChange , boolean verbooseSame ) { PS chunk = ps . getChunk ( true ) ; Faction oldFaction = BoardColls . get ( ) . getFactionAt ( chunk ) ; UConf uconf = UConf . get ( newFaction ) ; MConf mconf = MConf . get ( ) ; if ( newFaction == oldFaction ) { msg ( "%s<i><seq2seq4repair_space>already<seq2seq4repair_space>owns<seq2seq4repair_space>this<seq2seq4repair_space>land." , newFaction . describeTo ( this , true ) ) ; return true ; } if ( ! ( this . isUsingAdminMode ( ) ) ) { if ( newFaction . isNormal ( ) ) { if ( mconf . getWorldsNoClaiming ( ) . contains ( ps . getWorld ( ) ) ) { msg ( "<b>Sorry,<seq2seq4repair_space>this<seq2seq4repair_space>world<seq2seq4repair_space>has<seq2seq4repair_space>land<seq2seq4repair_space>claiming<seq2seq4repair_space>disabled." ) ; return false ; } if ( ! ( TERRITORY . has ( this , newFaction , true ) ) ) { return false ; } if ( ( newFaction . getUPlayers ( ) . size ( ) ) < ( uconf . claimsRequireMinFactionMembers ) ) { msg ( "Factions<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space><h>%s<b><seq2seq4repair_space>members<seq2seq4repair_space>to<seq2seq4repair_space>claim<seq2seq4repair_space>land." , uconf . claimsRequireMinFactionMembers ) ; return false ; } int ownedLand = newFaction . getLandCount ( ) ; if ( ( ( ( uconf . claimedLandsMax ) != 0 ) && ( ownedLand >= ( uconf . claimedLandsMax ) ) ) && ( ! ( newFaction . getFlag ( INFPOWER ) ) ) ) { msg ( "<b>Limit<seq2seq4repair_space>reached.<seq2seq4repair_space>You<seq2seq4repair_space>can't<seq2seq4repair_space>claim<seq2seq4repair_space>more<seq2seq4repair_space>land." ) ; return false ; } if ( ownedLand >= ( newFaction . getPowerRounded ( ) ) ) { msg ( "<b>You<seq2seq4repair_space>can't<seq2seq4repair_space>claim<seq2seq4repair_space>more<seq2seq4repair_space>land.<seq2seq4repair_space>You<seq2seq4repair_space>need<seq2seq4repair_space>more<seq2seq4repair_space>power." ) ; return false ; } if ( ( ( ( uconf . claimsMustBeConnected ) && ( ( newFaction . getLandCountInWorld ( ps . getWorld ( ) ) ) > 0 ) ) && ( ! ( BoardColls . get ( ) . isConnectedPs ( chunk , newFaction ) ) ) ) && ( ( ! ( uconf . claimsCanBeUnconnectedIfOwnedByOtherFaction ) ) || ( oldFaction . isNone ( ) ) ) ) { if ( uconf . claimsCanBeUnconnectedIfOwnedByOtherFaction ) { msg ( "<b>You<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>claim<seq2seq4repair_space>additional<seq2seq4repair_space>land<seq2seq4repair_space>which<seq2seq4repair_space>is<seq2seq4repair_space>connected<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>first<seq2seq4repair_space>claim<seq2seq4repair_space>or<seq2seq4repair_space>controlled<seq2seq4repair_space>by<seq2seq4repair_space>another<seq2seq4repair_space>faction!" ) ; } else { msg ( "<b>You<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>claim<seq2seq4repair_space>additional<seq2seq4repair_space>land<seq2seq4repair_space>which<seq2seq4repair_space>is<seq2seq4repair_space>connected<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>first<seq2seq4repair_space>claim!" ) ; } return false ; } } if ( oldFaction . isNormal ( ) ) { if ( ! ( TERRITORY . has ( this , oldFaction , false ) ) ) { if ( ! ( uconf . claimingFromOthersAllowed ) ) { msg ( "<b>You<seq2seq4repair_space>may<seq2seq4repair_space>not<seq2seq4repair_space>claim<seq2seq4repair_space>land<seq2seq4repair_space>from<seq2seq4repair_space>others." ) ; return false ; } if ( oldFaction . getRelationTo ( newFaction ) . isAtLeast ( TRUCE ) ) { msg ( "<b>You<seq2seq4repair_space>can't<seq2seq4repair_space>claim<seq2seq4repair_space>this<seq2seq4repair_space>land<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>your<seq2seq4repair_space>relation<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>current<seq2seq4repair_space>owner." ) ; return false ; } if ( ! ( oldFaction . hasLandInflation ( ) ) ) { msg ( "%s<i><seq2seq4repair_space>owns<seq2seq4repair_space>this<seq2seq4repair_space>land<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>strong<seq2seq4repair_space>enough<seq2seq4repair_space>to<seq2seq4repair_space>keep<seq2seq4repair_space>it." , oldFaction . getName ( this ) ) ; return false ; } if ( ! ( BoardColls . get ( ) . isBorderPs ( chunk ) ) ) { msg ( "<b>You<seq2seq4repair_space>must<seq2seq4repair_space>start<seq2seq4repair_space>claiming<seq2seq4repair_space>land<seq2seq4repair_space>at<seq2seq4repair_space>the<seq2seq4repair_space>border<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>territory." ) ; return false ; } } } } <START_BUG> EventFactionsChunkChange event = new EventFactionsChunkChange ( sender , chunk , newFaction ) ; <END_BUG> event . run ( ) ; if ( event . isCancelled ( ) ) return false ; BoardColls . get ( ) . setFactionAt ( chunk , newFaction ) ; Set < UPlayer > informees = new HashSet < UPlayer > ( ) ; informees . add ( this ) ; if ( newFaction . isNormal ( ) ) { informees . addAll ( newFaction . getUPlayers ( ) ) ; } if ( oldFaction . isNormal ( ) ) { informees . addAll ( oldFaction . getUPlayers ( ) ) ; } if ( MConf . get ( ) . logLandClaims ) { informees . add ( UPlayer . get ( IdUtil . getConsole ( ) ) ) ; } String chunkString = chunk . toString ( PSFormatHumanSpace . get ( ) ) ; String typeString = event . getType ( ) . toString ( ) . toLowerCase ( ) ; for ( UPlayer informee : informees ) { informee . msg ( "<h>%s<i><seq2seq4repair_space>did<seq2seq4repair_space>%s<seq2seq4repair_space>%s<seq2seq4repair_space><i>for<seq2seq4repair_space><h>%s<i><seq2seq4repair_space>from<seq2seq4repair_space><h>%s<i>." , this . describeTo ( informee , true ) , typeString , chunkString , newFaction . describeTo ( informee ) , oldFaction . describeTo ( informee ) ) ; } return true ; } }

Fix:
EventFactionsChunkChange event = new EventFactionsChunkChange ( this . getSender ( ) , chunk , newFaction ) ;