Skip to content

Instantly share code, notes, and snippets.

@bonii-xx
Last active October 15, 2023 17:31
Show Gist options
  • Save bonii-xx/e46f9d9e81e29d796b1b to your computer and use it in GitHub Desktop.
Save bonii-xx/e46f9d9e81e29d796b1b to your computer and use it in GitHub Desktop.

Revisions

  1. bonii-xx revised this gist Jan 18, 2015. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,16 @@ tag.setFloat("Projectile_Fragility", 0.9f); // This is a multiplier to the shaft

    FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);

    /* SINCE 1.8.3 - material mappings
    * This maps an item to a material so it can be used for repairing etc. */
    tag = new NBTTagCompound();
    tag.setInteger("MaterialId", 50);
    tag.setInteger("Value", 2); // 1 material ever 2 value. See PartMapping IMC
    item = new NBTTagCompound();
    (new ItemStack(TinkerTools.materials, 1, 2)).writeToNBT(item); // seared brick item
    tag.setTag("Item", item);

    FMLInterModComms.sendMessage("TConstruct", "addMaterialItem", tag);

    /* This part adds mappigs, so that you can convert items to toolparts in the Part Builder.
    Stone Parts are used as the baseline for what exists */
  2. bonii-xx revised this gist Jan 13, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -89,4 +89,10 @@ tag.setString("FluidName", FluidRegistry.WATER.getName());
    tag.setInteger("Temperature", 9001);
    // but also used up very quickly
    tag.setInteger("Duration", 1); // this means 15 mb last 1 tick. Therefore 1 second of use drains 15*20 = 300mb water
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryFuel", tag);
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryFuel", tag);

    /* SINCE 1.8.3
    This allows you to register your custom IEnergyContainerItems as a valid item for adding the Redstone Flux Modifier to your tool
    you can add any item you like, just make sure that the item implements IEnergyContainerItem interface from the cofh/api/energy api */
    ItemStack battery = new ItemStack(ModItems.battery);
    FMLInterModComms.sendMessage("TConstruct", "addFluxBattery", battery);
  3. bonii-xx revised this gist Dec 30, 2014. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,17 @@ tag.setFloat("Stonebound", 0); // optional, cannot be used if jagged
    tag.setString("Style", EnumChatFormatting.RED.toString()); // optional, color of the material text
    tag.setInteger("Color", 255 << 24 | 45 << 16 | 45 << 8 | 40); // argb

    /* SINCE 1.8.2 - bow and arrow stats
    * for bow and arrow stats, best compare to other materials to find good values
    */
    // additional stats for bows
    tag.setInteger("Bow_DrawSpeed", 100); // the higher the longer it takes to draw the bow
    tag.setFloat("Bow_ProjectileSpeed", 1.0f); // the higher the faster the projectile goes

    // additional stats for arrows
    tag.setFloat("Projectile_Mass", 2.0f);
    tag.setFloat("Projectile_Fragility", 0.9f); // This is a multiplier to the shafts break-chance

    FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);


  4. bonii-xx revised this gist Nov 28, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    NBTTagCompound tag = new NBTTagCompound();
    tag.setInteger("Id", 50); // Unique material ID. Reseved IDs: 0-40 Tinker, 41-45 Iguana Tinker Tweaks, 100-200 ExtraTiC
    tag.setString("Name", "Seared Stone"); // Unique material name
    tag.setInteger("HarvestLevel", 3); // diamond level
    tag.setInteger("Durability", 100);
    tag.setInteger("MiningSpeed", 100);
    tag.setInteger("Attack", 0); // optional
  5. bonii-xx revised this gist Nov 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -58,7 +58,7 @@ item = new NBTTagCompound();
    (new ItemStack(TinkerSmeltery.smeltery, 1, 4)).writeToNBT(item); // seared stone block
    tag.setTag("Block", item);
    // liquid to produce. This time the amount DOES matter!
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue/4)).writeToNBT(tag); // this also works, amount doesn't matter
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue/4)).writeToNBT(tag); // this also works
    // the temperature required
    tag.setInteger("Temperature", 850);
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryMelting", tag);
  6. bonii-xx revised this gist Oct 16, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ tag.setString("FluidName", TinkerSmeltery.moltenStoneFluid.getName());
    tag.setInteger("MaterialId", 50); // output material id
    FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);

    // Smeltery stuff since 1.7.0d5
    // Smeltery stuff since 1.7.1
    /* This part adds Smeltery melting. Give it an item, a block to render in the smeltery, the temperature required and the liquid to produce.
    For reference: Iron has temperature 600, Stone has 800, Water has 20.
    Melting duration is directly related to temperature required. */
  7. bonii-xx revised this gist Oct 14, 2014. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -44,7 +44,7 @@ tag.setString("FluidName", TinkerSmeltery.moltenStoneFluid.getName());
    tag.setInteger("MaterialId", 50); // output material id
    FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);

    // Since 1.7.0d5
    // Smeltery stuff since 1.7.0d5
    /* This part adds Smeltery melting. Give it an item, a block to render in the smeltery, the temperature required and the liquid to produce.
    For reference: Iron has temperature 600, Stone has 800, Water has 20.
    Melting duration is directly related to temperature required. */
    @@ -61,4 +61,20 @@ tag.setTag("Block", item);
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue/4)).writeToNBT(tag); // this also works, amount doesn't matter
    // the temperature required
    tag.setInteger("Temperature", 850);
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryMelting", tag);
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryMelting", tag);

    /* This part adds Smeltery fuel. Give it a fuel, how hot it is and how long it lasts.
    The temperature determines WHAT it can melt (e.g. stone needs at least temperature 800) and how FAST it melts
    The duration depends on how long one "portion" of fuel lasts.

    For reference: Lava has a temperature of 1300 and a duration of 80
    The duration has to be divided through 20 to get the seconds.
    One "portion" is 15mb. */
    tag = new NBTTagCompound();
    // fuel liquid. Amount doesn't matter if you use the fluidstack variant
    tag.setString("FluidName", FluidRegistry.WATER.getName());
    // water is totally OP
    tag.setInteger("Temperature", 9001);
    // but also used up very quickly
    tag.setInteger("Duration", 1); // this means 15 mb last 1 tick. Therefore 1 second of use drains 15*20 = 300mb water
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryFuel", tag);
  8. bonii-xx revised this gist Oct 14, 2014. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -42,4 +42,23 @@ tag.setString("FluidName", TinkerSmeltery.moltenStoneFluid.getName());
    // or this way, it's equal
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, 1)).writeToNBT(tag); // this also works, amount doesn't matter
    tag.setInteger("MaterialId", 50); // output material id
    FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);
    FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);

    // Since 1.7.0d5
    /* This part adds Smeltery melting. Give it an item, a block to render in the smeltery, the temperature required and the liquid to produce.
    For reference: Iron has temperature 600, Stone has 800, Water has 20.
    Melting duration is directly related to temperature required. */
    tag = new NBTTagCompound();
    // the item
    item = new NBTTagCompound();
    (new ItemStack(TinkerTools.materials, 1, 2)).writeToNBT(item); // seared brick item
    tag.setTag("Item", item);
    // the block to render
    item = new NBTTagCompound();
    (new ItemStack(TinkerSmeltery.smeltery, 1, 4)).writeToNBT(item); // seared stone block
    tag.setTag("Block", item);
    // liquid to produce. This time the amount DOES matter!
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, TConstruct.ingotLiquidValue/4)).writeToNBT(tag); // this also works, amount doesn't matter
    // the temperature required
    tag.setInteger("Temperature", 850);
    FMLInterModComms.sendMessage("TConstruct", "addSmelteryMelting", tag);
  9. bonii-xx revised this gist Sep 22, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,6 @@ tag.setInteger("Color", 255 << 24 | 45 << 16 | 45 << 8 | 40); // argb
    FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);



    /* This part adds mappigs, so that you can convert items to toolparts in the Part Builder.
    Stone Parts are used as the baseline for what exists */
    tag = new NBTTagCompound();
  10. bonii-xx renamed this gist Sep 22, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.java → ToolMaterials
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,8 @@


    /* This part adds Smeltery casting. Give it a liquid, and which material to output. BAM toolpart casting.
    Iron parts are used as the baseline for what exists */
    Iron parts are used as the baseline for what exists.
    Note that the Liquid has to exist. */
    tag = new NBTTagCompound();
    // liquid to use
    tag.setString("FluidName", TinkerSmeltery.moltenStoneFluid.getName());
  11. bonii-xx created this gist Sep 22, 2014.
    45 changes: 45 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    /* This first part adds Seared Stone as a material. Toolparts and tool graphics are created automatically by color */
    NBTTagCompound tag = new NBTTagCompound();
    tag.setInteger("Id", 50); // Unique material ID. Reseved IDs: 0-40 Tinker, 41-45 Iguana Tinker Tweaks, 100-200 ExtraTiC
    tag.setString("Name", "Seared Stone"); // Unique material name
    tag.setInteger("Durability", 100);
    tag.setInteger("MiningSpeed", 100);
    tag.setInteger("Attack", 0); // optional
    tag.setFloat("HandleModifier", 0.1f);
    tag.setInteger("Reinforced", 0); // optional
    tag.setFloat("Stonebound", 0); // optional, cannot be used if jagged
    //tag.setFloat("Jagged", 0); // optional, cannot be used if stonebound
    tag.setString("Style", EnumChatFormatting.RED.toString()); // optional, color of the material text
    tag.setInteger("Color", 255 << 24 | 45 << 16 | 45 << 8 | 40); // argb

    FMLInterModComms.sendMessage("TConstruct", "addMaterial", tag);



    /* This part adds mappigs, so that you can convert items to toolparts in the Part Builder.
    Stone Parts are used as the baseline for what exists */
    tag = new NBTTagCompound();
    tag.setInteger("MaterialId", 50); // output material id
    NBTTagCompound item = new NBTTagCompound();
    (new ItemStack(TinkerSmeltery.smeltery, 1, 2)).writeToNBT(item); // seared brick block
    tag.setTag("Item", item);

    item = new NBTTagCompound();
    (new ItemStack(TinkerTools.materials, 1, 2)).writeToNBT(item); // seared brick item
    tag.setTag("Shard", item);

    // 1 value = 1 shard. So 1 blocks like stone usually have value 2.
    // Seared Brick is the shard, the block consists of 4 bricks, therefore value 4
    tag.setInteger("Value", 4);
    FMLInterModComms.sendMessage("TConstruct", "addPartBuilderMaterial", tag);


    /* This part adds Smeltery casting. Give it a liquid, and which material to output. BAM toolpart casting.
    Iron parts are used as the baseline for what exists */
    tag = new NBTTagCompound();
    // liquid to use
    tag.setString("FluidName", TinkerSmeltery.moltenStoneFluid.getName());
    // or this way, it's equal
    (new FluidStack(TinkerSmeltery.moltenStoneFluid, 1)).writeToNBT(tag); // this also works, amount doesn't matter
    tag.setInteger("MaterialId", 50); // output material id
    FMLInterModComms.sendMessage("TConstruct", "addPartCastingMaterial", tag);