Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/1 #15

Closed
wants to merge 30 commits into from
Closed

Pr/1 #15

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c864a6b
Updated Rendering of Moon
Abastro Sep 25, 2015
0ff41cf
Added Bunch of configs, and current time context on HUD.
Abastro Sep 27, 2015
98399d0
Fixed foolish mistake on wake up time.
Abastro Oct 3, 2015
819bccc
Added config for hour/minute length.
Abastro Oct 3, 2015
6de6bcc
Added category comment.
Abastro Oct 3, 2015
c7948ed
Implemented Gui Configs!
Abastro Oct 3, 2015
5fe1449
Updated to 0.1.14
Abastro Oct 3, 2015
bfa7883
Create README.md
Abastro Oct 6, 2015
5b39a51
Preparing update & HUD fix
Abastro Oct 9, 2015
184b974
Organized configuration
Abastro Oct 15, 2015
7085dfb
Edited Waking Property System
Abastro Oct 20, 2015
74e9f93
Constructing Wake system
Abastro Oct 22, 2015
37ae118
Final Fixes
Abastro Oct 31, 2015
e800af7
Fixed Configuration wording.
Abastro Nov 2, 2015
a52e574
Progressing to 0.1.16
Abastro Nov 2, 2015
fadfab4
Fixed Gui showing every categories
Abastro Nov 2, 2015
3c000e2
Added property to totally disable wake system provided by stellar sky
Abastro Nov 20, 2015
7d786e6
Missed change
Abastro Nov 21, 2015
8b12736
Progressing to 0.1.17
Abastro Nov 21, 2015
a23b602
Fixed Silly Mistake
Abastro Nov 22, 2015
c7c04c5
Fixed phase of the moon
Abastro Dec 11, 2015
a881e98
Added config for HUD time information.
Abastro Dec 14, 2015
8931d6f
Refactoring codes
Abastro Dec 14, 2015
3945954
Organized code related with view mode.
Abastro Dec 14, 2015
44e2771
Still cleaning.
Abastro Dec 15, 2015
32f2998
v0.1.17 Release.
Abastro Dec 15, 2015
bd7819d
First commit
PitchBright Dec 17, 2015
78e84fb
Merge pull request #13 from PitchBright/1.7
Abastro Dec 17, 2015
d2115fd
Changed brightness calculation of stellar objects.
Abastro Dec 22, 2015
efd2092
v0.1.18 Release
Abastro Dec 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local.properties
gradle/
build/
eclipse/
run/
CREDITS-fml.txt
forge-*.txt
LICENSE-fml.txt
Expand Down Expand Up @@ -228,4 +229,7 @@ pip-log.txt
#Idea
*.iml
*.ipr
*.iws
*.iws
gradlew

gradlew.bat
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# StellarSky
Stellar Sky, Real Constellations in Minecraft!

