Skip to content

Commit

Permalink
Merge pull request #68 from TPPI-Dev/Dev
Browse files Browse the repository at this point in the history
Merge for 1.1
  • Loading branch information
tterrag1098 committed Apr 25, 2014
2 parents 30bb24b + 29b281c commit 2afd0e8
Show file tree
Hide file tree
Showing 45 changed files with 1,024 additions and 1,689 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ TPPI-Tweaks
===========
Random tweaks and additions for the /r/feedthebeast modpack (TestPackPleaseIgnore)

Builds: http://zone.chill.in/jenkins/job/TPPITweaks/
Builds: http://ci.tterrag.com/job/TPPI-Tweaks/
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ task buildInfo {
} else {
ext.revision = "GITBORK"
}

if (System.getenv().BUILD_NUMBER != null) {
ext.buildNum = "${System.getenv().BUILD_NUMBER}"
} else {
Expand All @@ -47,7 +46,8 @@ if (System.getenv().ARTIFACT_VERSION != null) {
artifact_version = "${system.getenv().ARTIFACT_VERSION}"
}

version = "MC${config.minecraft_version}-${artifact_version}-${System.getenv().BUILD_NUMBER}"
version = "MC${config.minecraft_version}-${artifact_version}-${buildInfo.buildNum}"
def actualVersion = "${artifact_version}-${buildInfo.buildNum}"

minecraft {
version = "1.6.4-9.11.1.964"
Expand All @@ -64,7 +64,7 @@ processResources
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
expand 'version':actualVersion, 'mcversion':project.minecraft.version
}

// copy everything else, thats not the mcmod.info
Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
minecraft_version=1.6.4
forge_version=9.11.1.964
mod_version=1.0.0
mod_version=1.1.0
64 changes: 39 additions & 25 deletions src/main/java/tppitweaks/TPPITweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

import net.minecraft.creativetab.CreativeTabs;
Expand All @@ -18,6 +17,7 @@
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;
Expand All @@ -37,11 +37,11 @@
@NetworkMod(serverSideRequired = true, clientSideRequired = true, channels = { Reference.CHANNEL }, packetHandler = PacketHandler.class)
public class TPPITweaks
{
public static final String VERSION = "1.0.0";
public static final String VERSION = "1.1.0";

@Instance("TPPITweaks")
public static TPPITweaks instance;

@SidedProxy(clientSide = "tppitweaks.proxy.ClientProxy", serverSide = "tppitweaks.proxy.CommonProxy")
public static CommonProxy proxy;

Expand All @@ -51,31 +51,26 @@ public class TPPITweaks
public static final Logger logger = Logger.getLogger("TPPITweaks");

public static CreativeTabTPPI creativeTab = new CreativeTabTPPI(CreativeTabs.getNextID());

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger.setParent(FMLCommonHandler.instance().getFMLLogger());
public void preInit(FMLPreInitializationEvent event)
{
logger.setParent(FMLCommonHandler.instance().getFMLLogger());

ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
.getAbsolutePath() + "/TPPI/TPPITweaks.cfg"));
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());
try
{
ConfigurationHandler.loadChangelogText(FileLoader.getChangelogText());
FileLoader.init(ConfigurationHandler.cfg, 0);
}
catch (FileNotFoundException e)
catch (IOException e)
{
logger.log(Level.WARNING, "TPPI Changelog not found, please check the TPPI config folder.");
e.printStackTrace();
}


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

CommandTPPI.initValidCommandArguments(FileLoader.getSupportedModsFile());

ModItems.initItems();
Expand All @@ -89,31 +84,50 @@ public void preInit(FMLPreInitializationEvent event) {
@EventHandler
public void init(FMLInitializationEvent event)
{
AM2SpawnControls.doAM2SpawnControls();
// AM2SpawnControls.doAM2SpawnControls();

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)
{
RecipeTweaks.doPostInitRecipeTweaks();

if (FMLCommonHandler.instance().getSide().isClient())
{
GuiHelper.initMap();
try
{
GuiHelper.initMap();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}

tweakAtEvent(EventTime.POST_INIT);
}

@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);
}
}
6 changes: 6 additions & 0 deletions src/main/java/tppitweaks/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import tppitweaks.config.ConfigurationHandler;
import cpw.mods.fml.common.registry.GameRegistry;

Expand All @@ -17,6 +18,9 @@ public static void initBlocks() {
}

public static void registerRecipes() {

OreDictionary.registerOre("blockCompressedRedstone", tppiBlock);

if(OreDictionary.getOres("blockRedstone").isEmpty()) {

GameRegistry.addShapedRecipe(new ItemStack(tppiBlock),
Expand All @@ -40,6 +44,8 @@ public static void registerRecipes() {
}));

}

GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Block.blockRedstone, 9), "blockCompressedRedstone"));
}

}
4 changes: 3 additions & 1 deletion src/main/java/tppitweaks/client/gui/GuiHelper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package tppitweaks.client.gui;

import java.io.FileNotFoundException;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreenBook;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -26,7 +28,7 @@ public static void doGuideGUI()
Minecraft.getMinecraft().displayGuiScreen(new GuiGuideBase());
}

public static void initMap()
public static void initMap() throws FileNotFoundException
{
GuiGuideBase.initMap();
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tppitweaks/client/gui/MaricultureGui.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tppitweaks.client.gui;

import tppitweaks.config.ConfigurationHandler;
import tppitweaks.util.FileLoader;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import tppitweaks.config.ConfigurationHandler;
import tppitweaks.util.FileLoader;

public class MaricultureGui extends GuiScreen
{
Expand Down Expand Up @@ -55,7 +55,7 @@ protected void actionPerformed(GuiButton button)
this.mc.displayGuiScreen(null);
break;
case 4:
ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false");
ConfigurationHandler.manuallyChangeConfigValue("B:showMaricultureGUI", "true", "false");
this.mc.displayGuiScreen(null);
break;
default:
Expand Down
17 changes: 8 additions & 9 deletions src/main/java/tppitweaks/command/CommandTPPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,8 @@ private void giveModBook(String modName, ICommandSender command)
NBTTagList bookPages = new NBTTagList("pages");

ArrayList<String> pages;
//try
//{
pages = TxtParser.parseFileMods(FileLoader.getSupportedModsFile(), modName + ", " + properName);
/*}
catch (FileNotFoundException e)
{
pages = new ArrayList<String>();
e.printStackTrace();
}*/

pages = TxtParser.parseFileMods(FileLoader.getSupportedModsFile(), modName + ", " + properName);

if (pages.get(0).startsWith("<") && pages.get(0).endsWith("> "))
{
Expand Down Expand Up @@ -320,4 +313,10 @@ public int compareTo(Object arg0)
{
return this.compareTo((ICommand) arg0);
}

@Override
public boolean equals(Object obj)
{
return this.compareTo(obj) == 0;
}
}
43 changes: 28 additions & 15 deletions src/main/java/tppitweaks/config/ConfigurationHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ public class ConfigurationHandler
public static boolean enderTankTesseract;
public static boolean steelReactorCasings;
public static boolean glassFuelRods;
public static boolean twoReactorGlass;
public static boolean eloraamBreakersAndDeployers;
public static boolean ic2TEGlassInterchangeability;
public static boolean tweakDA;
public static boolean tweakSFM;
public static boolean tweakAM2;

public static boolean tweakJABBA;
public static boolean buffUnifierRecipe;

public static boolean disableAGAutoOutputter;

public static boolean fixExURecipes;
Expand All @@ -57,14 +60,17 @@ public class ConfigurationHandler
public static boolean unnerfPaperRecipe;
public static boolean readdResinSmelting;
public static boolean doCharcoalBlockCompression;

public static boolean makeEIOHardModeEasier;
public static boolean unregisterFusedQuartz;

public static boolean addEssenceSeedRecipe;

public static boolean harderActivatorRecipe;
public static boolean harderDisassemblerRecipe;
public static boolean disableCardboardBox;
public static boolean disableMiner;
public static boolean nerfMiner;
public static boolean disableUniversalCables;

public static boolean harderLillipadRecipe;

Expand All @@ -77,6 +83,7 @@ public class ConfigurationHandler

public static boolean showDownloadGUI;
public static boolean showMaricultureGui;
public static boolean doSpawnBook;

public static boolean autoEnableTT;

Expand Down Expand Up @@ -104,30 +111,35 @@ public static void init(File file)

blockID = config.getBlock("tppiBlockId", 3115).getInt();

bookID = config.getItem("tppiBookId", 21000).getInt() - 256;
materialID = config.getItem("tppiMaterialId", 21001).getInt() - 256;
bookID = config.getItem("tppiBookId", 21650).getInt() - 256;
materialID = config.getItem("tppiMaterialId", 21651).getInt() - 256;

bookTitle = config.get("TPPI Guide Info", "bookTitle", "TPPI Welcome Packet", "The title of the custom spawn book", Type.STRING).getString();
bookAuthor = config.get("TPPI Guide Info", "bookAuthor", "The TPPI Team", "The author of the custom spawn book", Type.STRING).getString();
changelogTitle = config.get("TPPI Guide Info", "changelogTitle", "TPPI Changelog", "The title of the changelog").getString();
supportedModsName = config.get("TPPI Guide Info", "supportedModsFilename", "SupportedMods", "The file name of the file to read the mod documentation from (used to support translation). Do not include the extension in the filename (it is .txt)").getString();
guideSkin = config.get("TPPI Guide Info", "TPPIGuideSkin", 0, "The skin of the guide GUI/item, 0=tech, 1=scroll").getInt();

doSpawnBook = config.get("TPPI Guide Info", "doSpawnBook", true, "Whether or not to give the player a welcome book on first spawn").getBoolean(true);

enderChestTesseract = config.get("Ender Storage Tweaks", "enderChestTesseract", true, "EnderStorage Ender Chests require tesseracts instead of ender pearls.").getBoolean(true);
enderPouchNerf = config.get("Ender Storage Tweaks", "enderPouchNerf", true, "EnderStorage Ender Pouches require pyrotheum dust and liquid ender instead of blaze rods and ender pearls.").getBoolean(true);
enderTankTesseract = config.get("Ender Storage Tweaks", "enderTankTesseract", true, "EnderStorage Ender Tanks require tesseracts instead of ender pearls.").getBoolean(true);

steelReactorCasings = config.get("Other Mod Tweaks", "steelReactorCasings", true, "Big Reactors reactor casings require steel. Affects ONLY the casings.").getBoolean(true);
ic2TEGlassInterchangeability = config.get("Other Mod Tweaks", "ic2TEGlassInterchangeability", true, "IC2 reinforced glass (glassReinforced) and Thermal Expansion hardened glass (glassHardened)\nwill be cross-registered as each other in the ore dictionary.").getBoolean(true);
steelReactorCasings = config.get("Other Mod Tweaks", "steelReactorCasings", false, "Big Reactors reactor casings require steel. Affects ONLY the casings.").getBoolean(true);
ic2TEGlassInterchangeability = config.get("Other Mod Tweaks", "ic2TEGlassInterchangeability", true, "IC2 reinforced glass (glassReinforced) and Thermal Expansion hardened glass (glassHardened)\nwill be cross-registered as each other in the ore dictionary.").getBoolean(false);
tweakDA = config.get("Other Mod Tweaks", "tweakDARecipe", true, "Make Dimensional Anchors' recipe closer to that of a chicken chunks chunk loader.").getBoolean(true);
tweakSFM = config.get("Other Mod Tweaks", "stevesFactoryManagerAERecipes", true, "Recipes from Steve's Factory Manager take items from Applied Energistics.").getBoolean(true);
tweakAM2 = config.get("Other Mod Tweaks", "addAM2NatureGuardianRecipe", true, "Add recipe for Ars Magica 2 Nature Guardian spawn egg. Useful when dryads are disabled.").getBoolean(true);
glassFuelRods = config.get("Other Mod Tweaks", "glassFuelRods", true, "Big Reactors fuel rods take just a touch of reactor glass.").getBoolean(true);
glassFuelRods = config.get("Other Mod Tweaks", "glassFuelRods", false, "Big Reactors fuel rods take just a touch of reactor glass.").getBoolean(false);
twoReactorGlass = config.get("Other Mod Tweaks", "twoReactorGlass", true, "Big Reactors\' reactor glass recipe gives two reactor glass in exchange for the harder recipe.").getBoolean(true);
eloraamBreakersAndDeployers = config.get("Other Mod Tweaks", "eloraamBreakersAndDeployers", true, "OpenBlocks block breakers and placers have the same recipes as Redpower 2's.").getBoolean(true);
removeStupidEnergyCrystalRecipe = config.get("Other Mod Tweaks", "removeDartCraftEnergyCrystalRecipe", true, "Remove DartCraft's IC2 energy crystal recipe.").getBoolean(true);
disableForceShears = config.get("Other Mod Tweaks", "disableForceShears", true, "Remove the force shears recipe because they were crashing servers rarely, but in a serious way. Disable this at your own risk.").getBoolean(true);

disableAGAutoOutputter = config.get("Other Mod Tweaks", "disableAGAutoOutputter", true, "Remove the recipe for the Advanced Genetics auto output upgrade, because crashes.").getBoolean(true);
tweakJABBA = config.get("Other Mod Tweaks", "tweakJABBA", true, "Alter the JABBA barrel recipe to be a little more complicated, leaving FZ barrels as a \"low-tech\" option").getBoolean(true);
buffUnifierRecipe = config.get("Other Mod Tweaks", "buffUnifierRecipe", true, "Make the unifier cheaper.").getBoolean(true);
makeEIOHardModeEasier = config.get("Other Mod Tweaks", "makeEnderIOHardModeEasier", true, "Give some EnderIO recipes a buff as they are way too diffucult. Currently affects: basic capacitor, reservoir").getBoolean(true);
unregisterFusedQuartz = config.get("Other Mod Tweaks", "unregisterFusedQuartz", true, "Having fused quartz be registered under hardened glass doesn't make much sense. This fixes that.").getBoolean(true);

fixExURecipes = config.get("ExtraUtils Tweaks", "fixExtraUtilsRecipes", true, "Current version of ExU has broken recipes for the unstable ingot block. This fixes that.").getBoolean(true);
nerfEnderQuarry = config.get("ExtraUtils Tweaks", "nerfEnderQuarry", true, "Make the Extra Utilities ender quarry expensive.").getBoolean(true);
Expand All @@ -144,19 +156,20 @@ public static void init(File file)
readdResinSmelting = config.get("Gregtech Tweaks", "readdResinSmelting", true, "Re-add the IC2 sticky resin to rubber smelting recipe.").getBoolean(true);
doCharcoalBlockCompression = config.get("Gregtech Tweaks", "doCharcoalBlockCompression", true, "Charcoal blocks can be compressed to coal via compressor.").getBoolean(true);

showDownloadGUI = config.get("Mod Downloads", "showDownloadGUI", true, "Show the Download GUI on startup.").getBoolean(true);
showMaricultureGui = config.get("Mod Loading Tweaks", "showMaricultureGUI", true, "Show the mariculture fix GUI on startup.").getBoolean(true);
showDownloadGUI = config.get("Mod Downloads", "showDownloadGUI", false, "Show the Download GUI on startup.").getBoolean(true);
showMaricultureGui = config.get("Mod Loading Tweaks", "showMaricultureGUI", false, "Show the mariculture fix GUI on startup.").getBoolean(false);

registerMagicalCropsOre = config.get("Other Mod Tweaks", "registerMagicalCropsOre", true, "Register essence ores from Magical Crops in the ore dictionary under \"oreMCropsEssence\" and \"oreMCropsNetherEssence\".").getBoolean(true);
harderActivatorRecipe = config.get("Other Mod Tweaks", "harderActivatorRecipe", true, "Make the autonomous activator recipe slightly harder").getBoolean(true);
harderLillipadRecipe = config.get("Other Mod Tweaks", "harderLillipadOfFertility", true, "Make the lillipad of fertility much harder to craft").getBoolean(true);
addEssenceSeedRecipe = config.get("Other Mod Tweaks", "addEssenceSeedRecipe", true, "Add a recipe for the essence seeds in magical crops").getBoolean(true);
addEssenceSeedRecipe = config.get("Other Mod Tweaks", "addEssenceSeedRecipe", false, "Add a recipe for the essence seeds in magical crops").getBoolean(false);

addOsmiumToOreWasher = config.get("Mekanism Tweaks", "addOsmiumToOreWasher", true, "Add a recipe for impure osmium dust to clean osmium dust in the IC2 ore washer.").getBoolean(true);
harderDisassemblerRecipe = config.get("Mekanism Tweaks", "harderAtomicDisassembler", true, "Makes the recipe for the Atomic Disassembler much more difficult").getBoolean(true);
disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", true, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(true);
disableCardboardBox = config.get("Mekanism Tweaks", "disableCardboardBox", false, "Remove the recipe for the cardboard box (it can move ANY tile entity including nodes and spanwers)").getBoolean(false);
disableMiner = config.get("Mekanism Tweaks", "disableDigitalMiner", false, "Remove the recipe for the digital miner (not really any reason to do this now but I'm not deleting code)").getBoolean(false);
nerfMiner = config.get("Mekanism Tweaks", "nerfDigitalMiner", true, "Make the recipe for the digital miner a bit...ok a lot harder").getBoolean(true);
disableUniversalCables = config.get("Mekanism Tweaks", "disableUniversalCables", false, "Remove the recipe for universal cables.").getBoolean(false);

autoEnableTT = config.get("Mod Loading Tweaks", "autoEnableTT", true, "Allow this mod to disable and enable Thaumic Tinkerer automatically").getBoolean(true);

Expand All @@ -165,7 +178,7 @@ public static void init(File file)
Reference.KAMIFilename = config.get("Mod Loading Tweaks", "KAMI_filename", Reference.DEFAULT_KAMI_FILENAME, "The filename for KAMI to use to check for its presence and disable/enable it automatically").getString();

Reference.packName = config.get("Pack Info", "packName", "Test Pack Please Ignore", "The full name of the pack").getString();
Reference.packVersion = config.get("Pack Info", "packVerison", "0.0.1", "The version of the pack").getString();
Reference.packVersion = config.get("Pack Info", "packVerison", "1.0.0", "The version of the pack").getString();
Reference.packAcronym = config.get("Pack Info", "packAcronym", "TPPI", "The acronym of the pack (required, can be the same as name)").getString();
allowCapes = config.get("Pack Info", "allowDevCapes", true, "Enables/Disables the visibility of dev capes. This only affects the user and does NOT have to be the same between client and server.").getBoolean(true);

Expand Down
Loading

0 comments on commit 2afd0e8

Please sign in to comment.