From bef2fa7bef674d73561edb7e019b731367b1e8f1 Mon Sep 17 00:00:00 2001 From: Frakern <134113799+frakern@users.noreply.github.com> Date: Wed, 24 May 2023 17:04:27 +0900 Subject: [PATCH] Run Prettier --- src/starpocalypse/StarpocalypseMod.java | 19 +++++++++---------- .../market/GroundDefenseAdder.java | 2 +- src/starpocalypse/market/MarketHelper.java | 3 +-- src/starpocalypse/market/StationAdder.java | 8 +++----- .../salvage/DerelictModifyingScript.java | 1 - .../salvage/StarpocalypseCampaignPlugin.java | 11 +++++------ .../StarpocalypseFleetEncounterContext.java | 7 +++---- ...StarpocalypseNexFleetEncounterContext.java | 5 ++--- .../submarket/RegulatedBlackMarket.java | 15 +++++++++------ 9 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/starpocalypse/StarpocalypseMod.java b/src/starpocalypse/StarpocalypseMod.java index 14683b7..690debc 100644 --- a/src/starpocalypse/StarpocalypseMod.java +++ b/src/starpocalypse/StarpocalypseMod.java @@ -63,8 +63,7 @@ public void afterGameSave() { if (ConfigHelper.isUninstall()) { SharedData.getData().getPlayerActivityTracker().advance(0); showUninstalledDialog(); - } - else { + } else { salvageMultiplier(); } } @@ -95,9 +94,7 @@ private void addDmodsToStartingFleet() { private void addGroundDefenses(MarketListener listener) { if (settings.optBoolean("addGroundDefenses", true)) { log.info("Enabling ground defenses adder"); - listener.add( - new GroundDefenseAdder(settings.optInt("sizeHeavyBatteries", 5)) - ); + listener.add(new GroundDefenseAdder(settings.optInt("sizeHeavyBatteries", 5))); } } @@ -119,11 +116,13 @@ private void addPatrolHqs(MarketListener listener) { private void addStations(MarketListener listener) { if (settings.optBoolean("addStations", true)) { log.info("Enabling station adder"); - listener.add(new StationAdder( - settings.optInt("sizeForOrbitalStation", 5), - settings.optInt("sizeForBattleStation", 6), - settings.optInt("sizeForStarFortress", 7) - )); + listener.add( + new StationAdder( + settings.optInt("sizeForOrbitalStation", 5), + settings.optInt("sizeForBattleStation", 6), + settings.optInt("sizeForStarFortress", 7) + ) + ); } } diff --git a/src/starpocalypse/market/GroundDefenseAdder.java b/src/starpocalypse/market/GroundDefenseAdder.java index e6a4f1e..0fbda0c 100644 --- a/src/starpocalypse/market/GroundDefenseAdder.java +++ b/src/starpocalypse/market/GroundDefenseAdder.java @@ -13,7 +13,7 @@ public class GroundDefenseAdder extends MarketChanger { public GroundDefenseAdder(int sizeHeavyBatteries) { this.sizeHeavyBatteries = sizeHeavyBatteries; - this.blockingIndustries = new String[] {Industries.GROUNDDEFENSES, Industries.HEAVYBATTERIES}; + this.blockingIndustries = new String[] { Industries.GROUNDDEFENSES, Industries.HEAVYBATTERIES }; } @Override diff --git a/src/starpocalypse/market/MarketHelper.java b/src/starpocalypse/market/MarketHelper.java index 7889c9c..10038e7 100644 --- a/src/starpocalypse/market/MarketHelper.java +++ b/src/starpocalypse/market/MarketHelper.java @@ -1,9 +1,8 @@ package starpocalypse.market; import com.fs.starfarer.api.campaign.econ.MarketAPI; -import lombok.extern.log4j.Log4j; - import java.util.Objects; +import lombok.extern.log4j.Log4j; @Log4j public class MarketHelper { diff --git a/src/starpocalypse/market/StationAdder.java b/src/starpocalypse/market/StationAdder.java index c497663..e1a95ca 100644 --- a/src/starpocalypse/market/StationAdder.java +++ b/src/starpocalypse/market/StationAdder.java @@ -39,7 +39,7 @@ protected boolean canChange(MarketAPI market) { protected void changeImpl(MarketAPI market) { String factionId = market.getFactionId(); String stationType = factionStations.get(factionId); - switch(stationType) { + switch (stationType) { case "high": stationType = "_high"; break; @@ -53,11 +53,9 @@ protected void changeImpl(MarketAPI market) { } if (market.getSize() >= this.sizeForStarFortress) { helper.addMissing(market, "starfortress" + stationType, false, stationDatabase.getAll()); - } - else if (market.getSize() >= this.sizeForBattleStation) { + } else if (market.getSize() >= this.sizeForBattleStation) { helper.addMissing(market, "battlestation" + stationType, false, stationDatabase.getAll()); - } - else if (market.getSize() >= this.sizeForOrbitalStation) { + } else if (market.getSize() >= this.sizeForOrbitalStation) { helper.addMissing(market, "orbitalstation" + stationType, false, stationDatabase.getAll()); } } diff --git a/src/starpocalypse/salvage/DerelictModifyingScript.java b/src/starpocalypse/salvage/DerelictModifyingScript.java index 54e1427..348c0e5 100644 --- a/src/starpocalypse/salvage/DerelictModifyingScript.java +++ b/src/starpocalypse/salvage/DerelictModifyingScript.java @@ -7,7 +7,6 @@ import com.fs.starfarer.api.impl.campaign.ids.MemFlags; import com.fs.starfarer.api.impl.campaign.ids.Tags; import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special.ShipRecoverySpecial; - import java.util.List; public class DerelictModifyingScript implements EveryFrameScript { diff --git a/src/starpocalypse/salvage/StarpocalypseCampaignPlugin.java b/src/starpocalypse/salvage/StarpocalypseCampaignPlugin.java index 5a82832..7b23910 100644 --- a/src/starpocalypse/salvage/StarpocalypseCampaignPlugin.java +++ b/src/starpocalypse/salvage/StarpocalypseCampaignPlugin.java @@ -24,14 +24,13 @@ public PluginPick pickInteractionDialogPlugin(SectorEnt if (interactionTarget instanceof CampaignFleetAPI) { if (ConfigHelper.hasNexerelin()) { return new PluginPick( - new StarpocalypseNexFleetInteractionDialogPlugin(), - PickPriority.MOD_SET + new StarpocalypseNexFleetInteractionDialogPlugin(), + PickPriority.MOD_SET ); - } - else { + } else { return new PluginPick( - new StarpocalypseFleetInteractionDialogPlugin(), - PickPriority.MOD_SET + new StarpocalypseFleetInteractionDialogPlugin(), + PickPriority.MOD_SET ); } } diff --git a/src/starpocalypse/salvage/StarpocalypseFleetEncounterContext.java b/src/starpocalypse/salvage/StarpocalypseFleetEncounterContext.java index 72486a4..df383d2 100644 --- a/src/starpocalypse/salvage/StarpocalypseFleetEncounterContext.java +++ b/src/starpocalypse/salvage/StarpocalypseFleetEncounterContext.java @@ -5,10 +5,9 @@ import com.fs.starfarer.api.campaign.CampaignFleetAPI; import com.fs.starfarer.api.fleet.FleetMemberAPI; import com.fs.starfarer.api.impl.campaign.FleetEncounterContext; -import starpocalypse.helper.ConfigHelper; - import java.util.LinkedList; import java.util.List; +import starpocalypse.helper.ConfigHelper; public class StarpocalypseFleetEncounterContext extends FleetEncounterContext { @@ -31,7 +30,7 @@ public List getRecoverableShips( if (!ConfigHelper.isStingyRecoveriesIncludePlayerShips()) { // Fleet snapshot before battle. List playerFleet = Global.getSector().getPlayerFleet().getFleetData().getSnapshot(); - for (FleetMemberAPI ship: recoverableShips) { + for (FleetMemberAPI ship : recoverableShips) { if (playerFleet.contains(ship)) { playerShips.add(ship); recoverableShips.remove(ship); @@ -49,4 +48,4 @@ public List getStoryRecoverableShips() { int cutOff = Math.min(23, allShips.size()); return allShips.subList(0, cutOff); } -} \ No newline at end of file +} diff --git a/src/starpocalypse/salvage/StarpocalypseNexFleetEncounterContext.java b/src/starpocalypse/salvage/StarpocalypseNexFleetEncounterContext.java index 4ca7291..6945ad1 100644 --- a/src/starpocalypse/salvage/StarpocalypseNexFleetEncounterContext.java +++ b/src/starpocalypse/salvage/StarpocalypseNexFleetEncounterContext.java @@ -5,10 +5,9 @@ import com.fs.starfarer.api.campaign.CampaignFleetAPI; import com.fs.starfarer.api.fleet.FleetMemberAPI; import exerelin.campaign.battle.NexFleetEncounterContext; -import starpocalypse.helper.ConfigHelper; - import java.util.LinkedList; import java.util.List; +import starpocalypse.helper.ConfigHelper; public class StarpocalypseNexFleetEncounterContext extends NexFleetEncounterContext { @@ -31,7 +30,7 @@ public List getRecoverableShips( if (!ConfigHelper.isStingyRecoveriesIncludePlayerShips()) { // Fleet snapshot before battle. List playerFleet = Global.getSector().getPlayerFleet().getFleetData().getSnapshot(); - for (FleetMemberAPI ship: recoverableShips) { + for (FleetMemberAPI ship : recoverableShips) { if (playerFleet.contains(ship)) { playerShips.add(ship); recoverableShips.remove(ship); diff --git a/src/starpocalypse/submarket/RegulatedBlackMarket.java b/src/starpocalypse/submarket/RegulatedBlackMarket.java index d0efcbe..c0e9518 100644 --- a/src/starpocalypse/submarket/RegulatedBlackMarket.java +++ b/src/starpocalypse/submarket/RegulatedBlackMarket.java @@ -14,13 +14,12 @@ import com.fs.starfarer.api.impl.campaign.ids.HullMods; import com.fs.starfarer.api.impl.campaign.submarkets.BlackMarketPlugin; import com.fs.starfarer.api.ui.TooltipMakerAPI; +import java.util.Objects; import starpocalypse.config.SimpleMap; import starpocalypse.helper.CargoUtils; import starpocalypse.helper.ConfigHelper; import starpocalypse.helper.SubmarketUtils; -import java.util.Objects; - public class RegulatedBlackMarket extends BlackMarketPlugin { private String location; @@ -145,7 +144,6 @@ public void updateCargoPrePlayerInteraction() { } } - private String getHullName(FleetMemberAPI ship) { ShipHullSpecAPI hullSpec = ship.getHullSpec().getBaseHull(); if (hullSpec == null) { @@ -159,7 +157,9 @@ private boolean isAlwaysLegal(String name) { } private boolean isCivilian(ShipVariantAPI variant) { - return variant.hasHullMod(HullMods.CIVGRADE) || variant.getHints().contains(ShipHullSpecAPI.ShipTypeHints.CIVILIAN); + return ( + variant.hasHullMod(HullMods.CIVGRADE) || variant.getHints().contains(ShipHullSpecAPI.ShipTypeHints.CIVILIAN) + ); } private boolean isSignificant(String commodityId) { @@ -222,7 +222,11 @@ private void removeItems(CargoAPI cargo) { private void removeShips(FleetDataAPI ships) { for (FleetMemberAPI member : ships.getMembersListCopy()) { if (isIllegalOnSubmarket(member, TransferAction.PLAYER_BUY)) { - log.info(location + ": Removing from black market due to high stability " + member.getHullSpec().getHullName()); + log.info( + location + + ": Removing from black market due to high stability " + + member.getHullSpec().getHullName() + ); ships.removeFleetMember(member); } } @@ -232,5 +236,4 @@ private void removeShips(FleetDataAPI ships) { public String getTariffTextOverride() { return "Bribes"; } - }