Skip to content

Commit

Permalink
Reformat more things
Browse files Browse the repository at this point in the history
  • Loading branch information
oitsjustjose committed Oct 25, 2018
1 parent 49134d8 commit 356f078
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.oitsjustjose.geolosys.client;

import javax.annotation.Nullable;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

import javax.annotation.Nullable;

public class ClientGUIProxy implements IGuiHandler
{
public static int MANUAL_GUI_ID = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.oitsjustjose.geolosys.client;

import com.oitsjustjose.geolosys.common.CommonProxy;

import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;

Expand Down
24 changes: 18 additions & 6 deletions src/main/java/com/oitsjustjose/geolosys/client/GuiManual.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
package com.oitsjustjose.geolosys.client;

import java.io.IOException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Random;

import javax.annotation.Nonnull;

import com.oitsjustjose.geolosys.Geolosys;
import com.oitsjustjose.geolosys.common.blocks.Types;
import com.oitsjustjose.geolosys.common.config.ConfigOres;
import com.oitsjustjose.geolosys.common.config.ModConfig;
import com.oitsjustjose.geolosys.common.items.ItemCluster;
import com.oitsjustjose.geolosys.common.manual.*;
import com.oitsjustjose.geolosys.common.manual.BookChapter;
import com.oitsjustjose.geolosys.common.manual.BookPage;
import com.oitsjustjose.geolosys.common.manual.BookPageContents;
import com.oitsjustjose.geolosys.common.manual.BookPageItemDisplay;
import com.oitsjustjose.geolosys.common.manual.BookPageOre;
import com.oitsjustjose.geolosys.common.manual.BookPageText;
import com.oitsjustjose.geolosys.common.manual.ChapterLink;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
Expand All @@ -23,11 +40,6 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.*;

/**
* @author Mangoose / https://github.com/the-realest-stu/
* Code taken directly from:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package com.oitsjustjose.geolosys.client;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;

import com.oitsjustjose.geolosys.Geolosys;

import org.apache.commons.io.IOUtils;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.Language;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;

@SideOnly(Side.CLIENT)
public class TranslationManager
Expand All @@ -31,10 +33,13 @@ private void loadLanguages()
// Come on Mojang, how are you going to have a language code that doesn't correspond to the language?
if (!lang.getLanguageCode().contains("_"))
{
Geolosys.getInstance().LOGGER.info("Couldn't find langfile " + lang.getLanguageCode() + ", looks like Mojang messed up. This language's translations may not work correctly.");
Geolosys.getInstance().LOGGER.info("Couldn't find langfile " + lang.getLanguageCode()
+ ", looks like Mojang messed up. This language's translations may not work correctly.");
continue;
}
InputStream in = Geolosys.class.getResourceAsStream("/assets/geolosys/lang/" + lang.getLanguageCode().substring(0, lang.getLanguageCode().indexOf("_")) + lang.getLanguageCode().substring(lang.getLanguageCode().indexOf("_")).toUpperCase() + ".lang");
InputStream in = Geolosys.class.getResourceAsStream("/assets/geolosys/lang/"
+ lang.getLanguageCode().substring(0, lang.getLanguageCode().indexOf("_"))
+ lang.getLanguageCode().substring(lang.getLanguageCode().indexOf("_")).toUpperCase() + ".lang");
if (in == null)
{
continue;
Expand All @@ -47,7 +52,8 @@ private void loadLanguages()
{
continue;
}
translations.get(lang.getLanguageCode()).put(s.substring(0, s.indexOf("=")), s.substring(s.indexOf("=") + 1));
translations.get(lang.getLanguageCode()).put(s.substring(0, s.indexOf("=")),
s.substring(s.indexOf("=") + 1));
}
}
catch (IOException ignored)
Expand All @@ -59,11 +65,15 @@ private void loadLanguages()

public String translate(String untranslated)
{
if (translations.containsKey(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode()))
if (translations
.containsKey(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode()))
{
if (translations.get(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode()).containsKey(untranslated))
if (translations.get(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode())
.containsKey(untranslated))
{
return translations.get(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode()).get(untranslated);
return translations
.get(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode())
.get(untranslated);
}
}
return translations.get("en_us").get(untranslated);
Expand Down

0 comments on commit 356f078

Please sign in to comment.