Skip to content

Commit

Permalink
Merge branch 'Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tterrag1098 committed Aug 9, 2014
2 parents b2a4069 + 6c35290 commit 47a4f4a
Show file tree
Hide file tree
Showing 113 changed files with 832 additions and 6,387 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Empty file modified gradlew
100644 → 100755
Empty file.
73 changes: 13 additions & 60 deletions src/main/java/tppitweaks/TPPITweaks.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
package tppitweaks;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Logger;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import tppitweaks.block.ModBlocks;
import tppitweaks.client.gui.GuiHelper;
import tppitweaks.command.CommandTPPI;
import tppitweaks.command.CommandGetInvolved;
import tppitweaks.command.CommandOres;
import tppitweaks.config.ConfigurationHandler;
import tppitweaks.creativeTab.CreativeTabTPPI;
import tppitweaks.event.TPPIEventHandler;
import tppitweaks.item.ModItems;
import tppitweaks.lib.Reference;
import tppitweaks.proxy.CommonProxy;
import tppitweaks.proxy.PacketHandler;
import tppitweaks.recipetweaks.RecipeAddition.EventTime;
import tppitweaks.recipetweaks.RecipeTweaks;
import tppitweaks.util.FileLoader;
import tppitweaks.util.TPPIPlayerTracker;
import tppitweaks.recipetweaks.AdditionalTweaks;
import tterrag.rtc.RecipeTweakingCore;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
Expand All @@ -30,11 +25,8 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "TPPITweaks", name = "TPPI Tweaks", version = TPPITweaks.VERSION, dependencies = Reference.DEPENDENCIES)
@NetworkMod(serverSideRequired = true, clientSideRequired = true, channels = { Reference.CHANNEL }, packetHandler = PacketHandler.class)
public class TPPITweaks
{
public static final String VERSION = "1.1.0";
Expand All @@ -46,7 +38,6 @@ public class TPPITweaks
public static CommonProxy proxy;

public static TPPIEventHandler eventHandler;
public static TPPIPlayerTracker playerTracker;

public static final Logger logger = Logger.getLogger("TPPITweaks");

Expand All @@ -56,78 +47,40 @@ public class TPPITweaks
public void preInit(FMLPreInitializationEvent event)
{
logger.setParent(FMLCommonHandler.instance().getFMLLogger());

RecipeTweakingCore.registerPackageName("tppitweaks.recipetweaks.modTweaks");

ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + "/TPPI/TPPITweaks.cfg"));

try
{
FileLoader.init(ConfigurationHandler.cfg, 0);
}
catch (IOException e)
{
e.printStackTrace();
}

ConfigurationHandler.loadGuideText(FileLoader.getGuideText());
ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText());

CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile());

ModItems.initItems();
ModBlocks.initBlocks();

playerTracker = new TPPIPlayerTracker();
GameRegistry.registerPlayerTracker(playerTracker);
MinecraftForge.EVENT_BUS.register(playerTracker);
}

@EventHandler
public void init(FMLInitializationEvent event)
{
// AM2SpawnControls.doAM2SpawnControls();

ModItems.initItems();
ModBlocks.initBlocks();

eventHandler = new TPPIEventHandler();
MinecraftForge.EVENT_BUS.register(eventHandler);
ModItems.registerRecipes();
ModBlocks.registerRecipes();

if (event.getSide().isClient())
proxy.initTickHandler();

tweakAtEvent(EventTime.INIT);
}

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
if (FMLCommonHandler.instance().getSide().isClient())
{
try
{
GuiHelper.initMap();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}

tweakAtEvent(EventTime.POST_INIT);
AdditionalTweaks.doOreDictTweaks();
AdditionalTweaks.addMiscRecipes();
}

@EventHandler
public void onFMLServerStart(FMLServerStartingEvent event)
{
event.registerServerCommand(new CommandTPPI());
}

public static void tweakAtEvent(EventTime event)
{
if (event == EventTime.POST_INIT)
RecipeTweaks.removeRecipes();

RecipeTweaks.addRecipes(event);

RecipeTweaks.doRemainingTweaks(event);
event.registerServerCommand(new CommandOres());
event.registerServerCommand(new CommandGetInvolved());
}
}
50 changes: 23 additions & 27 deletions src/main/java/tppitweaks/client/gui/ConfigGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,55 @@
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
@Deprecated
public class ConfigGui extends GuiScreen
{

public ConfigGui()
{

}

@SuppressWarnings("unchecked")
@Override
public void initGui()
{
this.buttonList.add(new GuiButton(13, this.width / 2 - 100, 60, 200, 20, "Enable Hard Mode"));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 200, 200, 20, "Continue"));
}

@Override
public void drawScreen(int par1, int par2, float par3)
{
this.drawDefaultBackground();
this.drawCenteredString(this.fontRenderer, "Config Options", this.width / 2, 10, 0xFFFFFF);

this.drawCenteredString(this.fontRenderer, "Config Options", this.width / 2, 10, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "Use hard mode configs?", this.width / 2, 40, 0xFFFFFF);

this.drawCenteredString(this.fontRenderer, "The hard mode config enables all GT nerfs, as well as all", this.width / 2, 114, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "expsnsive versions of recpies", this.width / 2, 124, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "NOTE: You will have to restart Minecraft in order for the", this.width / 2, 134, 0xFFFFFF);
this.drawCenteredString(this.fontRenderer, "config change to take effect", this.width / 2, 144, 0xFFFFFF);

super.drawScreen(par1, par2, par3);
}

@Override
public void actionPerformed(GuiButton button)
{
switch(button.id) {
case 13:
try
{
File file=new File("config/TPPI/config/hardconfig.zip");
Unzipper.unzipFiles(new FileInputStream(file), "config");
GuiHelper.updateGui.actionPerformed(button);
break;
}
catch (Exception e)
{
e.printStackTrace();
}

default:
GuiHelper.updateGui.actionPerformed(button);
switch (button.id)
{
case 13:
try
{
File file = new File("config/TPPI/config/hardconfig.zip");
Unzipper.unzipFiles(new FileInputStream(file), "config");
break;
}
catch (Exception e)
{
e.printStackTrace();
}
}

}

}
35 changes: 0 additions & 35 deletions src/main/java/tppitweaks/client/gui/GuiHelper.java

This file was deleted.

Loading

0 comments on commit 47a4f4a

Please sign in to comment.