Skip to content

Commit

Permalink
Add fixPlanetIcons feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ROMVoid95 committed Sep 5, 2020
1 parent cbe032e commit 7fd2d33
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 58 deletions.
10 changes: 2 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

[Added]

- Option to choose addon for Separate Galaxy feature
- Default addon for Seperate Galaxy is now "none"
- Warning in crash-log if Separate Galaxy is enabled
- command /leaverace to leave GC SpaceRace team
- Team owners cannot use command


[Changed/Removed]

- Parse loaded Addons from FML Loader
- Modpack Crashlog Data
1 change: 0 additions & 1 deletion src/main/java/net/rom/gctweaks/GalacticTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import net.rom.gctweaks.base.core.utils.I18nHelper;
import net.rom.gctweaks.base.core.utils.LogHelper;
import net.rom.gctweaks.base.version.CommandDownloadUpdate;
import net.rom.gctweaks.gc.features.oxygenfeature.command.CommandOxygenReset;

@Mod(modid = Ref.MOD_ID, name = Ref.MOD_NAME, version = Ref.MOD_VERSION, dependencies = Ref.DEPS, certificateFingerprint = Ref.MOD_FINGERPRINT, useMetadata = true)
public class GalacticTweaks {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


@Mod.EventBusSubscriber(value = Side.CLIENT, modid = Ref.MOD_ID)
@SuppressWarnings("deprecation")
public final class VersionChecker {

private VersionChecker() {}
Expand Down Expand Up @@ -50,6 +51,7 @@ public static void onTick (ClientTickEvent event) {
player.sendMessage(new TextComponentTranslation("gctweaks.versions.outdated2", online
.toString()));
player.sendMessage(new TextComponentTranslation("gctweaks.versions.outdated0"));

ITextComponent component = ITextComponent.Serializer.fromJsonLenient(I18n
.translateToLocal("gctweaks.versions.updateMessage").replaceAll("%version%", fileId));
player.sendMessage(component);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/rom/gctweaks/gc/GalacticraftModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.rom.gctweaks.base.Module;
import net.rom.gctweaks.gc.features.CompressorFixes;
import net.rom.gctweaks.gc.features.FixAsmodeusMapIcons;
import net.rom.gctweaks.gc.features.MobsBreatheInSpace;
import net.rom.gctweaks.gc.features.NoSpaceMusic;
import net.rom.gctweaks.gc.features.OverworldComets;
Expand All @@ -24,6 +25,6 @@ public void addFeatures() {
registerFeature(new OverworldComets());
registerFeature(new SeperateAddonPlanets());
registerFeature(new SpaceRaceFeature());
registerFeature(new FixAsmodeusMapIcons());
}

}
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);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package net.rom.gctweaks.gc.features.galaxyfeature;

import java.util.Map;

import com.mjr.extraplanets.planets.ExtraPlanets_Planets;

import galaxyspace.systems.SolarSystem.SolarSystemBodies;
Expand All @@ -14,7 +12,6 @@
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
import micdoodle8.mods.galacticraft.planets.asteroids.AsteroidsModule;
import net.minecraft.util.ResourceLocation;
import net.rom.gctweaks.base.core.compat.CompatMods;

public class GCPlanets {
public static Planet FAKE_OVERWORLD;
Expand Down Expand Up @@ -57,49 +54,6 @@ private static void build () {
.getPhaseShift(), GalacticraftCore.planetOverworld.getRelativeDistanceFromCenter().scaledDistance);
buildAsteroids(FAKE_ASTEROIDS, "fakeRocks", GCSystems.EP_SYSTEM, AsteroidsModule.planetAsteroids
.getPhaseShift(), 1.375F);
fixPlanetIcons();
}

private static void fixPlanetIcons () {
if (CompatMods.ZOLLERN.isLoaded() || CompatMods.MOREPLANETS.isLoaded()) {
for (Map.Entry<String, Planet> planet : GalaxyRegistry.getRegisteredPlanets().entrySet()) {
Planet p = planet.getValue();
if (p.getRelativeSize() != 1.0F) {
p.setRelativeSize(1.0F);
}
}
}

// if (AsmodeusConfig.enableNewGalaxyMap) {
// if (CompatMods.ZOLLERN.isLoaded()) {
// ZGPlanets.starPsios.setRelativeSize(1.0F);
// ZGPlanets.starPraedyth.setRelativeSize(1.0F);
// ZGPlanets.starSol2.setRelativeSize(1.0F);
// ZGPlanets.starPantheon.setRelativeSize(1.0F);
// ZGPlanets.starOlympus.setRelativeSize(1.0F);
// ZGPlanets.starAsgard.setRelativeSize(1.0F);
// ZGPlanets.starVega.setRelativeSize(1.0F);
// ZGPlanets.starNova.setRelativeSize(1.0F);
// ZGPlanets.planetZollus.setRelativeSize(1.0F);
// ZGPlanets.planetKriffon.setRelativeSize(1.0F);
// ZGPlanets.planetPurgot.setRelativeSize(1.0F);
// ZGPlanets.planetEden.setRelativeSize(1.0F);
// ZGPlanets.planetXathius.setRelativeSize(1.0F);
// ZGPlanets.planetOasis.setRelativeSize(1.0F);
// ZGPlanets.planetXantheon.setRelativeSize(1.0F);
// ZGPlanets.planetCandora.setRelativeSize(1.0F);
// ZGPlanets.planetAtheon.setRelativeSize(1.0F);
// ZGPlanets.planetAltum.setRelativeSize(1.0F);
// ZGPlanets.planetCaligro.setRelativeSize(1.0F);
// }
// if (CompatMods.MOREPLANETS.isLoaded()) {
// MPPlanets.LAZENDUS.setRelativeSize(1.0F);
// MPPlanets.DIONA.setRelativeSize(1.0F);
// MPPlanets.CHALOS.setRelativeSize(1.0F);
// MPPlanets.NIBIRU.setRelativeSize(1.0F);
// MPPlanets.KOENTUS.setRelativeSize(1.0F);
// }
// }
}

public static void buildAsteroids (Planet planet, String planetName, SolarSystem solarSystem, float randomPhase, float au) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@

import micdoodle8.mods.galacticraft.core.dimension.SpaceRace;
import micdoodle8.mods.galacticraft.core.dimension.SpaceRaceManager;
import micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats;
import micdoodle8.mods.galacticraft.core.util.PlayerUtil;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;

Expand Down

0 comments on commit 7fd2d33

Please sign in to comment.