(This github is divided to 2 branches: 1.7 and 1.8
master branch won't be used.)
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

apply plugin: 'forge'

version = "v0.1.10[1.7.10]"
version = "v0.1.18[1.7.10]"
group= "stellarium" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Stellar Sky"

Expand Down
127 changes: 94 additions & 33 deletions src/main/java/stellarium/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
package stellarium;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.client.Minecraft;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import stellarium.config.EnumViewMode;
import stellarium.config.IConfigHandler;
import stellarium.stellars.Optics;
import stellarium.stellars.StellarManager;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;

public class ClientProxy extends CommonProxy implements IProxy {

private static final String clientConfigCategory = "clientconfig";
private static final String clientConfigOpticsCategory = "clientconfig.optics";

@Override
public void preInit(FMLPreInitializationEvent event) throws IOException {
public void preInit(FMLPreInitializationEvent event) {
manager = new StellarManager(Side.CLIENT);

//Initialize Objects
config = new Configuration(event.getSuggestedConfigurationFile());

config.load();
setupConfig();
config.save();
this.setupConfigManager(event.getSuggestedConfigurationFile());

manager.InitializeStars();

MinecraftForge.EVENT_BUS.register(new StellarClientHook());
FMLCommonHandler.instance().bus().register(new StellarKeyHook());
}

@Override
public void load(FMLInitializationEvent event) {
public void load(FMLInitializationEvent event) throws IOException {
super.load(event);

manager.initializeStars();
}

@Override
Expand All @@ -42,25 +48,80 @@ public void postInit(FMLPostInitializationEvent event) {
}

@Override
public void setupConfig() {
super.setupConfig();

Property Mag_Limit=config.get(Configuration.CATEGORY_GENERAL, "Mag_Limit", 5.0);
Mag_Limit.comment="Limit of magnitude can be seen on naked eye.\n" +
"If you want to increase FPS, you can set this property a bit little (e.g. 0.3)\n" +
"and FPS will be exponentially improved";
manager.Mag_Limit=(float)Mag_Limit.getDouble(5.0);
public void setupConfigManager(File file) {
super.setupConfigManager(file);
cfgManager.register(clientConfigCategory, new IConfigHandler() {

Property mag_Limit, turb, moon_Frac, minuteLength, hourToMinute, viewMode;

@Override
public void setupConfig(Configuration config, String category) {
config.setCategoryComment(category, "Configurations for client modifications.\n"
+ "Most of them are for rendering/view.");
config.setCategoryLanguageKey(category, "config.category.client");
config.setCategoryRequiresMcRestart(category, false);

mag_Limit=config.get(category, "Mag_Limit", 5.0);
mag_Limit.comment="Limit of magnitude can be seen on naked eye.\n" +
"If you want to increase FPS, you can set this property a bit little (e.g. 0.3)\n" +
"and FPS will be exponentially improved";
mag_Limit.setRequiresMcRestart(false);
mag_Limit.setLanguageKey("config.property.client.maglimit");

Property turb=config.get(Configuration.CATEGORY_GENERAL, "Twinkling(Turbulance)", 0.3);
turb.comment="Degree of the twinkling effect of star.\n"
+ "It determines the turbulance of atmosphere, which actually cause the twinkling effect";
manager.Turb=(float)turb.getDouble(0.3);

Property Moon_Frac=config.get(Configuration.CATEGORY_GENERAL, "Moon_Fragments_Number", 16);
Moon_Frac.comment="Moon is drawn with fragments\n" +
"Less fragments will increase FPS, but the moon become more defective\n";
manager.ImgFrac=Moon_Frac.getInt(16);
}
turb=config.get(category, "Twinkling(Turbulance)", 1.0);
turb.comment="Degree of the twinkling effect of star.\n"
+ "It determines the turbulance of atmosphere, which actually cause the twinkling effect";
turb.setRequiresMcRestart(false);
turb.setLanguageKey("config.property.client.turbulance");

moon_Frac=config.get(category, "Moon_Fragments_Number", 16);
moon_Frac.comment="Moon is drawn with fragments\n" +
"Less fragments will increase FPS, but the moon become more defective";
moon_Frac.setRequiresMcRestart(false);
moon_Frac.setLanguageKey("config.property.client.moonfrac");

minuteLength = config.get(category, "Minute_Length", 20.0);
minuteLength.comment = "Length of minute in tick. (The minute & hour is displayed on HUD as HH:MM format)";
minuteLength.setRequiresMcRestart(false);
minuteLength.setLanguageKey("config.property.client.minutelength");

hourToMinute = config.get(category, "Hour_Length", 60);
hourToMinute.comment = "Length of hour in minute. (The minute & hour is displayed on HUD as HH:MM format)";
hourToMinute.setRequiresMcRestart(false);
hourToMinute.setLanguageKey("config.property.client.hourlength");

viewMode = config.get(category, "Mode_HUD_Time_View", "empty")
.setValidValues(EnumViewMode.names);
viewMode.comment = "Mode for HUD time view.\n"
+ " 3 modes available: empty, hhmm, tick.\n"
+ "Can also be changed in-game using key.";
viewMode.setRequiresMcRestart(false);
viewMode.setLanguageKey("config.property.client.modeview");

viewMode.setValue(manager.getViewMode().getName());


List<String> propNameList = Arrays.asList(mag_Limit.getName(),
moon_Frac.getName(), turb.getName(), viewMode.getName(),
minuteLength.getName(), hourToMinute.getName());
config.setCategoryPropertyOrder(category, propNameList);
}

@Override
public void loadFromConfig(Configuration config, String category) {
manager.mag_Limit=(float)mag_Limit.getDouble();
manager.turb=(float)turb.getDouble();
manager.imgFrac=moon_Frac.getInt();
manager.minuteLength = minuteLength.getDouble();
manager.anHourToMinute = hourToMinute.getInt();

manager.setViewMode(EnumViewMode.getModeForName(viewMode.getString()));
}

});

cfgManager.register(clientConfigOpticsCategory, Optics.instance);
}

@Override
public World getDefWorld() {
Expand Down
Loading