Skip to content

Commit

Permalink
Update: smaller wood items can be smelted to make Fragmented Carbon.
Browse files Browse the repository at this point in the history
  • Loading branch information
radfast committed Jan 26, 2020
1 parent c5a06b6 commit bfce854
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import micdoodle8.mods.galacticraft.core.energy.tile.EnergyStorageTile;
import micdoodle8.mods.galacticraft.core.energy.tile.TileBaseElectricBlockWithInventory;
import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
import micdoodle8.mods.galacticraft.planets.mars.items.MarsItems;
import micdoodle8.mods.miccore.Annotations.NetworkedField;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -15,6 +16,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
Expand Down Expand Up @@ -147,14 +149,17 @@ else if (this.processTicks > 0 && this.processTicks < this.processTimeRequired)
*/
public boolean canProcess()
{
if (this.getInventory().get(1).isEmpty())
ItemStack stack = this.getInventory().get(1);
if (stack.isEmpty())
{
return false;
}
ItemStack result = FurnaceRecipes.instance().getSmeltingResult(this.getInventory().get(1));
ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack);
if (result.isEmpty())
{
return false;
int burnable = TileEntityFurnace.getItemBurnTime(stack);
if (burnable >= 200 && burnable < 400) result = new ItemStack(MarsItems.carbonFragments); //this includes most wooden tools, doors, stairs, boats etc but not saplings and sticks
else return false;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ public EnumSortCategoryItem getCategory(int meta)
{
return EnumSortCategoryItem.GENERAL;
}

@Override
public int getItemBurnTime(ItemStack itemStack)
{
return 200;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static void addUniversalRecipes()
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MarsBlocks.marsBlock, 1, 1), new ItemStack(GCItems.basicItem, 1, 4), 1.0F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MarsBlocks.marsBlock, 1, 2), new ItemStack(MarsItems.marsItemBasic, 1, 2), 0.2F);
FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(MarsBlocks.marsBlock, 1, 3), new ItemStack(Items.IRON_INGOT), 0.2F);
FurnaceRecipes.instance().addSmeltingRecipeForBlock(Blocks.PLANKS, new ItemStack(MarsItems.carbonFragments), 0.0F);

// Schematic
HashMap<Integer, ItemStack> input = new HashMap<Integer, ItemStack>();
Expand Down

1 comment on commit bfce854

@BlesseNtumble
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now GC Core won't work without GC Planets module?

Please sign in to comment.