Skip to content

Commit

Permalink
Make tool parts added via addPartCastingMaterial smeltable and register
Browse files Browse the repository at this point in the history
FluidType if it's not present
  • Loading branch information
codewarrior0 authored and bonii-xx committed Feb 27, 2015
1 parent 28583d6 commit 6964434
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/java/tconstruct/util/IMCHandler.java
Expand Up @@ -185,6 +185,12 @@ else if(type.equals("addPartCastingMaterial"))
newRecipies.add(recipe);
}

FluidType ft = FluidType.getFluidType(liquid.getFluid().getName());
if(ft == null) {
ft = new FluidType(TinkerSmeltery.glueBlock, 0, 500, liquid.getFluid(), true);
FluidType.registerFluidType(liquid.getFluid().getName(), ft);
}

// has to be done separately so we have all checks and no concurrent modification exception
for(CastingRecipe recipe : newRecipies)
{
Expand All @@ -195,10 +201,8 @@ else if(type.equals("addPartCastingMaterial"))

// ok, this recipe creates a toolpart and uses iron for it. add a new one for the IMC stuff!
TConstructRegistry.getTableCasting().addCastingRecipe(output, liquid2, recipe.cast, recipe.consumeCast, recipe.coolTime);
}

if(FluidType.getFluidType(liquid.getFluid().getName()) == null) {
FluidType.registerFluidType(liquid.getFluid().getName(), TinkerSmeltery.glueBlock, 0, 500, liquid.getFluid(), true);
// and make it melt!
Smeltery.addMelting(ft, output, 0, liquid2.amount);
}

TConstruct.logger.debug("Casting IMC: Added fluid " + tag.getString("FluidName") + " to part casting");
Expand Down

0 comments on commit 6964434

Please sign in to comment.