Skip to content

Commit

Permalink
Add an alternative way to craft bolts with config (default off) #1295
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Jan 2, 2015
1 parent 1a18389 commit 195dfc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Expand Up @@ -109,7 +109,7 @@ public int getColorFromItemStack(ItemStack stack, int renderpass) {
if(renderpass > 0)
{
int matId = getMaterialID2(stack);
if(matId > icons2.length)
if(matId > icons2.length || matId < 0)
return super.getColorFromItemStack(stack, renderpass);

if(icons[matId] == null)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Expand Up @@ -64,6 +64,7 @@ public static void initProps (File location)
miningLevelIncrease = config.get("Difficulty Changes", "Modifiers increase Mining Level", true).getBoolean(true);
denyMattock = config.get("Difficulty Changes", "Deny creation of non-metal mattocks", false).getBoolean(false);
craftEndstone = config.get("Difficulty Changes", "Allow creation of endstone", true).getBoolean(true);
alternativeBoltRecipe = config.get("Difficulty Changes", "Add alternitave recipe for bolt parts: arrowhead + toolrod in a crafting grid", false).getBoolean(false);

naturalSlimeSpawn = config.get("Mobs", "Blue Slime spawn chance", 1, "Set to 0 to disable").getInt(1);

Expand Down Expand Up @@ -315,6 +316,7 @@ public static void initProps (File location)
public static boolean labotimizeVanillaTools;
public static boolean miningLevelIncrease;
public static boolean denyMattock;
public static boolean alternativeBoltRecipe;

// Smeltery Output Modification
public static double ingotsPerOre;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/tconstruct/weaponry/TinkerWeaponry.java
Expand Up @@ -15,11 +15,13 @@
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.oredict.OreDictionary;
import tconstruct.TConstruct;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.*;
Expand Down Expand Up @@ -348,6 +350,9 @@ private void addWeaponRecipies()

private void registerBoltCasting()
{
if(PHConstruct.alternativeBoltRecipe)
GameRegistry.addRecipe(new AlternateBoltRecipe());

LiquidCasting tb = TConstructRegistry.getTableCasting();

// any fluid that is a toolpart material can be used
Expand Down

0 comments on commit 195dfc7

Please sign in to comment.