diff --git a/src/tppitweaks/command/CommandTPPI.java b/src/tppitweaks/command/CommandTPPI.java index 06f16ec..fb7730f 100644 --- a/src/tppitweaks/command/CommandTPPI.java +++ b/src/tppitweaks/command/CommandTPPI.java @@ -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; @@ -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"); @@ -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); } } @@ -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); diff --git a/src/tppitweaks/config/ConfigurationHandler.java b/src/tppitweaks/config/ConfigurationHandler.java index 5679393..74beb3c 100644 --- a/src/tppitweaks/config/ConfigurationHandler.java +++ b/src/tppitweaks/config/ConfigurationHandler.java @@ -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; @@ -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); diff --git a/src/tppitweaks/recipetweaks/RecipeTweaks.java b/src/tppitweaks/recipetweaks/RecipeTweaks.java index 69c4eec..8f05718 100644 --- a/src/tppitweaks/recipetweaks/RecipeTweaks.java +++ b/src/tppitweaks/recipetweaks/RecipeTweaks.java @@ -65,8 +65,10 @@ public static void doPostInitRecipeTweaks() doOreDictTweaks(); - if (okayToTweakIC2) + if (okayToTweakIC2) { IC2Tweaks.registerOres(); + IC2Tweaks.addRecipes(); + } if (okayToTweakMagicalCrops) MagicropsTweaks.registerOres(); diff --git a/src/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java b/src/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java index 5b7cd49..a652cd7 100644 --- a/src/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java +++ b/src/tppitweaks/recipetweaks/modTweaks/GregtechTweaks.java @@ -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) { diff --git a/src/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java b/src/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java index 53f1aa7..e19ad9b 100644 --- a/src/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java +++ b/src/tppitweaks/recipetweaks/modTweaks/IC2Tweaks.java @@ -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; @@ -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)); + } + } + } } diff --git a/src/tppitweaks/recipetweaks/modTweaks/TETweaks.java b/src/tppitweaks/recipetweaks/modTweaks/TETweaks.java new file mode 100644 index 0000000..245a256 --- /dev/null +++ b/src/tppitweaks/recipetweaks/modTweaks/TETweaks.java @@ -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) {} + } + +}