-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
61 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/net/rom/gctweaks/gc/features/FixAsmodeusMapIcons.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package net.rom.gctweaks.gc.features; | ||
|
||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
|
||
import asmodeuscore.core.configs.AsmodeusConfig; | ||
import micdoodle8.mods.galacticraft.api.galaxies.GalaxyRegistry; | ||
import micdoodle8.mods.galacticraft.api.galaxies.Planet; | ||
import micdoodle8.mods.galacticraft.api.galaxies.SolarSystem; | ||
import net.minecraftforge.common.config.Configuration; | ||
import net.rom.gctweaks.base.Feature; | ||
import net.rom.gctweaks.base.core.compat.CompatMods; | ||
|
||
public class FixAsmodeusMapIcons extends Feature { | ||
|
||
public static boolean fixIcons; | ||
|
||
@Override | ||
public String comment () { | ||
return "Fixes the Planet/Star icon sizes from More Planets & ZollernGalaxy"; | ||
} | ||
|
||
@Override | ||
public String[] category () { | ||
return new String[] { "fix-icons" }; | ||
} | ||
|
||
@Override | ||
public void syncConfig (Configuration config, String[] category) { | ||
fixIcons = config | ||
.get(category[0], "fixAsmodeusMapIcons", false, "Set to true to enable Fix Icons feature\nOnly affects icons if enableNewGalaxyMap is enabled in 'Asmodeuscore/core.conf'") | ||
.getBoolean(); | ||
} | ||
|
||
@Override | ||
public void postInit () { | ||
if (FixAsmodeusMapIcons.fixIcons) { | ||
if (CompatMods.ZOLLERN.isLoaded() || CompatMods.MOREPLANETS.isLoaded()) { | ||
if (AsmodeusConfig.enableNewGalaxyMap) { | ||
fixPlanetIcons(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
public static void fixPlanetIcons () { | ||
for (Map.Entry<String, Planet> planet : GalaxyRegistry.getRegisteredPlanets().entrySet()) { | ||
planet.getValue().setRelativeSize(1.0F); | ||
} | ||
for (Entry<String, SolarSystem> star : GalaxyRegistry.getRegisteredSolarSystems().entrySet()) { | ||
star.getValue().getMainStar().setRelativeSize(1.0F); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters