mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 23:13:07 +00:00
Merge branch 'master' of https://github.com/SlimeKnights/TinkersConstruct
This commit is contained in:
commit
980ea2d497
3 files changed
+68
-45
No files matched your search
@@ -1175,7 +1175,6 @@ public class TContent implements IFuelHandler
|
||||
Item.redstone), 'd', new ItemStack(redstoneMachine, 1, 0)));
|
||||
|
||||
// ToolStation Recipes (Wooden Version)
|
||||
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 0), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', Block.workbench);
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(toolStationWood, 1, 0), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', "crafterWood"));
|
||||
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 2), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 1));
|
||||
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 3), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 2));
|
||||
@@ -1305,7 +1304,7 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.addRecipe(new ItemStack(castingChannel, 4, 0), "b b", "bbb", 'b', searedBrick); //Channel
|
||||
|
||||
// Jack o'Latern Recipe - Stone Torch
|
||||
GameRegistry.addRecipe(new ItemStack(Block.pumpkinLantern, 1, 0), "p", "s", 'p', new ItemStack(Block.pumpkin), 'w', new ItemStack(stoneTorch));
|
||||
GameRegistry.addRecipe(new ItemStack(Block.pumpkinLantern, 1, 0), "p", "s", 'p', new ItemStack(Block.pumpkin), 's', new ItemStack(stoneTorch));
|
||||
// Stone Torch Recipe
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(stoneTorch, 4), "p", "w", 'p', new ItemStack(Item.coal, 1, Short.MAX_VALUE), 'w', "stoneRod"));
|
||||
// Stone Ladder Recipe
|
||||
@@ -1390,10 +1389,9 @@ public class TContent implements IFuelHandler
|
||||
GameRegistry.addRecipe(new ItemStack(barricadeJungle, 1, 0), "b", "b", 'b', new ItemStack(Block.wood, 1, 3));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(barricadeOak, 1, 0), "b", "b", 'b', "logWood"));
|
||||
// Advanced WorkBench Recipes
|
||||
GameRegistry.addRecipe(new ItemStack(craftingStationWood, 1, 0), "b", 'b', new ItemStack(Block.workbench));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(craftingStationWood, 1, 0), "b", 'b', "crafterWood"));
|
||||
//Slab crafters
|
||||
GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 6, 0), "bbb", 'b', new ItemStack(Block.workbench));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(craftingSlabWood, 6, 0), "bbb", 'b', "crafterWood"));
|
||||
GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 1, 0), "b", 'b', new ItemStack(craftingStationWood, 1, 0));
|
||||
GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 1, 1), "b", 'b', new ItemStack(toolStationWood, 1, 0));
|
||||
GameRegistry.addRecipe(new ItemStack(craftingSlabWood, 1, 2), "b", 'b', new ItemStack(toolStationWood, 1, 1));
|
||||
@@ -1982,6 +1980,8 @@ public class TContent implements IFuelHandler
|
||||
ensureOreIsRegistered("stoneMossy", new ItemStack(Block.stoneBrick, 1, 1));
|
||||
ensureOreIsRegistered("stoneMossy", new ItemStack(Block.cobblestoneMossy));
|
||||
|
||||
ensureOreIsRegistered("crafterWood", new ItemStack(Block.workbench, 1));
|
||||
|
||||
String[] matNames = { "wood", "stone", "iron", "flint", "cactus", "bone", "obsidian", "netherrack", "slime", "paper", "cobalt", "ardite", "manyullyn", "copper", "bronze", "alumite", "steel",
|
||||
"blueslime" };
|
||||
for (int i = 0; i < matNames.length; i++)
|
||||
@@ -2346,6 +2346,7 @@ public class TContent implements IFuelHandler
|
||||
// Ingots, Dust
|
||||
registerIngotCasting(ft);
|
||||
Smeltery.addDictionaryMelting("ingot" + ft.toString(), ft, -50, TConstruct.ingotLiquidValue);
|
||||
registerPatternMaterial("ingot" + ft.toString(), 2, ft.toString());
|
||||
Smeltery.addDictionaryMelting("dust" + ft.toString(), ft, -75, TConstruct.ingotLiquidValue);
|
||||
// Factorization support
|
||||
Smeltery.addDictionaryMelting("crystalline" + ft.toString(), ft, -50, TConstruct.ingotLiquidValue);
|
||||
@@ -2356,18 +2357,12 @@ public class TContent implements IFuelHandler
|
||||
Smeltery.addDictionaryMelting("oreNether" + ft.toString(), ft, 75, TConstruct.oreLiquidValue * 2);
|
||||
// Blocks
|
||||
Smeltery.addDictionaryMelting("block" + ft.toString(), ft, 100, TConstruct.blockLiquidValue);
|
||||
registerPatternMaterial("block" + ft.toString(), 18, ft.toString());
|
||||
}
|
||||
|
||||
registerPatternMaterial("plankWood", 2, "Wood");
|
||||
registerPatternMaterial("stickWood", 1, "Wood");
|
||||
registerPatternMaterial("slabWood", 1, "Wood");
|
||||
registerPatternMaterial("ingotCopper", 2, "Copper");
|
||||
registerPatternMaterial("ingotBronze", 2, "Bronze");
|
||||
registerPatternMaterial("ingotCobalt", 2, "Cobalt");
|
||||
registerPatternMaterial("ingotArdite", 2, "Ardite");
|
||||
registerPatternMaterial("ingotManyullyn", 2, "Manyullyn");
|
||||
registerPatternMaterial("ingotAlumite", 2, "Alumite");
|
||||
registerPatternMaterial("ingotSteel", 2, "Steel");
|
||||
}
|
||||
|
||||
private void registerPatternMaterial (String oreName, int value, String materialName)
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package tconstruct.items;
|
||||
|
||||
import java.util.List;
|
||||
import cpw.mods.fml.relauncher.*;
|
||||
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
|
||||
import tconstruct.library.util.IPattern;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.crafting.PatternBuilder.MaterialSet;
|
||||
import tconstruct.library.util.IPattern;
|
||||
|
||||
public class Pattern extends CraftingItem implements IPattern
|
||||
{
|
||||
@@ -34,6 +33,7 @@ public class Pattern extends CraftingItem implements IPattern
|
||||
private static final String[] patternName = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign",
|
||||
"knifeblade", "chisel", "largerod", "toughbinding", "largeplate", "broadaxe", "scythe", "excavator", "largeblade", "hammerhead", "fullguard", "bowstring", "fletching", "arrowhead" };
|
||||
|
||||
@Override
|
||||
public void getSubItems (int id, CreativeTabs tab, List list)
|
||||
{
|
||||
for (int i = 1; i < patternName.length; i++)
|
||||
@@ -43,11 +43,15 @@ public class Pattern extends CraftingItem implements IPattern
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItemStack (ItemStack stack)
|
||||
{
|
||||
if (stack.stackSize <= 0)
|
||||
return null;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid (ItemStack stack)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package tconstruct.modifiers;
|
||||
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.library.tools.ToolMod;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.library.crafting.PatternBuilder;
|
||||
import tconstruct.library.tools.*;
|
||||
|
||||
/* Little mod for actually adding the lapis modifier */
|
||||
|
||||
@@ -26,41 +24,44 @@ public class ModRepair extends ToolMod
|
||||
@Override
|
||||
protected boolean canModify (ItemStack tool, ItemStack[] input)
|
||||
{
|
||||
if ((input[0] == null && input[1] == null) || (input[0] != null && input[1] != null)) //Only valid for one itemstack
|
||||
if ((input[0] == null && input[1] == null))
|
||||
return false;
|
||||
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
if (tags.getInteger("Damage") > 0)
|
||||
{
|
||||
int headID = tags.getInteger("Head");
|
||||
int matID = -1;
|
||||
if (input[0] != null)
|
||||
matID = PatternBuilder.instance.getPartID(input[0]);
|
||||
else
|
||||
matID = PatternBuilder.instance.getPartID(input[1]);
|
||||
if (input[0] != null && input[1] != null)
|
||||
return headID == PatternBuilder.instance.getPartID(input[0]) && headID == PatternBuilder.instance.getPartID(input[1]) && calculateIfNecessary(tool, input);
|
||||
else if (input[0] != null && input[1] == null)
|
||||
return headID == PatternBuilder.instance.getPartID(input[0]);
|
||||
else if (input[0] == null && input[1] != null)
|
||||
return headID == PatternBuilder.instance.getPartID(input[1]);
|
||||
|
||||
if (matID == headID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify (ItemStack[] input, ItemStack tool)
|
||||
private boolean calculateIfNecessary (ItemStack tool, ItemStack[] input)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
int damage = tags.getInteger("Damage");
|
||||
int valueSlot1 = 0;
|
||||
int valueSlot2 = 0;
|
||||
if (input[0] != null)
|
||||
valueSlot1 = calculateIncrease(tool, PatternBuilder.instance.getPartValue(input[0]));
|
||||
if (input[1] != null)
|
||||
valueSlot2 = calculateIncrease(tool, PatternBuilder.instance.getPartValue(input[1]));
|
||||
|
||||
return ((damage - valueSlot1) > 0) && ((damage - valueSlot2) > 0);
|
||||
}
|
||||
|
||||
private int calculateIncrease (ItemStack tool, int materialValue)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
tags.setBoolean("Broken", false);
|
||||
int damage = tags.getInteger("Damage");
|
||||
int dur = tags.getInteger("BaseDurability");
|
||||
|
||||
int materialValue = 0;
|
||||
if (input[0] != null)
|
||||
materialValue = PatternBuilder.instance.getPartValue(input[0]);
|
||||
else
|
||||
materialValue = PatternBuilder.instance.getPartValue(input[1]);
|
||||
|
||||
int increase = (int) (50 + (dur * 0.4f * materialValue));
|
||||
//TConstruct.logger.info("Increase: "+increase);
|
||||
|
||||
int modifiers = tags.getInteger("Modifiers");
|
||||
float mods = 1.0f;
|
||||
@@ -74,14 +75,39 @@ public class ModRepair extends ToolMod
|
||||
increase *= mods;
|
||||
|
||||
int repair = tags.getInteger("RepairCount");
|
||||
repair += 1;
|
||||
tags.setInteger("RepairCount", repair);
|
||||
|
||||
float repairCount = (100 - repair) / 100f;
|
||||
if (repairCount < 0.5f)
|
||||
repairCount = 0.5f;
|
||||
increase *= repairCount;
|
||||
increase /= ((ToolCore) tool.getItem()).getRepairCost();
|
||||
return increase;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modify (ItemStack[] input, ItemStack tool)
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
tags.setBoolean("Broken", false);
|
||||
int damage = tags.getInteger("Damage");
|
||||
int dur = tags.getInteger("BaseDurability");
|
||||
int itemsUsed = 0;
|
||||
|
||||
int materialValue = 0;
|
||||
if (input[0] != null)
|
||||
{
|
||||
materialValue += PatternBuilder.instance.getPartValue(input[0]);
|
||||
itemsUsed++;
|
||||
}
|
||||
if (input[1] != null)
|
||||
{
|
||||
materialValue += PatternBuilder.instance.getPartValue(input[1]);
|
||||
itemsUsed++;
|
||||
}
|
||||
|
||||
int increase = calculateIncrease(tool, materialValue);
|
||||
int repair = tags.getInteger("RepairCount");
|
||||
repair += itemsUsed;
|
||||
tags.setInteger("RepairCount", repair);
|
||||
|
||||
damage -= increase;
|
||||
if (damage < 0)
|
||||
@@ -89,8 +115,6 @@ public class ModRepair extends ToolMod
|
||||
tags.setInteger("Damage", damage);
|
||||
|
||||
AbilityHelper.damageTool(tool, 0, null, true);
|
||||
//tool.setItemDamage(damage * 100 / dur);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user