Skip to content

Commit

Permalink
All modifiers changed to use the tinker table
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo committed Dec 12, 2013
1 parent 50fdf1b commit 8b154a9
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 68 deletions.
31 changes: 7 additions & 24 deletions src/main/java/tconstruct/common/TRecipes.java
Expand Up @@ -229,7 +229,6 @@ protected static void addRecipesForToolBuilder ()
tb.addNormalToolRecipe(TRepo.hammer, TRepo.hammerHead, TRepo.toughRod, TRepo.largePlate, TRepo.largePlate);
tb.addNormalToolRecipe(TRepo.battleaxe, TRepo.broadAxeHead, TRepo.toughRod, TRepo.broadAxeHead, TRepo.toughBinding);

//tb.addNormalToolRecipe(TRepo.shortbow, TRepo.toolRod, TRepo.bowstring, TRepo.toolRod);
BowRecipe recipe = new BowRecipe(TRepo.toolRod, TRepo.bowstring, TRepo.toolRod, TRepo.shortbow);
tb.addCustomToolRecipe(recipe);
tb.addNormalToolRecipe(TRepo.arrow, TRepo.arrowhead, TRepo.toolRod, TRepo.fletching);
Expand All @@ -244,55 +243,39 @@ protected static void addRecipesForToolBuilder ()

ItemStack redstoneItem = new ItemStack(Item.redstone);
ItemStack redstoneBlock = new ItemStack(Block.blockRedstone);
tb.registerToolMod(new ModRedstone(new ItemStack[] { redstoneItem }, 2, 1));
tb.registerToolMod(new ModRedstone(new ItemStack[] { redstoneItem, redstoneItem }, 2, 2));
tb.registerToolMod(new ModRedstone(new ItemStack[] { redstoneBlock }, 2, 9));
tb.registerToolMod(new ModRedstone(new ItemStack[] { redstoneItem, redstoneBlock }, 2, 10));
tb.registerToolMod(new ModRedstone(new ItemStack[] { redstoneBlock, redstoneBlock }, 2, 18));
tb.registerToolMod(new ModRedstone(2, new ItemStack[] { redstoneItem, redstoneBlock }, new int[] { 1, 9 }));

ItemStack lapisItem = new ItemStack(Item.dyePowder, 1, 4);
ItemStack lapisBlock = new ItemStack(Block.blockLapis);
TRepo.modLapis = new ModLapis(new ItemStack[] { lapisItem }, 10, 1);
TRepo.modLapis = new ModLapis(10, new ItemStack[] { lapisItem, lapisBlock }, new int[] { 1, 9 });
tb.registerToolMod(TRepo.modLapis);
tb.registerToolMod(new ModLapis(new ItemStack[] { lapisItem, lapisItem }, 10, 2));
tb.registerToolMod(new ModLapis(new ItemStack[] { lapisBlock }, 10, 9));
tb.registerToolMod(new ModLapis(new ItemStack[] { lapisItem, lapisBlock }, 10, 10));
tb.registerToolMod(new ModLapis(new ItemStack[] { lapisBlock, lapisBlock }, 10, 18));

tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(TRepo.materials, 1, 6) }, 4, "Moss", 3, "\u00a72", "Auto-Repair"));
ItemStack blazePowder = new ItemStack(Item.blazePowder);
tb.registerToolMod(new ModBlaze(new ItemStack[] { blazePowder }, 7, 1));
tb.registerToolMod(new ModBlaze(new ItemStack[] { blazePowder, blazePowder }, 7, 2));
tb.registerToolMod(new ModBlaze(7, new ItemStack[] { blazePowder }, new int[] { 1 }));
tb.registerToolMod(new ModAutoSmelt(new ItemStack[] { new ItemStack(TRepo.materials, 1, 7) }, 6, "Lava", "\u00a74", "Auto-Smelt"));
tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(TRepo.materials, 1, 8) }, 8, "Necrotic", 1, "\u00a78", "Life Steal"));

TRepo.modAttack = new ModAttack("Quartz", 11, new ItemStack[] { new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz, 1, Short.MAX_VALUE) }, new int[] { 1, 4 });
tb.registerToolMod(TRepo.modAttack);
/*tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { new ItemStack(Item.netherQuartz), new ItemStack(Block.blockNetherQuartz, 1, Short.MAX_VALUE) }, 11, 1));
tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzItem, quartzItem }, 11, 2));
tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzBlock }, 11, 4));
tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzItem, quartzBlock }, 11, 5));
tb.registerToolMod(new ModAttack("Quartz", new ItemStack[] { quartzBlock, quartzBlock }, 11, 8));*/

tb.registerToolMod(new ModExtraModifier(new ItemStack[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free"));
tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Block.blockDiamond), new ItemStack(Item.appleGold, 1, 1) }, "Tier1.5Free"));
tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free"));

ItemStack silkyJewel = new ItemStack(TRepo.materials, 1, 26);
tb.registerToolMod(new ModButtertouch(new ItemStack[] { silkyJewel }, 12));

ItemStack piston = new ItemStack(Block.pistonBase);
tb.registerToolMod(new ModPiston(new ItemStack[] { piston }, 3, 1));
tb.registerToolMod(new ModPiston(new ItemStack[] { piston, piston }, 3, 2));
tb.registerToolMod(new ModPiston(3, new ItemStack[] { piston }, new int[] { 1 }));

tb.registerToolMod(new ModInteger(new ItemStack[] { new ItemStack(Block.obsidian), new ItemStack(Item.enderPearl) }, 13, "Beheading", 1, "\u00a7d", "Beheading"));

ItemStack holySoil = new ItemStack(TRepo.craftedSoil, 1, 4);
tb.registerToolMod(new ModSmite("Smite", new ItemStack[] { holySoil }, 14, 1));
tb.registerToolMod(new ModSmite("Smite", new ItemStack[] { holySoil, holySoil }, 14, 2));
tb.registerToolMod(new ModSmite("Smite", 14, new ItemStack[] { holySoil }, new int[] { 1 }));

ItemStack spidereyeball = new ItemStack(Item.fermentedSpiderEye);
tb.registerToolMod(new ModAntiSpider("Anti-Spider", new ItemStack[] { spidereyeball }, 15, 1));
tb.registerToolMod(new ModAntiSpider("Anti-Spider", new ItemStack[] { spidereyeball, spidereyeball }, 15, 2));
tb.registerToolMod(new ModAntiSpider("Anti-Spider", 15, new ItemStack[] { spidereyeball }, new int[] { 1 }));

ItemStack obsidianPlate = new ItemStack(TRepo.largePlate, 1, 6);
tb.registerToolMod(new ModReinforced(new ItemStack[] { obsidianPlate }, 16, 1));
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/tconstruct/modifiers/tools/ModAntiSpider.java
Expand Up @@ -4,19 +4,17 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public class ModAntiSpider extends ToolMod
public class ModAntiSpider extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max = 4;
String guiType;

public ModAntiSpider(String type, ItemStack[] items, int effect, int inc)
public ModAntiSpider(String type, int effect, ItemStack[] items, int[] values)
{
super(items, effect, "ModAntiSpider");
super(effect, "ModAntiSpider", items, values);
tooltipName = "\u00a72Bane of Arthropods";
guiType = type;
increase = inc;
}

@Override
Expand All @@ -27,7 +25,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;

else if (keyPair[0] == keyPair[1])
Expand All @@ -41,6 +39,7 @@ else if (keyPair[0] == keyPair[1])
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int increase = matchingAmount(input);
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
Expand Down
15 changes: 6 additions & 9 deletions src/main/java/tconstruct/modifiers/tools/ModBlaze.java
Expand Up @@ -3,23 +3,19 @@
import java.util.Arrays;
import java.util.List;

import tconstruct.library.tools.ToolCore;
import tconstruct.library.tools.ToolMod;

import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import tconstruct.library.tools.ToolCore;

public class ModBlaze extends ToolMod
public class ModBlaze extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max;

public ModBlaze(ItemStack[] items, int effect, int inc)
public ModBlaze(int effect, ItemStack[] items, int[] values)
{
super(items, effect, "Blaze");
super(effect, "Blaze", items, values);
tooltipName = "\u00a76Fiery";
increase = inc;
max = 25;
}

