Skip to content

Commit

Permalink
Re-added TE paper recipe, added charcoal block to coal compression, a…
Browse files Browse the repository at this point in the history
…dded removeBooks command.
  • Loading branch information
wha-ha-ha committed Feb 5, 2014
1 parent 2af5d99 commit d86059a
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/tppitweaks/command/CommandTPPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -43,6 +44,7 @@ public static void initValidCommandArguments(InputStream file)
validCommands.add("getInvolved");
validCommands.add("changelog");
validCommands.add("guide");
validCommands.add("removeBooks");

supportedModsAndList.add("list");

Expand Down Expand Up @@ -117,6 +119,8 @@ else if (astring[0].equalsIgnoreCase("mods"))
processCommandChangelog(icommandsender);
}else if(astring[0].equalsIgnoreCase("guide")) {
processCommandGuide(icommandsender);
}else if(astring[0].equalsIgnoreCase("removeBooks")) {
removeGuideBooks(icommandsender);
}

}
Expand All @@ -137,6 +141,20 @@ else if (astring[0].equalsIgnoreCase("mods"))

}

private void removeGuideBooks(ICommandSender command) {
EntityPlayer player = command.getEntityWorld().getPlayerEntityByName(command.getCommandSenderName());

for(ItemStack s : player.inventory.mainInventory) {
try{
if(s.itemID == Item.writtenBook.itemID && s.stackTagCompound.getTag("author").equals(ConfigurationHandler.bookAuthor)) {
s.stackSize = 0;
player.inventoryContainer.detectAndSendChanges();
}
}catch(Throwable t) {}
}

}

private void processCommandGuide(ICommandSender command)
{
ItemStack stack = new ItemStack(ModItems.tppiBook, 1, 2);
Expand Down
3 changes: 3 additions & 0 deletions src/tppitweaks/config/ConfigurationHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class ConfigurationHandler
public static boolean addOneToOnePlateHammerRecipes;
public static boolean unnerfPaperRecipe;
public static boolean readdResinSmelting;
public static boolean doCharcoalBlockCompression;

public static boolean harderDisassemblerRecipe;
public static boolean disableCardboardBox;

Expand Down Expand Up @@ -110,6 +112,7 @@ public static void init(File file)
tinkersAluminumOreInGTMachines = config.get("Gregtech Tweaks", "tinkersAluminumOreInGTMachines", true, "Tinkers' Construct aluminum ore works in GregTech machines.").getBoolean(true);
unnerfPaperRecipe = config.get("Gregtech Tweaks", "unnerfPaperRecipe", true, "Revert GregTech's paper recipe output nerf.").getBoolean(true);
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);

Expand Down
4 changes: 3 additions & 1 deletion src/tppitweaks/recipetweaks/RecipeTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ public static void doPostInitRecipeTweaks()

doOreDictTweaks();

if (okayToTweakIC2)
if (okayToTweakIC2) {
IC2Tweaks.registerOres();
IC2Tweaks.addRecipes();
}

if (okayToTweakMagicalCrops)
MagicropsTweaks.registerOres();
Expand Down
1 change: 1 addition & 0 deletions src/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static void doStuff()
public static void addRecipes() {
if(ConfigurationHandler.unnerfPaperRecipe) {
GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {Item.reed, Item.reed, Item.reed});
TETweaks.addPaperRecipe();
GameRegistry.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"#", "#", "#", '#', Item.reed});
}
if(ConfigurationHandler.readdResinSmelting) {
Expand Down
9 changes: 9 additions & 0 deletions src/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package tppitweaks.recipetweaks.modTweaks;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import tppitweaks.config.ConfigurationHandler;
Expand All @@ -25,4 +26,12 @@ public static void registerOres()
}
}
}

public static void addRecipes() {
if(ConfigurationHandler.doCharcoalBlockCompression) {
if(!OreDictionary.getOres("blockCharcoal").isEmpty()) {
ic2.core.block.machine.tileentity.TileEntityCompressor.addRecipe("blockCharcoal", 1, new ItemStack(Item.coal, 1, 0));
}
}
}
}
15 changes: 15 additions & 0 deletions src/tppitweaks/recipetweaks/modTweaks/TETweaks.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package tppitweaks.recipetweaks.modTweaks;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;

public class TETweaks {

public static void addPaperRecipe() {
try {
GameRegistry.addShapelessRecipe(new ItemStack(Item.paper, 3), new Object[] {thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips, thermalexpansion.item.TEItems.woodchips});
}catch(Throwable t) {}
}

}

0 comments on commit d86059a

Please sign in to comment.