Expand All @@ -35,7 +31,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;

else if (keyPair[0] == keyPair[1])
Expand All @@ -49,6 +45,7 @@ else if (keyPair[0] == keyPair[1])
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int increase = matchingAmount(input);
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/tconstruct/modifiers/tools/ModLapis.java
Expand Up @@ -15,17 +15,15 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;

public class ModLapis extends ToolMod
public class ModLapis extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max = 450;

public ModLapis(ItemStack[] items, int effect, int inc)
public ModLapis(int effect, ItemStack[] items, int[] values)
{
super(items, effect, "Lapis");
super(effect, "Lapis", items, values);
tooltipName = "\u00a79Luck";
increase = inc;
}

@Override
Expand All @@ -44,7 +42,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= max)
if (keyPair[0] + matchingAmount(input) <= max)
return true;
else
return false;
Expand All @@ -68,6 +66,7 @@ public void modify (ItemStack[] input, ItemStack tool)
tags.setInteger("Modifiers", modifiers);
}

int increase = matchingAmount(input);
int keyPair[] = tags.getIntArray(key);
keyPair[0] += increase;
tags.setIntArray(key, keyPair);
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/tconstruct/modifiers/tools/ModPiston.java
Expand Up @@ -9,18 +9,15 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public class ModPiston extends ToolMod
public class ModPiston extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max;
int max = 10;

public ModPiston(ItemStack[] items, int effect, int inc)
public ModPiston(int effect, ItemStack[] items, int[] values)
{
super(items, effect, "Piston");
super(effect, "Piston", items, values);
tooltipName = "\u00a77Knockback";
increase = inc;
max = 10;
}

@Override
Expand All @@ -35,7 +32,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;

else if (keyPair[0] == keyPair[1])
Expand All @@ -49,6 +46,7 @@ else if (keyPair[0] == keyPair[1])
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int increase = matchingAmount(input);
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/tconstruct/modifiers/tools/ModRedstone.java
Expand Up @@ -9,18 +9,15 @@
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public class ModRedstone extends ToolMod
public class ModRedstone extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max;
int max = 50;

public ModRedstone(ItemStack[] items, int effect, int inc)
public ModRedstone(int effect, ItemStack[] items, int[] values)
{
super(items, effect, "Redstone");
super(effect, "Redstone", items, values);
tooltipName = "\u00a74Haste";
increase = inc;
max = 50;
}

@Override
Expand All @@ -35,7 +32,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;

else if (keyPair[0] == keyPair[1])
Expand All @@ -50,6 +47,7 @@ public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int[] keyPair;
int increase = matchingAmount(input);
if (tags.hasKey(key))
{
keyPair = tags.getIntArray(key);
Expand Down
12 changes: 5 additions & 7 deletions src/main/java/tconstruct/modifiers/tools/ModSmite.java
@@ -1,22 +1,19 @@
package tconstruct.modifiers.tools;

import tconstruct.library.tools.ToolMod;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public class ModSmite extends ToolMod
public class ModSmite extends ToolModTypeFilter
{
String tooltipName;
int increase;
int max = 36;
String tagName;

public ModSmite(String type, ItemStack[] items, int effect, int inc)
public ModSmite(String type, int effect, ItemStack[] items, int[] values)
{
super(items, effect, "ModSmite");
super(effect, "ModSmite", items, values);
tooltipName = "\u00a7eSmite";
tagName = type;
increase = inc;
}

@Override
Expand All @@ -27,7 +24,7 @@ protected boolean canModify (ItemStack tool, ItemStack[] input)
return tags.getInteger("Modifiers") > 0;

int keyPair[] = tags.getIntArray(key);
if (keyPair[0] + increase <= keyPair[1])
if (keyPair[0] + matchingAmount(input) <= keyPair[1])
return true;

else if (keyPair[0] == keyPair[1])
Expand All @@ -41,6 +38,7 @@ else if (keyPair[0] == keyPair[1])
public void modify (ItemStack[] input, ItemStack tool)
{
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
int increase = matchingAmount(input);
if (tags.hasKey(key))
{
int[] keyPair = tags.getIntArray(key);
Expand Down

0 comments on commit 8b154a9

Please sign in to comment.